|
|
1.1 ! root 1: /*++ BUILD Version: 0001 // Increment this if a change has global effects ! 2: ! 3: Copyright (c) 1989-1993 Microsoft Corporation ! 4: ! 5: Module Name: ! 6: ! 7: ntdef.h ! 8: ! 9: Abstract: ! 10: ! 11: Type definitions for the basic types. ! 12: ! 13: Author: ! 14: ! 15: Mark Lucovsky (markl) 02-Feb-1989 ! 16: ! 17: Revision History: ! 18: ! 19: --*/ ! 20: ! 21: #ifndef _NTDEF_ ! 22: #define _NTDEF_ ! 23: ! 24: #include <ctype.h> // winnt ! 25: ! 26: // begin_ntminiport ! 27: ! 28: #ifndef IN ! 29: #define IN ! 30: #endif ! 31: ! 32: #ifndef OUT ! 33: #define OUT ! 34: #endif ! 35: ! 36: #ifndef OPTIONAL ! 37: #define OPTIONAL ! 38: #endif ! 39: ! 40: #ifndef NOTHING ! 41: #define NOTHING ! 42: #endif ! 43: ! 44: #ifndef CRITICAL ! 45: #define CRITICAL ! 46: #endif ! 47: ! 48: #ifndef ANYSIZE_ARRAY ! 49: #define ANYSIZE_ARRAY 1 // winnt ! 50: #endif ! 51: ! 52: #if defined(_MIPS_) || defined(_ALPHA_) // winnt ! 53: #define UNALIGNED __unaligned // winnt ! 54: #else // winnt ! 55: #define UNALIGNED // winnt ! 56: #endif // winnt ! 57: ! 58: #ifndef CONST ! 59: #define CONST const ! 60: #endif ! 61: ! 62: // ! 63: // Void ! 64: // ! 65: ! 66: typedef void *PVOID; // winnt ! 67: ! 68: // end_ntminiport ! 69: ! 70: #if (_MSC_VER >= 800) // winnt ! 71: #define NTAPI __stdcall // winnt ! 72: #else // winnt ! 73: #define _cdecl // winnt ! 74: #define NTAPI // winnt ! 75: #endif // winnt ! 76: ! 77: // begin_winnt begin_ntminiport ! 78: ! 79: // ! 80: // Basics ! 81: // ! 82: ! 83: #ifndef VOID ! 84: #define VOID void ! 85: typedef char CHAR; ! 86: typedef short SHORT; ! 87: typedef long LONG; ! 88: #endif ! 89: ! 90: // ! 91: // UNICODE (Wide Character) types ! 92: // ! 93: ! 94: typedef wchar_t WCHAR; // wc, 16-bit UNICODE character ! 95: ! 96: typedef WCHAR *PWCHAR; ! 97: typedef WCHAR *LPWCH, *PWCH; ! 98: typedef CONST WCHAR *LPCWCH, *PCWCH; ! 99: typedef WCHAR *NWPSTR; ! 100: typedef WCHAR *LPWSTR, *PWSTR; ! 101: ! 102: typedef CONST WCHAR *LPCWSTR, *PCWSTR; ! 103: ! 104: // ! 105: // ANSI (Multi-byte Character) types ! 106: // ! 107: typedef CHAR *PCHAR; ! 108: typedef CHAR *LPCH, *PCH; ! 109: ! 110: typedef CONST CHAR *LPCCH, *PCCH; ! 111: typedef CHAR *NPSTR; ! 112: typedef CHAR *LPSTR, *PSTR; ! 113: typedef CONST CHAR *LPCSTR, *PCSTR; ! 114: ! 115: // ! 116: // Neutral ANSI/UNICODE types and macros ! 117: // ! 118: #ifdef UNICODE ! 119: ! 120: #ifndef _TCHAR_DEFINED ! 121: typedef WCHAR TCHAR, *PTCHAR; ! 122: typedef WCHAR TUCHAR, *PTUCHAR; ! 123: #define _TCHAR_DEFINED ! 124: #endif /* !_TCHAR_DEFINED */ ! 125: ! 126: typedef LPWSTR LPTCH, PTCH; ! 127: typedef LPWSTR PTSTR, LPTSTR; ! 128: typedef LPCWSTR LPCTSTR; ! 129: typedef LPWSTR LP; ! 130: #define __TEXT(quote) L##quote ! 131: ! 132: #else /* UNICODE */ ! 133: ! 134: #ifndef _TCHAR_DEFINED ! 135: typedef char TCHAR, *PTCHAR; ! 136: typedef unsigned char TUCHAR, *PTUCHAR; ! 137: #define _TCHAR_DEFINED ! 138: #endif /* !_TCHAR_DEFINED */ ! 139: ! 140: typedef LPSTR LPTCH, PTCH; ! 141: typedef LPSTR PTSTR, LPTSTR; ! 142: typedef LPCSTR LPCTSTR; ! 143: #define __TEXT(quote) quote ! 144: ! 145: #endif /* UNICODE */ ! 146: #define TEXT(quote) __TEXT(quote) ! 147: ! 148: ! 149: // end_winnt ! 150: ! 151: typedef double DOUBLE; ! 152: ! 153: typedef struct _QUAD { // QUAD is for those times we want ! 154: double DoNotUseThisField; // an 8 byte aligned 8 byte long structure ! 155: } QUAD; // which is NOT really a floating point ! 156: // number. Use DOUBLE if you want an FP ! 157: // number. ! 158: ! 159: // ! 160: // Pointer to Basics ! 161: // ! 162: ! 163: typedef SHORT *PSHORT; // winnt ! 164: typedef LONG *PLONG; // winnt ! 165: typedef QUAD *PQUAD; ! 166: ! 167: // ! 168: // Unsigned Basics ! 169: // ! 170: ! 171: // Tell windef.h that some types are already defined. ! 172: #define BASETYPES ! 173: ! 174: typedef unsigned char UCHAR; ! 175: typedef unsigned short USHORT; ! 176: typedef unsigned long ULONG; ! 177: typedef QUAD UQUAD; ! 178: ! 179: // ! 180: // Pointer to Unsigned Basics ! 181: // ! 182: ! 183: typedef UCHAR *PUCHAR; ! 184: typedef USHORT *PUSHORT; ! 185: typedef ULONG *PULONG; ! 186: typedef UQUAD *PUQUAD; ! 187: ! 188: // ! 189: // Signed characters ! 190: // ! 191: ! 192: typedef signed char SCHAR; ! 193: typedef SCHAR *PSCHAR; ! 194: ! 195: #ifndef NO_STRICT ! 196: #define STRICT 1 ! 197: #endif ! 198: ! 199: // ! 200: // Handle to an Object ! 201: // ! 202: ! 203: // begin_winnt ! 204: ! 205: #ifdef STRICT ! 206: typedef void *HANDLE; ! 207: #define DECLARE_HANDLE(name) struct name##__ { int unused; }; typedef struct name##__ *name ! 208: #else ! 209: typedef PVOID HANDLE; ! 210: #define DECLARE_HANDLE(name) typedef HANDLE name ! 211: #endif ! 212: typedef HANDLE *PHANDLE; ! 213: ! 214: // end_winnt ! 215: ! 216: // ! 217: // Low order two bits of a handle are ignored by the system and available ! 218: // for use by application code as tag bits. The remaining bits are opaque ! 219: // and used to store a serial number and table index. ! 220: // ! 221: ! 222: #define OBJ_HANDLE_TAGBITS 0x00000003L ! 223: ! 224: // ! 225: // Cardinal Data Types [0 - 2**N-2) ! 226: // ! 227: ! 228: typedef char CCHAR; // winnt ! 229: typedef short CSHORT; ! 230: typedef ULONG CLONG; ! 231: ! 232: typedef CCHAR *PCCHAR; ! 233: typedef CSHORT *PCSHORT; ! 234: typedef CLONG *PCLONG; ! 235: ! 236: // end_ntminiport ! 237: ! 238: // ! 239: // NLS basics (Locale and Language Ids) ! 240: // ! 241: ! 242: typedef ULONG LCID; // winnt ! 243: typedef PULONG PLCID; // winnt ! 244: typedef USHORT LANGID; // winnt ! 245: ! 246: // ! 247: // NTSTATUS ! 248: // ! 249: ! 250: typedef LONG NTSTATUS; ! 251: /*lint -e624 */ // Don't complain about different typedefs. // winnt ! 252: typedef NTSTATUS *PNTSTATUS; ! 253: /*lint +e624 */ // Resume checking for different typedefs. // winnt ! 254: ! 255: // ! 256: // Status values are 32 bit values layed out as follows: ! 257: // ! 258: // 3 3 2 2 2 2 2 2 2 2 2 2 1 1 1 1 1 1 1 1 1 1 ! 259: // 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 ! 260: // +---+-+-------------------------+-------------------------------+ ! 261: // |Sev|C| Facility | Code | ! 262: // +---+-+-------------------------+-------------------------------+ ! 263: // ! 264: // where ! 265: // ! 266: // Sev - is the severity code ! 267: // ! 268: // 00 - Success ! 269: // 01 - Informational ! 270: // 10 - Warning ! 271: // 11 - Error ! 272: // ! 273: // C - is the Customer code flag ! 274: // ! 275: // Facility - is the facility code ! 276: // ! 277: // Code - is the facility's status code ! 278: // ! 279: ! 280: // ! 281: // Generic test for success on any status value (non-negative numbers ! 282: // indicate success). ! 283: // ! 284: ! 285: #define NT_SUCCESS(Status) ((NTSTATUS)(Status) >= 0) ! 286: ! 287: // ! 288: // Generic test for information on any status value. ! 289: // ! 290: ! 291: #define NT_INFORMATION(Status) ((ULONG)(Status) >> 30 == 1) ! 292: ! 293: // ! 294: // Generic test for warning on any status value. ! 295: // ! 296: ! 297: #define NT_WARNING(Status) ((ULONG)(Status) >> 30 == 2) ! 298: ! 299: // ! 300: // Generic test for error on any status value. ! 301: // ! 302: ! 303: #define NT_ERROR(Status) ((ULONG)(Status) >> 30 == 3) ! 304: ! 305: // begin_winnt ! 306: #define APPLICATION_ERROR_MASK 0x20000000 ! 307: #define ERROR_SEVERITY_SUCCESS 0x00000000 ! 308: #define ERROR_SEVERITY_INFORMATIONAL 0x40000000 ! 309: #define ERROR_SEVERITY_WARNING 0x80000000 ! 310: #define ERROR_SEVERITY_ERROR 0xC0000000 ! 311: // end_winnt ! 312: ! 313: // ! 314: // Large (64-bit) integer types and operations ! 315: // ! 316: ! 317: #define TIME LARGE_INTEGER ! 318: #define _TIME _LARGE_INTEGER ! 319: #define PTIME PLARGE_INTEGER ! 320: #define LowTime LowPart ! 321: #define HighTime HighPart ! 322: ! 323: ! 324: // begin_winnt begin_ntminiport ! 325: ! 326: #if defined(MIDL_PASS) || defined(_CFRONT_PASS_) ! 327: typedef double LONGLONG; ! 328: typedef double ULONGLONG; ! 329: #else ! 330: #if defined(_M_IX86) ! 331: typedef double LONGLONG; ! 332: typedef double ULONGLONG; ! 333: #elif defined(_M_MRX000) ! 334: typedef double LONGLONG; ! 335: typedef double ULONGLONG; ! 336: #elif defined(_ALPHA_) ! 337: typedef __int64 LONGLONG; ! 338: typedef unsigned __int64 ULONGLONG; ! 339: #else ! 340: typedef double LONGLONG; ! 341: typedef double ULONGLONG; ! 342: #endif ! 343: #endif ! 344: ! 345: typedef LONGLONG *PLONGLONG; ! 346: typedef ULONGLONG *PULONGLONG; ! 347: ! 348: #if defined(MIDL_PASS) ! 349: typedef struct _LARGE_INTEGER { ! 350: #else // MIDL_PASS ! 351: typedef union _LARGE_INTEGER { ! 352: #if defined(_CFRONT_PASS_) ! 353: struct { ! 354: ULONG LowPart; ! 355: LONG HighPart; ! 356: } u; ! 357: #else ! 358: struct { ! 359: ULONG LowPart; ! 360: LONG HighPart; ! 361: }; ! 362: #endif ! 363: #endif //MIDL_PASS ! 364: LONGLONG QuadPart; ! 365: } LARGE_INTEGER, *PLARGE_INTEGER; ! 366: ! 367: ! 368: #if defined(MIDL_PASS) ! 369: typedef struct _ULARGE_INTEGER { ! 370: #else // MIDL_PASS ! 371: typedef union _ULARGE_INTEGER { ! 372: #if defined(_CFRONT_PASS_) ! 373: struct { ! 374: ULONG LowPart; ! 375: ULONG HighPart; ! 376: } u; ! 377: #else ! 378: struct { ! 379: ULONG LowPart; ! 380: ULONG HighPart; ! 381: }; ! 382: #endif ! 383: #endif //MIDL_PASS ! 384: ULONGLONG QuadPart; ! 385: } ULARGE_INTEGER, *PULARGE_INTEGER; ! 386: ! 387: // end_ntminiport ! 388: ! 389: // ! 390: // Locally Unique Identifier ! 391: // ! 392: ! 393: typedef LARGE_INTEGER LUID, *PLUID; ! 394: ! 395: // end_winnt ! 396: // begin_ntminiport ! 397: ! 398: // ! 399: // Physical address. ! 400: // ! 401: ! 402: typedef LARGE_INTEGER PHYSICAL_ADDRESS, *PPHYSICAL_ADDRESS; // windbgkd ! 403: ! 404: // end_ntminiport ! 405: ! 406: #ifdef LARGE_INTEGER_INTRINICS ! 407: ! 408: #define I64Neg( a ) (-(a)) ! 409: #define I64Add( a, b ) ((a) + (b)) ! 410: #define I64Sub( a, b ) ((a) - (b)) ! 411: #define I64Mul( a, b ) ((a) * (b)) ! 412: #define I64Div( a, b ) ((a) / (b)) ! 413: #define I64Mod( a, b ) ((a) % (b)) ! 414: #define I64Gtr( a, b ) ((a) > (b)) ! 415: #define I64Geq( a, b ) ((a) >= (b)) ! 416: #define I64Eql( a, b ) ((a) == (b)) ! 417: #define I64Neq( a, b ) ((a) != (b)) ! 418: #define I64Leq( a, b ) ((a) <= (b)) ! 419: #define I64Ltr( a, b ) ((a) < (b)) ! 420: #define I64Shr( a, b ) ((a) >> (b)) ! 421: #define I64Shl( a, b ) ((a) << (b)) ! 422: #define I64Sar( a, b ) ((LARGE_INTEGER)(a) >> (b)) ! 423: #define I64Not( a ) (~(a)) ! 424: #define I64And( a, b ) ((a) & (b)) ! 425: #define I64Or( a, b ) ((a) | (b)) ! 426: #define I64Xor( a, b ) ((a) ^ (b)) ! 427: ! 428: #define LiNeg(a) (-(a)) ! 429: #define LiAdd(a,b) ((a) + (b)) ! 430: #define LiSub(a,b) ((a) - (b)) ! 431: #define LiNMul(a,b) ((a) * (b)) ! 432: #define LiXMul(a,b) ((a) * (b)) ! 433: #define LiDiv(a,b) ((a) / (b)) ! 434: #define LiXDiv(a,b) ((a) / (b)) ! 435: #define LiMod(a,b) ((a) % (b)) ! 436: #define LiShr(a,b) ((a) >> (b)) ! 437: #define LiShl(a,b) ((a) << (b)) ! 438: #define LiGtr(a,b) ((a) > (b)) ! 439: #define LiGeq(a,b) ((a) >= (b)) ! 440: #define LiEql(a,b) ((a) == (b)) ! 441: #define LiNeq(a,b) ((a) != (b)) ! 442: #define LiLtr(a,b) ((a) < (b)) ! 443: #define LiLeq(a,b) ((a) <= (b)) ! 444: #define LiGtrZero(a) ((a) > 0) ! 445: #define LiGeqZero(a) ((a) >= 0) ! 446: #define LiEqlZero(a) ((a) == 0) ! 447: #define LiNeqZero(a) ((a) != 0) ! 448: #define LiLtrZero(a) ((a) < (0) ! 449: #define LiLeqZero(a) ((a) <= (0) ! 450: #define LiFromLong(a) (a) ! 451: #define LiFromUlong(a) (a) ! 452: ! 453: #define LiTemps {;} ! 454: #define LiGtrT_(a,b) ((a) > (b)) ! 455: #define LiGtr_T(a,b) ((a) > (b)) ! 456: #define LiGtrTT(a,b) ((a) > (b)) ! 457: #define LiGeqT_(a,b) ((a) >= (b)) ! 458: #define LiGeq_T(a,b) ((a) >= (b)) ! 459: #define LiGeqTT(a,b) ((a) >= (b)) ! 460: #define LiEqlT_(a,b) ((a) == (b)) ! 461: #define LiEql_T(a,b) ((a) == (b)) ! 462: #define LiEqlTT(a,b) ((a) == (b)) ! 463: #define LiNeqT_(a,b) ((a) != (b)) ! 464: #define LiNeq_T(a,b) ((a) != (b)) ! 465: #define LiNeqTT(a,b) ((a) != (b)) ! 466: #define LiLtrT_(a,b) ((a) < (b)) ! 467: #define LiLtr_T(a,b) ((a) < (b)) ! 468: #define LiLtrTT(a,b) ((a) < (b)) ! 469: #define LiLeqT_(a,b) ((a) <= (b)) ! 470: #define LiLeq_T(a,b) ((a) <= (b)) ! 471: #define LiLeqTT(a,b) ((a) <= (b)) ! 472: #define LiGtrZeroT(a) ((a) > 0) ! 473: #define LiGeqZeroT(a) ((a) >= 0) ! 474: #define LiEqlZeroT(a) ((a) == 0) ! 475: #define LiNeqZeroT(a) ((a) != 0) ! 476: #define LiLtrZeroT(a) ((a) < 0) ! 477: #define LiLeqZeroT(a) ((a) <= 0) ! 478: ! 479: #else ! 480: ! 481: #define I64Neg( a ) (RtlLargeIntegerNegate((a))) ! 482: #define I64Add( a, b ) (RtlLargeIntegerAdd((a), (b))) ! 483: #define I64Sub( a, b ) (RtlLargeIntegerSubtract((a), (b))) ! 484: #define I64Mul( a, b ) (RtlLargeIntegerMultiply((a), (b))) ! 485: #define I64Div( a, b ) (RtlLargeIntegerDivide((a), (b), NULL)) ! 486: #define I64Mod( a, b ) (RtlLargeIntegerModulo((a), (b))) ! 487: #define I64Gtr( a, b ) (RtlLargeIntegerGreaterThan((a), (b))) ! 488: #define I64Geq( a, b ) (RtlLargeIntegerGreaterThanOrEqualTo((a), (b))) ! 489: #define I64Eql( a, b ) (RtlLargeIntegerEqualTo((a), (b))) ! 490: #define I64Neq( a, b ) (!RtlLargeIntegerEqualTo((a), (b))) ! 491: #define I64Ltr( a, b ) (RtlLargeIntegerLessThan((a), (b))) ! 492: #define I64Leq( a, b ) (!RtlLargeIntegerGreaterThan((a), (b))) ! 493: #define I64Shr( a, b ) (RtlLargeIntegerShiftRight((a), (b))) ! 494: #define I64Shl( a, b ) (RtlLargeIntegerShiftLeft((a), (b))) ! 495: #define I64Sar( a, b ) (RtlLargeIntegerArithmeticShift((a), (b))) ! 496: #define I64Not( a ) (RtlLargeIntegerNegate((a))) ! 497: #define I64And( a, b ) (RtlLargeIntegerAnd((a), (b))) ! 498: #define I64Or( a, b ) (RtlLargeIntegerOr((a), (b))) ! 499: #define I64Xor( a, b ) (RtlLargeIntegerXor((a), (b))) ! 500: ! 501: #define LiNeg(a) (RtlLargeIntegerNegate((a))) // -a ! 502: #define LiAdd(a,b) (RtlLargeIntegerAdd((a),(b))) // a + b ! 503: #define LiSub(a,b) (RtlLargeIntegerSubtract((a),(b))) // a - b ! 504: #define LiNMul(a,b) (RtlEnlargedIntegerMultiply((a),(b))) // a * b (Long * Long) ! 505: #define LiXMul(a,b) (RtlExtendedIntegerMultiply((a),(b))) // a * b (Large * Long) ! 506: #define LiDiv(a,b) (RtlLargeIntegerDivide((a),(b),NULL)) // a / b (Large / Large) ! 507: #define LiXDiv(a,b) (RtlExtendedLargeIntegerDivide((a),(b),NULL)) // a / b (Large / Long) ! 508: #define LiMod(a,b) (RtlLargeIntegerModulo((a),(b))) // a % b ! 509: #define LiShr(a,b) (RtlLargeIntegerShiftRight((a),(CCHAR)(b))) // a >> b ! 510: #define LiShl(a,b) (RtlLargeIntegerShiftLeft((a),(CCHAR)(b))) // a << b ! 511: #define LiGtr(a,b) (RtlLargeIntegerGreaterThan((a),(b))) // a > b ! 512: #define LiGeq(a,b) (RtlLargeIntegerGreaterThanOrEqualTo((a),(b))) // a >= b ! 513: #define LiEql(a,b) (RtlLargeIntegerEqualTo((a),(b))) // a == b ! 514: #define LiNeq(a,b) (RtlLargeIntegerNotEqualTo((a),(b))) // a != b ! 515: #define LiLtr(a,b) (RtlLargeIntegerLessThan((a),(b))) // a < b ! 516: #define LiLeq(a,b) (RtlLargeIntegerLessThanOrEqualTo((a),(b))) // a <= b ! 517: #define LiGtrZero(a) (RtlLargeIntegerGreaterThanZero((a))) // a > 0 ! 518: #define LiGeqZero(a) (RtlLargeIntegerGreaterOrEqualToZero((a))) // a >= 0 ! 519: #define LiEqlZero(a) (RtlLargeIntegerEqualToZero((a))) // a == 0 ! 520: #define LiNeqZero(a) (RtlLargeIntegerNotEqualToZero((a))) // a != 0 ! 521: #define LiLtrZero(a) (RtlLargeIntegerLessThanZero((a))) // a < 0 ! 522: #define LiLeqZero(a) (RtlLargeIntegerLessOrEqualToZero((a))) // a <= 0 ! 523: #define LiFromLong(a) (RtlConvertLongToLargeInteger((a))) ! 524: #define LiFromUlong(a) (RtlConvertUlongToLargeInteger((a))) ! 525: ! 526: #define LiTemps LARGE_INTEGER _LiT1,_LiT2 ! 527: #define LiGtrT_(a,b) ((_LiT1 = a,_LiT2), LiGtr(_LiT1,(b))) ! 528: #define LiGtr_T(a,b) ((_LiT1,_LiT2 = b), LiGtr((a),_LiT2)) ! 529: #define LiGtrTT(a,b) ((_LiT1 = a, _LiT2 = b),LiGtr(_LiT1,_LiT2)) ! 530: #define LiGeqT_(a,b) ((_LiT1 = a,_LiT2), LiGeq(_LiT1,(b))) ! 531: #define LiGeq_T(a,b) ((_LiT1,_LiT2 = b), LiGeq((a),_LiT2)) ! 532: #define LiGeqTT(a,b) ((_LiT1 = a, _LiT2 = b),LiGeq(_LiT1,_LiT2)) ! 533: #define LiEqlT_(a,b) ((_LiT1 = a,_LiT2), LiEql(_LiT1,(b))) ! 534: #define LiEql_T(a,b) ((_LiT1,_LiT2 = b), LiEql((a),_LiT2)) ! 535: #define LiEqlTT(a,b) ((_LiT1 = a, _LiT2 = b),LiEql(_LiT1,_LiT2)) ! 536: #define LiNeqT_(a,b) ((_LiT1 = a,_LiT2), LiNeq(_LiT1,(b))) ! 537: #define LiNeq_T(a,b) ((_LiT1,_LiT2 = b), LiNeq((a),_LiT2)) ! 538: #define LiNeqTT(a,b) ((_LiT1 = a, _LiT2 = b),LiNeq(_LiT1,_LiT2)) ! 539: #define LiLtrT_(a,b) ((_LiT1 = a,_LiT2), LiLtr(_LiT1,(b))) ! 540: #define LiLtr_T(a,b) ((_LiT1,_LiT2 = b), LiLtr((a),_LiT2)) ! 541: #define LiLtrTT(a,b) ((_LiT1 = a, _LiT2 = b),LiLtr(_LiT1,_LiT2)) ! 542: #define LiLeqT_(a,b) ((_LiT1 = a,_LiT2), LiLeq(_LiT1,(b))) ! 543: #define LiLeq_T(a,b) ((_LiT1,_LiT2 = b), LiLeq((a),_LiT2)) ! 544: #define LiLeqTT(a,b) ((_LiT1 = a, _LiT2 = b),LiLeq(_LiT1,_LiT2)) ! 545: #define LiGtrZeroT(a) ((_LiT1 = a,_LiT2), LiGtrZero(_LiT1)) ! 546: #define LiGeqZeroT(a) ((_LiT1 = a,_LiT2), LiGeqZero(_LiT1)) ! 547: #define LiEqlZeroT(a) ((_LiT1 = a,_LiT2), LiEqlZero(_LiT1)) ! 548: #define LiNeqZeroT(a) ((_LiT1 = a,_LiT2), LiNeqZero(_LiT1)) ! 549: #define LiLtrZeroT(a) ((_LiT1 = a,_LiT2), LiLtrZero(_LiT1)) ! 550: #define LiLeqZeroT(a) ((_LiT1 = a,_LiT2), LiLeqZero(_LiT1)) ! 551: ! 552: #endif ! 553: ! 554: ! 555: ! 556: // ! 557: // Event type ! 558: // ! 559: ! 560: typedef enum _EVENT_TYPE { ! 561: NotificationEvent, ! 562: SynchronizationEvent ! 563: } EVENT_TYPE; ! 564: ! 565: // ! 566: // Wait type ! 567: // ! 568: ! 569: typedef enum _WAIT_TYPE { ! 570: WaitAll, ! 571: WaitAny ! 572: } WAIT_TYPE; ! 573: ! 574: // ! 575: // Pointer to an Asciiz string ! 576: // ! 577: ! 578: typedef CHAR *PSZ; ! 579: typedef CONST char *PCSZ; ! 580: ! 581: // ! 582: // Counted String ! 583: // ! 584: ! 585: typedef struct _STRING { ! 586: USHORT Length; ! 587: USHORT MaximumLength; ! 588: #ifdef MIDL_PASS ! 589: [size_is(MaximumLength), length_is(Length) ] ! 590: #endif // MIDL_PASS ! 591: PCHAR Buffer; ! 592: } STRING; ! 593: typedef STRING *PSTRING; ! 594: ! 595: typedef STRING ANSI_STRING; ! 596: typedef PSTRING PANSI_STRING; ! 597: ! 598: typedef STRING OEM_STRING; ! 599: typedef PSTRING POEM_STRING; ! 600: ! 601: // ! 602: // CONSTCounted String ! 603: // ! 604: ! 605: typedef struct _CSTRING { ! 606: USHORT Length; ! 607: USHORT MaximumLength; ! 608: CONST char *Buffer; ! 609: } CSTRING; ! 610: typedef CSTRING *PCSTRING; ! 611: ! 612: typedef STRING CANSI_STRING; ! 613: typedef PSTRING PCANSI_STRING; ! 614: ! 615: // ! 616: // Unicode strings are counted 16-bit character strings. If they are ! 617: // NULL terminated, Length does not include trailing NULL. ! 618: // ! 619: ! 620: typedef struct _UNICODE_STRING { ! 621: USHORT Length; ! 622: USHORT MaximumLength; ! 623: #ifdef MIDL_PASS ! 624: [size_is(MaximumLength / 2), length_is((Length) / 2) ] USHORT * Buffer; ! 625: #else // MIDL_PASS ! 626: PWSTR Buffer; ! 627: #endif // MIDL_PASS ! 628: } UNICODE_STRING; ! 629: typedef UNICODE_STRING *PUNICODE_STRING; ! 630: #define UNICODE_NULL ((WCHAR)0) // winnt ! 631: ! 632: // begin_ntminiport ! 633: ! 634: // ! 635: // Boolean ! 636: // ! 637: ! 638: typedef UCHAR BOOLEAN; // winnt ! 639: typedef BOOLEAN *PBOOLEAN; // winnt ! 640: ! 641: // end_ntminiport ! 642: ! 643: // begin_winnt ! 644: // ! 645: // Doubly linked list structure. Can be used as either a list head, or ! 646: // as link words. ! 647: // ! 648: ! 649: typedef struct _LIST_ENTRY { ! 650: struct _LIST_ENTRY *Flink; ! 651: struct _LIST_ENTRY *Blink; ! 652: } LIST_ENTRY; ! 653: typedef LIST_ENTRY *PLIST_ENTRY; ! 654: ! 655: // ! 656: // Singly linked list structure. Can be used as either a list head, or ! 657: // as link words. ! 658: // ! 659: ! 660: typedef struct _SINGLE_LIST_ENTRY { ! 661: struct _SINGLE_LIST_ENTRY *Next; ! 662: } SINGLE_LIST_ENTRY, *PSINGLE_LIST_ENTRY; ! 663: // end_winnt ! 664: ! 665: ! 666: // ! 667: // Valid values for the Attributes field ! 668: // ! 669: ! 670: #define OBJ_INHERIT 0x00000002L ! 671: #define OBJ_PERMANENT 0x00000010L ! 672: #define OBJ_EXCLUSIVE 0x00000020L ! 673: #define OBJ_CASE_INSENSITIVE 0x00000040L ! 674: #define OBJ_OPENIF 0x00000080L ! 675: #define OBJ_VALID_ATTRIBUTES 0x000000F2L ! 676: ! 677: // ! 678: // Object Attributes structure ! 679: // ! 680: ! 681: typedef struct _OBJECT_ATTRIBUTES { ! 682: ULONG Length; ! 683: HANDLE RootDirectory; ! 684: PUNICODE_STRING ObjectName; ! 685: ULONG Attributes; ! 686: PVOID SecurityDescriptor; // Points to type SECURITY_DESCRIPTOR ! 687: PVOID SecurityQualityOfService; // Points to type SECURITY_QUALITY_OF_SERVICE ! 688: } OBJECT_ATTRIBUTES; ! 689: typedef OBJECT_ATTRIBUTES *POBJECT_ATTRIBUTES; ! 690: ! 691: //++ ! 692: // ! 693: // VOID ! 694: // InitializeObjectAttributes( ! 695: // OUT POBJECT_ATTRIBUTES p, ! 696: // IN PUNICODE_STRING n, ! 697: // IN ULONG a, ! 698: // IN HANDLE r, ! 699: // IN PSECURITY_DESCRIPTOR s ! 700: // ) ! 701: // ! 702: //-- ! 703: ! 704: #define InitializeObjectAttributes( p, n, a, r, s ) { \ ! 705: (p)->Length = sizeof( OBJECT_ATTRIBUTES ); \ ! 706: (p)->RootDirectory = r; \ ! 707: (p)->Attributes = a; \ ! 708: (p)->ObjectName = n; \ ! 709: (p)->SecurityDescriptor = s; \ ! 710: (p)->SecurityQualityOfService = NULL; \ ! 711: } ! 712: ! 713: // begin_ntminiport ! 714: ! 715: // ! 716: // Constants ! 717: // ! 718: ! 719: #define FALSE 0 ! 720: #define TRUE 1 ! 721: ! 722: #ifndef NULL ! 723: #ifdef __cplusplus ! 724: #define NULL 0 ! 725: #else ! 726: #define NULL ((void *)0) ! 727: #endif ! 728: #endif // NULL ! 729: ! 730: // end_ntminiport ! 731: ! 732: #define MINCHAR 0x80 // winnt ! 733: #define MAXCHAR 0x7f // winnt ! 734: #define MINSHORT 0x8000 // winnt ! 735: #define MAXSHORT 0x7fff // winnt ! 736: #define MINLONG 0x80000000 // winnt ! 737: #define MAXLONG 0x7fffffff // winnt ! 738: #define MAXUCHAR 0xff // winnt ! 739: #define MAXUSHORT 0xffff // winnt ! 740: #define MAXULONG 0xffffffff // winnt ! 741: ! 742: // ! 743: // Useful Helper Macros ! 744: // ! 745: ! 746: // ! 747: // Determine if an argument is present by testing the value of the pointer ! 748: // to the argument value. ! 749: // ! 750: ! 751: #define ARGUMENT_PRESENT(ArgumentPointer) (\ ! 752: (CHAR *)(ArgumentPointer) != (CHAR *)(NULL) ) ! 753: ! 754: // begin_winnt begin_ntminiport ! 755: // ! 756: // Calculate the byte offset of a field in a structure of type type. ! 757: // ! 758: ! 759: #define FIELD_OFFSET(type, field) ((LONG)&(((type *)0)->field)) ! 760: ! 761: ! 762: // ! 763: // Calculate the address of the base of the structure given its type, and an ! 764: // address of a field within the structure. ! 765: // ! 766: ! 767: #define CONTAINING_RECORD(address, type, field) ((type *)( \ ! 768: (PCHAR)(address) - \ ! 769: (PCHAR)(&((type *)0)->field))) ! 770: // end_winnt end_ntminiport ! 771: ! 772: // ! 773: // Exception handler routine definition. ! 774: // ! 775: ! 776: struct _CONTEXT; ! 777: struct _EXCEPTION_RECORD; ! 778: ! 779: typedef ! 780: EXCEPTION_DISPOSITION ! 781: (*PEXCEPTION_ROUTINE) ( ! 782: IN struct _EXCEPTION_RECORD *ExceptionRecord, ! 783: IN PVOID EstablisherFrame, ! 784: IN OUT struct _CONTEXT *ContextRecord, ! 785: IN OUT PVOID DispatcherContext ! 786: ); ! 787: ! 788: // begin_ntminiport ! 789: ! 790: // ! 791: // Interrupt Request Level (IRQL) ! 792: // ! 793: ! 794: typedef UCHAR KIRQL; ! 795: ! 796: typedef KIRQL *PKIRQL; ! 797: ! 798: // end_ntminiport ! 799: ! 800: // ! 801: // Product types ! 802: // ! 803: ! 804: typedef enum _NT_PRODUCT_TYPE { ! 805: NtProductWinNt = 1, ! 806: NtProductLanManNt ! 807: } NT_PRODUCT_TYPE, *PNT_PRODUCT_TYPE; ! 808: ! 809: ! 810: ! 811: ! 812: // begin_winnt ! 813: ! 814: /* ! 815: * Language IDs. ! 816: * ! 817: * The following two combinations of primary language ID and ! 818: * sublanguage ID have special semantics: ! 819: * ! 820: * Primary Language ID Sublanguage ID Result ! 821: * ------------------- --------------- ------------------------ ! 822: * LANG_NEUTRAL SUBLANG_NEUTRAL Language neutral ! 823: * LANG_NEUTRAL SUBLANG_DEFAULT User default language ! 824: * LANG_NEUTRAL SUBLANG_SYS_DEFAULT System default language ! 825: */ ! 826: ! 827: /* ! 828: * Primary language IDs. ! 829: */ ! 830: #define LANG_NEUTRAL 0x00 ! 831: ! 832: #define LANG_ALBANIAN 0x1c ! 833: #define LANG_ARABIC 0x01 ! 834: #define LANG_BAHASA 0x21 ! 835: #define LANG_BULGARIAN 0x02 ! 836: #define LANG_CATALAN 0x03 ! 837: #define LANG_CHINESE 0x04 ! 838: #define LANG_CZECH 0x05 ! 839: #define LANG_DANISH 0x06 ! 840: #define LANG_DUTCH 0x13 ! 841: #define LANG_ENGLISH 0x09 ! 842: #define LANG_FINNISH 0x0b ! 843: #define LANG_FRENCH 0x0c ! 844: #define LANG_GERMAN 0x07 ! 845: #define LANG_GREEK 0x08 ! 846: #define LANG_HEBREW 0x0d ! 847: #define LANG_HUNGARIAN 0x0e ! 848: #define LANG_ICELANDIC 0x0f ! 849: #define LANG_ITALIAN 0x10 ! 850: #define LANG_JAPANESE 0x11 ! 851: #define LANG_KOREAN 0x12 ! 852: #define LANG_NORWEGIAN 0x14 ! 853: #define LANG_POLISH 0x15 ! 854: #define LANG_PORTUGUESE 0x16 ! 855: #define LANG_RHAETO_ROMAN 0x17 ! 856: #define LANG_ROMANIAN 0x18 ! 857: #define LANG_RUSSIAN 0x19 ! 858: #define LANG_SERBO_CROATIAN 0x1a ! 859: #define LANG_SLOVAK 0x1b ! 860: #define LANG_SPANISH 0x0a ! 861: #define LANG_SWEDISH 0x1d ! 862: #define LANG_THAI 0x1e ! 863: #define LANG_TURKISH 0x1f ! 864: #define LANG_URDU 0x20 ! 865: ! 866: /* ! 867: * Sublanguage IDs. ! 868: * ! 869: * The name immediately following SUBLANG_ dictates which primary ! 870: * language ID that sublanguage ID can be combined with to form a ! 871: * valid language ID. ! 872: */ ! 873: #define SUBLANG_NEUTRAL 0x00 /* language neutral */ ! 874: #define SUBLANG_DEFAULT 0x01 /* user default */ ! 875: #define SUBLANG_SYS_DEFAULT 0x02 /* system default */ ! 876: ! 877: #define SUBLANG_CHINESE_SIMPLIFIED 0x02 /* Chinese (Simplified) */ ! 878: #define SUBLANG_CHINESE_TRADITIONAL 0x01 /* Chinese (Traditional) */ ! 879: #define SUBLANG_DUTCH 0x01 /* Dutch */ ! 880: #define SUBLANG_DUTCH_BELGIAN 0x02 /* Dutch (Belgian) */ ! 881: #define SUBLANG_ENGLISH_US 0x01 /* English (USA) */ ! 882: #define SUBLANG_ENGLISH_UK 0x02 /* English (UK) */ ! 883: #define SUBLANG_ENGLISH_AUS 0x03 /* English (Australian) */ ! 884: #define SUBLANG_ENGLISH_CAN 0x04 /* English (Canadian) */ ! 885: #define SUBLANG_ENGLISH_NZ 0x05 /* English (New Zealand) */ ! 886: #define SUBLANG_ENGLISH_EIRE 0x06 /* English (Irish) */ ! 887: #define SUBLANG_FRENCH 0x01 /* French */ ! 888: #define SUBLANG_FRENCH_BELGIAN 0x02 /* French (Belgian) */ ! 889: #define SUBLANG_FRENCH_CANADIAN 0x03 /* French (Canadian) */ ! 890: #define SUBLANG_FRENCH_SWISS 0x04 /* French (Swiss) */ ! 891: #define SUBLANG_GERMAN 0x01 /* German */ ! 892: #define SUBLANG_GERMAN_SWISS 0x02 /* German (Swiss) */ ! 893: #define SUBLANG_GERMAN_AUSTRIAN 0x03 /* German (Austrian) */ ! 894: #define SUBLANG_ITALIAN 0x01 /* Italian */ ! 895: #define SUBLANG_ITALIAN_SWISS 0x02 /* Italian (Swiss) */ ! 896: #define SUBLANG_NORWEGIAN_BOKMAL 0x01 /* Norwegian (Bokmal) */ ! 897: #define SUBLANG_NORWEGIAN_NYNORSK 0x02 /* Norwegian (Nynorsk) */ ! 898: #define SUBLANG_PORTUGUESE 0x02 /* Portuguese */ ! 899: #define SUBLANG_PORTUGUESE_BRAZILIAN 0x01 /* Portuguese (Brazilian) */ ! 900: #define SUBLANG_SERBO_CROATIAN_CYRILLIC 0x02 /* Serbo-Croatian (Cyrillic) */ ! 901: #define SUBLANG_SERBO_CROATIAN_LATIN 0x01 /* Croato-Serbian (Latin) */ ! 902: #define SUBLANG_SPANISH 0x01 /* Spanish (Castilian) */ ! 903: #define SUBLANG_SPANISH_MEXICAN 0x02 /* Spanish (Mexican) */ ! 904: #define SUBLANG_SPANISH_MODERN 0x03 /* Spanish (Modern) */ ! 905: ! 906: /* ! 907: * Sorting IDs. ! 908: * ! 909: */ ! 910: #define SORT_DEFAULT 0x0 /* sorting default */ ! 911: ! 912: ! 913: /* ! 914: * A language ID is a 16 bit value which is the combination of a ! 915: * primary language ID and a secondary language ID. The bits are ! 916: * allocated as follows: ! 917: * ! 918: * +-----------------------+-------------------------+ ! 919: * | Sublanguage ID | Primary Language ID | ! 920: * +-----------------------+-------------------------+ ! 921: * 15 10 9 0 bit ! 922: * ! 923: * ! 924: * Language ID creation/extraction macros: ! 925: * ! 926: * MAKELANGID - construct language id from a primary language id and ! 927: * a sublanguage id. ! 928: * PRIMARYLANGID - extract primary language id from a language id. ! 929: * SUBLANGID - extract sublanguage id from a language id. ! 930: */ ! 931: #define MAKELANGID(p, s) ((((USHORT)(s)) << 10) | (USHORT)(p)) ! 932: #define PRIMARYLANGID(lgid) ((USHORT)(lgid) & 0x3ff) ! 933: #define SUBLANGID(lgid) ((USHORT)(lgid) >> 10) ! 934: ! 935: ! 936: /* ! 937: * A locale ID is a 32 bit value which is the combination of a ! 938: * language ID, a sort ID, and a reserved area. The bits are ! 939: * allocated as follows: ! 940: * ! 941: * +-------------+---------+-------------------------+ ! 942: * | Reserved | Sort ID | Language ID | ! 943: * +-------------+---------+-------------------------+ ! 944: * 31 20 19 16 15 0 bit ! 945: * ! 946: * ! 947: * Locale ID creation/extraction macros: ! 948: * ! 949: * MAKELCID - construct locale id from a language id and a sort id. ! 950: * LANGIDFROMLCID - extract language id from a locale id. ! 951: * SORTIDFROMLCID - extract sort id from a locale id. ! 952: */ ! 953: #define NLS_VALID_LOCALE_MASK 0x000fffff ! 954: ! 955: #define MAKELCID(lgid, srtid) ((ULONG)((((ULONG)((USHORT)(srtid))) << 16) | \ ! 956: ((ULONG)((USHORT)(lgid))))) ! 957: #define LANGIDFROMLCID(lcid) ((USHORT)(lcid)) ! 958: #define SORTIDFROMLCID(lcid) ((USHORT)((((ULONG)(lcid)) & NLS_VALID_LOCALE_MASK) >> 16)) ! 959: ! 960: ! 961: /* ! 962: * Default System and User IDs for language and locale. ! 963: */ ! 964: #define LANG_SYSTEM_DEFAULT (MAKELANGID(LANG_NEUTRAL, SUBLANG_SYS_DEFAULT)) ! 965: #define LANG_USER_DEFAULT (MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT)) ! 966: ! 967: #define LOCALE_SYSTEM_DEFAULT (MAKELCID(LANG_SYSTEM_DEFAULT, SORT_DEFAULT)) ! 968: #define LOCALE_USER_DEFAULT (MAKELCID(LANG_USER_DEFAULT, SORT_DEFAULT)) ! 969: ! 970: ! 971: ! 972: // begin_ntminiport ! 973: ! 974: // ! 975: // Macros used to eliminate compiler warning generated when formal ! 976: // parameters or local variables are not declared. ! 977: // ! 978: // Use DBG_UNREFERENCED_PARAMETER() when a parameter is not yet ! 979: // referenced but will be once the module is completely developed. ! 980: // ! 981: // Use DBG_UNREFERENCED_LOCAL_VARIABLE() when a local variable is not yet ! 982: // referenced but will be once the module is completely developed. ! 983: // ! 984: // Use UNREFERENCED_PARAMETER() if a parameter will never be referenced. ! 985: // ! 986: // DBG_UNREFERENCED_PARAMETER and DBG_UNREFERENCED_LOCAL_VARIABLE will ! 987: // eventually be made into a null macro to help determine whether there ! 988: // is unfinished work. ! 989: // ! 990: ! 991: #if ! (defined(lint) || defined(_lint)) ! 992: #define UNREFERENCED_PARAMETER(P) (P) ! 993: #define DBG_UNREFERENCED_PARAMETER(P) (P) ! 994: #define DBG_UNREFERENCED_LOCAL_VARIABLE(V) (V) ! 995: ! 996: #else // lint or _lint ! 997: ! 998: // Note: lint -e530 says don't complain about uninitialized variables for ! 999: // this. line +e530 turns that checking back on. Error 527 has to do with ! 1000: // unreachable code. ! 1001: ! 1002: #define UNREFERENCED_PARAMETER(P) \ ! 1003: /*lint -e527 -e530 */ \ ! 1004: { \ ! 1005: (P) = (P); \ ! 1006: } \ ! 1007: /*lint +e527 +e530 */ ! 1008: #define DBG_UNREFERENCED_PARAMETER(P) \ ! 1009: /*lint -e527 -e530 */ \ ! 1010: { \ ! 1011: (P) = (P); \ ! 1012: } \ ! 1013: /*lint +e527 +e530 */ ! 1014: #define DBG_UNREFERENCED_LOCAL_VARIABLE(V) \ ! 1015: /*lint -e527 -e530 */ \ ! 1016: { \ ! 1017: (V) = (V); \ ! 1018: } \ ! 1019: /*lint +e527 +e530 */ ! 1020: ! 1021: #endif // lint or _lint ! 1022: ! 1023: ! 1024: // end_winnt end_ntminiport ! 1025: ! 1026: #endif // _NTDEF_
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.