윈도우 데이터 타입

Common Data Types

The following data types are commonly used when transferring data across the wire. All multiple-byte numbers are transmitted in little-endian format (least significant byte first), unless otherwise indicated.

typedef  __int8; 
typedef  __int16; 
typedef  __int32; 
typedef  __int64; 
typedef int BOOL, *PBOOL, *LPBOOL; 
typedef BYTE BOOLEAN, *PBOOLEAN; 
typedef WCHAR * BSTR; 
typedef unsigned char BYTE, *PBYTE, *LPBYTE; 
typedef char CHAR, *PCHAR; 
typedef  CONST; 
typedef  DOUBLE; 
typedef unsigned long DWORD, *PDWORD, *LPDWORD; 
typedef ULONGLONG DWORDLONG, *PDWORDLONG; 
typedef ULONG_PTR DWORD_PTR; 
typedef unsigned int DWORD32; 
typedef unsigned __int64 DWORD64; 
typedef  GUID; 
typedef  HALF_PTR; 
typedef  handle_t; 
typedef  HRESULT; 
typedef int INT, *LPINT; 
typedef  INT_PTR; 
typedef signed char INT8; 
typedef signed short INT16; 
typedef signed int INT32; 
typedef signed __int64 INT64; 
typedef  LARGE_INTEGER; 
typedef  LMSTR; 
typedef  LMCSTR; 
typedef long LONG, *LPLONG; 
typedef  LONGLONG; 
typedef  LONG_PTR; 
typedef signed int LONG32; 
typedef __int64 LONG64; 
typedef  LPCSTR; 
typedef LPCSTR LPCTSTR; 
typedef  LPCWSTR; 
typedef  LPSTR; 
typedef  LPTSTR; 
typedef  LPWSTR; 
typedef  NET_API_STATUS; 
typedef  OLD_LARGE_INTEGER; 
typedef  PWSTR; 
typedef unsigned __int64 QWORD; 
typedef short SHORT; 
typedef  STRING; 
typedef  SYSTEMTIME; 
typedef  TCHAR; 
typedef  TIME; 
typedef unsigned char UCHAR, *PUCHAR; 
typedef unsigned int UINT; 
typedef  UINT_PTR; 
typedef unsigned char UINT8; 
typedef unsigned short UINT16; 
typedef unsigned int UINT32; 
typedef unsigned __int64 UINT64; 
typedef unsigned long ULONG, *PULONG; 
typedef  ULONGLONG; 
typedef  ULONG_PTR; 
typedef unsigned int ULONG32; 
typedef unsigned __int64 ULONG64; 
typedef  UNICODE; 
typedef  UNICODE_STRING; 
typedef  unsigned __int8; 
typedef  unsigned __int16; 
typedef  unsigned __int32; 
typedef  unsigned __int64; 
typedef unsigned short UNSIGNED16; 
typedef unsigned long UNSIGNED32; 
typedef unsigned short USHORT; 
typedef  UTIME; 
typedef  UUID; 
typedef  VARIANT; 
typedef void VOID, *PVOID; 
typedef wchar_t WCHAR, *PWCHAR; 
typedef  wchar_t; 
typedef unsigned short WORD, *PWORD, *LPWORD; 
Value Meaning

__int8

An 8-bit signed integer (range: –128 through 127 decimal). The first bit (Most Significant Bit (MSB)) is the signing bit.

__int16

A 16-bit signed integer (range: –32768 through 32767 decimal. The first bit (Most Significant Bit (MSB)) is the signing bit.

__int32

A 32-bit signed integer (range: –2147483648 through 2147483647 decimal). The first bit (Most Significant Bit (MSB)) is the signing bit.

__int64

A 64-bit signed integer (range: –9223372036854775808 through 9223372036854775807 decimal). The first bit (Most Significant Bit (MSB)) is the signing bit.

BOOL

A 32-bit field that is set to 1 to indicate TRUE, or 0 to indicate FALSE.

This type is declared in WinDef.h as follows:

typedef int BOOL;

BOOLEAN

An 8-bit field that is set to 1 to indicate TRUE, or 0 to indicate FALSE.

This type is declared in WinNT.h as follows:

typedef BYTE BOOLEAN;

BSTR

BSTR is a pointer to a null-terminated character string in which the string length is stored with the string. Because the length is stored with the string, BSTR variables can contain embedded null characters. For example:

[4 bytes (length prefix)], wchar_t[length], [\0]

For more information about the BSTR typedef, see the DBTYPE_BSTR description in the :Track('ctl00_rs1_mainContentContainer_ctl00|ctl00_rs1_mainContentContainer_ctl01',this);" href="http://msdn2.microsoft.com/en-us/library/ms711251.aspx" >Type Indicators section on Microsoft Developer Network (MSDN).

BYTE

An 8-bit block of data.

This type is declared in WinDef.h as follows:

typedef unsigned char BYTE;

CHAR

An 8-bit block of data that typically contains a Windows (ANSI) character.

This type is declared in WinNT.h as follows:

typedef char CHAR;

CONST

A variable whose value is to remain constant during execution.

This type is declared in WinDef.h as follows:

#define CONST const

DOUBLE

An 8-byte, double-precision, floating-point number representing a double-precision, 64-bit, IEEE 754 value with the range: 10308 through 10^323. The DOUBLE type can also represent NaN (Not a Number), positive and negative infinity, or positive and negative 0.

DWORD

A 32-bit unsigned integer (range: 0 through 4294967295 decimal). Because a DWORD is unsigned, its first bit (Most Significant Bit (MSB)) is not reserved for signing.

This type is declared in WinDef.h as follows:

typedef unsigned long DWORD;

DWORDLONG

A 64-bit unsigned integer (range: 0 through 18446744073709551615 decimal).

This type is declared in WinNT.h as follows:

typedef ULONGLONG 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;

GUID

A Globally Unique Identifier (GUID). This data type exposes the GUID structure, documented on the Microsoft Developer Network (MSDN), which contains the following fields:

  • DWORD: The first 8 hexadecimal digits of the GUID.

  • WORD: The first group of 4 hexadecimal digits of the GUID.

  • WORD: The second group of 4 hexadecimal digits of the GUID.

  • BYTE[]: An array whose first 2 bytes specify the third group of 4 hexadecimal digits, and whose remaining 6 bytes contain the final 12 hexadecimal digits of the GUID.

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_t

A context handle. Its implementation is server-specific, so its exact size and composition fall outside the scope of these documents.

HRESULT

A 32-bit value that is used to describe an error or warning and contains the following fields:

  • A 1-bit code that indicates severity, where 0 represents success and 1 represents failure.

  • A 4-bit reserved value.

  • An 11-bit code, also known as a facility code, that indicates responsibility for the error or warning.

  • A 16-bit code that describes the error or warning.

INT

A 32-bit signed integer (range: –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 (range: –128 through 127 decimal). The first bit (Most Significant Bit (MSB)) is the signing bit.

This type is declared in BaseTsd.h as follows:

typedef signed char INT8;

INT16

A 16-bit signed integer (range: –32768 through 32767 decimal). The first bit (Most Significant Bit (MSB)) is the signing bit.

This type is declared in BaseTsd.h as follows:

typedef signed short INT16;

INT32

A 32-bit signed integer (range: –2147483648 through 2147483647 decimal). The first bit (Most Significant Bit (MSB)) is the signing bit.

This type is declared in BaseTsd.h as follows:

typedef signed int INT32;

INT64

A 64-bit signed integer (range: –9223372036854775808 through 9223372036854775807 decimal). The first bit (Most Significant Bit (MSB)) is the signing bit.

This type is declared in BaseTsd.h as follows:

typedef signed __int64 INT64;

LARGE_INTEGER

A 64-bit signed integer (range: –9223372036854775808 through 9223372036854775807 decimal). This data type exposes the LARGE_INTEGER structure. For more information, see :Track('ctl00_rs1_mainContentContainer_ctl00|ctl00_rs1_mainContentContainer_ctl02',this);" href="http://go.microsoft.com/fwlink/?LinkId=124211" >LARGE_INTEGER on Microsoft Developer Network (MSDN).

LMSTR

A 32-bit pointer to a null-terminated string of 16-bit Unicode characters.

This type is declared in Lmcons.h as follows:

#define LMSTR LPWSTR

LMCSTR

A 32-bit pointer to a constant null-terminated string of 16-bit Unicode characters.

This type is declared in Lmcons.h as follows:

#define LMCSTR LPCWSTR

LONG

A 32-bit signed integer (range: –2147483648 through 2147483647 decimal).

This type is declared in WinNT.h as follows:

typedef long LONG;

LONGLONG

A 64-bit signed integer (range: –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 32-bit signed LONG 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.

This type is declared in BaseTsd.h as follows:

typedef signed int LONG32;

LONG64

A 64-bit signed integer.

This type is declared in BaseTsd.h as follows:

typedef __int64 LONG64;

LPCSTR

A 32-bit pointer to a constant null-terminated string of 8-bit Windows (ANSI) characters.

This type is declared in WinNT.h as follows:

typedef __nullterminated CONST CHAR *LPCSTR;

LPCTSTR

A 32-bit pointer to a null-terminated string of 8-bit Windows (ANSI) characters.

This type is declared in WinNT.h as follows:

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

LPCWSTR

A 32-bit pointer to a constant null-terminated string of 16-bit Unicode characters.

This type is declared in WinNT.h as follows:

typedef CONST WCHAR *LPCWSTR;

LPSTR

A 32-bit pointer to a null-terminated string of 8-bit Windows (ANSI) characters.

This type is declared in WinNT.h as follows:

typedef CHAR *LPSTR;

LPTSTR

A 32-bit pointer to a null-terminated string of 8-bit Windows (ANSI) characters.

This type is declared in WinNT.h as follows:

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

LPWSTR

A 32-bit pointer to a null-terminated string of 16-bit Unicode characters.

This type is declared in WinNT.h as follows:

typedef WCHAR *LPWSTR;

NET_API_STATUS

A DWORD data type.

This type is declared in Lmcons.h as follows:

#define NET_API_STATUS DWORD

OLD_LARGE_INTEGER

A data type that exposes an OLD_LARGE_INTEGER structure, which contains the following:

  • ULONG: The lower 4 bytes.

  • LONG: The upper 4 bytes.

For more information, see :Track('ctl00_rs1_mainContentContainer_ctl00|ctl00_rs1_mainContentContainer_ctl03',this);" href="http://go.microsoft.com/fwlink/?LinkId=124152" >OLD_LARGE_INTEGER on Microsoft Developer Network (MSDN).

PWSTR

A 32-bit pointer to a null-terminated string of 16-bit Unicode characters.

This type is declared in WinNT.h as follows:

typedef WCHAR *PWSTR;

QWORD

A 64-bit unsigned integer.

This type is declared in wmsdkidl.h as follows:

typedef unsigned __int64 QWORD

SHORT

A 16-bit integer (range: –32768 through 32767 decimal). The first bit (Most Significant Bit (MSB)) is the signing bit.

This type is declared in WinNT.h as follows:

typedef short SHORT;

STRING

Unless otherwise noted, a UCHAR buffer that represents a null-terminated ASCII string.

SYSTEMTIME

A date and time, in Coordinated Universal Time (UTC), represented by using individual WORD-sized structure members for the month, day, year, day of week, hour, minute, second, and millisecond. This data type exposes the SYSTEMTIME structure.

This structure is declared in Winbase.h as follows:

typedef struct _SYSTEMTIME {
    WORD wYear;
    WORD wMonth;
    WORD wDayOfWeek;
    WORD wDay;
    WORD wHour;
    WORD wMinute;
    WORD wSecond;
    WORD wMilliseconds;
} SYSTEMTIME, *PSYSTEMTIME;

For more information, see the :Track('ctl00_rs1_mainContentContainer_ctl00|ctl00_rs1_mainContentContainer_ctl04',this);" href="http://go.microsoft.com/fwlink/?LinkId=93364" >SYSTEMTIME on Microsoft Developer Network (MSDN).

TCHAR

A character that is a WCHAR if Unicode is defined, or a CHAR otherwise.

This type is declared in WinNT.h as follows:

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

TIME

A 64-bit integer that represents an absolute time or a time interval. Times are specified in units of 100 milliseconds. This data type exposes the TIME structure, which contains the following:

  • ULONG: The lower 4 bytes.

  • LONG: The upper 4 bytes.

A positive value expresses an absolute time, where the base time is the beginning of the year 1601 A.D. in the Gregorian calendar. A negative value expresses a time interval relative to some base time, typically the current time.

UCHAR

An 8-bit integer block of data with the range: 0 through 255 decimal. Because a UCHAR is unsigned, its first bit (Most Significant Bit (MSB)) is not reserved for signing.

This type is declared in WinDef.h as follows:

typedef unsigned char UCHAR;

UINT

A 32-bit unsigned integer (range: 0 through 4294967295 decimal). Because a UINT is unsigned, its first bit (Most Significant Bit (MSB)) is not reserved for signing.

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 8-bit unsigned integer (range: 0 through 255 decimal). Because a UINT8 is unsigned, its first bit (Most Significant Bit (MSB)) is not reserved for signing.

This type is declared in BaseTsd.h as follows:

typedef unsigned char UINT8;

UINT16

A 16-bit unsigned integer (range: 0 through 65535 decimal). Because a UINT16 is unsigned, its first bit (Most Significant Bit (MSB)) is not reserved for signing.

This type is declared in BaseTsd.h as follows:

typedef unsigned short UINT16;

UINT32

A 32-bit unsigned integer (range: 0 through 4294967295 decimal). Because a UINT32 is unsigned, its first bit (Most Significant Bit (MSB)) is not reserved for signing.

This type is declared in BaseTsd.h as follows:

typedef unsigned int UINT32;

UINT64

A 64-bit unsigned integer (range: 0 through 18446744073709551615 decimal). Because a UINT64 is unsigned, its first bit (Most Significant Bit (MSB)) is not reserved for signing.

This type is declared in BaseTsd.h as follows:

typedef unsigned __int64 UINT64;

ULONG

A 32-bit unsigned integer (range: 0 through 4294967295 decimal). Because a ULONG is unsigned, its first bit (Most Significant Bit (MSB)) is not reserved for signing.

This type is declared in WinDef.h as follows:

typedef unsigned long ULONG;

ULONGLONG

A 64-bit unsigned integer (range: 0 through 18446744073709551615 decimal). Because a ULONGLONG is unsigned, its first bit (Most Significant Bit (MSB)) is not reserved for signing.

This type is declared in WinNT.h as follows:

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

ULONG_PTR

A 32-bit pointer to a ULONG.

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.

This type is declared in BaseTsd.h as follows:

typedef unsigned int ULONG32;

ULONG64

An unsigned LONG64.

This type is declared in BaseTsd.h as follows:

typedef unsigned __int64 ULONG64;

UNICODE

Unless otherwise specified by a public specification, Microsoft uses the UTF-16 version of the Unicode character encoding. For more information on UTF-16, see :Track('ctl00_rs1_mainContentContainer_ctl00|ctl00_rs1_mainContentContainer_ctl05',this);" href="http://go.microsoft.com/fwlink/?LinkId=90380" >RFC 2781: UTF-16, an encoding of ISO 10646.

UNICODE_STRING

A complex data type, documented on Microsoft Developer Network (MSDN) that consists of the following:

  • USHORT: Length, in bytes, of the wide-character string.

  • USHORT: Total size, in bytes, of memory allocated for the wide-character string buffer.

  • PWSTR: Pointer to a wide-character string buffer.

unsigned __int8

A 8-bit unsigned integer (range: 0 through 255 decimal). Because an unsigned __int8 is unsigned, its first bit (Most Significant Bit (MSB)) is not reserved for signing.

unsigned __int16

A 16-bit unsigned integer (range: 0 through 65535 decimal). Because an unsigned __int16 is unsigned, its first bit (Most Significant Bit (MSB)) is not reserved for signing.

unsigned __int32

A 32-bit unsigned integer (range: 0 through 4294967295 decimal). Because an unsigned __int32 is unsigned, its first bit (Most Significant Bit (MSB)) is not reserved for signing.

unsigned __int64

A 64-bit unsigned integer (range: 0 through 18446744073709551615 decimal). Because an unsigned __int64 is unsigned, its first bit (Most Significant Bit (MSB)) is not reserved for signing.

UNSIGNED16

A 16-bit unsigned integer (range: 0 through 65535 decimal). Because an UNSIGNED16 is unsigned, its first bit (Most Significant Bit (MSB)) is not reserved for signing.

UNSIGNED32

A 32-bit unsigned integer (range: 0 through 4294967295 decimal). Because an UNSIGNED32 is unsigned, its first bit (Most Significant Bit (MSB)) is not reserved for signing.

USHORT

A 16-bit unsigned integer (range: 0 through 65535 decimal). Because a USHORT is unsigned, its first bit (Most Significant Bit (MSB)) is not reserved for signing.

This type is declared in WinDef.h as follows:

typedef unsigned short USHORT;

UTIME

A 32-bit unsigned integer that represents the number of seconds since 00:00:00.0 January 1, 1970 Coordinated Universal Time (UTC). For example, noon on January 1, 1970 is represented as 43200.

UUID

A Universally Unique Identifier. This data type exposes the UUID structure, documented on Microsoft Developer Network (MSDN), which contains the following:

  • LONG: The first 8 hexadecimal digits of the UUID.

  • SHORT: The first group of 4 hexadecimal digits of the UUID.

  • SHORT: The second group of 4 hexadecimal digits of the UUID.

  • CHAR[]: An array whose first 2 bytes specify the third group of four hexadecimal digits, and whose remaining 6 bytes contain the final 12 hexadecimal digits of the UUID.

VARIANT

An automation structure data type, documented on Microsoft Developer Network (MSDN), that can represent any other automation data type.

VOID

This is an alias for void.

WCHAR

A 16-bit Unicode character.

This type is declared in WinNT.h as follows:

typedef wchar_t WCHAR;

wchar_t

A 16-bit Unicode character for use with the Microsoft Interface Definition Language (MIDL) compiler.

WORD

A 16-bit unsigned integer (range: 0 through 65535 decimal). Because a WORD is unsigned, its first bit (Most Significant Bit (MSB)) is not reserved for signing.

This type is declared in WinDef.h as follows:

typedef unsigned short WORD;
위로 스크롤