Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

143 lines
3.1 KiB

  1. /********************************************************************/
  2. /** Copyright(c) Microsoft Corp., 1990-1998 **/
  3. /********************************************************************/
  4. #include <excpt.h>
  5. #include <bugcodes.h>
  6. #include <ntiologc.h>
  7. #include <devioctl.h>
  8. #include <windows.h>
  9. typedef LONG NTSTATUS;
  10. typedef NTSTATUS *PNTSTATUS;
  11. ///// From NTDEF.h ////
  12. //
  13. // Generic test for success on any status value (non-negative numbers
  14. // indicate success).
  15. //
  16. #define NT_SUCCESS(Status) ((NTSTATUS)(Status) >= 0)
  17. //
  18. // Determine if an argument is present by testing the value of the pointer
  19. // to the argument value.
  20. //
  21. #define ARGUMENT_PRESENT(ArgumentPointer) (\
  22. (CHAR *)(ArgumentPointer) != (CHAR *)(NULL) )
  23. //
  24. // Unicode strings are counted 16-bit character strings. If they are
  25. // NULL terminated, Length does not include trailing NULL.
  26. //
  27. typedef struct _UNICODE_STRING {
  28. USHORT Length;
  29. USHORT MaximumLength;
  30. #ifdef MIDL_PASS
  31. [size_is(MaximumLength / 2), length_is((Length) / 2) ] USHORT * Buffer;
  32. #else // MIDL_PASS
  33. PWSTR Buffer;
  34. #endif // MIDL_PASS
  35. } UNICODE_STRING;
  36. typedef UNICODE_STRING *PUNICODE_STRING;
  37. #define UNICODE_NULL ((WCHAR)0) // winnt
  38. typedef UNICODE_STRING *PUNICODE_STRING;
  39. //// From NTDDK.H /////
  40. //
  41. // Define the base asynchronous I/O argument types
  42. //
  43. #define OBJ_NAME_PATH_SEPARATOR ((WCHAR)L'\\')
  44. #if DBG
  45. NTSYSAPI
  46. VOID
  47. NTAPI
  48. RtlAssert(
  49. PVOID FailedAssertion,
  50. PVOID FileName,
  51. ULONG LineNumber,
  52. PCHAR Message
  53. );
  54. #define ASSERT( exp ) \
  55. if (!(exp)) \
  56. RtlAssert( #exp, __FILE__, __LINE__, NULL )
  57. #define ASSERTMSG( msg, exp ) \
  58. if (!(exp)) \
  59. RtlAssert( #exp, __FILE__, __LINE__, msg )
  60. #else
  61. #define ASSERT( exp )
  62. #define ASSERTMSG( msg, exp )
  63. #endif // DBG
  64. NTSYSAPI
  65. VOID
  66. NTAPI
  67. RtlInitUnicodeString(
  68. PUNICODE_STRING DestinationString,
  69. PCWSTR SourceString
  70. );
  71. NTSYSAPI
  72. NTSTATUS
  73. NTAPI
  74. RtlAppendUnicodeStringToString (
  75. PUNICODE_STRING Destination,
  76. PUNICODE_STRING Source
  77. );
  78. NTSYSAPI
  79. NTSTATUS
  80. NTAPI
  81. RtlIntegerToUnicodeString (
  82. ULONG Value,
  83. ULONG Base,
  84. PUNICODE_STRING String
  85. );
  86. ///////////////////
  87. // From NTSTATUS.H
  88. //
  89. // MessageId: STATUS_UNSUCCESSFUL
  90. //
  91. // MessageText:
  92. //
  93. // {Operation Failed}
  94. // The requested operation was unsuccessful.
  95. //
  96. #define STATUS_UNSUCCESSFUL ((NTSTATUS)0xC0000001L)
  97. //
  98. // MessageId: STATUS_BUFFER_TOO_SMALL
  99. //
  100. // MessageText:
  101. //
  102. // {Buffer Too Small}
  103. // The buffer is too small to contain the entry. No information has been
  104. // written to the buffer.
  105. //
  106. #define STATUS_BUFFER_TOO_SMALL ((NTSTATUS)0xC0000023L)
  107. //
  108. // MessageId: STATUS_INSUFFICIENT_RESOURCES
  109. //
  110. // MessageText:
  111. //
  112. // Insufficient system resources exist to complete the API.
  113. //
  114. #define STATUS_INSUFFICIENT_RESOURCES ((NTSTATUS)0xC000009AL) // ntsubauth
  115. //
  116. // The success status codes 0 - 63 are reserved for wait completion status.
  117. //
  118. #define STATUS_SUCCESS ((NTSTATUS)0x00000000L) // ntsubauth