'WindowsAPI'에 해당되는 글 2건

  1. 2016.10.13 2. Windef.h
  2. 2016.10.13 1. _FILETIME 구조체
WindowsAPI/Reference2016. 10. 13. 01:36

Windows Data Types

The data types supported by Windows are used to define function return values, function and message parameters, and structure members. They define the size and meaning of these elements. For more information about the underlying C/C++ data types, see Data Type Ranges.

The following table contains the following types: character, integer, Boolean, pointer, and handle. The character, integer, and Boolean types are common to most C compilers. Most of the pointer-type names begin with a prefix of P or LP. Handles refer to a resource that has been loaded into memory.

For more information about handling 64-bit integers, see Large Integers.

Data typeDescription
APIENTRY

The calling convention for system functions.

This type is declared in WinDef.h as follows:

#define APIENTRY WINAPI

ATOM

An atom. For more information, see About Atom Tables.

This type is declared in WinDef.h as follows:

typedef WORD ATOM;

BOOL

A Boolean variable (should be TRUE or FALSE).

This type is declared in WinDef.h as follows:

typedef int BOOL;

BOOLEAN

A Boolean variable (should be TRUE or FALSE).

This type is declared in WinNT.h as follows:

typedef BYTE BOOLEAN;

BYTE

A byte (8 bits).

This type is declared in WinDef.h as follows:

typedef unsigned char BYTE;

CALLBACK

The calling convention for callback functions.

This type is declared in WinDef.h as follows:

#define CALLBACK __stdcall

CALLBACKWINAPI, and APIENTRY are all used to define functions with the __stdcall calling convention. Most functions in the Windows API are declared using WINAPI. You may wish to use CALLBACK for the callback functions that you implement to help identify the function as a callback function.

CCHAR

An 8-bit Windows (ANSI) character.

This type is declared in WinNT.h as follows:

typedef char CCHAR;

CHAR

An 8-bit Windows (ANSI) character. For more information, see Character Sets Used By Fonts.

This type is declared in WinNT.h as follows:

typedef char CHAR;

COLORREF

The red, green, blue (RGB) color value (32 bits). See COLORREF for information on this type.

This type is declared in WinDef.h as follows:

typedef DWORD COLORREF;

CONST

A variable whose value is to remain constant during execution.

This type is declared in WinDef.h as follows:

#define CONST const

DWORD

A 32-bit unsigned integer. The range is 0 through 4294967295 decimal.

This type is declared in IntSafe.h as follows:

typedef unsigned long DWORD;

DWORDLONG

A 64-bit unsigned integer. The range is 0 through 18446744073709551615 decimal.

This type is declared in IntSafe.h as follows:

typedef unsigned __int64 DWORDLONG;

DWORD_PTR

An unsigned long type for pointer precision. Use when casting a pointer to a long type to perform pointer arithmetic. (Also commonly used for general 32-bit parameters that have been extended to 64 bits in 64-bit Windows.)

This type is declared in BaseTsd.h as follows:

typedef ULONG_PTR DWORD_PTR;

DWORD32

A 32-bit unsigned integer.

This type is declared in BaseTsd.h as follows:

typedef unsigned int DWORD32;

DWORD64

A 64-bit unsigned integer.

This type is declared in BaseTsd.h as follows:

typedef unsigned __int64 DWORD64;

FLOAT

A floating-point variable.

This type is declared in WinDef.h as follows:

typedef float FLOAT;

HACCEL

A handle to an accelerator table.

This type is declared in WinDef.h as follows:

typedef HANDLE HACCEL;

HALF_PTR

Half the size of a pointer. Use within a structure that contains a pointer and two small fields.

This type is declared in BaseTsd.h as follows:

#ifdef _WIN64
 typedef int HALF_PTR;
#else
 typedef short HALF_PTR;
#endif

HANDLE

A handle to an object.

This type is declared in WinNT.h as follows:

typedef PVOID HANDLE;

HBITMAP

A handle to a bitmap.

This type is declared in WinDef.h as follows:

typedef HANDLE HBITMAP;

HBRUSH

A handle to a brush.

This type is declared in WinDef.h as follows:

typedef HANDLE HBRUSH;

HCOLORSPACE

A handle to a color space.

This type is declared in WinDef.h as follows:

typedef HANDLE HCOLORSPACE;

HCONV

A handle to a dynamic data exchange (DDE) conversation.

This type is declared in Ddeml.h as follows:

typedef HANDLE HCONV;

HCONVLIST

A handle to a DDE conversation list.

This type is declared in Ddeml.h as follows:

typedef HANDLE HCONVLIST;

HCURSOR

A handle to a cursor.

This type is declared in WinDef.h as follows:

typedef HICON HCURSOR;

HDC

A handle to a device context (DC).

This type is declared in WinDef.h as follows:

typedef HANDLE HDC;

HDDEDATA

A handle to DDE data.

This type is declared in Ddeml.h as follows:

typedef HANDLE HDDEDATA;

HDESK

A handle to a desktop.

This type is declared in WinDef.h as follows:

typedef HANDLE HDESK;

HDROP

A handle to an internal drop structure.

This type is declared in ShellApi.h as follows:

typedef HANDLE HDROP;

HDWP

A handle to a deferred window position structure.

This type is declared in WinUser.h as follows:

typedef HANDLE HDWP;

HENHMETAFILE

A handle to an enhanced metafile.

This type is declared in WinDef.h as follows:

typedef HANDLE HENHMETAFILE;

HFILE

A handle to a file opened by OpenFile, not CreateFile.

This type is declared in WinDef.h as follows:

typedef int HFILE;

HFONT

A handle to a font.

This type is declared in WinDef.h as follows:

typedef HANDLE HFONT;

HGDIOBJ

A handle to a GDI object.

This type is declared in WinDef.h as follows:

typedef HANDLE HGDIOBJ;

HGLOBAL

A handle to a global memory block.

This type is declared in WinDef.h as follows:

typedef HANDLE HGLOBAL;

HHOOK

A handle to a hook.

This type is declared in WinDef.h as follows:

typedef HANDLE HHOOK;

HICON

A handle to an icon.

This type is declared in WinDef.h as follows:

typedef HANDLE HICON;

HINSTANCE

A handle to an instance. This is the base address of the module in memory.

HMODULE and HINSTANCE are the same today, but represented different things in 16-bit Windows.

This type is declared in WinDef.h as follows:

typedef HANDLE HINSTANCE;

HKEY

A handle to a registry key.

This type is declared in WinDef.h as follows:

typedef HANDLE HKEY;

HKL

An input locale identifier.

This type is declared in WinDef.h as follows:

typedef HANDLE HKL;

HLOCAL

A handle to a local memory block.

This type is declared in WinDef.h as follows:

typedef HANDLE HLOCAL;

HMENU

A handle to a menu.

This type is declared in WinDef.h as follows:

typedef HANDLE HMENU;

HMETAFILE

A handle to a metafile.

This type is declared in WinDef.h as follows:

typedef HANDLE HMETAFILE;

HMODULE

A handle to a module. The is the base address of the module in memory.

HMODULE and HINSTANCE are the same in current versions of Windows, but represented different things in 16-bit Windows.

This type is declared in WinDef.h as follows:

typedef HINSTANCE HMODULE;

HMONITOR

A handle to a display monitor.

This type is declared in WinDef.h as follows:

if(WINVER >= 0x0500) typedef HANDLE HMONITOR;

HPALETTE

A handle to a palette.

This type is declared in WinDef.h as follows:

typedef HANDLE HPALETTE;

HPEN

A handle to a pen.

This type is declared in WinDef.h as follows:

typedef HANDLE HPEN;

HRESULT

The return codes used by COM interfaces. For more information, see Structure of the COM Error Codes. To test an HRESULT value, use theFAILED and SUCCEEDED macros.

This type is declared in WinNT.h as follows:

typedef LONG HRESULT;

HRGN

A handle to a region.

This type is declared in WinDef.h as follows:

typedef HANDLE HRGN;

HRSRC

A handle to a resource.

This type is declared in WinDef.h as follows:

typedef HANDLE HRSRC;

HSZ

A handle to a DDE string.

This type is declared in Ddeml.h as follows:

typedef HANDLE HSZ;

HWINSTA

A handle to a window station.

This type is declared in WinDef.h as follows:

typedef HANDLE WINSTA;

HWND

A handle to a window.

This type is declared in WinDef.h as follows:

typedef HANDLE HWND;

INT

A 32-bit signed integer. The range is -2147483648 through 2147483647 decimal.

This type is declared in WinDef.h as follows:

typedef int INT;

INT_PTR

A signed integer type for pointer precision. Use when casting a pointer to an integer to perform pointer arithmetic.

This type is declared in BaseTsd.h as follows:

#if defined(_WIN64) 
 typedef __int64 INT_PTR; 
#else 
 typedef int INT_PTR;
#endif

INT8

An 8-bit signed integer.

This type is declared in BaseTsd.h as follows:

typedef signed char INT8;

INT16

A 16-bit signed integer.

This type is declared in BaseTsd.h as follows:

typedef signed short INT16;

INT32

A 32-bit signed integer. The range is -2147483648 through 2147483647 decimal.

This type is declared in BaseTsd.h as follows:

typedef signed int INT32;

INT64

A 64-bit signed integer. The range is –9223372036854775808 through 9223372036854775807 decimal.

This type is declared in BaseTsd.h as follows:

typedef signed __int64 INT64;

LANGID

A language identifier. For more information, see Language Identifiers.

This type is declared in WinNT.h as follows:

typedef WORD LANGID;

LCID

A locale identifier. For more information, see Locale Identifiers.

This type is declared in WinNT.h as follows:

typedef DWORD LCID;

LCTYPE

A locale information type. For a list, see Locale Information Constants.

This type is declared in WinNls.h as follows:

typedef DWORD LCTYPE;

LGRPID

A language group identifier. For a list, see EnumLanguageGroupLocales.

This type is declared in WinNls.h as follows:

typedef DWORD LGRPID;

LONG

A 32-bit signed integer. The range is –2147483648 through 2147483647 decimal.

This type is declared in WinNT.h as follows:

typedef long LONG;

LONGLONG

A 64-bit signed integer. The range is –9223372036854775808 through 9223372036854775807 decimal.

This type is declared in WinNT.h as follows:

#if !defined(_M_IX86)
 typedef __int64 LONGLONG; 
#else
 typedef double LONGLONG;
#endif

LONG_PTR

A signed long type for pointer precision. Use when casting a pointer to a long to perform pointer arithmetic.

This type is declared in BaseTsd.h as follows:

#if defined(_WIN64)
 typedef __int64 LONG_PTR; 
#else
 typedef long LONG_PTR;
#endif

LONG32

A 32-bit signed integer. The range is –2147483648 through 2147483647 decimal.

This type is declared in BaseTsd.h as follows:

typedef signed int LONG32;

LONG64

A 64-bit signed integer. The range is –9223372036854775808 through 9223372036854775807 decimal.

This type is declared in BaseTsd.h as follows:

typedef __int64 LONG64;

LPARAM

A message parameter.

This type is declared in WinDef.h as follows:

typedef LONG_PTR LPARAM;

LPBOOL

A pointer to a BOOL.

This type is declared in WinDef.h as follows:

typedef BOOL far *LPBOOL;

LPBYTE

A pointer to a BYTE.

This type is declared in WinDef.h as follows:

typedef BYTE far *LPBYTE;

LPCOLORREF

A pointer to a COLORREF value.

This type is declared in WinDef.h as follows:

typedef DWORD *LPCOLORREF;

LPCSTR

A pointer to a constant null-terminated string of 8-bit Windows (ANSI) characters. For more information, see Character Sets Used By Fonts.

This type is declared in WinNT.h as follows:

typedef __nullterminated CONST CHAR *LPCSTR;

LPCTSTR

An LPCWSTR if UNICODE is defined, an LPCSTR otherwise. For more information, see Windows Data Types for Strings.

This type is declared in WinNT.h as follows:

#ifdef UNICODE
 typedef LPCWSTR LPCTSTR; 
#else
 typedef LPCSTR LPCTSTR;
#endif

LPCVOID

A pointer to a constant of any type.

This type is declared in WinDef.h as follows:

typedef CONST void *LPCVOID;

LPCWSTR

A pointer to a constant null-terminated string of 16-bit Unicode characters. For more information, see Character Sets Used By Fonts.

This type is declared in WinNT.h as follows:

typedef CONST WCHAR *LPCWSTR;

LPDWORD

A pointer to a DWORD.

This type is declared in WinDef.h as follows:

typedef DWORD *LPDWORD;

LPHANDLE

A pointer to a HANDLE.

This type is declared in WinDef.h as follows:

typedef HANDLE *LPHANDLE;

LPINT

A pointer to an INT.

This type is declared in WinDef.h as follows:

typedef int *LPINT;

LPLONG

A pointer to a LONG.

This type is declared in WinDef.h as follows:

typedef long *LPLONG;

LPSTR

A pointer to a null-terminated string of 8-bit Windows (ANSI) characters. For more information, see Character Sets Used By Fonts.

This type is declared in WinNT.h as follows:

typedef CHAR *LPSTR;

LPTSTR

An LPWSTR if UNICODE is defined, an LPSTR otherwise. For more information, see Windows Data Types for Strings.

This type is declared in WinNT.h as follows:

#ifdef UNICODE
 typedef LPWSTR LPTSTR;
#else
 typedef LPSTR LPTSTR;
#endif

LPVOID

A pointer to any type.

This type is declared in WinDef.h as follows:

typedef void *LPVOID;

LPWORD

A pointer to a WORD.

This type is declared in WinDef.h as follows:

typedef WORD *LPWORD;

LPWSTR

A pointer to a null-terminated string of 16-bit Unicode characters. For more information, see Character Sets Used By Fonts.

This type is declared in WinNT.h as follows:

typedef WCHAR *LPWSTR;

LRESULT

Signed result of message processing.

This type is declared in WinDef.h as follows:

typedef LONG_PTR LRESULT;

PBOOL

A pointer to a BOOL.

This type is declared in WinDef.h as follows:

typedef BOOL *PBOOL;

PBOOLEAN

A pointer to a BOOLEAN.

This type is declared in WinNT.h as follows:

typedef BOOLEAN *PBOOLEAN;

PBYTE

A pointer to a BYTE.

This type is declared in WinDef.h as follows:

typedef BYTE *PBYTE;

PCHAR

A pointer to a CHAR.

This type is declared in WinNT.h as follows:

typedef CHAR *PCHAR;

PCSTR

A pointer to a constant null-terminated string of 8-bit Windows (ANSI) characters. For more information, see Character Sets Used By Fonts.

This type is declared in WinNT.h as follows:

typedef CONST CHAR *PCSTR;

PCTSTR

PCWSTR if UNICODE is defined, a PCSTR otherwise. For more information, see Windows Data Types for Strings.

This type is declared in WinNT.h as follows:

#ifdef UNICODE
 typedef LPCWSTR PCTSTR;
#else
 typedef LPCSTR PCTSTR;
#endif

PCWSTR

A pointer to a constant null-terminated string of 16-bit Unicode characters. For more information, see Character Sets Used By Fonts.

This type is declared in WinNT.h as follows:

typedef CONST WCHAR *PCWSTR;

PDWORD

A pointer to a DWORD.

This type is declared in WinDef.h as follows:

typedef DWORD *PDWORD;

PDWORDLONG

A pointer to a DWORDLONG.

This type is declared in WinNT.h as follows:

typedef DWORDLONG *PDWORDLONG;

PDWORD_PTR

A pointer to a DWORD_PTR.

This type is declared in BaseTsd.h as follows:

typedef DWORD_PTR *PDWORD_PTR;

PDWORD32

A pointer to a DWORD32.

This type is declared in BaseTsd.h as follows:

typedef DWORD32 *PDWORD32;

PDWORD64

A pointer to a DWORD64.

This type is declared in BaseTsd.h as follows:

typedef DWORD64 *PDWORD64;

PFLOAT

A pointer to a FLOAT.

This type is declared in WinDef.h as follows:

typedef FLOAT *PFLOAT;

PHALF_PTR

A pointer to a HALF_PTR.

This type is declared in BaseTsd.h as follows:

#ifdef _WIN64
 typedef HALF_PTR *PHALF_PTR;
#else
 typedef HALF_PTR *PHALF_PTR;
#endif

PHANDLE

A pointer to a HANDLE.

This type is declared in WinNT.h as follows:

typedef HANDLE *PHANDLE;

PHKEY

A pointer to an HKEY.

This type is declared in WinDef.h as follows:

typedef HKEY *PHKEY;

PINT

A pointer to an INT.

This type is declared in WinDef.h as follows:

typedef int *PINT;

PINT_PTR

A pointer to an INT_PTR.

This type is declared in BaseTsd.h as follows:

typedef INT_PTR *PINT_PTR;

PINT8

A pointer to an INT8.

This type is declared in BaseTsd.h as follows:

typedef INT8 *PINT8;

PINT16

A pointer to an INT16.

This type is declared in BaseTsd.h as follows:

typedef INT16 *PINT16;

PINT32

A pointer to an INT32.

This type is declared in BaseTsd.h as follows:

typedef INT32 *PINT32;

PINT64

A pointer to an INT64.

This type is declared in BaseTsd.h as follows:

typedef INT64 *PINT64;

PLCID

A pointer to an LCID.

This type is declared in WinNT.h as follows:

typedef PDWORD PLCID;

PLONG

A pointer to a LONG.

This type is declared in WinNT.h as follows:

typedef LONG *PLONG;

PLONGLONG

A pointer to a LONGLONG.

This type is declared in WinNT.h as follows:

typedef LONGLONG *PLONGLONG;

PLONG_PTR

A pointer to a LONG_PTR.

This type is declared in BaseTsd.h as follows:

typedef LONG_PTR *PLONG_PTR;

PLONG32

A pointer to a LONG32.

This type is declared in BaseTsd.h as follows:

typedef LONG32 *PLONG32;

PLONG64

A pointer to a LONG64.

This type is declared in BaseTsd.h as follows:

typedef LONG64 *PLONG64;

POINTER_32

A 32-bit pointer. On a 32-bit system, this is a native pointer. On a 64-bit system, this is a truncated 64-bit pointer.

This type is declared in BaseTsd.h as follows:

#if defined(_WIN64)
 #define POINTER_32 __ptr32
#else
 #define POINTER_32
#endif

POINTER_64

A 64-bit pointer. On a 64-bit system, this is a native pointer. On a 32-bit system, this is a sign-extended 32-bit pointer.

Note that it is not safe to assume the state of the high pointer bit.

This type is declared in BaseTsd.h as follows:

#if (_MSC_VER >= 1300)
 #define POINTER_64 __ptr64
#else
 #define POINTER_64
#endif

POINTER_SIGNED

A signed pointer.

This type is declared in BaseTsd.h as follows:

#define POINTER_SIGNED __sptr

POINTER_UNSIGNED

An unsigned pointer.

This type is declared in BaseTsd.h as follows:

#define POINTER_UNSIGNED __uptr

PSHORT

A pointer to a SHORT.

This type is declared in WinNT.h as follows:

typedef SHORT *PSHORT;

PSIZE_T

A pointer to a SIZE_T.

This type is declared in BaseTsd.h as follows:

typedef SIZE_T *PSIZE_T;

PSSIZE_T

A pointer to a SSIZE_T.

This type is declared in BaseTsd.h as follows:

typedef SSIZE_T *PSSIZE_T;

PSTR

A pointer to a null-terminated string of 8-bit Windows (ANSI) characters. For more information, see Character Sets Used By Fonts.

This type is declared in WinNT.h as follows:

typedef CHAR *PSTR;

PTBYTE

A pointer to a TBYTE.

This type is declared in WinNT.h as follows:

typedef TBYTE *PTBYTE;

PTCHAR

A pointer to a TCHAR.

This type is declared in WinNT.h as follows:

typedef TCHAR *PTCHAR;

PTSTR

PWSTR if UNICODE is defined, a PSTR otherwise. For more information, see Windows Data Types for Strings.

This type is declared in WinNT.h as follows:

#ifdef UNICODE
 typedef LPWSTR PTSTR;
#else typedef LPSTR PTSTR;
#endif

PUCHAR

A pointer to a UCHAR.

This type is declared in WinDef.h as follows:

typedef UCHAR *PUCHAR;

PUHALF_PTR

A pointer to a UHALF_PTR.

This type is declared in BaseTsd.h as follows:

#ifdef _WIN64
 typedef UHALF_PTR *PUHALF_PTR;
#else
 typedef UHALF_PTR *PUHALF_PTR;
#endif

PUINT

A pointer to a UINT.

This type is declared in WinDef.h as follows:

typedef UINT *PUINT;

PUINT_PTR

A pointer to a UINT_PTR.

This type is declared in BaseTsd.h as follows:

typedef UINT_PTR *PUINT_PTR;

PUINT8

A pointer to a UINT8.

This type is declared in BaseTsd.h as follows:

typedef UINT8 *PUINT8;

PUINT16

A pointer to a UINT16.

This type is declared in BaseTsd.h as follows:

typedef UINT16 *PUINT16;

PUINT32

A pointer to a UINT32.

This type is declared in BaseTsd.h as follows:

typedef UINT32 *PUINT32;

PUINT64

A pointer to a UINT64.

This type is declared in BaseTsd.h as follows:

typedef UINT64 *PUINT64;

PULONG

A pointer to a ULONG.

This type is declared in WinDef.h as follows:

typedef ULONG *PULONG;

PULONGLONG

A pointer to a ULONGLONG.

This type is declared in WinDef.h as follows:

typedef ULONGLONG *PULONGLONG;

PULONG_PTR

A pointer to a ULONG_PTR.

This type is declared in BaseTsd.h as follows:

typedef ULONG_PTR *PULONG_PTR;

PULONG32

A pointer to a ULONG32.

This type is declared in BaseTsd.h as follows:

typedef ULONG32 *PULONG32;

PULONG64

A pointer to a ULONG64.

This type is declared in BaseTsd.h as follows:

typedef ULONG64 *PULONG64;

PUSHORT

A pointer to a USHORT.

This type is declared in WinDef.h as follows:

typedef USHORT *PUSHORT;

PVOID

A pointer to any type.

This type is declared in WinNT.h as follows:

typedef void *PVOID;

PWCHAR

A pointer to a WCHAR.

This type is declared in WinNT.h as follows:

typedef WCHAR *PWCHAR;

PWORD

A pointer to a WORD.

This type is declared in WinDef.h as follows:

typedef WORD *PWORD;

PWSTR

A pointer to a null-terminated string of 16-bit Unicode characters. For more information, see Character Sets Used By Fonts.

This type is declared in WinNT.h as follows:

typedef WCHAR *PWSTR;

QWORD

A 64-bit unsigned integer.

This type is declared as follows:

typedef unsigned __int64 QWORD;

SC_HANDLE

A handle to a service control manager database. For more information, see SCM Handles.

This type is declared in WinSvc.h as follows:

typedef HANDLE SC_HANDLE;

SC_LOCK

A lock to a service control manager database. For more information, see SCM Handles.

This type is declared in WinSvc.h as follows:

typedef LPVOID SC_LOCK;

SERVICE_STATUS_HANDLE

A handle to a service status value. For more information, see SCM Handles.

This type is declared in WinSvc.h as follows:

typedef HANDLE SERVICE_STATUS_HANDLE;

SHORT

A 16-bit integer. The range is –32768 through 32767 decimal.

This type is declared in WinNT.h as follows:

typedef short SHORT;

SIZE_T

The maximum number of bytes to which a pointer can point. Use for a count that must span the full range of a pointer.

This type is declared in BaseTsd.h as follows:

typedef ULONG_PTR SIZE_T;

SSIZE_T

A signed version of SIZE_T.

This type is declared in BaseTsd.h as follows:

typedef LONG_PTR SSIZE_T;

TBYTE

WCHAR if UNICODE is defined, a CHAR otherwise.

This type is declared in WinNT.h as follows:

#ifdef UNICODE
 typedef WCHAR TBYTE;
#else
 typedef unsigned char TBYTE;
#endif

TCHAR

WCHAR if UNICODE is defined, a CHAR otherwise.

This type is declared in WinNT.h as follows:

#ifdef UNICODE
 typedef WCHAR TCHAR;
#else
 typedef char TCHAR;
#endif

UCHAR

An unsigned CHAR.

This type is declared in WinDef.h as follows:

typedef unsigned char UCHAR;

UHALF_PTR

An unsigned HALF_PTR. Use within a structure that contains a pointer and two small fields.

This type is declared in BaseTsd.h as follows:

#ifdef _WIN64
 typedef unsigned int UHALF_PTR;
#else
 typedef unsigned short UHALF_PTR;
#endif

UINT

An unsigned INT. The range is 0 through 4294967295 decimal.

This type is declared in WinDef.h as follows:

typedef unsigned int UINT;

UINT_PTR

An unsigned INT_PTR.

This type is declared in BaseTsd.h as follows:

#if defined(_WIN64)
 typedef unsigned __int64 UINT_PTR;
#else
 typedef unsigned int UINT_PTR;
#endif

UINT8

An unsigned INT8.

This type is declared in BaseTsd.h as follows:

typedef unsigned char UINT8;

UINT16

An unsigned INT16.

This type is declared in BaseTsd.h as follows:

typedef unsigned short UINT16;

UINT32

An unsigned INT32. The range is 0 through 4294967295 decimal.

This type is declared in BaseTsd.h as follows:

typedef unsigned int UINT32;

UINT64

An unsigned INT64. The range is 0 through 18446744073709551615 decimal.

This type is declared in BaseTsd.h as follows:

typedef usigned __int 64 UINT64;

ULONG

An unsigned LONG. The range is 0 through 4294967295 decimal.

This type is declared in WinDef.h as follows:

typedef unsigned long ULONG;

ULONGLONG

A 64-bit unsigned integer. The range is 0 through 18446744073709551615 decimal.

This type is declared in WinNT.h as follows:

#if !defined(_M_IX86)
 typedef unsigned __int64 ULONGLONG;
#else
 typedef double ULONGLONG;
#endif

ULONG_PTR

An unsigned LONG_PTR.

This type is declared in BaseTsd.h as follows:

#if defined(_WIN64)
 typedef unsigned __int64 ULONG_PTR;
#else
 typedef unsigned long ULONG_PTR;
#endif

ULONG32

An unsigned LONG32. The range is 0 through 4294967295 decimal.

This type is declared in BaseTsd.h as follows:

typedef unsigned int ULONG32;

ULONG64

An unsigned LONG64. The range is 0 through 18446744073709551615 decimal.

This type is declared in BaseTsd.h as follows:

typedef unsigned __int64 ULONG64;

UNICODE_STRING

A Unicode string.

This type is declared in Winternl.h as follows:

typedef struct _UNICODE_STRING {
  USHORT  Length;
  USHORT  MaximumLength;
  PWSTR  Buffer;
} UNICODE_STRING;
typedef UNICODE_STRING *PUNICODE_STRING;
typedef const UNICODE_STRING *PCUNICODE_STRING;

USHORT

An unsigned SHORT. The range is 0 through 65535 decimal.

This type is declared in WinDef.h as follows:

typedef unsigned short USHORT;

USN

An update sequence number (USN).

This type is declared in WinNT.h as follows:

typedef LONGLONG USN;

VOID

Any type.

This type is declared in WinNT.h as follows:

#define VOID void

WCHAR

A 16-bit Unicode character. For more information, see Character Sets Used By Fonts.

This type is declared in WinNT.h as follows:

typedef wchar_t WCHAR;

WINAPI

The calling convention for system functions.

This type is declared in WinDef.h as follows:

#define WINAPI __stdcall

CALLBACKWINAPI, and APIENTRY are all used to define functions with the __stdcall calling convention. Most functions in the Windows API are declared using WINAPI. You may wish to use CALLBACK for the callback functions that you implement to help identify the function as a callback function.

WORD

A 16-bit unsigned integer. The range is 0 through 65535 decimal.

This type is declared in WinDef.h as follows:

typedef unsigned short WORD;

WPARAM

A message parameter.

This type is declared in WinDef.h as follows:

typedef UINT_PTR WPARAM;

Requirements

Minimum supported client

Windows XP [desktop apps only]

Minimum supported server

Windows Server 2003 [desktop apps only]

Header

BaseTsd.h;
WinDef.h;
WinNT.h


'WindowsAPI > Reference' 카테고리의 다른 글

1. _FILETIME 구조체  (0) 2016.10.13
Posted by 멜데스
WindowsAPI/Reference2016. 10. 13. 01:35
요약
파일 시간은 파일이 생성되었거나 마지막으로 접근한, 혹은 마지막으로 쓰여진 특정 날짜와 시간을 나타냅니다. 파일 시간은 FILETIME 구조체에 저장됩니다. 이 구조는 다양 한 Win32 API 호출에 사용 됩니다.
자세한 내용
FILETIME 구조 1601 년 1 월 1 일 이후로 100 나노초 간격의 수를 나타냅니다. 구조를 단일 64 비트 값을 결합 하는 두 개의 32 비트 값으로 구성 됩니다.

   typedef struct _FILETIME {
     DWORD dwLowDateTime;
     DWORD dwHighDateTime;
   } FILETIME;
				
100 나노초 간격 기반 FILETIME 구조를 참고 합니다. 파일 시간을 사용 하 여 작업할 때 다음 기호를 정의 하는 것이 좋습니다. 예를 들어:

   #define _SECOND ((int64) 10000000)
   #define _MINUTE (60 * _SECOND)
   #define _HOUR   (60 * _MINUTE)
   #define _DAY    (24 * _HOUR)
				

Arithmetics 파일 시간을 사용 하 여 수행합니다.

필요 파일 시간이 간단한 산술 연산을 수행 하는 경우가 많습니다. 예를 들어, 파일을 이전 30 일 때 알아야 할 수도 있습니다. 파일 시간에 산술을 수행하려면, FILETIME을 쿼드 워드(64 비트 정수)로 변경하여 산술 연산을 수행한 다음, 해당 결과를 다시 FILETIME로 변환해야 합니다. 

다음 샘플 코드 ft 파일의 작성 시간을 포함 하는 FILETIME 구조를 가정 하 고 30 일 시간이 추가 됩니다.

   ULONGLONG qwResult;

   // Copy the time into a quadword.
   qwResult = (((ULONGLONG) ft.dwHighDateTime) << 32) + ft.dwLowDateTime;

   // Add 30 days.
   qwResult += 30 * _DAY;

   // Copy the result back into the FILETIME structure.
   ft.dwLowDateTime  = (DWORD) (qwResult & 0xFFFFFFFF );
   ft.dwHighDateTime = (DWORD) (qwResult >> 32 );
				

파일 시간 설정

SetFileTime() 함수를 사용 하 여 파일에 대 한 파일 시간을 설정할 수 있습니다.

   BOOL SetFileTime(
     HANDLE hFile,                     // Handle to the file.
     CONST FILETIME *lpCreationTime,   // Time the file was created.
     CONST FILETIME *lpLastAccessTime, // Time the file was last accessed.
     CONST FILETIME *lpLastWriteTime   // Time the file was last
                                       // written to.
   );
				
이 함수를 사용 하 여 수정 작성, 마지막 액세스 및 마지막 파일의 내용을 변경 하지 않고 시간을 쓸 수 있습니다. 이 함수를 사용 하 여 열린 파일 핸들 있어야. 이 파일 핸들을 createfile () 또는 OpenFile()에 대 한 호출에서 얻을 수 있습니다. GENERIC_WRITE 액세스 파일을 열어야 합니다. 파일 시간을 설정한 후 CloseHandle()에 대 한 호출을 통해 파일 핸들을 해제 해야 합니다. 

것으로 간주 szFilename 올바른 파일 이름을 하며 FILETIME 구조가 ft, ft에 있는 시간을 파일을 만든 날짜를 설정 하는 다음 예제 코드:

   BOOL bResult;
   HANDLE hFile = CreateFile( szFilename,
      GENERIC_WRITE, // The file must be opened with write access.
      FILE_SHARE_READ | FILE_SHARE_WRITE, NULL, OPEN_EXISTING, 0, NULL );

   if (hFile != INVALID_HANDLE_VALUE) {
      bResult = SetFileTime( hFile, &ft, NULL, NULL );
      CloseHandle(hFile);
   }
				

파일 시간 표시

파일 시간 협정 세계시 (UTC)를 기준으로 합니다. UTC 기반 시간에 그리니치, 영국 현재 날짜 및 시간으로 느슨하게 정의 됩니다. 대부분의 경우 현지 시간 (즉, 날짜 및 표준 시간대의 시간)에 대 한 파일 시간을 표시 합니다. 이렇게 하려면 다음과 같이 FileTimeToLocalFileTime()를 사용할 수 있습니다.

   BOOL FileTimeToLocalFileTime(
     CONST FILETIME *lpFileTime,  // Pointer to UTC file time to convert.
     LPFILETIME lpLocalFileTime   // Pointer to converted file time.
   );
참고가이 함수는 표준 시간대 및 일광 절약 시간제에 대 한 현재 설정을 사용 합니다. 따라서 일광 절약 시간제 인 경우이 함수는 고려 일광 절약 시간제 시간 변환 하는 표준 시간으로 경우에. 

첫 번째 파일 시간을 의미 있는 방식으로 표시 하려면 다음과 같이 FileTimeToSystemTime()를 사용 하 여 시스템 시간으로 변환할 필요.

   BOOL FileTimeToSystemTime(
     CONST FILETIME *lpFileTime, // Pointer to file time to convert.
     LPSYSTEMTIME lpSystemTime   // Pointer to structure to receive
   );                            // system time.
				
날짜 및 시간을 월, 일, 연도, 요일, 시간, 분, 초 및 밀리초에 대 한 개별 구성원을 사용 하 여 있는 SYSTEMTIME 구조를 나타냅니다. 

또한 시스템에 대해 선택한 현재 로케일에 일관 된 형식으로 날짜와 시간을 표시 하는 것이 좋습니다.

   int GetDateFormat(
     LCID Locale,              // Locale for which date is to be formatted.
     DWORD dwFlags,            // Flags specifying function options.
     CONST SYSTEMTIME *lpDate, // Date to be formatted.
     LPCTSTR lpFormat,         // Date format string.
     LPTSTR lpDateStr,         // Buffer for storing formatted string.
     int cchDate               // Size of buffer.
   );

   int GetTimeFormat(
     LCID Locale,              // Locale for which time is to be formatted.
     DWORD dwFlags,            // Flags specifying function options.
     CONST SYSTEMTIME *lpTime, // Time to be formatted.
     LPCTSTR lpFormat,         // Time format string.
     LPTSTR lpTimeStr,         // Buffer for storing formatted string.
     int cchTime               // Size of buffer.
   );
				
LOCALE_USER_DEFAULT 첫 번째 매개 변수로이 함수에 전달 하 여 알려 전달 된 날짜/시간 기본 형식에 따라 현재 로케일에 대 한 서식을 지정 합니다. 

Ft는 UTC 값을 포함 하는 FILETIME 구조를 가정 하 고 다음 샘플 코드 ft에 저장 된 날짜를 인쇄 합니다.

   SYSTEMTIME st;
   char szLocalDate[255], szLocalTime[255];

   FileTimeToLocalFileTime( &ft, &ft );
   FileTimeToSystemTime( &ft, &st );
   GetDateFormat( LOCALE_USER_DEFAULT, DATE_LONGDATE, &st, NULL,
     szLocalDate, 255 );
   GetTimeFormat( LOCALE_USER_DEFAULT, 0, &st, NULL, szLocalTime, 255 );
   printf( "%s %s\n", szLocalDate, szLocalTime );
				


'WindowsAPI > Reference' 카테고리의 다른 글

2. Windef.h  (0) 2016.10.13
Posted by 멜데스