Source code of Windows XP (NT5)
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.

219 lines
6.4 KiB

  1. /*++
  2. Copyright (c) 1990 Microsoft Corporation
  3. Module Name:
  4. status.h
  5. Abstract:
  6. This module defines manifest constants for the LAN Manager server.
  7. Author:
  8. David Treadwell (davidtr) 10-May-1990
  9. Revision History:
  10. --*/
  11. #ifndef _STATUS_
  12. #define _STATUS_
  13. //
  14. // The server has 16 bits available to it in each 32-bit status code.
  15. // See \nt\sdk\inc\ntstatus.h for a description of the use of the
  16. // high 16 bits of the status.
  17. //
  18. // The layout of the bits is:
  19. //
  20. // 3 3 2 2 2 2 2 2 2 2 2 2 1 1 1 1 1 1 1 1 1 1
  21. // 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
  22. // +---+-+-------------------------+-------+-----------------------+
  23. // |Sev|C| Facility--Server | Class | Code |
  24. // +---+-+-------------------------+-------+-----------------------+
  25. //
  26. // Class values:
  27. // 0 - a server-specific error code, not put directly on the wire.
  28. // 1 - SMB error class DOS. This includes those OS/2 errors
  29. // that share code values and meanings with the SMB protocol.
  30. // 2 - SMB error class SERVER.
  31. // 3 - SMB error class HARDWARE.
  32. // 4 - other SMB error classes
  33. // 5-E - undefined
  34. // F - an OS/2-specific error. If the client is OS/2, then the
  35. // SMB error class is set to DOS and the code is set to
  36. // the actual OS/2 error code contained in the Code field.
  37. //
  38. // The meaning of the Code field depends on the Class value. If the
  39. // class is 00, then the code value is arbitrary. For other classes,
  40. // the code is the actual code of the error in the SMB or OS/2
  41. // protocols.
  42. //
  43. #define SRV_STATUS_FACILITY_CODE 0x00980000L
  44. #define SRV_SRV_STATUS (0xC0000000L | SRV_STATUS_FACILITY_CODE)
  45. #define SRV_DOS_STATUS (0xC0001000L | SRV_STATUS_FACILITY_CODE)
  46. #define SRV_SERVER_STATUS (0xC0002000L | SRV_STATUS_FACILITY_CODE)
  47. #define SRV_HARDWARE_STATUS (0xC0003000L | SRV_STATUS_FACILITY_CODE)
  48. #define SRV_WIN32_STATUS (0xC000E000L | SRV_STATUS_FACILITY_CODE)
  49. #define SRV_OS2_STATUS (0xC000F000L | SRV_STATUS_FACILITY_CODE)
  50. //++
  51. //
  52. // BOOLEAN
  53. // SmbIsSrvStatus (
  54. // IN NTSTATUS Status
  55. // )
  56. //
  57. // Routine Description:
  58. //
  59. // Macro to determine whether a status code is one defined by the
  60. // server (has the server facility code).
  61. //
  62. // Arguments:
  63. //
  64. // Status - the status code to check.
  65. //
  66. // Return Value:
  67. //
  68. // BOOLEAN - TRUE if the facility code is the servers, FALSE
  69. // otherwise.
  70. //
  71. //--
  72. #define SrvIsSrvStatus(Status) \
  73. ( ((Status) & 0x1FFF0000) == SRV_STATUS_FACILITY_CODE ? TRUE : FALSE )
  74. //++
  75. //
  76. // UCHAR
  77. // SmbErrorClass (
  78. // IN NTSTATUS Status
  79. // )
  80. //
  81. // Routine Description:
  82. //
  83. // This macro extracts the error class field from a server status
  84. // code.
  85. //
  86. // Arguments:
  87. //
  88. // Status - the status code from which to get the error class.
  89. //
  90. // Return Value:
  91. //
  92. // UCHAR - the server error class of the status code.
  93. //
  94. //--
  95. #define SrvErrorClass(Status) ((UCHAR)( ((Status) & 0x0000F000) >> 12 ))
  96. //++
  97. //
  98. // UCHAR
  99. // SmbErrorCode (
  100. // IN NTSTATUS Status
  101. // )
  102. //
  103. // Routine Description:
  104. //
  105. // This macro extracts the error code field from a server status
  106. // code.
  107. //
  108. // Arguments:
  109. //
  110. // Status - the status code from which to get the error code.
  111. //
  112. // Return Value:
  113. //
  114. // UCHAR - the server error code of the status code.
  115. //
  116. //--
  117. #define SrvErrorCode(Status) ((USHORT)( (Status) & 0xFFF) )
  118. //
  119. // Status codes unique to the server. These error codes are used
  120. // internally only.
  121. //
  122. #define STATUS_ENDPOINT_CLOSED (SRV_SRV_STATUS | 0x01)
  123. #define STATUS_DISCONNECTED (SRV_SRV_STATUS | 0x02)
  124. #define STATUS_SERVER_ALREADY_STARTED (SRV_SRV_STATUS | 0x04)
  125. #define STATUS_SERVER_NOT_STARTED (SRV_SRV_STATUS | 0x05)
  126. #define STATUS_OPLOCK_BREAK_UNDERWAY (SRV_SRV_STATUS | 0x06)
  127. #define STATUS_NONEXISTENT_NET_NAME (SRV_SRV_STATUS | 0x08)
  128. //
  129. // Error codes that exist in both the SMB protocol and OS/2 but not NT.
  130. // Note that all SMB DOS-class error codes are defined in OS/2.
  131. //
  132. #define STATUS_OS2_INVALID_FUNCTION (SRV_DOS_STATUS | ERROR_INVALID_FUNCTION)
  133. #define STATUS_OS2_TOO_MANY_OPEN_FILES \
  134. (SRV_DOS_STATUS | ERROR_TOO_MANY_OPEN_FILES)
  135. #define STATUS_OS2_INVALID_ACCESS (SRV_DOS_STATUS | ERROR_INVALID_ACCESS)
  136. //
  137. // SMB SERVER-class error codes that lack an NT or OS/2 equivalent.
  138. //
  139. #define STATUS_INVALID_SMB (SRV_SERVER_STATUS | SMB_ERR_ERROR)
  140. #define STATUS_SMB_BAD_NET_NAME (SRV_SERVER_STATUS | SMB_ERR_BAD_NET_NAME)
  141. #define STATUS_SMB_BAD_TID (SRV_SERVER_STATUS | SMB_ERR_BAD_TID)
  142. #define STATUS_SMB_BAD_UID (SRV_SERVER_STATUS | SMB_ERR_BAD_UID)
  143. #define STATUS_SMB_TOO_MANY_UIDS (SRV_SERVER_STATUS | SMB_ERR_TOO_MANY_UIDS)
  144. #define STATUS_SMB_USE_MPX (SRV_SERVER_STATUS | SMB_ERR_USE_MPX)
  145. #define STATUS_SMB_USE_STANDARD (SRV_SERVER_STATUS | SMB_ERR_USE_STANDARD)
  146. #define STATUS_SMB_CONTINUE_MPX (SRV_SERVER_STATUS | SMB_ERR_CONTINUE_MPX)
  147. #define STATUS_SMB_BAD_COMMAND (SRV_SERVER_STATUS | SMB_ERR_BAD_COMMAND)
  148. #define STATUS_SMB_NO_SUPPORT (SRV_SERVER_STATUS | SMB_ERR_NO_SUPPORT_INTERNAL)
  149. // *** because SMB_ERR_NO_SUPPORT uses 16 bits, but we have only 12 bits
  150. // available for error codes, it must be special-cased in the code.
  151. //
  152. // SMB HARDWARE-class error codes that lack an NT or OS/2 equivalent.
  153. //
  154. #define STATUS_SMB_DATA (SRV_HARDWARE_STATUS | SMB_ERR_DATA)
  155. //
  156. // OS/2 error codes that lack an NT or SMB equivalent.
  157. //
  158. #include <winerror.h>
  159. #define STATUS_OS2_INVALID_LEVEL \
  160. (NTSTATUS)(SRV_OS2_STATUS | ERROR_INVALID_LEVEL)
  161. #define STATUS_OS2_EA_LIST_INCONSISTENT \
  162. (NTSTATUS)(SRV_OS2_STATUS | ERROR_EA_LIST_INCONSISTENT)
  163. #define STATUS_OS2_NEGATIVE_SEEK \
  164. (NTSTATUS)(SRV_OS2_STATUS | ERROR_NEGATIVE_SEEK)
  165. #define STATUS_OS2_NO_MORE_SIDS \
  166. (NTSTATUS)(SRV_OS2_STATUS | ERROR_NO_MORE_SEARCH_HANDLES)
  167. #define STATUS_OS2_EAS_DIDNT_FIT \
  168. (NTSTATUS)(SRV_OS2_STATUS | ERROR_EAS_DIDNT_FIT)
  169. #define STATUS_OS2_EA_ACCESS_DENIED \
  170. (NTSTATUS)(SRV_OS2_STATUS | ERROR_EA_ACCESS_DENIED)
  171. #define STATUS_OS2_CANCEL_VIOLATION \
  172. (NTSTATUS)(SRV_OS2_STATUS | ERROR_CANCEL_VIOLATION)
  173. #define STATUS_OS2_ATOMIC_LOCKS_NOT_SUPPORTED \
  174. (NTSTATUS)(SRV_OS2_STATUS | ERROR_ATOMIC_LOCKS_NOT_SUPPORTED)
  175. #define STATUS_OS2_CANNOT_COPY \
  176. (NTSTATUS)(SRV_OS2_STATUS | ERROR_CANNOT_COPY)
  177. #endif // ndef _STATUS_