PageRenderTime 77ms CodeModel.GetById 0ms RepoModel.GetById 0ms app.codeStats 1ms

/epan/dissectors/packet-windows-common.c

https://github.com/labx-technologies-llc/wireshark
C | 3147 lines | 2587 code | 296 blank | 264 comment | 141 complexity | 6edeee720d9cda2f8437b0f24a566c20 MD5 | raw file
Possible License(s): GPL-2.0, BSD-3-Clause
  1. /* packet-windows-common.c
  2. * Routines for dissecting various Windows data types
  3. *
  4. * $Id$
  5. *
  6. * Wireshark - Network traffic analyzer
  7. * By Gerald Combs <gerald@wireshark.org>
  8. * Copyright 1998 Gerald Combs
  9. *
  10. * This program is free software; you can redistribute it and/or
  11. * modify it under the terms of the GNU General Public License
  12. * as published by the Free Software Foundation; either version 2
  13. * of the License, or (at your option) any later version.
  14. *
  15. * This program is distributed in the hope that it will be useful,
  16. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  17. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  18. * GNU General Public License for more details.
  19. *
  20. * You should have received a copy of the GNU General Public License
  21. * along with this program; if not, write to the Free Software
  22. * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
  23. */
  24. #include "config.h"
  25. #include <glib.h>
  26. #include <string.h>
  27. #include <epan/packet.h>
  28. #include <epan/emem.h>
  29. #include "packet-dcerpc.h"
  30. #include "packet-smb-sidsnooping.h"
  31. #include "packet-windows-common.h"
  32. #include <epan/dissectors/packet-smb.h> /* for "sid_name_snooping" */
  33. static int hf_nt_sec_desc_revision = -1;
  34. static int hf_nt_sec_desc_type_owner_defaulted = -1;
  35. static int hf_nt_sec_desc_type_group_defaulted = -1;
  36. static int hf_nt_sec_desc_type_dacl_present = -1;
  37. static int hf_nt_sec_desc_type_dacl_defaulted = -1;
  38. static int hf_nt_sec_desc_type_sacl_present = -1;
  39. static int hf_nt_sec_desc_type_sacl_defaulted = -1;
  40. static int hf_nt_sec_desc_type_dacl_trusted = -1;
  41. static int hf_nt_sec_desc_type_server_security = -1;
  42. static int hf_nt_sec_desc_type_dacl_auto_inherit_req = -1;
  43. static int hf_nt_sec_desc_type_sacl_auto_inherit_req = -1;
  44. static int hf_nt_sec_desc_type_dacl_auto_inherited = -1;
  45. static int hf_nt_sec_desc_type_sacl_auto_inherited = -1;
  46. static int hf_nt_sec_desc_type_dacl_protected = -1;
  47. static int hf_nt_sec_desc_type_sacl_protected = -1;
  48. static int hf_nt_sec_desc_type_rm_control_valid = -1;
  49. static int hf_nt_sec_desc_type_self_relative = -1;
  50. static int hf_nt_sid = -1;
  51. static int hf_nt_sid_revision = -1;
  52. static int hf_nt_sid_num_auth = -1;
  53. static int hf_nt_sid_auth_dec = -1;
  54. static int hf_nt_sid_auth_hex = -1;
  55. static int hf_nt_sid_subauth = -1;
  56. static int hf_nt_sid_rid_dec = -1;
  57. static int hf_nt_sid_rid_hex = -1;
  58. static int hf_nt_sid_wkwn = -1;
  59. static int hf_nt_sid_domain = -1;
  60. static int hf_nt_acl_revision = -1;
  61. static int hf_nt_acl_size = -1;
  62. static int hf_nt_acl_num_aces = -1;
  63. static int hf_nt_ace_flags_object_inherit = -1;
  64. static int hf_nt_ace_flags_container_inherit = -1;
  65. static int hf_nt_ace_flags_non_propagate_inherit = -1;
  66. static int hf_nt_ace_flags_inherit_only = -1;
  67. static int hf_nt_ace_flags_inherited_ace = -1;
  68. static int hf_nt_ace_flags_successful_access = -1;
  69. static int hf_nt_ace_flags_failed_access = -1;
  70. static int hf_nt_ace_type = -1;
  71. static int hf_nt_ace_size = -1;
  72. static int hf_nt_ace_flags_object_type_present = -1;
  73. static int hf_nt_ace_flags_inherited_object_type_present = -1;
  74. static int hf_nt_ace_guid = -1;
  75. static int hf_nt_ace_inherited_guid = -1;
  76. static int hf_nt_security_information_sacl = -1;
  77. static int hf_nt_security_information_dacl = -1;
  78. static int hf_nt_security_information_group = -1;
  79. static int hf_nt_security_information_owner = -1;
  80. static gint ett_nt_sec_desc = -1;
  81. static gint ett_nt_sec_desc_type = -1;
  82. static gint ett_nt_sid = -1;
  83. static gint ett_nt_acl = -1;
  84. static gint ett_nt_ace = -1;
  85. static gint ett_nt_ace_flags = -1;
  86. static gint ett_nt_ace_object = -1;
  87. static gint ett_nt_ace_object_flags = -1;
  88. static gint ett_nt_security_information = -1;
  89. /* WERR error codes
  90. * This list is based on the samba doserr.h file and was generated by running
  91. cat doserr.h | grep "^#define WERR" | grep -v "FOOBAR"| sed -e "s/^#define[ \t]//" | while read WERR junk;do echo " {"${WERR}, \"${WERR}\""}," ; done
  92. */
  93. const value_string WERR_errors[] = {
  94. {WERR_OK, "WERR_OK"},
  95. {WERR_BADFUNC, "WERR_BADFUNC"},
  96. {WERR_BADFILE, "WERR_BADFILE"},
  97. {WERR_ACCESS_DENIED, "WERR_ACCESS_DENIED"},
  98. {WERR_BADFID, "WERR_BADFID"},
  99. {WERR_NOMEM, "WERR_NOMEM"},
  100. {WERR_GENERAL_FAILURE, "WERR_GENERAL_FAILURE"},
  101. {WERR_NOT_SUPPORTED, "WERR_NOT_SUPPORTED"},
  102. {WERR_BAD_NETPATH, "WERR_BAD_NETPATH"},
  103. {WERR_UNEXP_NET_ERR, "WERR_UNEXP_NET_ERR"},
  104. {WERR_PRINTQ_FULL, "WERR_PRINTQ_FULL"},
  105. {WERR_NO_SPOOL_SPACE, "WERR_NO_SPOOL_SPACE"},
  106. {WERR_NO_SUCH_SHARE, "WERR_NO_SUCH_SHARE"},
  107. {WERR_FILE_EXISTS, "WERR_FILE_EXISTS"},
  108. {WERR_BAD_PASSWORD, "WERR_BAD_PASSWORD"},
  109. {WERR_INVALID_PARAM, "WERR_INVALID_PARAM"},
  110. {WERR_INSUFFICIENT_BUFFER, "WERR_INSUFFICIENT_BUFFER"},
  111. {WERR_INVALID_NAME, "WERR_INVALID_NAME"},
  112. {WERR_UNKNOWN_LEVEL, "WERR_UNKNOWN_LEVEL"},
  113. {WERR_OBJECT_PATH_INVALID, "WERR_OBJECT_PATH_INVALID"},
  114. {WERR_ALREADY_EXISTS, "WERR_ALREADY_EXISTS"},
  115. {WERR_NO_MORE_ITEMS, "WERR_NO_MORE_ITEMS"},
  116. {WERR_MORE_DATA, "WERR_MORE_DATA"},
  117. {WERR_CAN_NOT_COMPLETE, "WERR_CAN_NOT_COMPLETE"},
  118. {WERR_NOT_FOUND, "WERR_NOT_FOUND"},
  119. {WERR_INVALID_COMPUTERNAME, "WERR_INVALID_COMPUTERNAME"},
  120. {WERR_INVALID_DOMAINNAME, "WERR_INVALID_DOMAINNAME"},
  121. {WERR_UNKNOWN_REVISION, "WERR_UNKNOWN_REVISION"},
  122. {WERR_REVISION_MISMATCH, "WERR_REVISION_MISMATCH"},
  123. {WERR_INVALID_OWNER, "WERR_INVALID_OWNER"},
  124. {WERR_NO_SUCH_PRIVILEGE, "WERR_NO_SUCH_PRIVILEGE"},
  125. {WERR_PRIVILEGE_NOT_HELD, "WERR_PRIVILEGE_NOT_HELD"},
  126. {WERR_NO_SUCH_USER, "WERR_NO_SUCH_USER"},
  127. {WERR_INVALID_SECURITY_DESCRIPTOR, "WERR_INVALID_SECURITY_DESCRIPTOR"},
  128. {WERR_NO_SUCH_DOMAIN, "WERR_NO_SUCH_DOMAIN"},
  129. {WERR_NO_SYSTEM_RESOURCES, "WERR_NO_SYSTEM_RESOURCES"},
  130. {WERR_SERVER_UNAVAILABLE, "WERR_SERVER_UNAVAILABLE"},
  131. {WERR_INVALID_FORM_NAME, "WERR_INVALID_FORM_NAME"},
  132. {WERR_INVALID_FORM_SIZE, "WERR_INVALID_FORM_SIZE"},
  133. {WERR_ALREADY_SHARED, "WERR_ALREADY_SHARED"},
  134. {WERR_BUF_TOO_SMALL, "WERR_BUF_TOO_SMALL"},
  135. {WERR_JOB_NOT_FOUND, "WERR_JOB_NOT_FOUND"},
  136. {WERR_DEST_NOT_FOUND, "WERR_DEST_NOT_FOUND"},
  137. {WERR_NOT_LOCAL_DOMAIN, "WERR_NOT_LOCAL_DOMAIN"},
  138. {WERR_DEVICE_NOT_AVAILABLE, "WERR_DEVICE_NOT_AVAILABLE"},
  139. {WERR_STATUS_MORE_ENTRIES, "WERR_STATUS_MORE_ENTRIES"},
  140. {WERR_PRINTER_DRIVER_ALREADY_INSTALLED, "WERR_PRINTER_DRIVER_ALREADY_INSTALLED"},
  141. {WERR_UNKNOWN_PORT, "WERR_UNKNOWN_PORT"},
  142. {WERR_UNKNOWN_PRINTER_DRIVER, "WERR_UNKNOWN_PRINTER_DRIVER"},
  143. {WERR_UNKNOWN_PRINTPROCESSOR, "WERR_UNKNOWN_PRINTPROCESSOR"},
  144. {WERR_INVALID_SEPARATOR_FILE, "WERR_INVALID_SEPARATOR_FILE"},
  145. {WERR_INVALID_PRIORITY, "WERR_INVALID_PRIORITY"},
  146. {WERR_INVALID_PRINTER_NAME, "WERR_INVALID_PRINTER_NAME"},
  147. {WERR_PRINTER_ALREADY_EXISTS, "WERR_PRINTER_ALREADY_EXISTS"},
  148. {WERR_INVALID_PRINTER_COMMAND, "WERR_INVALID_PRINTER_COMMAND"},
  149. {WERR_INVALID_DATATYPE, "WERR_INVALID_DATATYPE"},
  150. {WERR_INVALID_ENVIRONMENT, "WERR_INVALID_ENVIRONMENT"},
  151. {WERR_SESSION_NOT_FOUND, "WERR_SESSION_NOT_FOUND"},
  152. {WERR_FID_NOT_FOUND, "WERR_FID_NOT_FOUND"},
  153. {WERR_UNKNOWN_PRINT_MONITOR, "WERR_UNKNOWN_PRINT_MONITOR"},
  154. {WERR_PRINTER_DRIVER_IN_USE, "WERR_PRINTER_DRIVER_IN_USE"},
  155. {WERR_SPOOL_FILE_NOT_FOUND, "WERR_SPOOL_FILE_NOT_FOUND"},
  156. {WERR_SPL_NO_STARTDOC, "WERR_SPL_NO_STARTDOC"},
  157. {WERR_SPL_NO_ADDJOB, "WERR_SPL_NO_ADDJOB"},
  158. {WERR_PRINT_PROCESSOR_ALREADY_INSTALLED, "WERR_PRINT_PROCESSOR_ALREADY_INSTALLED"},
  159. {WERR_PRINT_MONITOR_ALREADY_INSTALLED, "WERR_PRINT_MONITOR_ALREADY_INSTALLED"},
  160. {WERR_INVALID_PRINT_MONITOR, "WERR_INVALID_PRINT_MONITOR"},
  161. {WERR_PRINT_MONITOR_IN_USE, "WERR_PRINT_MONITOR_IN_USE"},
  162. {WERR_PRINTER_HAS_JOBS_QUEUED, "WERR_PRINTER_HAS_JOBS_QUEUED"},
  163. {WERR_CLASS_NOT_REGISTERED, "WERR_CLASS_NOT_REGISTERED"},
  164. {WERR_NO_SHUTDOWN_IN_PROGRESS, "WERR_NO_SHUTDOWN_IN_PROGRESS"},
  165. {WERR_SHUTDOWN_ALREADY_IN_PROGRESS, "WERR_SHUTDOWN_ALREADY_IN_PROGRESS"},
  166. {WERR_NET_NAME_NOT_FOUND, "WERR_NET_NAME_NOT_FOUND"},
  167. {WERR_DEVICE_NOT_SHARED, "WERR_DEVICE_NOT_SHARED"},
  168. {WERR_DFS_NO_SUCH_VOL, "WERR_DFS_NO_SUCH_VOL"},
  169. {WERR_DFS_NO_SUCH_SHARE, "WERR_DFS_NO_SUCH_SHARE"},
  170. {WERR_DFS_NO_SUCH_SERVER, "WERR_DFS_NO_SUCH_SERVER"},
  171. {WERR_DFS_INTERNAL_ERROR, "WERR_DFS_INTERNAL_ERROR"},
  172. {WERR_DFS_CANT_CREATE_JUNCT, "WERR_DFS_CANT_CREATE_JUNCT"},
  173. {WERR_DS_SERVICE_BUSY, "WERR_DS_SERVICE_BUSY"},
  174. {WERR_DS_SERVICE_UNAVAILABLE, "WERR_DS_SERVICE_UNAVAILABLE"},
  175. {WERR_DS_NO_SUCH_OBJECT, "WERR_DS_NO_SUCH_OBJECT"},
  176. {WERR_DS_OBJ_NOT_FOUND, "WERR_DS_OBJ_NOT_FOUND"},
  177. {WERR_DS_DRA_INVALID_PARAMETER, "WERR_DS_DRA_INVALID_PARAMETER"},
  178. {WERR_DS_DRA_BAD_DN, "WERR_DS_DRA_BAD_DN"},
  179. {WERR_DS_DRA_BAD_NC, "WERR_DS_DRA_BAD_NC"},
  180. {WERR_DS_DRA_INTERNAL_ERROR, "WERR_DS_DRA_INTERNAL_ERROR"},
  181. {WERR_DS_DRA_OUT_OF_MEM, "WERR_DS_DRA_OUT_OF_MEM"},
  182. {WERR_DS_SINGLE_VALUE_CONSTRAINT, "WERR_DS_SINGLE_VALUE_CONSTRAINT"},
  183. {WERR_DS_DRA_DB_ERROR, "WERR_DS_DRA_DB_ERROR"},
  184. {WERR_DS_DRA_NO_REPLICA, "WERR_DS_DRA_NO_REPLICA"},
  185. {WERR_DS_DRA_ACCESS_DENIED, "WERR_DS_DRA_ACCESS_DENIED"},
  186. {WERR_DS_DNS_LOOKUP_FAILURE, "WERR_DS_DNS_LOOKUP_FAILURE"},
  187. {WERR_DS_WRONG_LINKED_ATTRIBUTE_SYNTAX, "WERR_DS_WRONG_LINKED_ATTRIBUTE_SYNTAX"},
  188. {WERR_SEC_E_ALGORITHM_MISMATCH, "WERR_SEC_E_ALGORITHM_MISMATCH"},
  189. {0, NULL}
  190. };
  191. /*
  192. * DOS error codes.
  193. */
  194. const value_string DOS_errors[] = {
  195. {0, "Success"},
  196. {SMBE_insufficientbuffer, "Insufficient buffer"},
  197. {SMBE_badfunc, "Invalid function (or system call)"},
  198. {SMBE_badfile, "File not found (pathname error)"},
  199. {SMBE_badpath, "Directory not found"},
  200. {SMBE_nofids, "Too many open files"},
  201. {SMBE_noaccess, "Access denied"},
  202. {SMBE_badfid, "Invalid fid"},
  203. {SMBE_nomem, "Out of memory"},
  204. {SMBE_badmem, "Invalid memory block address"},
  205. {SMBE_badenv, "Invalid environment"},
  206. {SMBE_badaccess, "Invalid open mode"},
  207. {SMBE_baddata, "Invalid data (only from ioctl call)"},
  208. {SMBE_res, "Reserved error code?"},
  209. {SMBE_baddrive, "Invalid drive"},
  210. {SMBE_remcd, "Attempt to delete current directory"},
  211. {SMBE_diffdevice, "Rename/move across different filesystems"},
  212. {SMBE_nofiles, "No more files found in file search"},
  213. {SMBE_badshare, "Share mode on file conflict with open mode"},
  214. {SMBE_lock, "Lock request conflicts with existing lock"},
  215. {SMBE_unsup, "Request unsupported, returned by Win 95"},
  216. {SMBE_nosuchshare, "Requested share does not exist"},
  217. {SMBE_filexists, "File in operation already exists"},
  218. {SMBE_cannotopen, "Cannot open the file specified"},
  219. {SMBE_unknownlevel, "Unknown info level"},
  220. {SMBE_invalidname, "Invalid name"},
  221. {SMBE_badpipe, "Named pipe invalid"},
  222. {SMBE_pipebusy, "All instances of pipe are busy"},
  223. {SMBE_pipeclosing, "Named pipe close in progress"},
  224. {SMBE_notconnected, "No process on other end of named pipe"},
  225. {SMBE_moredata, "More data to be returned"},
  226. {SMBE_baddirectory, "Invalid directory name in a path."},
  227. {SMBE_eas_didnt_fit, "Extended attributes didn't fit"},
  228. {SMBE_eas_nsup, "Extended attributes not supported"},
  229. {SMBE_notify_buf_small, "Buffer too small to return change notify."},
  230. {SMBE_unknownipc, "Unknown IPC Operation"},
  231. {SMBE_noipc, "Don't support ipc"},
  232. {SMBE_alreadyexists, "File already exists"},
  233. {SMBE_unknownprinterdriver, "Unknown printer driver"},
  234. {SMBE_invalidprintername, "Invalid printer name"},
  235. {SMBE_printeralreadyexists, "Printer already exists"},
  236. {SMBE_invaliddatatype, "Invalid data type"},
  237. {SMBE_invalidenvironment, "Invalid environment"},
  238. {SMBE_printerdriverinuse, "Printer driver in use"},
  239. {SMBE_invalidparam, "Invalid parameter"},
  240. {SMBE_invalidformsize, "Invalid form size"},
  241. {SMBE_invalidsecuritydescriptor, "Invalid security descriptor"},
  242. {SMBE_invalidowner, "Invalid owner"},
  243. {SMBE_nomoreitems, "No more items"},
  244. {SMBE_serverunavailable, "Server unavailable"},
  245. {0, NULL}
  246. };
  247. /*
  248. * NT error codes.
  249. *
  250. * From
  251. *
  252. * http://www.wildpackets.com/elements/misc/SMB_NT_Status_Codes.txt
  253. */
  254. const value_string NT_errors[] = {
  255. { 0x00000000, "STATUS_SUCCESS" },
  256. /*{ 0x00000000, "STATUS_WAIT_0" }, */
  257. { 0x00000001, "STATUS_WAIT_1" },
  258. { 0x00000002, "STATUS_WAIT_2" },
  259. { 0x00000003, "STATUS_WAIT_3" },
  260. { 0x0000003F, "STATUS_WAIT_63" },
  261. { 0x00000080, "STATUS_ABANDONED" },
  262. /*{ 0x00000080, "STATUS_ABANDONED_WAIT_0" },*/
  263. { 0x000000BF, "STATUS_ABANDONED_WAIT_63" },
  264. { 0x000000C0, "STATUS_USER_APC" },
  265. { 0x00000100, "STATUS_KERNEL_APC" },
  266. { 0x00000101, "STATUS_ALERTED" },
  267. { 0x00000102, "STATUS_TIMEOUT" },
  268. { 0x00000103, "STATUS_PENDING" },
  269. { 0x00000104, "STATUS_REPARSE" },
  270. { 0x00000105, "STATUS_MORE_ENTRIES" },
  271. { 0x00000106, "STATUS_NOT_ALL_ASSIGNED" },
  272. { 0x00000107, "STATUS_SOME_NOT_MAPPED" },
  273. { 0x00000108, "STATUS_OPLOCK_BREAK_IN_PROGRESS" },
  274. { 0x00000109, "STATUS_VOLUME_MOUNTED" },
  275. { 0x0000010A, "STATUS_RXACT_COMMITTED" },
  276. { 0x0000010B, "STATUS_NOTIFY_CLEANUP" },
  277. { 0x0000010C, "STATUS_NOTIFY_ENUM_DIR" },
  278. { 0x0000010D, "STATUS_NO_QUOTAS_FOR_ACCOUNT" },
  279. { 0x0000010E, "STATUS_PRIMARY_TRANSPORT_CONNECT_FAILED" },
  280. { 0x00000110, "STATUS_PAGE_FAULT_TRANSITION" },
  281. { 0x00000111, "STATUS_PAGE_FAULT_DEMAND_ZERO" },
  282. { 0x00000112, "STATUS_PAGE_FAULT_COPY_ON_WRITE" },
  283. { 0x00000113, "STATUS_PAGE_FAULT_GUARD_PAGE" },
  284. { 0x00000114, "STATUS_PAGE_FAULT_PAGING_FILE" },
  285. { 0x00000115, "STATUS_CACHE_PAGE_LOCKED" },
  286. { 0x00000116, "STATUS_CRASH_DUMP" },
  287. { 0x00000117, "STATUS_BUFFER_ALL_ZEROS" },
  288. { 0x00000118, "STATUS_REPARSE_OBJECT" },
  289. { 0x0000045C, "STATUS_NO_SHUTDOWN_IN_PROGRESS" },
  290. { 0x40000000, "STATUS_OBJECT_NAME_EXISTS" },
  291. { 0x40000001, "STATUS_THREAD_WAS_SUSPENDED" },
  292. { 0x40000002, "STATUS_WORKING_SET_LIMIT_RANGE" },
  293. { 0x40000003, "STATUS_IMAGE_NOT_AT_BASE" },
  294. { 0x40000004, "STATUS_RXACT_STATE_CREATED" },
  295. { 0x40000005, "STATUS_SEGMENT_NOTIFICATION" },
  296. { 0x40000006, "STATUS_LOCAL_USER_SESSION_KEY" },
  297. { 0x40000007, "STATUS_BAD_CURRENT_DIRECTORY" },
  298. { 0x40000008, "STATUS_SERIAL_MORE_WRITES" },
  299. { 0x40000009, "STATUS_REGISTRY_RECOVERED" },
  300. { 0x4000000A, "STATUS_FT_READ_RECOVERY_FROM_BACKUP" },
  301. { 0x4000000B, "STATUS_FT_WRITE_RECOVERY" },
  302. { 0x4000000C, "STATUS_SERIAL_COUNTER_TIMEOUT" },
  303. { 0x4000000D, "STATUS_NULL_LM_PASSWORD" },
  304. { 0x4000000E, "STATUS_IMAGE_MACHINE_TYPE_MISMATCH" },
  305. { 0x4000000F, "STATUS_RECEIVE_PARTIAL" },
  306. { 0x40000010, "STATUS_RECEIVE_EXPEDITED" },
  307. { 0x40000011, "STATUS_RECEIVE_PARTIAL_EXPEDITED" },
  308. { 0x40000012, "STATUS_EVENT_DONE" },
  309. { 0x40000013, "STATUS_EVENT_PENDING" },
  310. { 0x40000014, "STATUS_CHECKING_FILE_SYSTEM" },
  311. { 0x40000015, "STATUS_FATAL_APP_EXIT" },
  312. { 0x40000016, "STATUS_PREDEFINED_HANDLE" },
  313. { 0x40000017, "STATUS_WAS_UNLOCKED" },
  314. { 0x40000018, "STATUS_SERVICE_NOTIFICATION" },
  315. { 0x40000019, "STATUS_WAS_LOCKED" },
  316. { 0x4000001A, "STATUS_LOG_HARD_ERROR" },
  317. { 0x4000001B, "STATUS_ALREADY_WIN32" },
  318. { 0x4000001C, "STATUS_WX86_UNSIMULATE" },
  319. { 0x4000001D, "STATUS_WX86_CONTINUE" },
  320. { 0x4000001E, "STATUS_WX86_SINGLE_STEP" },
  321. { 0x4000001F, "STATUS_WX86_BREAKPOINT" },
  322. { 0x40000020, "STATUS_WX86_EXCEPTION_CONTINUE" },
  323. { 0x40000021, "STATUS_WX86_EXCEPTION_LASTCHANCE" },
  324. { 0x40000022, "STATUS_WX86_EXCEPTION_CHAIN" },
  325. { 0x40000023, "STATUS_IMAGE_MACHINE_TYPE_MISMATCH_EXE" },
  326. { 0x40000024, "STATUS_NO_YIELD_PERFORMED" },
  327. { 0x40000025, "STATUS_TIMER_RESUME_IGNORED" },
  328. { 0x80000001, "STATUS_GUARD_PAGE_VIOLATION" },
  329. { 0x80000002, "STATUS_DATATYPE_MISALIGNMENT" },
  330. { 0x80000003, "STATUS_BREAKPOINT" },
  331. { 0x80000004, "STATUS_SINGLE_STEP" },
  332. { 0x80000005, "STATUS_BUFFER_OVERFLOW" },
  333. { 0x80000006, "STATUS_NO_MORE_FILES" },
  334. { 0x80000007, "STATUS_WAKE_SYSTEM_DEBUGGER" },
  335. { 0x8000000A, "STATUS_HANDLES_CLOSED" },
  336. { 0x8000000B, "STATUS_NO_INHERITANCE" },
  337. { 0x8000000C, "STATUS_GUID_SUBSTITUTION_MADE" },
  338. { 0x8000000D, "STATUS_PARTIAL_COPY" },
  339. { 0x8000000E, "STATUS_DEVICE_PAPER_EMPTY" },
  340. { 0x8000000F, "STATUS_DEVICE_POWERED_OFF" },
  341. { 0x80000010, "STATUS_DEVICE_OFF_LINE" },
  342. { 0x80000011, "STATUS_DEVICE_BUSY" },
  343. { 0x80000012, "STATUS_NO_MORE_EAS" },
  344. { 0x80000013, "STATUS_INVALID_EA_NAME" },
  345. { 0x80000014, "STATUS_EA_LIST_INCONSISTENT" },
  346. { 0x80000015, "STATUS_INVALID_EA_FLAG" },
  347. { 0x80000016, "STATUS_VERIFY_REQUIRED" },
  348. { 0x80000017, "STATUS_EXTRANEOUS_INFORMATION" },
  349. { 0x80000018, "STATUS_RXACT_COMMIT_NECESSARY" },
  350. { 0x8000001A, "STATUS_NO_MORE_ENTRIES" },
  351. { 0x8000001B, "STATUS_FILEMARK_DETECTED" },
  352. { 0x8000001C, "STATUS_MEDIA_CHANGED" },
  353. { 0x8000001D, "STATUS_BUS_RESET" },
  354. { 0x8000001E, "STATUS_END_OF_MEDIA" },
  355. { 0x8000001F, "STATUS_BEGINNING_OF_MEDIA" },
  356. { 0x80000020, "STATUS_MEDIA_CHECK" },
  357. { 0x80000021, "STATUS_SETMARK_DETECTED" },
  358. { 0x80000022, "STATUS_NO_DATA_DETECTED" },
  359. { 0x80000023, "STATUS_REDIRECTOR_HAS_OPEN_HANDLES" },
  360. { 0x80000024, "STATUS_SERVER_HAS_OPEN_HANDLES" },
  361. { 0x80000025, "STATUS_ALREADY_DISCONNECTED" },
  362. { 0x80000026, "STATUS_LONGJUMP" },
  363. { 0x80040111, "MAPI_E_LOGON_FAILED" },
  364. { 0x80090300, "SEC_E_INSUFFICIENT_MEMORY" },
  365. { 0x80090301, "SEC_E_INVALID_HANDLE" },
  366. { 0x80090302, "SEC_E_UNSUPPORTED_FUNCTION" },
  367. { 0x8009030B, "SEC_E_NO_IMPERSONATION" },
  368. { 0x8009030D, "SEC_E_UNKNOWN_CREDENTIALS" },
  369. { 0x8009030E, "SEC_E_NO_CREDENTIALS" },
  370. { 0x8009030F, "SEC_E_MESSAGE_ALTERED" },
  371. { 0x80090310, "SEC_E_OUT_OF_SEQUENCE" },
  372. { 0x80090311, "SEC_E_NO_AUTHENTICATING_AUTHORITY" },
  373. { 0xC0000001, "STATUS_UNSUCCESSFUL" },
  374. { 0xC0000002, "STATUS_NOT_IMPLEMENTED" },
  375. { 0xC0000003, "STATUS_INVALID_INFO_CLASS" },
  376. { 0xC0000004, "STATUS_INFO_LENGTH_MISMATCH" },
  377. { 0xC0000005, "STATUS_ACCESS_VIOLATION" },
  378. { 0xC0000006, "STATUS_IN_PAGE_ERROR" },
  379. { 0xC0000007, "STATUS_PAGEFILE_QUOTA" },
  380. { 0xC0000008, "STATUS_INVALID_HANDLE" },
  381. { 0xC0000009, "STATUS_BAD_INITIAL_STACK" },
  382. { 0xC000000A, "STATUS_BAD_INITIAL_PC" },
  383. { 0xC000000B, "STATUS_INVALID_CID" },
  384. { 0xC000000C, "STATUS_TIMER_NOT_CANCELED" },
  385. { 0xC000000D, "STATUS_INVALID_PARAMETER" },
  386. { 0xC000000E, "STATUS_NO_SUCH_DEVICE" },
  387. { 0xC000000F, "STATUS_NO_SUCH_FILE" },
  388. { 0xC0000010, "STATUS_INVALID_DEVICE_REQUEST" },
  389. { 0xC0000011, "STATUS_END_OF_FILE" },
  390. { 0xC0000012, "STATUS_WRONG_VOLUME" },
  391. { 0xC0000013, "STATUS_NO_MEDIA_IN_DEVICE" },
  392. { 0xC0000014, "STATUS_UNRECOGNIZED_MEDIA" },
  393. { 0xC0000015, "STATUS_NONEXISTENT_SECTOR" },
  394. { 0xC0000016, "STATUS_MORE_PROCESSING_REQUIRED" },
  395. { 0xC0000017, "STATUS_NO_MEMORY" },
  396. { 0xC0000018, "STATUS_CONFLICTING_ADDRESSES" },
  397. { 0xC0000019, "STATUS_NOT_MAPPED_VIEW" },
  398. { 0xC000001A, "STATUS_UNABLE_TO_FREE_VM" },
  399. { 0xC000001B, "STATUS_UNABLE_TO_DELETE_SECTION" },
  400. { 0xC000001C, "STATUS_INVALID_SYSTEM_SERVICE" },
  401. { 0xC000001D, "STATUS_ILLEGAL_INSTRUCTION" },
  402. { 0xC000001E, "STATUS_INVALID_LOCK_SEQUENCE" },
  403. { 0xC000001F, "STATUS_INVALID_VIEW_SIZE" },
  404. { 0xC0000020, "STATUS_INVALID_FILE_FOR_SECTION" },
  405. { 0xC0000021, "STATUS_ALREADY_COMMITTED" },
  406. { 0xC0000022, "STATUS_ACCESS_DENIED" },
  407. { 0xC0000023, "STATUS_BUFFER_TOO_SMALL" },
  408. { 0xC0000024, "STATUS_OBJECT_TYPE_MISMATCH" },
  409. { 0xC0000025, "STATUS_NONCONTINUABLE_EXCEPTION" },
  410. { 0xC0000026, "STATUS_INVALID_DISPOSITION" },
  411. { 0xC0000027, "STATUS_UNWIND" },
  412. { 0xC0000028, "STATUS_BAD_STACK" },
  413. { 0xC0000029, "STATUS_INVALID_UNWIND_TARGET" },
  414. { 0xC000002A, "STATUS_NOT_LOCKED" },
  415. { 0xC000002B, "STATUS_PARITY_ERROR" },
  416. { 0xC000002C, "STATUS_UNABLE_TO_DECOMMIT_VM" },
  417. { 0xC000002D, "STATUS_NOT_COMMITTED" },
  418. { 0xC000002E, "STATUS_INVALID_PORT_ATTRIBUTES" },
  419. { 0xC000002F, "STATUS_PORT_MESSAGE_TOO_LONG" },
  420. { 0xC0000030, "STATUS_INVALID_PARAMETER_MIX" },
  421. { 0xC0000031, "STATUS_INVALID_QUOTA_LOWER" },
  422. { 0xC0000032, "STATUS_DISK_CORRUPT_ERROR" },
  423. { 0xC0000033, "STATUS_OBJECT_NAME_INVALID" },
  424. { 0xC0000034, "STATUS_OBJECT_NAME_NOT_FOUND" },
  425. { 0xC0000035, "STATUS_OBJECT_NAME_COLLISION" },
  426. { 0xC0000037, "STATUS_PORT_DISCONNECTED" },
  427. { 0xC0000038, "STATUS_DEVICE_ALREADY_ATTACHED" },
  428. { 0xC0000039, "STATUS_OBJECT_PATH_INVALID" },
  429. { 0xC000003A, "STATUS_OBJECT_PATH_NOT_FOUND" },
  430. { 0xC000003B, "STATUS_OBJECT_PATH_SYNTAX_BAD" },
  431. { 0xC000003C, "STATUS_DATA_OVERRUN" },
  432. { 0xC000003D, "STATUS_DATA_LATE_ERROR" },
  433. { 0xC000003E, "STATUS_DATA_ERROR" },
  434. { 0xC000003F, "STATUS_CRC_ERROR" },
  435. { 0xC0000040, "STATUS_SECTION_TOO_BIG" },
  436. { 0xC0000041, "STATUS_PORT_CONNECTION_REFUSED" },
  437. { 0xC0000042, "STATUS_INVALID_PORT_HANDLE" },
  438. { 0xC0000043, "STATUS_SHARING_VIOLATION" },
  439. { 0xC0000044, "STATUS_QUOTA_EXCEEDED" },
  440. { 0xC0000045, "STATUS_INVALID_PAGE_PROTECTION" },
  441. { 0xC0000046, "STATUS_MUTANT_NOT_OWNED" },
  442. { 0xC0000047, "STATUS_SEMAPHORE_LIMIT_EXCEEDED" },
  443. { 0xC0000048, "STATUS_PORT_ALREADY_SET" },
  444. { 0xC0000049, "STATUS_SECTION_NOT_IMAGE" },
  445. { 0xC000004A, "STATUS_SUSPEND_COUNT_EXCEEDED" },
  446. { 0xC000004B, "STATUS_THREAD_IS_TERMINATING" },
  447. { 0xC000004C, "STATUS_BAD_WORKING_SET_LIMIT" },
  448. { 0xC000004D, "STATUS_INCOMPATIBLE_FILE_MAP" },
  449. { 0xC000004E, "STATUS_SECTION_PROTECTION" },
  450. { 0xC000004F, "STATUS_EAS_NOT_SUPPORTED" },
  451. { 0xC0000050, "STATUS_EA_TOO_LARGE" },
  452. { 0xC0000051, "STATUS_NONEXISTENT_EA_ENTRY" },
  453. { 0xC0000052, "STATUS_NO_EAS_ON_FILE" },
  454. { 0xC0000053, "STATUS_EA_CORRUPT_ERROR" },
  455. { 0xC0000054, "STATUS_FILE_LOCK_CONFLICT" },
  456. { 0xC0000055, "STATUS_LOCK_NOT_GRANTED" },
  457. { 0xC0000056, "STATUS_DELETE_PENDING" },
  458. { 0xC0000057, "STATUS_CTL_FILE_NOT_SUPPORTED" },
  459. { 0xC0000058, "STATUS_UNKNOWN_REVISION" },
  460. { 0xC0000059, "STATUS_REVISION_MISMATCH" },
  461. { 0xC000005A, "STATUS_INVALID_OWNER" },
  462. { 0xC000005B, "STATUS_INVALID_PRIMARY_GROUP" },
  463. { 0xC000005C, "STATUS_NO_IMPERSONATION_TOKEN" },
  464. { 0xC000005D, "STATUS_CANT_DISABLE_MANDATORY" },
  465. { 0xC000005E, "STATUS_NO_LOGON_SERVERS" },
  466. { 0xC000005F, "STATUS_NO_SUCH_LOGON_SESSION" },
  467. { 0xC0000060, "STATUS_NO_SUCH_PRIVILEGE" },
  468. { 0xC0000061, "STATUS_PRIVILEGE_NOT_HELD" },
  469. { 0xC0000062, "STATUS_INVALID_ACCOUNT_NAME" },
  470. { 0xC0000063, "STATUS_USER_EXISTS" },
  471. { 0xC0000064, "STATUS_NO_SUCH_USER" },
  472. { 0xC0000065, "STATUS_GROUP_EXISTS" },
  473. { 0xC0000066, "STATUS_NO_SUCH_GROUP" },
  474. { 0xC0000067, "STATUS_MEMBER_IN_GROUP" },
  475. { 0xC0000068, "STATUS_MEMBER_NOT_IN_GROUP" },
  476. { 0xC0000069, "STATUS_LAST_ADMIN" },
  477. { 0xC000006A, "STATUS_WRONG_PASSWORD" },
  478. { 0xC000006B, "STATUS_ILL_FORMED_PASSWORD" },
  479. { 0xC000006C, "STATUS_PASSWORD_RESTRICTION" },
  480. { 0xC000006D, "STATUS_LOGON_FAILURE" },
  481. { 0xC000006E, "STATUS_ACCOUNT_RESTRICTION" },
  482. { 0xC000006F, "STATUS_INVALID_LOGON_HOURS" },
  483. { 0xC0000070, "STATUS_INVALID_WORKSTATION" },
  484. { 0xC0000071, "STATUS_PASSWORD_EXPIRED" },
  485. { 0xC0000072, "STATUS_ACCOUNT_DISABLED" },
  486. { 0xC0000073, "STATUS_NONE_MAPPED" },
  487. { 0xC0000074, "STATUS_TOO_MANY_LUIDS_REQUESTED" },
  488. { 0xC0000075, "STATUS_LUIDS_EXHAUSTED" },
  489. { 0xC0000076, "STATUS_INVALID_SUB_AUTHORITY" },
  490. { 0xC0000077, "STATUS_INVALID_ACL" },
  491. { 0xC0000078, "STATUS_INVALID_SID" },
  492. { 0xC0000079, "STATUS_INVALID_SECURITY_DESCR" },
  493. { 0xC000007A, "STATUS_PROCEDURE_NOT_FOUND" },
  494. { 0xC000007B, "STATUS_INVALID_IMAGE_FORMAT" },
  495. { 0xC000007C, "STATUS_NO_TOKEN" },
  496. { 0xC000007D, "STATUS_BAD_INHERITANCE_ACL" },
  497. { 0xC000007E, "STATUS_RANGE_NOT_LOCKED" },
  498. { 0xC000007F, "STATUS_DISK_FULL" },
  499. { 0xC0000080, "STATUS_SERVER_DISABLED" },
  500. { 0xC0000081, "STATUS_SERVER_NOT_DISABLED" },
  501. { 0xC0000082, "STATUS_TOO_MANY_GUIDS_REQUESTED" },
  502. { 0xC0000083, "STATUS_GUIDS_EXHAUSTED" },
  503. { 0xC0000084, "STATUS_INVALID_ID_AUTHORITY" },
  504. { 0xC0000085, "STATUS_AGENTS_EXHAUSTED" },
  505. { 0xC0000086, "STATUS_INVALID_VOLUME_LABEL" },
  506. { 0xC0000087, "STATUS_SECTION_NOT_EXTENDED" },
  507. { 0xC0000088, "STATUS_NOT_MAPPED_DATA" },
  508. { 0xC0000089, "STATUS_RESOURCE_DATA_NOT_FOUND" },
  509. { 0xC000008A, "STATUS_RESOURCE_TYPE_NOT_FOUND" },
  510. { 0xC000008B, "STATUS_RESOURCE_NAME_NOT_FOUND" },
  511. { 0xC000008C, "STATUS_ARRAY_BOUNDS_EXCEEDED" },
  512. { 0xC000008D, "STATUS_FLOAT_DENORMAL_OPERAND" },
  513. { 0xC000008E, "STATUS_FLOAT_DIVIDE_BY_ZERO" },
  514. { 0xC000008F, "STATUS_FLOAT_INEXACT_RESULT" },
  515. { 0xC0000090, "STATUS_FLOAT_INVALID_OPERATION" },
  516. { 0xC0000091, "STATUS_FLOAT_OVERFLOW" },
  517. { 0xC0000092, "STATUS_FLOAT_STACK_CHECK" },
  518. { 0xC0000093, "STATUS_FLOAT_UNDERFLOW" },
  519. { 0xC0000094, "STATUS_INTEGER_DIVIDE_BY_ZERO" },
  520. { 0xC0000095, "STATUS_INTEGER_OVERFLOW" },
  521. { 0xC0000096, "STATUS_PRIVILEGED_INSTRUCTION" },
  522. { 0xC0000097, "STATUS_TOO_MANY_PAGING_FILES" },
  523. { 0xC0000098, "STATUS_FILE_INVALID" },
  524. { 0xC0000099, "STATUS_ALLOTTED_SPACE_EXCEEDED" },
  525. { 0xC000009A, "STATUS_INSUFFICIENT_RESOURCES" },
  526. { 0xC000009B, "STATUS_DFS_EXIT_PATH_FOUND" },
  527. { 0xC000009C, "STATUS_DEVICE_DATA_ERROR" },
  528. { 0xC000009D, "STATUS_DEVICE_NOT_CONNECTED" },
  529. { 0xC000009E, "STATUS_DEVICE_POWER_FAILURE" },
  530. { 0xC000009F, "STATUS_FREE_VM_NOT_AT_BASE" },
  531. { 0xC00000A0, "STATUS_MEMORY_NOT_ALLOCATED" },
  532. { 0xC00000A1, "STATUS_WORKING_SET_QUOTA" },
  533. { 0xC00000A2, "STATUS_MEDIA_WRITE_PROTECTED" },
  534. { 0xC00000A3, "STATUS_DEVICE_NOT_READY" },
  535. { 0xC00000A4, "STATUS_INVALID_GROUP_ATTRIBUTES" },
  536. { 0xC00000A5, "STATUS_BAD_IMPERSONATION_LEVEL" },
  537. { 0xC00000A6, "STATUS_CANT_OPEN_ANONYMOUS" },
  538. { 0xC00000A7, "STATUS_BAD_VALIDATION_CLASS" },
  539. { 0xC00000A8, "STATUS_BAD_TOKEN_TYPE" },
  540. { 0xC00000A9, "STATUS_BAD_MASTER_BOOT_RECORD" },
  541. { 0xC00000AA, "STATUS_INSTRUCTION_MISALIGNMENT" },
  542. { 0xC00000AB, "STATUS_INSTANCE_NOT_AVAILABLE" },
  543. { 0xC00000AC, "STATUS_PIPE_NOT_AVAILABLE" },
  544. { 0xC00000AD, "STATUS_INVALID_PIPE_STATE" },
  545. { 0xC00000AE, "STATUS_PIPE_BUSY" },
  546. { 0xC00000AF, "STATUS_ILLEGAL_FUNCTION" },
  547. { 0xC00000B0, "STATUS_PIPE_DISCONNECTED" },
  548. { 0xC00000B1, "STATUS_PIPE_CLOSING" },
  549. { 0xC00000B2, "STATUS_PIPE_CONNECTED" },
  550. { 0xC00000B3, "STATUS_PIPE_LISTENING" },
  551. { 0xC00000B4, "STATUS_INVALID_READ_MODE" },
  552. { 0xC00000B5, "STATUS_IO_TIMEOUT" },
  553. { 0xC00000B6, "STATUS_FILE_FORCED_CLOSED" },
  554. { 0xC00000B7, "STATUS_PROFILING_NOT_STARTED" },
  555. { 0xC00000B8, "STATUS_PROFILING_NOT_STOPPED" },
  556. { 0xC00000B9, "STATUS_COULD_NOT_INTERPRET" },
  557. { 0xC00000BA, "STATUS_FILE_IS_A_DIRECTORY" },
  558. { 0xC00000BB, "STATUS_NOT_SUPPORTED" },
  559. { 0xC00000BC, "STATUS_REMOTE_NOT_LISTENING" },
  560. { 0xC00000BD, "STATUS_DUPLICATE_NAME" },
  561. { 0xC00000BE, "STATUS_BAD_NETWORK_PATH" },
  562. { 0xC00000BF, "STATUS_NETWORK_BUSY" },
  563. { 0xC00000C0, "STATUS_DEVICE_DOES_NOT_EXIST" },
  564. { 0xC00000C1, "STATUS_TOO_MANY_COMMANDS" },
  565. { 0xC00000C2, "STATUS_ADAPTER_HARDWARE_ERROR" },
  566. { 0xC00000C3, "STATUS_INVALID_NETWORK_RESPONSE" },
  567. { 0xC00000C4, "STATUS_UNEXPECTED_NETWORK_ERROR" },
  568. { 0xC00000C5, "STATUS_BAD_REMOTE_ADAPTER" },
  569. { 0xC00000C6, "STATUS_PRINT_QUEUE_FULL" },
  570. { 0xC00000C7, "STATUS_NO_SPOOL_SPACE" },
  571. { 0xC00000C8, "STATUS_PRINT_CANCELLED" },
  572. { 0xC00000C9, "STATUS_NETWORK_NAME_DELETED" },
  573. { 0xC00000CA, "STATUS_NETWORK_ACCESS_DENIED" },
  574. { 0xC00000CB, "STATUS_BAD_DEVICE_TYPE" },
  575. { 0xC00000CC, "STATUS_BAD_NETWORK_NAME" },
  576. { 0xC00000CD, "STATUS_TOO_MANY_NAMES" },
  577. { 0xC00000CE, "STATUS_TOO_MANY_SESSIONS" },
  578. { 0xC00000CF, "STATUS_SHARING_PAUSED" },
  579. { 0xC00000D0, "STATUS_REQUEST_NOT_ACCEPTED" },
  580. { 0xC00000D1, "STATUS_REDIRECTOR_PAUSED" },
  581. { 0xC00000D2, "STATUS_NET_WRITE_FAULT" },
  582. { 0xC00000D3, "STATUS_PROFILING_AT_LIMIT" },
  583. { 0xC00000D4, "STATUS_NOT_SAME_DEVICE" },
  584. { 0xC00000D5, "STATUS_FILE_RENAMED" },
  585. { 0xC00000D6, "STATUS_VIRTUAL_CIRCUIT_CLOSED" },
  586. { 0xC00000D7, "STATUS_NO_SECURITY_ON_OBJECT" },
  587. { 0xC00000D8, "STATUS_CANT_WAIT" },
  588. { 0xC00000D9, "STATUS_PIPE_EMPTY" },
  589. { 0xC00000DA, "STATUS_CANT_ACCESS_DOMAIN_INFO" },
  590. { 0xC00000DB, "STATUS_CANT_TERMINATE_SELF" },
  591. { 0xC00000DC, "STATUS_INVALID_SERVER_STATE" },
  592. { 0xC00000DD, "STATUS_INVALID_DOMAIN_STATE" },
  593. { 0xC00000DE, "STATUS_INVALID_DOMAIN_ROLE" },
  594. { 0xC00000DF, "STATUS_NO_SUCH_DOMAIN" },
  595. { 0xC00000E0, "STATUS_DOMAIN_EXISTS" },
  596. { 0xC00000E1, "STATUS_DOMAIN_LIMIT_EXCEEDED" },
  597. { 0xC00000E2, "STATUS_OPLOCK_NOT_GRANTED" },
  598. { 0xC00000E3, "STATUS_INVALID_OPLOCK_PROTOCOL" },
  599. { 0xC00000E4, "STATUS_INTERNAL_DB_CORRUPTION" },
  600. { 0xC00000E5, "STATUS_INTERNAL_ERROR" },
  601. { 0xC00000E6, "STATUS_GENERIC_NOT_MAPPED" },
  602. { 0xC00000E7, "STATUS_BAD_DESCRIPTOR_FORMAT" },
  603. { 0xC00000E8, "STATUS_INVALID_USER_BUFFER" },
  604. { 0xC00000E9, "STATUS_UNEXPECTED_IO_ERROR" },
  605. { 0xC00000EA, "STATUS_UNEXPECTED_MM_CREATE_ERR" },
  606. { 0xC00000EB, "STATUS_UNEXPECTED_MM_MAP_ERROR" },
  607. { 0xC00000EC, "STATUS_UNEXPECTED_MM_EXTEND_ERR" },
  608. { 0xC00000ED, "STATUS_NOT_LOGON_PROCESS" },
  609. { 0xC00000EE, "STATUS_LOGON_SESSION_EXISTS" },
  610. { 0xC00000EF, "STATUS_INVALID_PARAMETER_1" },
  611. { 0xC00000F0, "STATUS_INVALID_PARAMETER_2" },
  612. { 0xC00000F1, "STATUS_INVALID_PARAMETER_3" },
  613. { 0xC00000F2, "STATUS_INVALID_PARAMETER_4" },
  614. { 0xC00000F3, "STATUS_INVALID_PARAMETER_5" },
  615. { 0xC00000F4, "STATUS_INVALID_PARAMETER_6" },
  616. { 0xC00000F5, "STATUS_INVALID_PARAMETER_7" },
  617. { 0xC00000F6, "STATUS_INVALID_PARAMETER_8" },
  618. { 0xC00000F7, "STATUS_INVALID_PARAMETER_9" },
  619. { 0xC00000F8, "STATUS_INVALID_PARAMETER_10" },
  620. { 0xC00000F9, "STATUS_INVALID_PARAMETER_11" },
  621. { 0xC00000FA, "STATUS_INVALID_PARAMETER_12" },
  622. { 0xC00000FB, "STATUS_REDIRECTOR_NOT_STARTED" },
  623. { 0xC00000FC, "STATUS_REDIRECTOR_STARTED" },
  624. { 0xC00000FD, "STATUS_STACK_OVERFLOW" },
  625. { 0xC00000FE, "STATUS_NO_SUCH_PACKAGE" },
  626. { 0xC00000FF, "STATUS_BAD_FUNCTION_TABLE" },
  627. { 0xC0000100, "STATUS_VARIABLE_NOT_FOUND" },
  628. { 0xC0000101, "STATUS_DIRECTORY_NOT_EMPTY" },
  629. { 0xC0000102, "STATUS_FILE_CORRUPT_ERROR" },
  630. { 0xC0000103, "STATUS_NOT_A_DIRECTORY" },
  631. { 0xC0000104, "STATUS_BAD_LOGON_SESSION_STATE" },
  632. { 0xC0000105, "STATUS_LOGON_SESSION_COLLISION" },
  633. { 0xC0000106, "STATUS_NAME_TOO_LONG" },
  634. { 0xC0000107, "STATUS_FILES_OPEN" },
  635. { 0xC0000108, "STATUS_CONNECTION_IN_USE" },
  636. { 0xC0000109, "STATUS_MESSAGE_NOT_FOUND" },
  637. { 0xC000010A, "STATUS_PROCESS_IS_TERMINATING" },
  638. { 0xC000010B, "STATUS_INVALID_LOGON_TYPE" },
  639. { 0xC000010C, "STATUS_NO_GUID_TRANSLATION" },
  640. { 0xC000010D, "STATUS_CANNOT_IMPERSONATE" },
  641. { 0xC000010E, "STATUS_IMAGE_ALREADY_LOADED" },
  642. { 0xC000010F, "STATUS_ABIOS_NOT_PRESENT" },
  643. { 0xC0000110, "STATUS_ABIOS_LID_NOT_EXIST" },
  644. { 0xC0000111, "STATUS_ABIOS_LID_ALREADY_OWNED" },
  645. { 0xC0000112, "STATUS_ABIOS_NOT_LID_OWNER" },
  646. { 0xC0000113, "STATUS_ABIOS_INVALID_COMMAND" },
  647. { 0xC0000114, "STATUS_ABIOS_INVALID_LID" },
  648. { 0xC0000115, "STATUS_ABIOS_SELECTOR_NOT_AVAILABLE" },
  649. { 0xC0000116, "STATUS_ABIOS_INVALID_SELECTOR" },
  650. { 0xC0000117, "STATUS_NO_LDT" },
  651. { 0xC0000118, "STATUS_INVALID_LDT_SIZE" },
  652. { 0xC0000119, "STATUS_INVALID_LDT_OFFSET" },
  653. { 0xC000011A, "STATUS_INVALID_LDT_DESCRIPTOR" },
  654. { 0xC000011B, "STATUS_INVALID_IMAGE_NE_FORMAT" },
  655. { 0xC000011C, "STATUS_RXACT_INVALID_STATE" },
  656. { 0xC000011D, "STATUS_RXACT_COMMIT_FAILURE" },
  657. { 0xC000011E, "STATUS_MAPPED_FILE_SIZE_ZERO" },
  658. { 0xC000011F, "STATUS_TOO_MANY_OPENED_FILES" },
  659. { 0xC0000120, "STATUS_CANCELLED" },
  660. { 0xC0000121, "STATUS_CANNOT_DELETE" },
  661. { 0xC0000122, "STATUS_INVALID_COMPUTER_NAME" },
  662. { 0xC0000123, "STATUS_FILE_DELETED" },
  663. { 0xC0000124, "STATUS_SPECIAL_ACCOUNT" },
  664. { 0xC0000125, "STATUS_SPECIAL_GROUP" },
  665. { 0xC0000126, "STATUS_SPECIAL_USER" },
  666. { 0xC0000127, "STATUS_MEMBERS_PRIMARY_GROUP" },
  667. { 0xC0000128, "STATUS_FILE_CLOSED" },
  668. { 0xC0000129, "STATUS_TOO_MANY_THREADS" },
  669. { 0xC000012A, "STATUS_THREAD_NOT_IN_PROCESS" },
  670. { 0xC000012B, "STATUS_TOKEN_ALREADY_IN_USE" },
  671. { 0xC000012C, "STATUS_PAGEFILE_QUOTA_EXCEEDED" },
  672. { 0xC000012D, "STATUS_COMMITMENT_LIMIT" },
  673. { 0xC000012E, "STATUS_INVALID_IMAGE_LE_FORMAT" },
  674. { 0xC000012F, "STATUS_INVALID_IMAGE_NOT_MZ" },
  675. { 0xC0000130, "STATUS_INVALID_IMAGE_PROTECT" },
  676. { 0xC0000131, "STATUS_INVALID_IMAGE_WIN_16" },
  677. { 0xC0000132, "STATUS_LOGON_SERVER_CONFLICT" },
  678. { 0xC0000133, "STATUS_TIME_DIFFERENCE_AT_DC" },
  679. { 0xC0000134, "STATUS_SYNCHRONIZATION_REQUIRED" },
  680. { 0xC0000135, "STATUS_DLL_NOT_FOUND" },
  681. { 0xC0000136, "STATUS_OPEN_FAILED" },
  682. { 0xC0000137, "STATUS_IO_PRIVILEGE_FAILED" },
  683. { 0xC0000138, "STATUS_ORDINAL_NOT_FOUND" },
  684. { 0xC0000139, "STATUS_ENTRYPOINT_NOT_FOUND" },
  685. { 0xC000013A, "STATUS_CONTROL_C_EXIT" },
  686. { 0xC000013B, "STATUS_LOCAL_DISCONNECT" },
  687. { 0xC000013C, "STATUS_REMOTE_DISCONNECT" },
  688. { 0xC000013D, "STATUS_REMOTE_RESOURCES" },
  689. { 0xC000013E, "STATUS_LINK_FAILED" },
  690. { 0xC000013F, "STATUS_LINK_TIMEOUT" },
  691. { 0xC0000140, "STATUS_INVALID_CONNECTION" },
  692. { 0xC0000141, "STATUS_INVALID_ADDRESS" },
  693. { 0xC0000142, "STATUS_DLL_INIT_FAILED" },
  694. { 0xC0000143, "STATUS_MISSING_SYSTEMFILE" },
  695. { 0xC0000144, "STATUS_UNHANDLED_EXCEPTION" },
  696. { 0xC0000145, "STATUS_APP_INIT_FAILURE" },
  697. { 0xC0000146, "STATUS_PAGEFILE_CREATE_FAILED" },
  698. { 0xC0000147, "STATUS_NO_PAGEFILE" },
  699. { 0xC0000148, "STATUS_INVALID_LEVEL" },
  700. { 0xC0000149, "STATUS_WRONG_PASSWORD_CORE" },
  701. { 0xC000014A, "STATUS_ILLEGAL_FLOAT_CONTEXT" },
  702. { 0xC000014B, "STATUS_PIPE_BROKEN" },
  703. { 0xC000014C, "STATUS_REGISTRY_CORRUPT" },
  704. { 0xC000014D, "STATUS_REGISTRY_IO_FAILED" },
  705. { 0xC000014E, "STATUS_NO_EVENT_PAIR" },
  706. { 0xC000014F, "STATUS_UNRECOGNIZED_VOLUME" },
  707. { 0xC0000150, "STATUS_SERIAL_NO_DEVICE_INITED" },
  708. { 0xC0000151, "STATUS_NO_SUCH_ALIAS" },
  709. { 0xC0000152, "STATUS_MEMBER_NOT_IN_ALIAS" },
  710. { 0xC0000153, "STATUS_MEMBER_IN_ALIAS" },
  711. { 0xC0000154, "STATUS_ALIAS_EXISTS" },
  712. { 0xC0000155, "STATUS_LOGON_NOT_GRANTED" },
  713. { 0xC0000156, "STATUS_TOO_MANY_SECRETS" },
  714. { 0xC0000157, "STATUS_SECRET_TOO_LONG" },
  715. { 0xC0000158, "STATUS_INTERNAL_DB_ERROR" },
  716. { 0xC0000159, "STATUS_FULLSCREEN_MODE" },
  717. { 0xC000015A, "STATUS_TOO_MANY_CONTEXT_IDS" },
  718. { 0xC000015B, "STATUS_LOGON_TYPE_NOT_GRANTED" },
  719. { 0xC000015C, "STATUS_NOT_REGISTRY_FILE" },
  720. { 0xC000015D, "STATUS_NT_CROSS_ENCRYPTION_REQUIRED" },
  721. { 0xC000015E, "STATUS_DOMAIN_CTRLR_CONFIG_ERROR" },
  722. { 0xC000015F, "STATUS_FT_MISSING_MEMBER" },
  723. { 0xC0000160, "STATUS_ILL_FORMED_SERVICE_ENTRY" },
  724. { 0xC0000161, "STATUS_ILLEGAL_CHARACTER" },
  725. { 0xC0000162, "STATUS_UNMAPPABLE_CHARACTER" },
  726. { 0xC0000163, "STATUS_UNDEFINED_CHARACTER" },
  727. { 0xC0000164, "STATUS_FLOPPY_VOLUME" },
  728. { 0xC0000165, "STATUS_FLOPPY_ID_MARK_NOT_FOUND" },
  729. { 0xC0000166, "STATUS_FLOPPY_WRONG_CYLINDER" },
  730. { 0xC0000167, "STATUS_FLOPPY_UNKNOWN_ERROR" },
  731. { 0xC0000168, "STATUS_FLOPPY_BAD_REGISTERS" },
  732. { 0xC0000169, "STATUS_DISK_RECALIBRATE_FAILED" },
  733. { 0xC000016A, "STATUS_DISK_OPERATION_FAILED" },
  734. { 0xC000016B, "STATUS_DISK_RESET_FAILED" },
  735. { 0xC000016C, "STATUS_SHARED_IRQ_BUSY" },
  736. { 0xC000016D, "STATUS_FT_ORPHANING" },
  737. { 0xC000016E, "STATUS_BIOS_FAILED_TO_CONNECT_INTERRUPT" },
  738. { 0xC0000172, "STATUS_PARTITION_FAILURE" },
  739. { 0xC0000173, "STATUS_INVALID_BLOCK_LENGTH" },
  740. { 0xC0000174, "STATUS_DEVICE_NOT_PARTITIONED" },
  741. { 0xC0000175, "STATUS_UNABLE_TO_LOCK_MEDIA" },
  742. { 0xC0000176, "STATUS_UNABLE_TO_UNLOAD_MEDIA" },
  743. { 0xC0000177, "STATUS_EOM_OVERFLOW" },
  744. { 0xC0000178, "STATUS_NO_MEDIA" },
  745. { 0xC000017A, "STATUS_NO_SUCH_MEMBER" },
  746. { 0xC000017B, "STATUS_INVALID_MEMBER" },
  747. { 0xC000017C, "STATUS_KEY_DELETED" },
  748. { 0xC000017D, "STATUS_NO_LOG_SPACE" },
  749. { 0xC000017E, "STATUS_TOO_MANY_SIDS" },
  750. { 0xC000017F, "STATUS_LM_CROSS_ENCRYPTION_REQUIRED" },
  751. { 0xC0000180, "STATUS_KEY_HAS_CHILDREN" },
  752. { 0xC0000181, "STATUS_CHILD_MUST_BE_VOLATILE" },
  753. { 0xC0000182, "STATUS_DEVICE_CONFIGURATION_ERROR" },
  754. { 0xC0000183, "STATUS_DRIVER_INTERNAL_ERROR" },
  755. { 0xC0000184, "STATUS_INVALID_DEVICE_STATE" },
  756. { 0xC0000185, "STATUS_IO_DEVICE_ERROR" },
  757. { 0xC0000186, "STATUS_DEVICE_PROTOCOL_ERROR" },
  758. { 0xC0000187, "STATUS_BACKUP_CONTROLLER" },
  759. { 0xC0000188, "STATUS_LOG_FILE_FULL" },
  760. { 0xC0000189, "STATUS_TOO_LATE" },
  761. { 0xC000018A, "STATUS_NO_TRUST_LSA_SECRET" },
  762. { 0xC000018B, "STATUS_NO_TRUST_SAM_ACCOUNT" },
  763. { 0xC000018C, "STATUS_TRUSTED_DOMAIN_FAILURE" },
  764. { 0xC000018D, "STATUS_TRUSTED_RELATIONSHIP_FAILURE" },
  765. { 0xC000018E, "STATUS_EVENTLOG_FILE_CORRUPT" },
  766. { 0xC000018F, "STATUS_EVENTLOG_CANT_START" },
  767. { 0xC0000190, "STATUS_TRUST_FAILURE" },
  768. { 0xC0000191, "STATUS_MUTANT_LIMIT_EXCEEDED" },
  769. { 0xC0000192, "STATUS_NETLOGON_NOT_STARTED" },
  770. { 0xC0000193, "STATUS_ACCOUNT_EXPIRED" },
  771. { 0xC0000194, "STATUS_POSSIBLE_DEADLOCK" },
  772. { 0xC0000195, "STATUS_NETWORK_CREDENTIAL_CONFLICT" },
  773. { 0xC0000196, "STATUS_REMOTE_SESSION_LIMIT" },
  774. { 0xC0000197, "STATUS_EVENTLOG_FILE_CHANGED" },
  775. { 0xC0000198, "STATUS_NOLOGON_INTERDOMAIN_TRUST_ACCOUNT" },
  776. { 0xC0000199, "STATUS_NOLOGON_WORKSTATION_TRUST_ACCOUNT" },
  777. { 0xC000019A, "STATUS_NOLOGON_SERVER_TRUST_ACCOUNT" },
  778. { 0xC000019B, "STATUS_DOMAIN_TRUST_INCONSISTENT" },
  779. { 0xC000019C, "STATUS_FS_DRIVER_REQUIRED" },
  780. { 0xC0000202, "STATUS_NO_USER_SESSION_KEY" },
  781. { 0xC0000203, "STATUS_USER_SESSION_DELETED" },
  782. { 0xC0000204, "STATUS_RESOURCE_LANG_NOT_FOUND" },
  783. { 0xC0000205, "STATUS_INSUFF_SERVER_RESOURCES" },
  784. { 0xC0000206, "STATUS_INVALID_BUFFER_SIZE" },
  785. { 0xC0000207, "STATUS_INVALID_ADDRESS_COMPONENT" },
  786. { 0xC0000208, "STATUS_INVALID_ADDRESS_WILDCARD" },
  787. { 0xC0000209, "STATUS_TOO_MANY_ADDRESSES" },
  788. { 0xC000020A, "STATUS_ADDRESS_ALREADY_EXISTS" },
  789. { 0xC000020B, "STATUS_ADDRESS_CLOSED" },
  790. { 0xC000020C, "STATUS_CONNECTION_DISCONNECTED" },
  791. { 0xC000020D, "STATUS_CONNECTION_RESET" },
  792. { 0xC000020E, "STATUS_TOO_MANY_NODES" },
  793. { 0xC000020F, "STATUS_TRANSACTION_ABORTED" },
  794. { 0xC0000210, "STATUS_TRANSACTION_TIMED_OUT" },
  795. { 0xC0000211, "STATUS_TRANSACTION_NO_RELEASE" },
  796. { 0xC0000212, "STATUS_TRANSACTION_NO_MATCH" },
  797. { 0xC0000213, "STATUS_TRANSACTION_RESPONDED" },
  798. { 0xC0000214, "STATUS_TRANSACTION_INVALID_ID" },
  799. { 0xC0000215, "STATUS_TRANSACTION_INVALID_TYPE" },
  800. { 0xC0000216, "STATUS_NOT_SERVER_SESSION" },
  801. { 0xC0000217, "STATUS_NOT_CLIENT_SESSION" },
  802. { 0xC0000218, "STATUS_CANNOT_LOAD_REGISTRY_FILE" },
  803. { 0xC0000219, "STATUS_DEBUG_ATTACH_FAILED" },
  804. { 0xC000021A, "STATUS_SYSTEM_PROCESS_TERMINATED" },
  805. { 0xC000021B, "STATUS_DATA_NOT_ACCEPTED" },
  806. { 0xC000021C, "STATUS_NO_BROWSER_SERVERS_FOUND" },
  807. { 0xC000021D, "STATUS_VDM_HARD_ERROR" },
  808. { 0xC000021E, "STATUS_DRIVER_CANCEL_TIMEOUT" },
  809. { 0xC000021F, "STATUS_REPLY_MESSAGE_MISMATCH" },
  810. { 0xC0000220, "STATUS_MAPPED_ALIGNMENT" },
  811. { 0xC0000221, "STATUS_IMAGE_CHECKSUM_MISMATCH" },
  812. { 0xC0000222, "STATUS_LOST_WRITEBEHIND_DATA" },
  813. { 0xC0000223, "STATUS_CLIENT_SERVER_PARAMETERS_INVALID" },
  814. { 0xC0000224, "STATUS_PASSWORD_MUST_CHANGE" },
  815. { 0xC0000225, "STATUS_NOT_FOUND" },
  816. { 0xC0000226, "STATUS_NOT_TINY_STREAM" },
  817. { 0xC0000227, "STATUS_RECOVERY_FAILURE" },
  818. { 0xC0000228, "STATUS_STACK_OVERFLOW_READ" },
  819. { 0xC0000229, "STATUS_FAIL_CHECK" },
  820. { 0xC000022A, "STATUS_DUPLICATE_OBJECTID" },
  821. { 0xC000022B, "STATUS_OBJECTID_EXISTS" },
  822. { 0xC000022C, "STATUS_CONVERT_TO_LARGE" },
  823. { 0xC000022D, "STATUS_RETRY" },
  824. { 0xC000022E, "STATUS_FOUND_OUT_OF_SCOPE" },
  825. { 0xC000022F, "STATUS_ALLOCATE_BUCKET" },
  826. { 0xC0000230, "STATUS_PROPSET_NOT_FOUND" },
  827. { 0xC0000231, "STATUS_MARSHALL_OVERFLOW" },
  828. { 0xC0000232, "STATUS_INVALID_VARIANT" },
  829. { 0xC0000233, "STATUS_DOMAIN_CONTROLLER_NOT_FOUND" },
  830. { 0xC0000234, "STATUS_ACCOUNT_LOCKED_OUT" },
  831. { 0xC0000235, "STATUS_HANDLE_NOT_CLOSABLE" },
  832. { 0xC0000236, "STATUS_CONNECTION_REFUSED" },
  833. { 0xC0000237, "STATUS_GRACEFUL_DISCONNECT" },
  834. { 0xC0000238, "STATUS_ADDRESS_ALREADY_ASSOCIATED" },
  835. { 0xC0000239, "STATUS_ADDRESS_NOT_ASSOCIATED" },
  836. { 0xC000023A, "STATUS_CONNECTION_INVALID" },
  837. { 0xC000023B, "STATUS_CONNECTION_ACTIVE" },
  838. { 0xC000023C, "STATUS_NETWORK_UNREACHABLE" },
  839. { 0xC000023D, "STATUS_HOST_UNREACHABLE" },
  840. { 0xC000023E, "STATUS_PROTOCOL_UNREACHABLE" },
  841. { 0xC000023F, "STATUS_PORT_UNREACHABLE" },
  842. { 0xC0000240, "STATUS_REQUEST_ABORTED" },
  843. { 0xC0000241, "STATUS_CONNECTION_ABORTED" },
  844. { 0xC0000242, "STATUS_BAD_COMPRESSION_BUFFER" },
  845. { 0xC0000243, "STATUS_USER_MAPPED_FILE" },
  846. { 0xC0000244, "STATUS_AUDIT_FAILED" },
  847. { 0xC0000245, "STATUS_TIMER_RESOLUTION_NOT_SET" },
  848. { 0xC0000246, "STATUS_CONNECTION_COUNT_LIMIT" },
  849. { 0xC0000247, "STATUS_LOGIN_TIME_RESTRICTION" },
  850. { 0xC0000248, "STATUS_LOGIN_WKSTA_RESTRICTION" },
  851. { 0xC0000249, "STATUS_IMAGE_MP_UP_MISMATCH" },
  852. { 0xC0000250, "STATUS_INSUFFICIENT_LOGON_INFO" },
  853. { 0xC0000251, "STATUS_BAD_DLL_ENTRYPOINT" },
  854. { 0xC0000252, "STATUS_BAD_SERVICE_ENTRYPOINT" },
  855. { 0xC0000253, "STATUS_LPC_REPLY_LOST" },
  856. { 0xC0000254, "STATUS_IP_ADDRESS_CONFLICT1" },
  857. { 0xC0000255, "STATUS_IP_ADDRESS_CONFLICT2" },
  858. { 0xC0000256, "STATUS_REGISTRY_QUOTA_LIMIT" },
  859. { 0xC0000257, "STATUS_PATH_NOT_COVERED" },
  860. { 0xC0000258, "STATUS_NO_CALLBACK_ACTIVE" },
  861. { 0xC0000259, "STATUS_LICENSE_QUOTA_EXCEEDED" },
  862. { 0xC000025A, "STATUS_PWD_TOO_SHORT" },
  863. { 0xC000025B, "STATUS_PWD_TOO_RECENT" },
  864. { 0xC000025C, "STATUS_PWD_HISTORY_CONFLICT" },
  865. { 0xC000025E, "STATUS_PLUGPLAY_NO_DEVICE" },
  866. { 0xC000025F, "STATUS_UNSUPPORTED_COMPRESSION" },
  867. { 0xC0000260, "STATUS_INVALID_HW_PROFILE" },
  868. { 0xC0000261, "STATUS_INVALID_PLUGPLAY_DEVICE_PATH" },
  869. { 0xC0000262, "STATUS_DRIVER_ORDINAL_NOT_FOUND" },
  870. { 0xC0000263, "STATUS_DRIVER_ENTRYPOINT_NOT_FOUND" },
  871. { 0xC0000264, "STATUS_RESOURCE_NOT_OWNED" },
  872. { 0xC0000265, "STATUS_TOO_MANY_LINKS" },
  873. { 0xC0000266, "STATUS_QUOTA_LIST_INCONSISTENT" },
  874. { 0xC0000267, "STATUS_FILE_IS_OFFLINE" },
  875. { 0xC0000268, "STATUS_EVALUATION_EXPIRATION" },
  876. { 0xC0000269, "STATUS_ILLEGAL_DLL_RELOCATION" },
  877. { 0xC000026A, "STATUS_LICENSE_VIOLATION" },
  878. { 0xC000026B, "STATUS_DLL_INIT_FAILED_LOGOFF" },
  879. { 0xC000026C, "STATUS_DRIVER_UNABLE_TO_LOAD" },
  880. { 0xC000026D, "STATUS_DFS_UNAVAILABLE" },
  881. { 0xC000026E, "STATUS_VOLUME_DISMOUNTED" },
  882. { 0xC000026F, "STATUS_WX86_INTERNAL_ERROR" },
  883. { 0xC0000270, "STATUS_WX86_FLOAT_STACK_CHECK" },
  884. { 0xC0000271, "STATUS_VALIDATE_CONTINUE" },
  885. { 0xC0000272, "STATUS_NO_MATCH" },
  886. { 0xC0000273, "STATUS_NO_MORE_MATCHES" },
  887. { 0xC0000275, "STATUS_NOT_A_REPARSE_POINT" },
  888. { 0xC0000276, "STATUS_IO_REPARSE_TAG_INVALID" },
  889. { 0xC0000277, "STATUS_IO_REPARSE_TAG_MISMATCH" },
  890. { 0xC0000278, "STATUS_IO_REPARSE_DATA_INVALID" },
  891. { 0xC0000279, "STATUS_IO_REPARSE_TAG_NOT_HANDLED" },
  892. { 0xC0000280, "STATUS_REPARSE_POINT_NOT_RESOLVED" },
  893. { 0xC0000281, "STATUS_DIRECTORY_IS_A_REPARSE_POINT" },
  894. { 0xC0000282, "STATUS_RANGE_LIST_CONFLICT" },
  895. { 0xC0000283, "STATUS_SOURCE_ELEMENT_EMPTY" },
  896. { 0xC0000284, "STATUS_DESTINATION_ELEMENT_FULL" },
  897. { 0xC0000285, "STATUS_ILLEGAL_ELEMENT_ADDRESS" },
  898. { 0xC0000286, "STATUS_MAGAZINE_NOT_PRESENT" },
  899. { 0xC0000287, "STATUS_REINITIALIZATION_NEEDED" },
  900. { 0x80000288, "STATUS_DEVICE_REQUIRES_CLEANING" },
  901. { 0x80000289, "STATUS_DEVICE_DOOR_OPEN" },
  902. { 0xC000028A, "STATUS_ENCRYPTION_FAILED" },
  903. { 0xC000028B, "STATUS_DECRYPTION_FAILED" },
  904. { 0xC000028C, "STATUS_RANGE_NOT_FOUND" },
  905. { 0xC000028D, "STATUS_NO_RECOVERY_POLICY" },
  906. { 0xC000028E, "STATUS_NO_EFS" },
  907. { 0xC000028F, "STATUS_WRONG_EFS" },
  908. { 0xC0000290, "STATUS_NO_USER_KEYS" },
  909. { 0xC0000291, "STATUS_FILE_NOT_ENCRYPTED" },
  910. { 0xC0000292, "STATUS_NOT_EXPORT_FORMAT" },
  911. { 0xC0000293, "STATUS_FILE_ENCRYPTED" },
  912. { 0x40000294, "STATUS_WAKE_SYSTEM" },
  913. { 0xC0000295, "STATUS_WMI_GUID_NOT_FOUND" },
  914. { 0xC0000296, "STATUS_WMI_INSTANCE_NOT_FOUND" },
  915. { 0xC0000297, "STATUS_WMI_ITEMID_NOT_FOUND" },
  916. { 0xC0000298, "STATUS_WMI_TRY_AGAIN" },
  917. { 0xC0000299, "STATUS_SHARED_POLICY" },
  918. { 0xC000029A, "STATUS_POLICY_OBJECT_NOT_FOUND" },
  919. { 0xC000029B, "STATUS_POLICY_ONLY_IN_DS" },
  920. { 0xC000029C, "STATUS_VOLUME_NOT_UPGRADED" },
  921. { 0xC000029D, "STATUS_REMOTE_STORAGE_NOT_ACTIVE" },
  922. { 0xC000029E, "STATUS_REMOTE_STORAGE_MEDIA_ERROR" },
  923. { 0xC000029F, "STATUS_NO_TRACKING_SERVICE" },
  924. { 0xC00002A0, "STATUS_SERVER_SID_MISMATCH" },
  925. { 0xC00002A1, "STATUS_DS_NO_ATTRIBUTE_OR_VALUE" },
  926. { 0xC00002A2, "STATUS_DS_INVALID_ATTRIBUTE_SYNTAX" },
  927. { 0xC00002A3, "STATUS_DS_ATTRIBUTE_TYPE_UNDEFINED" },
  928. { 0xC00002A4, "STATUS_DS_ATTRIBUTE_OR_VALUE_EXISTS" },
  929. { 0xC00002A5, "STATUS_DS_BUSY" },
  930. { 0xC00002A6, "STATUS_DS_UNAVAILABLE" },
  931. { 0xC00002A7, "STATUS_DS_NO_RIDS_ALLOCATED" },
  932. { 0xC00002A8, "STATUS_DS_NO_MORE_RIDS" },
  933. { 0xC00002A9, "STATUS_DS_INCORRECT_ROLE_OWNER" },
  934. { 0xC00002AA, "STATUS_DS_RIDMGR_INIT_ERROR" },
  935. { 0xC00002AB, "STATUS_DS_OBJ_CLASS_VIOLATION" },
  936. { 0xC00002AC, "STATUS_DS_CANT_ON_NON_LEAF" },
  937. { 0xC00002AD, "STATUS_DS_CANT_ON_RDN" },
  938. { 0xC00002AE, "STATUS_DS_CANT_MOD_OBJ_CLASS" },
  939. { 0xC00002AF, "STATUS_DS_CROSS_DOM_MOVE_FAILED" },
  940. { 0xC00002B0, "STATUS_DS_GC_NOT_AVAILABLE" },
  941. { 0xC00002B1, "STATUS_DIRECTORY_SERVICE_REQUIRED" },
  942. { 0xC00002B2, "STATUS_REPARSE_ATTRIBUTE_CONFLICT" },
  943. { 0xC00002B3, "STATUS_CANT_ENABLE_DENY_ONLY" },
  944. { 0xC00002B4, "STATUS_FLOAT_MULTIPLE_FAULTS" },
  945. { 0xC00002B5, "STATUS_FLOAT_MULTIPLE_TRAPS" },
  946. { 0xC00002B6, "STATUS_DEVICE_REMOVED" },
  947. { 0xC00002B7, "STATUS_JOURNAL_DELETE_IN_PROGRESS" },
  948. { 0xC00002B8, "STATUS_JOURNAL_NOT_ACTIVE" },
  949. { 0xC00002B9, "STATUS_NOINTERFACE" },
  950. { 0xC00002C1, "STATUS_DS_ADMIN_LIMIT_EXCEEDED" },
  951. { 0xC00002C2, "STATUS_DRIVER_FAILED_SLEEP" },
  952. { 0xC00002C3, "STATUS_MUTUAL_AUTHENTICATION_FAILED" },
  953. { 0xC00002C4, "STATUS_CORRUPT_SYSTEM_FILE" },
  954. { 0xC00002C5, "STATUS_DATATYPE_MISALIGNMENT_ERROR" },
  955. { 0xC00002C6, "STATUS_WMI_READ_ONLY" },
  956. { 0xC00002C7, "STATUS_WMI_SET_FAILURE" },
  957. { 0xC00002C8, "STATUS_COMMITMENT_MINIMUM" },
  958. { 0xC00002C9, "STATUS_REG_NAT_CONSUMPTION" },
  959. { 0xC00002CA, "STATUS_TRANSPORT_FULL" },
  960. { 0xC00002CB, "STATUS_DS_SAM_INIT_FAILURE" },
  961. { 0xC00002CC, "STATUS_ONLY_IF_CONNECTED" },
  962. { 0xC00002CD, "STATUS_DS_SENSITIVE_GROUP_VIOLATION" },
  963. { 0xC00002CE, "STATUS_PNP_RESTART_ENUMERATION" },
  964. { 0xC00002CF, "STATUS_JOURNAL_ENTRY_DELETED" },
  965. { 0xC00002D0, "STATUS_DS_CANT_MOD_PRIMARYGROUPID" },
  966. { 0xC00002D1, "STATUS_SYSTEM_IMAGE_BAD_SIGNATURE" },
  967. { 0xC00002D2, "STATUS_PNP_REBOOT_REQUIRED" },
  968. { 0xC00002D3, "STATUS_POWER_STATE_INVALID" },
  969. { 0xC00002D4, "STATUS_DS_INVALID_GROUP_TYPE" },
  970. { 0xC00002D5, "STATUS_DS_NO_NEST_GLOBALGROUP_IN_MIXEDDOMAIN" },
  971. { 0xC00002D6, "STATUS_DS_NO_NEST_LOCALGROUP_IN_MIXEDDOMAIN" },
  972. { 0xC00002D7, "STATUS_DS_GLOBAL_CANT_HAVE_LOCAL_MEMBER" },
  973. { 0xC00002D8, "STATUS_DS_GLOBAL_CANT_HAVE_UNIVERSAL_MEMBER" },
  974. { 0xC00002D9, "STATUS_DS_UNIVERSAL_CANT_HAVE_LOCAL_MEMBER" },
  975. { 0xC00002DA, "STATUS_DS_GLOBAL_CANT_HAVE_CROSSDOMAIN_MEMBER" },
  976. { 0xC00002DB, "STATUS_DS_LOCAL_CANT_HAVE_CROSSDOMAIN_LOCAL_MEMBER" },
  977. { 0xC00002DC, "STATUS_DS_HAVE_PRIMARY_MEMBERS" },
  978. { 0xC00002DD, "STATUS_WMI_NOT_SUPPORTED" },
  979. { 0xC00002DE, "STATUS_INSUFFICIENT_POWER" },
  980. { 0xC00002DF, "STATUS_SAM_NEED_BOOTKEY_PASSWORD" },
  981. { 0xC00002E0, "STATUS_SAM_NEED_BOOTKEY_FLOPPY" },
  982. { 0xC00002E1, "STATUS_DS_CANT_START" },
  983. { 0xC00002E2, "STATUS_DS_INIT_FAILURE" },
  984. { 0xC00002E3, "STATUS_SAM_INIT_FAILURE" },
  985. { 0xC00002E4, "STATUS_DS_GC_REQUIRED" },
  986. { 0xC00002E5, "STATUS_DS_LOCAL_MEMBER_OF_LOCAL_ONLY" },
  987. { 0xC00002E6, "STATUS_DS_NO_FPO_IN_UNIVERSAL_GROUPS" },
  988. { 0xC00002E7, "STATUS_DS_MACHINE_ACCOUNT_QUOTA_EXCEEDED" },
  989. { 0xC00002E8, "STATUS_MULTIPLE_FAULT_VIOLATION" },
  990. { 0xC0000300, "STATUS_NOT_SUPPORTED_ON_SBS" },
  991. { 0xC000035C, "STATUS_NETWORK_SESSION_EXPIRED" },
  992. { 0xC0009898, "STATUS_WOW_ASSERTION" },
  993. { 0xC0020001, "RPC_NT_INVALID_STRING_BINDING" },
  994. { 0xC0020002, "RPC_NT_WRONG_KIND_OF_BINDING" },
  995. { 0xC0020003, "RPC_NT_INVALID_BINDING" },
  996. { 0xC0020004, "RPC_NT_PROTSEQ_NOT_SUPPORTED" },
  997. { 0xC0020005, "RPC_NT_INVALID_RPC_PROTSEQ" },
  998. { 0xC0020006, "RPC_NT_INVALID_STRING_UUID" },
  999. { 0xC0020007, "RPC_NT_INVALID_ENDPOINT_FORMAT" },
  1000. { 0xC0020008, "RPC_NT_INVALID_NET_ADDR" },
  1001. { 0xC0020009, "RPC_NT_NO_ENDPOINT_FOUND" },
  1002. { 0xC002000A, "RPC_NT_INVALID_TIMEOUT" },
  1003. { 0xC002000B, "RPC_NT_OBJECT_NOT_FOUND" },
  1004. { 0xC002000C, "RPC_NT_ALREADY_REGISTERED" },
  1005. { 0xC002000D, "RPC_NT_TYPE_ALREADY_REGISTERED" },
  1006. { 0xC002000E, "RPC_NT_ALREADY_LISTENING" },
  1007. { 0xC002000F, "RPC_NT_NO_PROTSEQS_REGISTERED" },
  1008. { 0xC0020010, "RPC_NT_NOT_LISTENING" },
  1009. { 0xC0020011, "RPC_NT_UNKNOWN_MGR_TYPE" },
  1010. { 0xC0020012, "RPC_NT_UNKNOWN_IF" },
  1011. { 0xC0020013, "RPC_NT_NO_BINDINGS" },
  1012. { 0xC0020014, "RPC_NT_NO_PROTSEQS" },
  1013. { 0xC0020015, "RPC_NT_CANT_CREATE_ENDPOINT" },
  1014. { 0xC0020016, "RPC_NT_OUT_OF_RESOURCES" },
  1015. { 0xC0020017, "RPC_NT_SERVER_UNAVAILABLE" },
  1016. { 0xC0020018, "RPC_NT_SERVER_TOO_BUSY" },
  1017. { 0xC0020019, "RPC_NT_INVALID_NETWORK_OPTIONS" },
  1018. { 0xC002001A, "RPC_NT_NO_CALL_ACTIVE" },
  1019. { 0xC002001B, "RPC_NT_CALL_FAILED" },
  1020. { 0xC002001C, "RPC_NT_CALL_FAILED_DNE" },
  1021. { 0xC002001D, "RPC_NT_PROTOCOL_ERROR" },
  1022. { 0xC002001F, "RPC_NT_UNSUPPORTED_TRANS_SYN" },
  1023. { 0xC0020021, "RPC_NT_UNSUPPORTED_TYPE" },
  1024. { 0xC0020022, "RPC_NT_INVALID_TAG" },
  1025. { 0xC0020023, "RPC_NT_INVALID_BOUND" },
  1026. { 0xC0020024, "RPC_NT_NO_ENTRY_NAME" },
  1027. { 0xC0020025, "RPC_NT_INVALID_NAME_SYNTAX" },
  1028. { 0xC0020026, "RPC_NT_UNSUPPORTED_NAME_SYNTAX" },
  1029. { 0xC0020028, "RPC_NT_UUID_NO_ADDRESS" },
  1030. { 0xC0020029, "RPC_NT_DUPLICATE_ENDPOINT" },
  1031. { 0xC002002A, "RPC_NT_UNKNOWN_AUTHN_TYPE" },
  1032. { 0xC002002B, "RPC_NT_MAX_CALLS_TOO_SMALL" },
  1033. { 0xC002002C, "RPC_NT_STRING_TOO_LONG" },
  1034. { 0xC002002D, "RPC_NT_PROTSEQ_NOT_FOUND" },
  1035. { 0xC002002E, "RPC_NT_PROCNUM_OUT_OF_RANGE" },
  1036. { 0xC002002F, "RPC_NT_BINDING_HAS_NO_AUTH" },
  1037. { 0xC0020030, "RPC_NT_UNKNOWN_AUTHN_SERVICE" },
  1038. { 0xC0020031, "RPC_NT_UNKNOWN_AUTHN_LEVEL" },
  1039. { 0xC0020032, "RPC_NT_INVALID_AUTH_IDENTITY" },
  1040. { 0xC0020033, "RPC_NT_UNKNOWN_AUTHZ_SERVICE" },
  1041. { 0xC0020034, "EPT_NT_INVALID_ENTRY" },
  1042. { 0xC0020035, "EPT_NT_CANT_PERFORM_OP" },
  1043. { 0xC0020036, "EPT_NT_NOT_REGISTERED" },
  1044. { 0xC0020037, "RPC_NT_NOTHING_TO_EXPORT" },
  1045. { 0xC0020038, "RPC_NT_INCOMPLETE_NAME" },
  1046. { 0xC0020039, "RPC_NT_INVALID_VERS_OPTION" },
  1047. { 0xC002003A, "RPC_NT_NO_MORE_MEMBERS" },
  1048. { 0xC002003B, "RPC_NT_NOT_ALL_OBJS_UNEXPORTED" },
  1049. { 0xC002003C, "RPC_NT_INTERFACE_NOT_FOUND" },
  1050. { 0xC002003D, "RPC_NT_ENTRY_ALREADY_EXISTS" },
  1051. { 0xC002003E, "RPC_NT_ENTRY_NOT_FOUND" },
  1052. { 0xC002003F, "RPC_NT_NAME_SERVICE_UNAVAILABLE" },
  1053. { 0xC0020040, "RPC_NT_INVALID_NAF_ID" },
  1054. { 0xC0020041, "RPC_NT_CANNOT_SUPPORT" },
  1055. { 0xC0020042, "RPC_NT_NO_CONTEXT_AVAILABLE" },
  1056. { 0xC0020043, "RPC_NT_INTERNAL_ERROR" },
  1057. { 0xC0020044, "RPC_NT_ZERO_DIVIDE" },
  1058. { 0xC0020045, "RPC_NT_ADDRESS_ERROR" },
  1059. { 0xC0020046, "RPC_NT_FP_DIV_ZERO" },
  1060. { 0xC0020047, "RPC_NT_FP_UNDERFLOW" },
  1061. { 0xC0020048, "RPC_NT_FP_OVERFLOW" },
  1062. { 0xC0021007, "RPC_P_RECEIVE_ALERTED" },
  1063. { 0xC0021008, "RPC_P_CONNECTION_CLOSED" },
  1064. { 0xC0021009, "RPC_P_RECEIVE_FAILED" },
  1065. { 0xC002100A, "RPC_P_SEND_FAILED" },
  1066. { 0xC002100B, "RPC_P_TIMEOUT" },
  1067. { 0xC002100C, "RPC_P_SERVER_TRANSPORT_ERROR" },
  1068. { 0xC002100E, "RPC_P_EXCEPTION_OCCURED" },
  1069. { 0xC0021012, "RPC_P_CONNECTION_SHUTDOWN" },
  1070. { 0xC0021015, "RPC_P_THREAD_LISTENING" },
  1071. { 0xC0030001, "RPC_NT_NO_MORE_ENTRIES" },
  1072. { 0xC0030002, "RPC_NT_SS_CHAR_TRANS_OPEN_FAIL" },
  1073. { 0xC0030003, "RPC_NT_SS_CHAR_TRANS_SHORT_FILE" },
  1074. { 0xC0030004, "RPC_NT_SS_IN_NULL_CONTEXT" },
  1075. { 0xC0030005, "RPC_NT_SS_CONTEXT_MISMATCH" },
  1076. { 0xC0030006, "RPC_NT_SS_CONTEXT_DAMAGED" },
  1077. { 0xC0030007, "RPC_NT_SS_HANDLES_MISMATCH" },
  1078. { 0xC0030008, "RPC_NT_SS_CANNOT_GET_CALL_HANDLE" },
  1079. { 0xC0030009, "RPC_NT_NULL_REF_POINTER" },
  1080. { 0xC003000A, "RPC_NT_ENUM_VALUE_OUT_OF_RANGE" },
  1081. { 0xC003000B, "RPC_NT_BYTE_COUNT_TOO_SMALL" },
  1082. { 0xC003000C, "RPC_NT_BAD_STUB_DATA" },
  1083. { 0xC0020049, "RPC_NT_CALL_IN_PROGRESS" },
  1084. { 0xC002004A, "RPC_NT_NO_MORE_BINDINGS" },
  1085. { 0xC002004B, "RPC_NT_GROUP_MEMBER_NOT_FOUND" },
  1086. { 0xC002004C, "EPT_NT_CANT_CREATE" },
  1087. { 0xC002004D, "RPC_NT_INVALID_OBJECT" },
  1088. { 0xC002004F, "RPC_NT_NO_INTERFACES" },
  1089. { 0xC0020050, "RPC_NT_CALL_CANCELLED" },
  1090. { 0xC0020051, "RPC_NT_BINDING_INCOMPLETE" },
  1091. { 0xC0020052, "RPC_NT_COMM_FAILURE" },
  1092. { 0xC0020053, "RPC_NT_UNSUPPORTED_AUTHN_LEVEL" },
  1093. { 0xC0020054, "RPC_NT_NO_PRINC_NAME" },
  1094. { 0xC0020055, "RPC_NT_NOT_RPC_ERROR" },
  1095. { 0x40020056, "RPC_NT_UUID_LOCAL_ONLY" },
  1096. { 0xC0020057, "RPC_NT_SEC_PKG_ERROR" },
  1097. { 0xC0020058, "RPC_NT_NOT_CANCELLED" },
  1098. { 0xC0030059, "RPC_NT_INVALID_ES_ACTION" },
  1099. { 0xC003005A, "RPC_NT_WRONG_ES_VERSION" },
  1100. { 0xC003005B, "RPC_NT_WRONG_STUB_VERSION" },
  1101. { 0xC003005C, "RPC_NT_INVALID_PIPE_OBJECT" },
  1102. { 0xC003005D, "RPC_NT_INVALID_PIPE_OPERATION" },
  1103. { 0xC003005E, "RPC_NT_WRONG_PIPE_VERSION" },
  1104. { 0x400200AF, "RPC_NT_SEND_INCOMPLETE" },
  1105. { 0, NULL }
  1106. };
  1107. /* These are the MS country codes from
  1108. http://www.unicode.org/unicode/onlinedat/countries.html
  1109. For countries that share the same number, I choose to use only the
  1110. name of the largest country. Apologies for this. If this offends you,
  1111. here is the table to change that.
  1112. This also includes the code of 0 for "Default", which isn't in
  1113. that list, but is in Microsoft's SDKs and the Cygnus "winnls.h"
  1114. header file. Presumably it means "don't override the setting
  1115. on the user's machine".
  1116. Future versions of Microsoft's "winnls.h" header file might include
  1117. additional codes; the current version matches the Unicode Consortium's
  1118. table.
  1119. */
  1120. const value_string ms_country_codes[] = {
  1121. { 0, "Default"},
  1122. { 1, "USA"},
  1123. { 2, "Canada"},
  1124. { 7, "Russia"},
  1125. { 20, "Egypt"},
  1126. { 27, "South Africa"},
  1127. { 30, "Greece"},
  1128. { 31, "Netherlands"},
  1129. { 32, "Belgium"},
  1130. { 33, "France"},
  1131. { 34, "Spain"},
  1132. { 36, "Hungary"},
  1133. { 39, "Italy"},
  1134. { 40, "Romania"},
  1135. { 41, "Switzerland"},
  1136. { 43, "Austria"},
  1137. { 44, "United Kingdom"},
  1138. { 45, "Denmark"},
  1139. { 46, "Sweden"},
  1140. { 47, "Norway"},
  1141. { 48, "Poland"},
  1142. { 49, "Germany"},
  1143. { 51, "Peru"},
  1144. { 52, "Mexico"},
  1145. { 54, "Argentina"},
  1146. { 55, "Brazil"},
  1147. { 56, "Chile"},
  1148. { 57, "Colombia"},
  1149. { 58, "Venezuela"},
  1150. { 60, "Malaysia"},
  1151. { 61, "Australia"},
  1152. { 62, "Indonesia"},
  1153. { 63, "Philippines"},
  1154. { 64, "New Zealand"},
  1155. { 65, "Singapore"},
  1156. { 66, "Thailand"},
  1157. { 81, "Japan"},
  1158. { 82, "South Korea"},
  1159. { 84, "Viet Nam"},
  1160. { 86, "China"},
  1161. { 90, "Turkey"},
  1162. { 91, "India"},
  1163. { 92, "Pakistan"},
  1164. {212, "Morocco"},
  1165. {213, "Algeria"},
  1166. {216, "Tunisia"},
  1167. {218, "Libya"},
  1168. {254, "Kenya"},
  1169. {263, "Zimbabwe"},
  1170. {298, "Faroe Islands"},
  1171. {351, "Portugal"},
  1172. {352, "Luxembourg"},
  1173. {353, "Ireland"},
  1174. {354, "Iceland"},
  1175. {355, "Albania"},
  1176. {358, "Finland"},
  1177. {359, "Bulgaria"},
  1178. {370, "Lithuania"},
  1179. {371, "Latvia"},
  1180. {372, "Estonia"},
  1181. {374, "Armenia"},
  1182. {375, "Belarus"},
  1183. {380, "Ukraine"},
  1184. {381, "Serbia"},
  1185. {385, "Croatia"},
  1186. {386, "Slovenia"},
  1187. {389, "Macedonia"},
  1188. {420, "Czech Republic"},
  1189. {421, "Slovak Republic"},
  1190. {501, "Belize"},
  1191. {502, "Guatemala"},
  1192. {503, "El Salvador"},
  1193. {504, "Honduras"},
  1194. {505, "Nicaragua"},
  1195. {506, "Costa Rica"},
  1196. {507, "Panama"},
  1197. {591, "Bolivia"},
  1198. {593, "Ecuador"},
  1199. {595, "Paraguay"},
  1200. {598, "Uruguay"},
  1201. {673, "Brunei Darussalam"},
  1202. {852, "Hong Kong"},
  1203. {853, "Macau"},
  1204. {886, "Taiwan"},
  1205. {960, "Maldives"},
  1206. {961, "Lebanon"},
  1207. {962, "Jordan"},
  1208. {963, "Syria"},
  1209. {964, "Iraq"},
  1210. {965, "Kuwait"},
  1211. {966, "Saudi Arabia"},
  1212. {967, "Yemen"},
  1213. {968, "Oman"},
  1214. {971, "United Arab Emirates"},
  1215. {972, "Israel"},
  1216. {973, "Bahrain"},
  1217. {974, "Qatar"},
  1218. {976, "Mongolia"},
  1219. {981, "Iran"},
  1220. {994, "Azerbaijan"},
  1221. {995, "Georgia"},
  1222. {996, "Kyrgyzstan"},
  1223. {0, NULL}
  1224. };
  1225. /*module_t* module;*/
  1226. /*pref_t* sid_display_hex;*/
  1227. #ifndef TIME_T_MIN
  1228. #define TIME_T_MIN ((time_t) ((time_t)0 < (time_t) -1 ? (time_t) 0 \
  1229. : ~ (time_t) 0 << (sizeof (time_t) * CHAR_BIT - 1)))
  1230. #endif
  1231. #ifndef TIME_T_MAX
  1232. #define TIME_T_MAX ((time_t) (~ (time_t) 0 - TIME_T_MIN))
  1233. #endif
  1234. /*
  1235. * Number of seconds between the UN*X epoch (January 1, 1970, 00:00:00 GMT)
  1236. * and the Windows NT epoch (January 1, 1601, 00:00:00 "GMT").
  1237. */
  1238. #define TIME_FIXUP_CONSTANT G_GINT64_CONSTANT(11644473600U)
  1239. /*
  1240. * Translate an 8-byte FILETIME value, given as the upper and lower 32 bits,
  1241. * to an "nstime_t".
  1242. * A FILETIME is a 64-bit integer, giving the time since Jan 1, 1601,
  1243. * midnight "UTC", in 100ns units.
  1244. * Return TRUE if the conversion succeeds, FALSE otherwise.
  1245. *
  1246. * According to the Samba code, it appears to be kludge-GMT (at least for
  1247. * file listings). This means it's the GMT you get by taking a local time
  1248. * and adding the server time zone offset. This is NOT the same as GMT in
  1249. * some cases. However, we don't know the server time zone, so we don't
  1250. * do that adjustment.
  1251. *
  1252. * This code is based on the Samba code:
  1253. *
  1254. * Unix SMB/Netbios implementation.
  1255. * Version 1.9.
  1256. * time handling functions
  1257. * Copyright (C) Andrew Tridgell 1992-1998
  1258. */
  1259. static gboolean
  1260. nt_time_to_nstime(guint32 filetime_high, guint32 filetime_low, nstime_t *tv)
  1261. {
  1262. guint64 d;
  1263. gint64 secs;
  1264. int nsecs;
  1265. /* The next two lines are a fix needed for the
  1266. broken SCO compiler. JRA. */
  1267. time_t l_time_min = TIME_T_MIN;
  1268. time_t l_time_max = TIME_T_MAX;
  1269. if (filetime_high == 0)
  1270. return FALSE;
  1271. d = ((guint64)filetime_high << 32) | filetime_low;
  1272. /* Split into seconds and nanoseconds. */
  1273. secs = d / 10000000;
  1274. nsecs = (int)((d % 10000000)*100);
  1275. /* Now adjust the seconds. */
  1276. secs -= TIME_FIXUP_CONSTANT;
  1277. if (!(l_time_min <= secs && secs <= l_time_max))
  1278. return FALSE;
  1279. /*
  1280. * Get the time as seconds and nanoseconds.
  1281. */
  1282. tv->secs = (time_t) secs;
  1283. tv->nsecs = nsecs;
  1284. return TRUE;
  1285. }
  1286. int
  1287. dissect_nt_64bit_time(tvbuff_t *tvb, proto_tree *tree, int offset, int hf_date)
  1288. {
  1289. guint32 filetime_high, filetime_low;
  1290. nstime_t ts;
  1291. /* XXX there seems also to be another special time value which is fairly common :
  1292. 0x40000000 00000000
  1293. the meaning of this one is yet unknown
  1294. */
  1295. if (tree) {
  1296. filetime_low = tvb_get_letohl(tvb, offset);
  1297. filetime_high = tvb_get_letohl(tvb, offset + 4);
  1298. if (filetime_low == 0 && filetime_high == 0) {
  1299. proto_tree_add_text(tree, tvb, offset, 8,
  1300. "%s: No time specified (0)",
  1301. proto_registrar_get_name(hf_date));
  1302. } else if(filetime_low==0 && filetime_high==0x80000000){
  1303. proto_tree_add_text(tree, tvb, offset, 8,
  1304. "%s: Infinity (relative time)",
  1305. proto_registrar_get_name(hf_date));
  1306. } else if(filetime_low==0xffffffff && filetime_high==0x7fffffff){
  1307. proto_tree_add_text(tree, tvb, offset, 8,
  1308. "%s: Infinity (absolute time)",
  1309. proto_registrar_get_name(hf_date));
  1310. } else {
  1311. if (nt_time_to_nstime(filetime_high, filetime_low, &ts)) {
  1312. proto_tree_add_time(tree, hf_date, tvb,
  1313. offset, 8, &ts);
  1314. } else {
  1315. proto_tree_add_text(tree, tvb, offset, 8,
  1316. "%s: Time can't be converted",
  1317. proto_registrar_get_name(hf_date));
  1318. }
  1319. }
  1320. }
  1321. offset += 8;
  1322. return offset;
  1323. }
  1324. /* Well-known SIDs defined in http://support.microsoft.com/kb/243330 */
  1325. static const sid_strings well_known_sids[] = {
  1326. {"S-1-0", "Null Authority"},
  1327. {"S-1-0-0", "Nobody"},
  1328. {"S-1-1", "World Authority"},
  1329. {"S-1-1-0", "Everyone"},
  1330. {"S-1-2", "Local Authority"},
  1331. {"S-1-2-0", "Local"},
  1332. {"S-1-2-1", "Console Logon"},
  1333. {"S-1-3", "Creator Authority"},
  1334. {"S-1-3-0", "Creator Owner"},
  1335. {"S-1-3-1", "Creator Group"},
  1336. {"S-1-3-2", "Creator Owner Server"},
  1337. {"S-1-3-3", "Creator Group Server"},
  1338. {"S-1-3-4", "Owner Rights"},
  1339. {"S-1-4", "Non-unique Authority"},
  1340. {"S-1-5-1", "Dialup"},
  1341. {"S-1-5-2", "Network"},
  1342. {"S-1-5-3", "Batch"},
  1343. {"S-1-5-4", "Interactive"},
  1344. {"S-1-5-5", "Logon Session"}, /* S-1-5-5-X-Y has 6 fields */
  1345. {"S-1-5-6", "Service"},
  1346. {"S-1-5-7", "Anonymous"},
  1347. {"S-1-5-8", "Proxy"},
  1348. {"S-1-5-9", "Enterprise Domain Controllers"},
  1349. {"S-1-5-10", "Principal Self"},
  1350. {"S-1-5-11", "Authenticated Users"},
  1351. {"S-1-5-12", "Reserved"},
  1352. {"S-1-5-13", "Terminal Server Users"},
  1353. {"S-1-5-14", "Remote Interactive Logon"},
  1354. {"S-1-5-15", "All users in this organization"},
  1355. {"S-1-5-17", "Default IIS user account"},
  1356. {"S-1-5-18", "Local System"},
  1357. {"S-1-5-19", "Local Service"},
  1358. {"S-1-5-20", "Network Service"},
  1359. /*
  1360. * S-1-5-21-<d1>-<d2>-<d3>-<RID> where "<d1>-<d2>-<d3>" is the NT domain
  1361. * RIDs are defined in 'wkwn_S_1_5_21_rids' */
  1362. {"S-1-5-21", "Domain SID"},
  1363. /* S-1-5-32-<RID>: Builtin local group SIDs */
  1364. {"S-1-5-32", "Local Group"},
  1365. {"S-1-5-32-544", "Administrators"},
  1366. {"S-1-5-32-545", "Users"},
  1367. {"S-1-5-32-546", "Guests"},
  1368. {"S-1-5-32-547", "Power Users"},
  1369. {"S-1-5-32-548", "Account Operators"},
  1370. {"S-1-5-32-549", "Server Operators"},
  1371. {"S-1-5-32-550", "Print Operators"},
  1372. {"S-1-5-32-551", "Backup Operators"},
  1373. {"S-1-5-32-552", "Replicators"},
  1374. {"S-1-5-32-554", "Pre-Windows 2000 Compatible Access"},
  1375. {"S-1-5-32-555", "Remote Desktop Users"},
  1376. {"S-1-5-32-556", "Network Configuration Operators"},
  1377. {"S-1-5-32-557", "Incoming Forest Trust Builders"},
  1378. {"S-1-5-32-558", "Performance Monitor Users"},
  1379. {"S-1-5-32-559", "Performance Log Users"},
  1380. {"S-1-5-32-560", "Windows Authorization Access Group"},
  1381. {"S-1-5-32-561", "Terminal Server License Servers"},
  1382. {"S-1-5-32-562", "Distributed COM Users"},
  1383. {"S-1-5-32-569", "Cryptographic Operators"},
  1384. {"S-1-5-32-573", "Event Log Readers"},
  1385. {"S-1-5-32-574", "Certificate Service DCOM Access"},
  1386. {"S-1-5-64", "Authentication"},
  1387. {"S-1-5-64-10", "NTLM"},
  1388. {"S-1-5-64-14", "SChannel"},
  1389. {"S-1-5-64-21", "Digest"},
  1390. {"S-1-5-80", "NT Service"},
  1391. {"S-1-16", "Mandatory Level"},
  1392. {"S-1-16-0", "Untrusted"},
  1393. {"S-1-16-4096", "Low"},
  1394. {"S-1-16-8192", "Medium"},
  1395. {"S-1-16-8448", "Medium Plus"},
  1396. {"S-1-16-12288", "High"},
  1397. {"S-1-16-16384", "System"},
  1398. {"S-1-16-20480", "Protected Process"},
  1399. {"S-1-16-28672", "Secure Process"},
  1400. {NULL, NULL}
  1401. };
  1402. static const char*
  1403. match_wkwn_sids(const char* sid) {
  1404. int i = 0;
  1405. while (well_known_sids[i].name) {
  1406. if (strcmp(well_known_sids[i].sid, sid)==0) {
  1407. return(well_known_sids[i].name);
  1408. }
  1409. i++;
  1410. }
  1411. return NULL;
  1412. }
  1413. /* For SIDs in the form 'S-1-5-21-X-Y-Z-<RID>', '21-X-Y-Z' is referred to
  1414. as the "domain SID" (NT domain) or "machine SID" (local machine).
  1415. The following are well-known RIDs which are appended to domain/machine SIDs
  1416. as defined in http://support.microsoft.com/kb/243330. */
  1417. static const value_string wkwn_S_1_5_21_rids[] = {
  1418. {498, "Enterprise Read-only Domain Controllers"},
  1419. {500, "Administrator"},
  1420. {501, "Guest"},
  1421. {502, "KRBTGT"},
  1422. {512, "Domain Admins"},
  1423. {513, "Domain Users"},
  1424. {514, "Domain Guests"},
  1425. {515, "Domain Computers"},
  1426. {516, "Domain Controllers"},
  1427. {517, "Cert Publishers"},
  1428. {518, "Schema Administrators"},
  1429. {519, "Enterprise Admins"},
  1430. {520, "Group Policy Creator Owners"},
  1431. {521, "Read-only Domain Controllers"},
  1432. {553, "RAS and IAS Servers"},
  1433. {571, "Allowed RODC Password Replication Group"},
  1434. {572, "Denied RODC Password Replication Group"},
  1435. {0, NULL}
  1436. };
  1437. /* Dissect an NT SID. Label it with 'name' and return a string version
  1438. * of the SID in the 'sid_str' parameter which has a packet lifetime
  1439. * scope and should NOT be freed by the caller. hf_sid can be -1 if
  1440. * the caller doesnt care what name is used and then "nt.sid" will be
  1441. * the default instead. If the caller wants a more appropriate hf
  1442. * field, it will just pass a FT_STRING hf field here
  1443. */
  1444. int
  1445. dissect_nt_sid(tvbuff_t *tvb, int offset, proto_tree *parent_tree,
  1446. const char *name, char **sid_str, int hf_sid)
  1447. {
  1448. int offset_sid_start = offset, sa_offset, rid_offset=0, wkwn_sid1_len=0,
  1449. wkwn_sid2_len = 0, i;
  1450. guint8 revision, num_auth;
  1451. guint32 sa_field, rid=0;
  1452. guint64 authority=0;
  1453. emem_strbuf_t *sa_str = NULL, *sid_in_dec_str = NULL, *sid_in_hex_str = NULL, *label_str = NULL,
  1454. *domain_str = NULL, *wkwn_sid1_str = NULL, *wkwn_sid2_str = NULL;
  1455. const char *mapped_name = NULL, *mapped_rid = NULL;
  1456. gboolean domain_sid = FALSE, s_1_5_32 = FALSE, s_1_5_64 = FALSE, locally_defined = FALSE,
  1457. S_1_16 = FALSE;
  1458. proto_item *item = NULL, *hidden_item;
  1459. proto_tree *subtree = NULL;
  1460. /* Revision of SID */
  1461. revision = tvb_get_guint8(tvb, offset);
  1462. offset++;
  1463. /* Number of subauthority fields */
  1464. num_auth = tvb_get_guint8(tvb, offset);
  1465. offset++;
  1466. if(sid_str)
  1467. *sid_str=NULL;
  1468. if(hf_sid==-1){
  1469. /* if no tree, just return the offset of the end_of_SID+1 */
  1470. if (!parent_tree)
  1471. return(offset+(6+(num_auth*4)));
  1472. hf_sid=hf_nt_sid;
  1473. }
  1474. /* Identifier Authority */
  1475. for(i=0; i<6; i++){
  1476. authority = (authority << 8) + tvb_get_guint8(tvb, offset);
  1477. offset++;
  1478. }
  1479. sid_in_dec_str = ep_strbuf_new_label("");
  1480. ep_strbuf_append_printf (sid_in_dec_str, "S-%u-%" G_GINT64_MODIFIER "u", revision, authority);
  1481. /* If sid_display_hex is set, sid_in_dec_str is still needed for
  1482. looking up well-known SIDs*/
  1483. if (sid_display_hex) {
  1484. sid_in_hex_str = ep_strbuf_new_label("");
  1485. ep_strbuf_append_printf (sid_in_hex_str, "S-%x-%" G_GINT64_MODIFIER "x", revision, authority);
  1486. }
  1487. wkwn_sid1_str = ep_strbuf_new_label("");
  1488. label_str = ep_strbuf_new_label("");
  1489. if (strcmp(sid_in_dec_str->str, "S-1-16")==0)
  1490. S_1_16 = TRUE;
  1491. /* Look for well-known SIDs in format 'S-1-<Identifier Authority>' (i.e., exactly 3 fields) */
  1492. if (num_auth==0 || S_1_16) {
  1493. mapped_name = match_wkwn_sids(sid_in_dec_str->str);
  1494. if (mapped_name) {
  1495. ep_strbuf_append_printf(label_str, "%s", mapped_name);
  1496. ep_strbuf_append_printf(wkwn_sid1_str, "%s",
  1497. (sid_display_hex ? sid_in_hex_str->str : sid_in_dec_str->str));
  1498. wkwn_sid1_len = 8;
  1499. }
  1500. }
  1501. sa_offset = offset;
  1502. sa_str = ep_strbuf_new_label("");
  1503. wkwn_sid2_str = ep_strbuf_new_label("");
  1504. domain_str = ep_strbuf_new_label("");
  1505. /* Build the sub-authorities and full SID strings */
  1506. for(i=1; i<num_auth+1; i++) {
  1507. /*
  1508. * XXX should not be letohl but native byteorder according to
  1509. * Samba header files.
  1510. *
  1511. * However, considering that there were never any NT ports
  1512. * to big-endian platforms (PowerPC and MIPS ran little-endian,
  1513. * and IA-64 runs little-endian, as does x86-64), we can (?)
  1514. * assume that non le byte encodings will be "uncommon"?
  1515. */
  1516. sa_field = tvb_get_letohl(tvb, offset);
  1517. ep_strbuf_append_printf(sid_in_dec_str, "-%u", sa_field);
  1518. ep_strbuf_append_printf(sa_str,
  1519. (i==1 ? (sid_display_hex ? "%x" : "%u") : (sid_display_hex ? "-%x" : "-%u")),
  1520. sa_field);
  1521. if (sid_display_hex)
  1522. ep_strbuf_append_printf(sid_in_hex_str, "-%x", sa_field);
  1523. if (i==1) {
  1524. /* Look for well-known SIDs at level one ("S-1-<authority>-<value>") */
  1525. if (S_1_16) {
  1526. /* Mandatory Level (S-1-16) */
  1527. mapped_rid = match_wkwn_sids(sid_in_dec_str->str);
  1528. if (mapped_rid) {
  1529. /* Get the RID */
  1530. ep_strbuf_append_printf(label_str, "%s-%s", mapped_name, mapped_rid);
  1531. rid = sa_field;
  1532. rid_offset = offset;
  1533. ep_strbuf_append_printf(wkwn_sid2_str, "%s",
  1534. (sid_display_hex ? sid_in_hex_str->str : sid_in_dec_str->str));
  1535. wkwn_sid1_len=12; }
  1536. } else {
  1537. mapped_name = match_wkwn_sids(sid_in_dec_str->str);
  1538. if (mapped_name) {
  1539. ep_strbuf_append_printf(label_str, "%s", mapped_name);
  1540. ep_strbuf_append_printf(wkwn_sid1_str, "%s",
  1541. (sid_display_hex ? sid_in_hex_str->str : sid_in_dec_str->str));
  1542. wkwn_sid1_len = 12;
  1543. }
  1544. /* The following three SID types have (unique) RIDs */
  1545. if (strcmp(sid_in_dec_str->str, "S-1-5-21")==0) {
  1546. /* Domain SID */
  1547. domain_sid = TRUE;
  1548. } else if (strcmp(sid_in_dec_str->str, "S-1-5-32")==0) {
  1549. /* Local Group (S-1-5-32) SID */
  1550. s_1_5_32 = TRUE;
  1551. } else if (strcmp(sid_in_dec_str->str, "S-1-5-64")==0) {
  1552. /* Authentication (S-1-5-64) SID */
  1553. s_1_5_64 = TRUE;
  1554. }
  1555. }
  1556. } else if (i==2 && !domain_sid) {
  1557. /* The only well-known SIDS with two subauthority fields ("level 2 SIDs") are
  1558. Local Group (S-1-5-32), and Authentication (S-1-5-64). */
  1559. if (s_1_5_32 || s_1_5_64) {
  1560. mapped_rid = match_wkwn_sids(sid_in_dec_str->str);
  1561. if (mapped_rid) {
  1562. /* Get the RID */
  1563. ep_strbuf_append_printf(label_str, "-%s", mapped_rid);
  1564. rid = sa_field;
  1565. rid_offset = offset;
  1566. ep_strbuf_append_printf(wkwn_sid2_str, "%s",
  1567. (sid_display_hex ? sid_in_hex_str->str : sid_in_dec_str->str));
  1568. wkwn_sid2_len=16;
  1569. } else {
  1570. /* The RID not well-known. */
  1571. locally_defined = TRUE;
  1572. }
  1573. } else {
  1574. if (mapped_name) {
  1575. /* A level 1 well-known SID appended with locally defined value */
  1576. locally_defined = TRUE;
  1577. }
  1578. }
  1579. } else {
  1580. /* 3 or more sub-auth fields - NOTE: Except for domain SIDs, there are no wkwn SIDs with 3 or more
  1581. sub-auth fields so we don't lookup SIDs here. Logon Session SIDs have 3 sub-auth fields but the
  1582. last two are locally defined. */
  1583. if (domain_sid) {
  1584. if (num_auth >= 4) {
  1585. if (i >= 2 && i <=4 ) {
  1586. /* Add the field to the domain string (d1-d2-d3) */
  1587. ep_strbuf_append_printf(domain_str,
  1588. (i==2 ? (sid_display_hex ? "%x" : "%u") : (sid_display_hex ? "-%x" : "-%u")), sa_field);
  1589. } else if (i==5) {
  1590. rid = sa_field;
  1591. rid_offset = offset;
  1592. mapped_rid = val_to_str_const(rid, wkwn_S_1_5_21_rids, "Domain RID");
  1593. ep_strbuf_append_printf(label_str, "-%s", mapped_rid);
  1594. } else {
  1595. locally_defined = TRUE;
  1596. }
  1597. } else {
  1598. mapped_name = "Corrupt domain SID";
  1599. }
  1600. } else {
  1601. if (mapped_name) {
  1602. /* A locally defined value appended to a level 2 well-known SID*/
  1603. locally_defined = TRUE;
  1604. }
  1605. }
  1606. }
  1607. offset+=4;
  1608. } /* End of for loop */
  1609. if ( !(mapped_name || domain_sid || s_1_5_32 || s_1_5_64) ) {
  1610. /* If requested, try to map the NON-well-known SID to an object name discovered in this capture */
  1611. if (sid_name_snooping) {
  1612. mapped_name = find_sid_name(sid_in_dec_str->str);
  1613. } else {
  1614. mapped_name = "<Unknown SID type>";
  1615. }
  1616. }
  1617. if (locally_defined) {
  1618. ep_strbuf_append_printf(label_str, "-<locally defined>");
  1619. }
  1620. /* It's tree time
  1621. Display the full SID string in hex or dec */
  1622. item = proto_tree_add_string_format(
  1623. parent_tree, hf_sid, tvb, offset_sid_start, (offset - offset_sid_start),
  1624. (sid_display_hex ? sid_in_hex_str->str : sid_in_dec_str->str),
  1625. "%s: %s", name, (sid_display_hex ? sid_in_hex_str->str : sid_in_dec_str->str)
  1626. );
  1627. proto_item_append_text(item, " (%s)", label_str->str);
  1628. subtree = proto_item_add_subtree(item, ett_nt_sid);
  1629. /* Add revision, num_auth, and authority */
  1630. proto_tree_add_item(subtree, hf_nt_sid_revision, tvb, offset_sid_start, 1, ENC_LITTLE_ENDIAN);
  1631. proto_tree_add_item(subtree, hf_nt_sid_num_auth, tvb, offset_sid_start+1, 1, ENC_LITTLE_ENDIAN);
  1632. proto_tree_add_uint64_format_value(subtree,
  1633. (sid_display_hex ? hf_nt_sid_auth_hex : hf_nt_sid_auth_dec),
  1634. tvb, offset_sid_start+2, 6, authority, "%" G_GINT64_MODIFIER "u", authority);
  1635. /* Add subauthorities */
  1636. proto_tree_add_string_format (subtree, hf_nt_sid_subauth, tvb, sa_offset,
  1637. num_auth*4, sa_str->str, "Subauthorities: %s", sa_str->str);
  1638. if (rid) {
  1639. item = proto_tree_add_item (subtree,
  1640. (sid_display_hex ? hf_nt_sid_rid_hex : hf_nt_sid_rid_dec), tvb, rid_offset, 4, ENC_LITTLE_ENDIAN);
  1641. proto_item_append_text(item, " (%s)", mapped_rid);
  1642. }
  1643. /* Add well-known SID and domain strings if present */
  1644. if (*wkwn_sid1_str->str) {
  1645. hidden_item = proto_tree_add_string_format(
  1646. subtree, hf_nt_sid_wkwn, tvb, offset_sid_start, wkwn_sid1_len,
  1647. wkwn_sid1_str->str, "Well-known SID: %s", wkwn_sid1_str->str);
  1648. proto_item_append_text(hidden_item, " (%s)", mapped_name);
  1649. PROTO_ITEM_SET_HIDDEN(hidden_item);
  1650. }
  1651. if (*wkwn_sid2_str->str) {
  1652. hidden_item = proto_tree_add_string_format(
  1653. subtree, hf_nt_sid_wkwn, tvb, offset_sid_start, wkwn_sid2_len,
  1654. wkwn_sid2_str->str, "Well-known SID: %s", wkwn_sid2_str->str);
  1655. proto_item_append_text(hidden_item, " (%s)", label_str->str);
  1656. PROTO_ITEM_SET_HIDDEN(hidden_item);
  1657. }
  1658. if (domain_sid && *domain_str->str) {
  1659. hidden_item = proto_tree_add_string_format(
  1660. subtree, hf_nt_sid_domain, tvb, offset_sid_start + 12, 12,
  1661. domain_str->str, "Domain: %s", domain_str->str);
  1662. PROTO_ITEM_SET_HIDDEN(hidden_item);
  1663. }
  1664. /* If requested, return SID string with mapped name */
  1665. if(sid_str){
  1666. if(mapped_name){
  1667. *sid_str = ep_strdup_printf("%s (%s)",
  1668. (sid_display_hex ? sid_in_hex_str->str : sid_in_dec_str->str), label_str->str);
  1669. } else {
  1670. *sid_str = ep_strdup(sid_display_hex ? sid_in_hex_str->str : sid_in_dec_str->str);
  1671. }
  1672. if(!(*sid_str)){
  1673. *sid_str=ep_strdup("corrupted SID");
  1674. }
  1675. }
  1676. return offset;
  1677. }
  1678. /* Dissect an access mask. All this stuff is kind of explained at MSDN:
  1679. http://msdn.microsoft.com/library/default.asp?url=/library/en-us/security/security/windows_2000_windows_nt_access_mask_format.asp
  1680. */
  1681. static gint ett_nt_access_mask = -1;
  1682. static gint ett_nt_access_mask_generic = -1;
  1683. static gint ett_nt_access_mask_standard = -1;
  1684. static gint ett_nt_access_mask_specific = -1;
  1685. static int hf_access_sacl = -1;
  1686. static int hf_access_maximum_allowed = -1;
  1687. static int hf_access_generic_read = -1;
  1688. static int hf_access_generic_write = -1;
  1689. static int hf_access_generic_execute = -1;
  1690. static int hf_access_generic_all = -1;
  1691. static int hf_access_standard_delete = -1;
  1692. static int hf_access_standard_read_control = -1;
  1693. static int hf_access_standard_synchronise = -1;
  1694. static int hf_access_standard_write_dac = -1;
  1695. static int hf_access_standard_write_owner = -1;
  1696. static int hf_access_specific_15 = -1;
  1697. static int hf_access_specific_14 = -1;
  1698. static int hf_access_specific_13 = -1;
  1699. static int hf_access_specific_12 = -1;
  1700. static int hf_access_specific_11 = -1;
  1701. static int hf_access_specific_10 = -1;
  1702. static int hf_access_specific_9 = -1;
  1703. static int hf_access_specific_8 = -1;
  1704. static int hf_access_specific_7 = -1;
  1705. static int hf_access_specific_6 = -1;
  1706. static int hf_access_specific_5 = -1;
  1707. static int hf_access_specific_4 = -1;
  1708. static int hf_access_specific_3 = -1;
  1709. static int hf_access_specific_2 = -1;
  1710. static int hf_access_specific_1 = -1;
  1711. static int hf_access_specific_0 = -1;
  1712. /* Map generic permissions to specific permissions */
  1713. static void map_generic_access(guint32 *access_mask,
  1714. struct generic_mapping *mapping)
  1715. {
  1716. if (*access_mask & GENERIC_READ_ACCESS) {
  1717. *access_mask &= ~GENERIC_READ_ACCESS;
  1718. *access_mask |= mapping->generic_read;
  1719. }
  1720. if (*access_mask & GENERIC_WRITE_ACCESS) {
  1721. *access_mask &= ~GENERIC_WRITE_ACCESS;
  1722. *access_mask |= mapping->generic_write;
  1723. }
  1724. if (*access_mask & GENERIC_EXECUTE_ACCESS) {
  1725. *access_mask &= ~GENERIC_EXECUTE_ACCESS;
  1726. *access_mask |= mapping->generic_execute;
  1727. }
  1728. if (*access_mask & GENERIC_ALL_ACCESS) {
  1729. *access_mask &= ~GENERIC_ALL_ACCESS;
  1730. *access_mask |= mapping->generic_all;
  1731. }
  1732. }
  1733. /* Map standard permissions to specific permissions */
  1734. static void map_standard_access(guint32 *access_mask,
  1735. struct standard_mapping *mapping)
  1736. {
  1737. if (*access_mask & READ_CONTROL_ACCESS) {
  1738. *access_mask &= ~READ_CONTROL_ACCESS;
  1739. *access_mask |= mapping->std_read;
  1740. }
  1741. if (*access_mask & (DELETE_ACCESS|WRITE_DAC_ACCESS|WRITE_OWNER_ACCESS|
  1742. SYNCHRONIZE_ACCESS)) {
  1743. *access_mask &= ~(DELETE_ACCESS|WRITE_DAC_ACCESS|
  1744. WRITE_OWNER_ACCESS|SYNCHRONIZE_ACCESS);
  1745. *access_mask |= mapping->std_all;
  1746. }
  1747. }
  1748. int
  1749. dissect_nt_access_mask(tvbuff_t *tvb, gint offset, packet_info *pinfo,
  1750. proto_tree *tree, guint8 *drep, int hfindex,
  1751. struct access_mask_info *ami, guint32 *perms)
  1752. {
  1753. proto_item *item;
  1754. proto_tree *subtree, *generic_tree, *standard_tree, *specific_tree;
  1755. guint32 access;
  1756. if (drep != NULL) {
  1757. /*
  1758. * Called from a DCE RPC protocol dissector, for a
  1759. * protocol where a 32-bit NDR integer contains
  1760. * an NT access mask; extract the access mask
  1761. * with an NDR call.
  1762. */
  1763. offset = dissect_ndr_uint32(tvb, offset, pinfo, NULL, drep,
  1764. hfindex, &access);
  1765. } else {
  1766. /*
  1767. * Called from SMB, where the access mask is just a
  1768. * 4-byte little-endian quantity with no special
  1769. * NDR alignment requirement; extract it with
  1770. * "tvb_get_letohl()".
  1771. */
  1772. access = tvb_get_letohl(tvb, offset);
  1773. offset += 4;
  1774. }
  1775. if (perms) {
  1776. *perms = access;
  1777. }
  1778. item = proto_tree_add_uint(tree, hfindex, tvb, offset - 4, 4, access);
  1779. subtree = proto_item_add_subtree(item, ett_nt_access_mask);
  1780. /* Generic access rights */
  1781. item = proto_tree_add_text(subtree, tvb, offset - 4, 4,
  1782. "Generic rights: 0x%08x",
  1783. access & GENERIC_RIGHTS_MASK);
  1784. generic_tree = proto_item_add_subtree(
  1785. item, ett_nt_access_mask_generic);
  1786. proto_tree_add_boolean(
  1787. generic_tree, hf_access_generic_read, tvb, offset - 4, 4,
  1788. access);
  1789. proto_tree_add_boolean(
  1790. generic_tree, hf_access_generic_write, tvb, offset - 4, 4,
  1791. access);
  1792. proto_tree_add_boolean(
  1793. generic_tree, hf_access_generic_execute, tvb, offset - 4, 4,
  1794. access);
  1795. proto_tree_add_boolean(
  1796. generic_tree, hf_access_generic_all, tvb, offset - 4, 4,
  1797. access);
  1798. /* Reserved (??) */
  1799. proto_tree_add_boolean(
  1800. subtree, hf_access_maximum_allowed, tvb, offset - 4, 4,
  1801. access);
  1802. /* Access system security */
  1803. proto_tree_add_boolean(
  1804. subtree, hf_access_sacl, tvb, offset - 4, 4,
  1805. access);
  1806. /* Standard access rights */
  1807. item = proto_tree_add_text(subtree, tvb, offset - 4, 4,
  1808. "Standard rights: 0x%08x",
  1809. access & STANDARD_RIGHTS_MASK);
  1810. standard_tree = proto_item_add_subtree(
  1811. item, ett_nt_access_mask_standard);
  1812. proto_tree_add_boolean(
  1813. standard_tree, hf_access_standard_synchronise, tvb,
  1814. offset - 4, 4, access);
  1815. proto_tree_add_boolean(
  1816. standard_tree, hf_access_standard_write_owner, tvb,
  1817. offset - 4, 4, access);
  1818. proto_tree_add_boolean(
  1819. standard_tree, hf_access_standard_write_dac, tvb,
  1820. offset - 4, 4, access);
  1821. proto_tree_add_boolean(
  1822. standard_tree, hf_access_standard_read_control, tvb,
  1823. offset - 4, 4, access);
  1824. proto_tree_add_boolean(
  1825. standard_tree, hf_access_standard_delete, tvb, offset - 4, 4,
  1826. access);
  1827. /* Specific access rights. Call the specific_rights_fn
  1828. pointer if we have one, otherwise just display bits 0-15 in
  1829. boring fashion. */
  1830. if (ami && ami->specific_rights_name)
  1831. item = proto_tree_add_text(subtree, tvb, offset - 4, 4,
  1832. "%s specific rights: 0x%08x",
  1833. ami->specific_rights_name,
  1834. access & SPECIFIC_RIGHTS_MASK);
  1835. else
  1836. item = proto_tree_add_text(subtree, tvb, offset - 4, 4,
  1837. "Specific rights: 0x%08x",
  1838. access & SPECIFIC_RIGHTS_MASK);
  1839. specific_tree = proto_item_add_subtree(
  1840. item, ett_nt_access_mask_specific);
  1841. if (ami && ami->specific_rights_fn) {
  1842. guint32 mapped_access = access;
  1843. proto_tree *specific_mapped;
  1844. specific_mapped = proto_item_add_subtree(
  1845. item, ett_nt_access_mask_specific);
  1846. ami->specific_rights_fn(
  1847. tvb, offset - 4, specific_tree, access);
  1848. if (ami->generic_mapping)
  1849. map_generic_access(&access, ami->generic_mapping);
  1850. if (ami->standard_mapping)
  1851. map_standard_access(&access, ami->standard_mapping);
  1852. if (access != mapped_access) {
  1853. ami->specific_rights_fn(
  1854. tvb, offset - 4, specific_mapped,
  1855. mapped_access);
  1856. }
  1857. return offset;
  1858. }
  1859. proto_tree_add_boolean(
  1860. specific_tree, hf_access_specific_15, tvb, offset - 4, 4,
  1861. access);
  1862. proto_tree_add_boolean(
  1863. specific_tree, hf_access_specific_14, tvb, offset - 4, 4,
  1864. access);
  1865. proto_tree_add_boolean(
  1866. specific_tree, hf_access_specific_13, tvb, offset - 4, 4,
  1867. access);
  1868. proto_tree_add_boolean(
  1869. specific_tree, hf_access_specific_12, tvb, offset - 4, 4,
  1870. access);
  1871. proto_tree_add_boolean(
  1872. specific_tree, hf_access_specific_11, tvb, offset - 4, 4,
  1873. access);
  1874. proto_tree_add_boolean(
  1875. specific_tree, hf_access_specific_10, tvb, offset - 4, 4,
  1876. access);
  1877. proto_tree_add_boolean(
  1878. specific_tree, hf_access_specific_9, tvb, offset - 4, 4,
  1879. access);
  1880. proto_tree_add_boolean(
  1881. specific_tree, hf_access_specific_8, tvb, offset - 4, 4,
  1882. access);
  1883. proto_tree_add_boolean(
  1884. specific_tree, hf_access_specific_7, tvb, offset - 4, 4,
  1885. access);
  1886. proto_tree_add_boolean(
  1887. specific_tree, hf_access_specific_6, tvb, offset - 4, 4,
  1888. access);
  1889. proto_tree_add_boolean(
  1890. specific_tree, hf_access_specific_5, tvb, offset - 4, 4,
  1891. access);
  1892. proto_tree_add_boolean(
  1893. specific_tree, hf_access_specific_4, tvb, offset - 4, 4,
  1894. access);
  1895. proto_tree_add_boolean(
  1896. specific_tree, hf_access_specific_3, tvb, offset - 4, 4,
  1897. access);
  1898. proto_tree_add_boolean(
  1899. specific_tree, hf_access_specific_2, tvb, offset - 4, 4,
  1900. access);
  1901. proto_tree_add_boolean(
  1902. specific_tree, hf_access_specific_1, tvb, offset - 4, 4,
  1903. access);
  1904. proto_tree_add_boolean(
  1905. specific_tree, hf_access_specific_0, tvb, offset - 4, 4,
  1906. access);
  1907. return offset;
  1908. }
  1909. static int hf_nt_access_mask = -1;
  1910. #define ACL_REVISION_NT4 2
  1911. #define ACL_REVISION_ADS 4
  1912. static const value_string acl_revision_vals[] = {
  1913. { ACL_REVISION_NT4, "NT4"},
  1914. { ACL_REVISION_ADS, "AD"},
  1915. {0,NULL}
  1916. };
  1917. #define ACE_TYPE_ACCESS_ALLOWED 0
  1918. #define ACE_TYPE_ACCESS_DENIED 1
  1919. #define ACE_TYPE_SYSTEM_AUDIT 2
  1920. #define ACE_TYPE_SYSTEM_ALARM 3
  1921. #define ACE_TYPE_ALLOWED_COMPOUND 4
  1922. #define ACE_TYPE_ACCESS_ALLOWED_OBJECT 5
  1923. #define ACE_TYPE_ACCESS_DENIED_OBJECT 6
  1924. #define ACE_TYPE_SYSTEM_AUDIT_OBJECT 7
  1925. #define ACE_TYPE_SYSTEM_ALARM_OBJECT 8
  1926. #define ACE_TYPE_ACCESS_ALLOWED_CALLBACK 9
  1927. #define ACE_TYPE_ACCESS_DENIED_CALLBACK 10
  1928. #define ACE_TYPE_ACCESS_ALLOWED_CALLBACK_OBJECT 11
  1929. #define ACE_TYPE_ACCESS_DENIED_CALLBACK_OBJECT 12
  1930. #define ACE_TYPE_SYSTEM_AUDIT_CALLBACK 13
  1931. #define ACE_TYPE_SYSTEM_ALARM_CALLBACK 14
  1932. #define ACE_TYPE_SYSTEM_AUDIT_CALLBACK_OBJECT 15
  1933. #define ACE_TYPE_SYSTEM_ALARM_CALLBACK_OBJECT 16
  1934. #define ACE_TYPE_SYSTEM_MANDATORY_LABEL 17
  1935. static const value_string ace_type_vals[] = {
  1936. { ACE_TYPE_ACCESS_ALLOWED, "Access Allowed"},
  1937. { ACE_TYPE_ACCESS_DENIED, "Access Denied"},
  1938. { ACE_TYPE_SYSTEM_AUDIT, "System Audit"},
  1939. { ACE_TYPE_SYSTEM_ALARM, "System Alarm"},
  1940. { ACE_TYPE_ALLOWED_COMPOUND, "Allowed Compound"},
  1941. { ACE_TYPE_ACCESS_ALLOWED_OBJECT, "Allowed Object"},
  1942. { ACE_TYPE_ACCESS_DENIED_OBJECT, "Denied Object"},
  1943. { ACE_TYPE_SYSTEM_AUDIT_OBJECT, "Audit Object"},
  1944. { ACE_TYPE_SYSTEM_ALARM_OBJECT, "Alarm Object"},
  1945. { ACE_TYPE_ACCESS_ALLOWED_CALLBACK, "Allowed Callback"},
  1946. { ACE_TYPE_ACCESS_DENIED_CALLBACK, "Denied Callback"},
  1947. { ACE_TYPE_ACCESS_ALLOWED_CALLBACK_OBJECT, "Allowed Callback Object"},
  1948. { ACE_TYPE_ACCESS_DENIED_CALLBACK_OBJECT, "Denied Callback Object"},
  1949. { ACE_TYPE_SYSTEM_AUDIT_CALLBACK, "Audit Callback"},
  1950. { ACE_TYPE_SYSTEM_ALARM_CALLBACK, "Alarm Callback"},
  1951. { ACE_TYPE_SYSTEM_AUDIT_CALLBACK_OBJECT, "Audit Callback Object"},
  1952. { ACE_TYPE_SYSTEM_ALARM_CALLBACK_OBJECT, "Alarm Callback Object"},
  1953. { ACE_TYPE_SYSTEM_MANDATORY_LABEL, "Mandatory label"},
  1954. { 0, NULL}
  1955. };
  1956. static const true_false_string tfs_ace_flags_object_inherit = {
  1957. "Subordinate files will inherit this ACE",
  1958. "Subordinate files will not inherit this ACE"
  1959. };
  1960. static const true_false_string tfs_ace_flags_container_inherit = {
  1961. "Subordinate containers will inherit this ACE",
  1962. "Subordinate containers will not inherit this ACE"
  1963. };
  1964. static const true_false_string tfs_ace_flags_non_propagate_inherit = {
  1965. "Subordinate object will not propagate the inherited ACE further",
  1966. "Subordinate object will propagate the inherited ACE further"
  1967. };
  1968. static const true_false_string tfs_ace_flags_inherit_only = {
  1969. "This ACE does not apply to the current object",
  1970. "This ACE applies to the current object"
  1971. };
  1972. static const true_false_string tfs_ace_flags_inherited_ace = {
  1973. "This ACE was inherited from its parent object",
  1974. "This ACE was not inherited from its parent object"
  1975. };
  1976. static const true_false_string tfs_ace_flags_successful_access = {
  1977. "Successful accesses will be audited",
  1978. "Successful accesses will not be audited"
  1979. };
  1980. static const true_false_string tfs_ace_flags_failed_access = {
  1981. "Failed accesses will be audited",
  1982. "Failed accesses will not be audited"
  1983. };
  1984. static const true_false_string flags_sec_info_sacl = {
  1985. "Request SACL",
  1986. "Do NOT request SACL"
  1987. };
  1988. static const true_false_string flags_sec_info_dacl = {
  1989. "Request DACL",
  1990. "Do NOT request DACL"
  1991. };
  1992. static const true_false_string flags_sec_info_group = {
  1993. "Request GROUP",
  1994. "Do NOT request group"
  1995. };
  1996. static const true_false_string flags_sec_info_owner = {
  1997. "Request OWNER",
  1998. "Do NOT request owner"
  1999. };
  2000. #define APPEND_ACE_TEXT(flag, item, string) \
  2001. if(flag){ \
  2002. if(item) \
  2003. proto_item_append_text(item, string, sep); \
  2004. sep = ", "; \
  2005. }
  2006. static int
  2007. dissect_nt_ace_object(tvbuff_t *tvb, int offset, proto_tree *parent_tree)
  2008. {
  2009. proto_item *item = NULL;
  2010. proto_tree *tree = NULL;
  2011. proto_item *flags_item = NULL;
  2012. proto_tree *flags_tree = NULL;
  2013. guint32 flags;
  2014. int old_offset=offset;
  2015. const char *sep = " ";
  2016. if(parent_tree){
  2017. item = proto_tree_add_text(parent_tree, tvb, offset, 0,
  2018. "ACE Object");
  2019. tree = proto_item_add_subtree(item, ett_nt_ace_object);
  2020. }
  2021. /* flags */
  2022. flags=tvb_get_letohl(tvb, offset);
  2023. if(tree){
  2024. flags_item = proto_tree_add_text(tree, tvb, offset, 4,
  2025. "ACE Object Flags (0x%08x)", flags);
  2026. flags_tree = proto_item_add_subtree(flags_item, ett_nt_ace_object_flags);
  2027. }
  2028. proto_tree_add_boolean(flags_tree, hf_nt_ace_flags_object_type_present,
  2029. tvb, offset, 4, flags);
  2030. APPEND_ACE_TEXT(flags&0x00000001, flags_item, "%sObject Type Present");
  2031. proto_tree_add_boolean(flags_tree, hf_nt_ace_flags_inherited_object_type_present,
  2032. tvb, offset, 4, flags);
  2033. APPEND_ACE_TEXT(flags&0x00000002, flags_item, "%sInherited Object Type Present");
  2034. offset+=4;
  2035. /* is there a GUID ? */
  2036. if(flags&0x00000001){
  2037. proto_tree_add_item(tree, hf_nt_ace_guid, tvb, offset, 16, ENC_LITTLE_ENDIAN);
  2038. offset+=16;
  2039. }
  2040. /* is there an inherited GUID ? */
  2041. if(flags&0x00000002){
  2042. proto_tree_add_item(tree, hf_nt_ace_inherited_guid, tvb, offset, 16, ENC_LITTLE_ENDIAN);
  2043. offset+=16;
  2044. }
  2045. proto_item_set_len(item, offset-old_offset);
  2046. return offset;
  2047. }
  2048. static int
  2049. dissect_nt_v2_ace_flags(tvbuff_t *tvb, int offset, proto_tree *parent_tree,
  2050. guint8 *data)
  2051. {
  2052. proto_item *item = NULL;
  2053. proto_tree *tree = NULL;
  2054. guint8 mask;
  2055. const char *sep = " ";
  2056. mask = tvb_get_guint8(tvb, offset);
  2057. if (data)
  2058. *data = mask;
  2059. if(parent_tree){
  2060. item = proto_tree_add_text(parent_tree, tvb, offset, 1,
  2061. "NT ACE Flags: 0x%02x", mask);
  2062. tree = proto_item_add_subtree(item, ett_nt_ace_flags);
  2063. }
  2064. proto_tree_add_boolean(tree, hf_nt_ace_flags_failed_access,
  2065. tvb, offset, 1, mask);
  2066. APPEND_ACE_TEXT(mask&0x80, item, "%sFailed Access");
  2067. proto_tree_add_boolean(tree, hf_nt_ace_flags_successful_access,
  2068. tvb, offset, 1, mask);
  2069. APPEND_ACE_TEXT(mask&0x40, item, "%sSuccessful Access");
  2070. proto_tree_add_boolean(tree, hf_nt_ace_flags_inherited_ace,
  2071. tvb, offset, 1, mask);
  2072. APPEND_ACE_TEXT(mask&0x10, item, "%sInherited ACE");
  2073. proto_tree_add_boolean(tree, hf_nt_ace_flags_inherit_only,
  2074. tvb, offset, 1, mask);
  2075. APPEND_ACE_TEXT(mask&0x08, item, "%sInherit Only");
  2076. proto_tree_add_boolean(tree, hf_nt_ace_flags_non_propagate_inherit,
  2077. tvb, offset, 1, mask);
  2078. APPEND_ACE_TEXT(mask&0x04, item, "%sNo Propagate Inherit");
  2079. proto_tree_add_boolean(tree, hf_nt_ace_flags_container_inherit,
  2080. tvb, offset, 1, mask);
  2081. APPEND_ACE_TEXT(mask&0x02, item, "%sContainer Inherit");
  2082. proto_tree_add_boolean(tree, hf_nt_ace_flags_object_inherit,
  2083. tvb, offset, 1, mask);
  2084. APPEND_ACE_TEXT(mask&0x01, item, "%sObject Inherit");
  2085. offset += 1;
  2086. return offset;
  2087. }
  2088. static int
  2089. dissect_nt_v2_ace(tvbuff_t *tvb, int offset, packet_info *pinfo,
  2090. proto_tree *parent_tree, guint8 *drep,
  2091. struct access_mask_info *ami)
  2092. {
  2093. proto_item *item = NULL;
  2094. proto_tree *tree = NULL;
  2095. int old_offset = offset;
  2096. char *sid_str = NULL;
  2097. guint16 size;
  2098. guint8 type;
  2099. guint8 flags;
  2100. guint32 perms = 0;
  2101. if(parent_tree){
  2102. item = proto_tree_add_text(parent_tree, tvb, offset, -1,
  2103. "NT ACE: ");
  2104. tree = proto_item_add_subtree(item, ett_nt_ace);
  2105. }
  2106. /* type */
  2107. type = tvb_get_guint8(tvb, offset);
  2108. proto_tree_add_uint(tree, hf_nt_ace_type, tvb, offset, 1, type);
  2109. offset += 1;
  2110. /* flags */
  2111. offset = dissect_nt_v2_ace_flags(tvb, offset, tree, &flags);
  2112. /* size */
  2113. size = tvb_get_letohs(tvb, offset);
  2114. if (size < 4) {
  2115. /*
  2116. * BOGUS - the size includes the ACE header length,
  2117. * which is 4.
  2118. */
  2119. proto_tree_add_uint_format(tree, hf_nt_ace_size, tvb, offset, 2,
  2120. size, "Size: %u (bogus, must be >= 4)", size);
  2121. return old_offset; /* our caller quits in this case */
  2122. }
  2123. proto_tree_add_uint(tree, hf_nt_ace_size, tvb, offset, 2, size);
  2124. offset += 2;
  2125. /* some ACE types we not yet handle store other things than access mask
  2126. * and SID in here.
  2127. * sometimes things that are not related at all to access control.
  2128. * naughty naughty. -- ronnie
  2129. */
  2130. switch(type){
  2131. case ACE_TYPE_ACCESS_ALLOWED:
  2132. case ACE_TYPE_ACCESS_DENIED:
  2133. case ACE_TYPE_SYSTEM_AUDIT:
  2134. case ACE_TYPE_SYSTEM_ALARM:
  2135. case ACE_TYPE_ALLOWED_COMPOUND:
  2136. case ACE_TYPE_ACCESS_ALLOWED_OBJECT:
  2137. case ACE_TYPE_ACCESS_DENIED_OBJECT:
  2138. case ACE_TYPE_SYSTEM_AUDIT_OBJECT:
  2139. case ACE_TYPE_SYSTEM_ALARM_OBJECT:
  2140. case ACE_TYPE_ACCESS_ALLOWED_CALLBACK:
  2141. case ACE_TYPE_ACCESS_DENIED_CALLBACK:
  2142. case ACE_TYPE_ACCESS_ALLOWED_CALLBACK_OBJECT:
  2143. case ACE_TYPE_ACCESS_DENIED_CALLBACK_OBJECT:
  2144. case ACE_TYPE_SYSTEM_AUDIT_CALLBACK:
  2145. case ACE_TYPE_SYSTEM_ALARM_CALLBACK:
  2146. case ACE_TYPE_SYSTEM_AUDIT_CALLBACK_OBJECT:
  2147. case ACE_TYPE_SYSTEM_ALARM_CALLBACK_OBJECT:
  2148. case ACE_TYPE_SYSTEM_MANDATORY_LABEL:
  2149. /* access mask */
  2150. offset = dissect_nt_access_mask(
  2151. tvb, offset, pinfo, tree, drep,
  2152. hf_nt_access_mask, ami, &perms);
  2153. /* these aces contain an extra object */
  2154. switch(type){
  2155. case ACE_TYPE_ACCESS_ALLOWED_OBJECT:
  2156. case ACE_TYPE_ACCESS_DENIED_OBJECT:
  2157. case ACE_TYPE_SYSTEM_AUDIT_OBJECT:
  2158. case ACE_TYPE_SYSTEM_ALARM_OBJECT:
  2159. case ACE_TYPE_ACCESS_ALLOWED_CALLBACK_OBJECT:
  2160. case ACE_TYPE_ACCESS_DENIED_CALLBACK_OBJECT:
  2161. case ACE_TYPE_SYSTEM_AUDIT_CALLBACK_OBJECT:
  2162. case ACE_TYPE_SYSTEM_ALARM_CALLBACK_OBJECT:
  2163. offset=dissect_nt_ace_object(tvb, offset, tree);
  2164. }
  2165. /* SID */
  2166. offset = dissect_nt_sid(tvb, offset, tree, "SID", &sid_str, -1);
  2167. if (item)
  2168. proto_item_append_text(
  2169. item, "%s, flags 0x%02x, %s, mask 0x%08x", sid_str, flags,
  2170. val_to_str(type, ace_type_vals, "Unknown ACE type (0x%02x)"),
  2171. perms);
  2172. break;
  2173. };
  2174. proto_item_set_len(item, offset-old_offset);
  2175. /* Sometimes there is some spare space at the end of the ACE so use
  2176. the size field to work out where the end is. */
  2177. return old_offset + size;
  2178. }
  2179. static int
  2180. dissect_nt_acl(tvbuff_t *tvb, int offset, packet_info *pinfo,
  2181. proto_tree *parent_tree, guint8 *drep, const char *name,
  2182. struct access_mask_info *ami)
  2183. {
  2184. proto_item *volatile item = NULL;
  2185. proto_tree *volatile tree = NULL;
  2186. int old_offset = offset;
  2187. int pre_ace_offset;
  2188. guint16 revision;
  2189. guint32 volatile num_aces;
  2190. gboolean volatile missing_data = FALSE;
  2191. gboolean volatile bad_ace = FALSE;
  2192. if(parent_tree) {
  2193. item = proto_tree_add_text(parent_tree, tvb, offset, -1,
  2194. "NT %s ACL", name);
  2195. tree = proto_item_add_subtree(item, ett_nt_acl);
  2196. }
  2197. /* revision */
  2198. /*
  2199. * XXX - is this *really* 2 bytes? The page at
  2200. *
  2201. * http://msdn.microsoft.com/library/default.asp?url=/library/en-us/secauthz/security/acl.asp
  2202. *
  2203. * indicates that it's one byte of revision and one byte of
  2204. * zero padding, which means the code that used to be here
  2205. * was correct - and this code would give the same results
  2206. * as long as the padding is zero, so if this dissects it
  2207. * correctly when the padding is zero, and the padding is
  2208. * always zero, the old code would dissect it correctly
  2209. * also.
  2210. */
  2211. revision = tvb_get_letohs(tvb, offset);
  2212. proto_tree_add_uint(tree, hf_nt_acl_revision,
  2213. tvb, offset, 2, revision);
  2214. offset += 2;
  2215. switch(revision){
  2216. case ACL_REVISION_NT4:
  2217. case ACL_REVISION_ADS:
  2218. case 3: /* weirdo type */
  2219. /* size */
  2220. proto_tree_add_item(tree, hf_nt_acl_size, tvb, offset, 2, ENC_LITTLE_ENDIAN);
  2221. offset += 2;
  2222. /* number of ace structures */
  2223. /*
  2224. * XXX - is this *really* 4 bytes? The page referred to above
  2225. * says it's 2 bytes of count followed by two bytes of
  2226. * zero padding.
  2227. */
  2228. num_aces = tvb_get_letohl(tvb, offset);
  2229. proto_tree_add_uint(tree, hf_nt_acl_num_aces,
  2230. tvb, offset, 4, num_aces);
  2231. offset += 4;
  2232. while(num_aces-- && !missing_data && !bad_ace) {
  2233. pre_ace_offset = offset;
  2234. /*
  2235. * These are at an offset later in the packet; don't
  2236. * fail if we can't fetch them, just note the problem
  2237. * and dissect the stuff before it.
  2238. */
  2239. TRY {
  2240. offset = dissect_nt_v2_ace(tvb, offset, pinfo, tree, drep, ami);
  2241. if (pre_ace_offset == offset) {
  2242. /*
  2243. * Bogus ACE, with a length < 4.
  2244. */
  2245. bad_ace = TRUE;
  2246. }
  2247. }
  2248. CATCH(BoundsError) {
  2249. proto_tree_add_text(tree, tvb, offset, 0, "ACE Extends beyond end of captured data");
  2250. missing_data = TRUE;
  2251. }
  2252. CATCH(ReportedBoundsError) {
  2253. proto_tree_add_text(tree, tvb, offset, 0, "ACE Extends beyond end of reassembled data");
  2254. missing_data = TRUE;
  2255. }
  2256. ENDTRY;
  2257. }
  2258. }
  2259. proto_item_set_len(item, offset-old_offset);
  2260. return offset;
  2261. }
  2262. static const true_false_string tfs_sec_desc_type_owner_defaulted = {
  2263. "OWNER is DEFAULTED",
  2264. "Owner is NOT defaulted"
  2265. };
  2266. static const true_false_string tfs_sec_desc_type_group_defaulted = {
  2267. "GROUP is DEFAULTED",
  2268. "Group is NOT defaulted"
  2269. };
  2270. static const true_false_string tfs_sec_desc_type_dacl_present = {
  2271. "DACL is PRESENT",
  2272. "DACL is NOT present"
  2273. };
  2274. static const true_false_string tfs_sec_desc_type_dacl_defaulted = {
  2275. "DACL is DEFAULTED",
  2276. "DACL is NOT defaulted"
  2277. };
  2278. static const true_false_string tfs_sec_desc_type_sacl_present = {
  2279. "SACL is PRESENT",
  2280. "SACL is NOT present"
  2281. };
  2282. static const true_false_string tfs_sec_desc_type_sacl_defaulted = {
  2283. "SACL is DEFAULTED",
  2284. "SACL is NOT defaulted"
  2285. };
  2286. static const true_false_string tfs_sec_desc_type_dacl_trusted = {
  2287. "DACL TRUSTED is TRUE",
  2288. "Dacl trusted is FALSE"
  2289. };
  2290. static const true_false_string tfs_sec_desc_type_server_security = {
  2291. "SERVER SECURITY is TRUE",
  2292. "Server security is FALSE"
  2293. };
  2294. static const true_false_string tfs_sec_desc_type_dacl_auto_inherit_req = {
  2295. "DACL has AUTO INHERIT REQUIRED",
  2296. "DACL does NOT require auto inherit"
  2297. };
  2298. static const true_false_string tfs_sec_desc_type_sacl_auto_inherit_req = {
  2299. "SACL has AUTO INHERIT REQUIRED",
  2300. "SACL does NOT require auto inherit"
  2301. };
  2302. static const true_false_string tfs_sec_desc_type_dacl_auto_inherited = {
  2303. "DACL is AUTO INHERITED",
  2304. "DACL is NOT auto inherited"
  2305. };
  2306. static const true_false_string tfs_sec_desc_type_sacl_auto_inherited = {
  2307. "SACL is AUTO INHERITED",
  2308. "SACL is NOT auto inherited"
  2309. };
  2310. static const true_false_string tfs_sec_desc_type_dacl_protected = {
  2311. "The DACL is PROTECTED",
  2312. "The DACL is NOT protected"
  2313. };
  2314. static const true_false_string tfs_sec_desc_type_sacl_protected = {
  2315. "The SACL is PROTECTED",
  2316. "The SACL is NOT protected"
  2317. };
  2318. static const true_false_string tfs_sec_desc_type_rm_control_valid = {
  2319. "Rm control valid is TRUE",
  2320. "Rm control valid is FALSE"
  2321. };
  2322. static const true_false_string tfs_sec_desc_type_self_relative = {
  2323. "This SecDesc is SELF RELATIVE",
  2324. "This SecDesc is NOT self relative"
  2325. };
  2326. static int
  2327. dissect_nt_sec_desc_type(tvbuff_t *tvb, int offset, proto_tree *parent_tree)
  2328. {
  2329. proto_item *item = NULL;
  2330. proto_tree *tree = NULL;
  2331. guint16 mask;
  2332. mask = tvb_get_letohs(tvb, offset);
  2333. if(parent_tree){
  2334. item = proto_tree_add_text(parent_tree, tvb, offset, 2,
  2335. "Type: 0x%04x", mask);
  2336. tree = proto_item_add_subtree(item, ett_nt_sec_desc_type);
  2337. }
  2338. proto_tree_add_boolean(tree,hf_nt_sec_desc_type_self_relative,
  2339. tvb, offset, 2, mask);
  2340. proto_tree_add_boolean(tree,hf_nt_sec_desc_type_rm_control_valid,
  2341. tvb, offset, 2, mask);
  2342. proto_tree_add_boolean(tree,hf_nt_sec_desc_type_sacl_protected,
  2343. tvb, offset, 2, mask);
  2344. proto_tree_add_boolean(tree,hf_nt_sec_desc_type_dacl_protected,
  2345. tvb, offset, 2, mask);
  2346. proto_tree_add_boolean(tree,hf_nt_sec_desc_type_sacl_auto_inherited,
  2347. tvb, offset, 2, mask);
  2348. proto_tree_add_boolean(tree,hf_nt_sec_desc_type_dacl_auto_inherited,
  2349. tvb, offset, 2, mask);
  2350. proto_tree_add_boolean(tree,hf_nt_sec_desc_type_sacl_auto_inherit_req,
  2351. tvb, offset, 2, mask);
  2352. proto_tree_add_boolean(tree,hf_nt_sec_desc_type_dacl_auto_inherit_req,
  2353. tvb, offset, 2, mask);
  2354. proto_tree_add_boolean(tree,hf_nt_sec_desc_type_server_security,
  2355. tvb, offset, 2, mask);
  2356. proto_tree_add_boolean(tree,hf_nt_sec_desc_type_dacl_trusted,
  2357. tvb, offset, 2, mask);
  2358. proto_tree_add_boolean(tree,hf_nt_sec_desc_type_sacl_defaulted,
  2359. tvb, offset, 2, mask);
  2360. proto_tree_add_boolean(tree,hf_nt_sec_desc_type_sacl_present,
  2361. tvb, offset, 2, mask);
  2362. proto_tree_add_boolean(tree,hf_nt_sec_desc_type_dacl_defaulted,
  2363. tvb, offset, 2, mask);
  2364. proto_tree_add_boolean(tree,hf_nt_sec_desc_type_dacl_present,
  2365. tvb, offset, 2, mask);
  2366. proto_tree_add_boolean(tree,hf_nt_sec_desc_type_group_defaulted,
  2367. tvb, offset, 2, mask);
  2368. proto_tree_add_boolean(tree, hf_nt_sec_desc_type_owner_defaulted,
  2369. tvb, offset, 2, mask);
  2370. offset += 2;
  2371. return offset;
  2372. }
  2373. int
  2374. dissect_nt_security_information(tvbuff_t *tvb, int offset, proto_tree *parent_tree)
  2375. {
  2376. proto_item *item = NULL;
  2377. proto_tree *tree = NULL;
  2378. guint32 mask;
  2379. mask = tvb_get_letohl(tvb, offset);
  2380. if(parent_tree){
  2381. item = proto_tree_add_text(parent_tree, tvb, offset, 4,
  2382. "SEC INFO: 0x%08x", mask);
  2383. tree = proto_item_add_subtree(item, ett_nt_security_information);
  2384. }
  2385. proto_tree_add_boolean(tree,hf_nt_security_information_sacl,
  2386. tvb, offset, 4, mask);
  2387. if (mask & 0x00000008) {
  2388. proto_item_append_text(item, " SACL");
  2389. }
  2390. proto_tree_add_boolean(tree,hf_nt_security_information_dacl,
  2391. tvb, offset, 4, mask);
  2392. if (mask & 0x00000004) {
  2393. proto_item_append_text(item, " DACL");
  2394. }
  2395. proto_tree_add_boolean(tree,hf_nt_security_information_group,
  2396. tvb, offset, 4, mask);
  2397. if (mask & 0x00000002) {
  2398. proto_item_append_text(item, " GROUP");
  2399. }
  2400. proto_tree_add_boolean(tree,hf_nt_security_information_owner,
  2401. tvb, offset, 4, mask);
  2402. if (mask & 0x00000001) {
  2403. proto_item_append_text(item, " OWNER");
  2404. }
  2405. offset += 4;
  2406. return offset;
  2407. }
  2408. int
  2409. dissect_nt_sec_desc(tvbuff_t *tvb, int offset, packet_info *pinfo,
  2410. proto_tree *parent_tree, guint8 *drep,
  2411. gboolean len_supplied _U_, int len,
  2412. struct access_mask_info *ami)
  2413. {
  2414. proto_item *item = NULL;
  2415. proto_tree *tree = NULL;
  2416. guint16 revision;
  2417. int start_offset = offset;
  2418. int volatile end_offset;
  2419. int item_offset;
  2420. guint32 owner_sid_offset;
  2421. guint32 volatile group_sid_offset;
  2422. guint32 volatile sacl_offset;
  2423. guint32 volatile dacl_offset;
  2424. item = proto_tree_add_text(parent_tree, tvb, offset, -1,
  2425. "NT Security Descriptor");
  2426. tree = proto_item_add_subtree(item, ett_nt_sec_desc);
  2427. /* revision */
  2428. revision = tvb_get_letohs(tvb, offset);
  2429. proto_tree_add_uint(tree, hf_nt_sec_desc_revision,
  2430. tvb, offset, 2, revision);
  2431. offset += 2;
  2432. switch(revision){
  2433. case 1: /* only version we will ever see of this structure?*/
  2434. /* type */
  2435. offset = dissect_nt_sec_desc_type(tvb, offset, tree);
  2436. /* offset to owner sid */
  2437. owner_sid_offset = tvb_get_letohl(tvb, offset);
  2438. if(owner_sid_offset != 0 && owner_sid_offset < 20){
  2439. /* Bogus value - points into fixed portion of descriptor */
  2440. proto_tree_add_text(tree, tvb, offset, 4, "Offset to owner SID: %u (bogus, must be >= 20)", owner_sid_offset);
  2441. owner_sid_offset = 0;
  2442. } else
  2443. proto_tree_add_text(tree, tvb, offset, 4, "Offset to owner SID: %u", owner_sid_offset);
  2444. offset += 4;
  2445. /* offset to group sid */
  2446. group_sid_offset = tvb_get_letohl(tvb, offset);
  2447. if(group_sid_offset != 0 && group_sid_offset < 20){
  2448. /* Bogus value - points into fixed portion of descriptor */
  2449. proto_tree_add_text(tree, tvb, offset, 4, "Offset to group SID: %u (bogus, must be >= 20)", group_sid_offset);
  2450. group_sid_offset = 0;
  2451. } else
  2452. proto_tree_add_text(tree, tvb, offset, 4, "Offset to group SID: %u", group_sid_offset);
  2453. offset += 4;
  2454. /* offset to sacl */
  2455. sacl_offset = tvb_get_letohl(tvb, offset);
  2456. if(sacl_offset != 0 && sacl_offset < 20){
  2457. /* Bogus value - points into fixed portion of descriptor */
  2458. proto_tree_add_text(tree, tvb, offset, 4, "Offset to SACL: %u (bogus, must be >= 20)", sacl_offset);
  2459. sacl_offset = 0;
  2460. } else
  2461. proto_tree_add_text(tree, tvb, offset, 4, "Offset to SACL: %u", sacl_offset);
  2462. offset += 4;
  2463. /* offset to dacl */
  2464. dacl_offset = tvb_get_letohl(tvb, offset);
  2465. if(dacl_offset != 0 && dacl_offset < 20){
  2466. /* Bogus value - points into fixed portion of descriptor */
  2467. proto_tree_add_text(tree, tvb, offset, 4, "Offset to DACL: %u (bogus, must be >= 20)", dacl_offset);
  2468. dacl_offset = 0;
  2469. } else
  2470. proto_tree_add_text(tree, tvb, offset, 4, "Offset to DACL: %u", dacl_offset);
  2471. offset += 4;
  2472. end_offset = offset;
  2473. /*owner SID*/
  2474. if(owner_sid_offset){
  2475. item_offset = start_offset+owner_sid_offset;
  2476. if (item_offset < start_offset) {
  2477. /*
  2478. * Overflow - throw an exception.
  2479. */
  2480. THROW(ReportedBoundsError);
  2481. }
  2482. TRY{
  2483. offset = dissect_nt_sid(tvb, item_offset, tree, "Owner", NULL, -1);
  2484. if (offset > end_offset)
  2485. end_offset = offset;
  2486. }
  2487. CATCH(BoundsError) {
  2488. proto_tree_add_text(tree, tvb, item_offset, 0, "Owner SID beyond end of captured data");
  2489. }
  2490. CATCH(ReportedBoundsError) {
  2491. proto_tree_add_text(tree, tvb, item_offset, 0, "Owner SID beyond end of reassembled data");
  2492. }
  2493. ENDTRY;
  2494. }
  2495. /*group SID*/
  2496. if(group_sid_offset){
  2497. item_offset = start_offset+group_sid_offset;
  2498. if (item_offset < start_offset) {
  2499. /*
  2500. * Overflow - throw an exception.
  2501. */
  2502. THROW(ReportedBoundsError);
  2503. }
  2504. TRY {
  2505. offset = dissect_nt_sid(tvb, item_offset, tree, "Group", NULL, -1);
  2506. if (offset > end_offset)
  2507. end_offset = offset;
  2508. }
  2509. CATCH(BoundsError) {
  2510. proto_tree_add_text(tree, tvb, item_offset, 0, "Group SID beyond end of captured data");
  2511. }
  2512. CATCH(ReportedBoundsError) {
  2513. proto_tree_add_text(tree, tvb, item_offset, 0, "Group SID beyond end of reassembled data");
  2514. }
  2515. ENDTRY;
  2516. }
  2517. /* sacl */
  2518. if(sacl_offset){
  2519. item_offset = start_offset+sacl_offset;
  2520. if (item_offset < start_offset) {
  2521. /*
  2522. * Overflow - throw an exception.
  2523. */
  2524. THROW(ReportedBoundsError);
  2525. }
  2526. offset = dissect_nt_acl(tvb, item_offset, pinfo, tree,
  2527. drep, "System (SACL)", ami);
  2528. if (offset > end_offset)
  2529. end_offset = offset;
  2530. }
  2531. /* dacl */
  2532. if(dacl_offset){
  2533. item_offset = start_offset+dacl_offset;
  2534. if (item_offset < start_offset) {
  2535. /*
  2536. * Overflow - throw an exception.
  2537. */
  2538. THROW(ReportedBoundsError);
  2539. }
  2540. offset = dissect_nt_acl(tvb, item_offset, pinfo, tree,
  2541. drep, "User (DACL)", ami);
  2542. if (offset > end_offset)
  2543. end_offset = offset;
  2544. }
  2545. break;
  2546. default:
  2547. end_offset = offset;
  2548. break;
  2549. }
  2550. len = end_offset - start_offset;
  2551. proto_item_set_len(item, len);
  2552. return offset;
  2553. }
  2554. /*
  2555. * XXX - we should have a way to register fields not associated with a
  2556. * protocol.
  2557. *
  2558. * XXX - make-reg-dotc.py doesn't check for an argument list of "(void)",
  2559. * so we have to give this a name other than "proto_register_..." so that
  2560. * it doesn't end up being called from "register.c".
  2561. */
  2562. void
  2563. proto_do_register_windows_common(int proto_smb)
  2564. {
  2565. static hf_register_info hf[] = {
  2566. /* Security descriptors */
  2567. { &hf_nt_sec_desc_revision,
  2568. { "Revision", "nt.sec_desc.revision", FT_UINT16, BASE_DEC,
  2569. NULL, 0, "Version of NT Security Descriptor structure", HFILL }},
  2570. { &hf_nt_sec_desc_type_owner_defaulted,
  2571. { "Owner Defaulted", "nt.sec_desc.type.owner_defaulted", FT_BOOLEAN, 16,
  2572. TFS(&tfs_sec_desc_type_owner_defaulted), 0x0001, "Is Owner Defaulted set?", HFILL }},
  2573. { &hf_nt_sec_desc_type_group_defaulted,
  2574. { "Group Defaulted", "nt.sec_desc.type.group_defaulted", FT_BOOLEAN, 16,
  2575. TFS(&tfs_sec_desc_type_group_defaulted), 0x0002, "Is Group Defaulted?", HFILL }},
  2576. { &hf_nt_sec_desc_type_dacl_present,
  2577. { "DACL Present", "nt.sec_desc.type.dacl_present", FT_BOOLEAN, 16,
  2578. TFS(&tfs_sec_desc_type_dacl_present), 0x0004, "Does this SecDesc have DACL present?", HFILL }},
  2579. { &hf_nt_sec_desc_type_dacl_defaulted,
  2580. { "DACL Defaulted", "nt.sec_desc.type.dacl_defaulted", FT_BOOLEAN, 16,
  2581. TFS(&tfs_sec_desc_type_dacl_defaulted), 0x0008, "Does this SecDesc have DACL Defaulted?", HFILL }},
  2582. { &hf_nt_sec_desc_type_sacl_present,
  2583. { "SACL Present", "nt.sec_desc.type.sacl_present", FT_BOOLEAN, 16,
  2584. TFS(&tfs_sec_desc_type_sacl_present), 0x0010, "Is the SACL present?", HFILL }},
  2585. { &hf_nt_sec_desc_type_sacl_defaulted,
  2586. { "SACL Defaulted", "nt.sec_desc.type.sacl_defaulted", FT_BOOLEAN, 16,
  2587. TFS(&tfs_sec_desc_type_sacl_defaulted), 0x0020, "Does this SecDesc have SACL Defaulted?", HFILL }},
  2588. { &hf_nt_sec_desc_type_dacl_auto_inherit_req,
  2589. { "DACL Auto Inherit Required", "nt.sec_desc.type.dacl_auto_inherit_req", FT_BOOLEAN, 16,
  2590. TFS(&tfs_sec_desc_type_dacl_auto_inherit_req), 0x0100, "Does this SecDesc have DACL Auto Inherit Required set?", HFILL }},
  2591. { &hf_nt_sec_desc_type_dacl_trusted,
  2592. { "DACL Trusted", "nt.sec_desc.type.dacl_trusted", FT_BOOLEAN, 16,
  2593. TFS(&tfs_sec_desc_type_dacl_trusted), 0x0040, "Does this SecDesc have DACL TRUSTED set?", HFILL }},
  2594. { &hf_nt_sec_desc_type_server_security,
  2595. { "Server Security", "nt.sec_desc.type.server_security", FT_BOOLEAN, 16,
  2596. TFS(&tfs_sec_desc_type_server_security), 0x0080, "Does this SecDesc have SERVER SECURITY set?", HFILL }},
  2597. { &hf_nt_sec_desc_type_sacl_auto_inherit_req,
  2598. { "SACL Auto Inherit Required", "nt.sec_desc.type.sacl_auto_inherit_req", FT_BOOLEAN, 16,
  2599. TFS(&tfs_sec_desc_type_sacl_auto_inherit_req), 0x0200, "Does this SecDesc have SACL Auto Inherit Required set?", HFILL }},
  2600. { &hf_nt_sec_desc_type_dacl_auto_inherited,
  2601. { "DACL Auto Inherited", "nt.sec_desc.type.dacl_auto_inherited", FT_BOOLEAN, 16,
  2602. TFS(&tfs_sec_desc_type_dacl_auto_inherited), 0x0400, "Is this DACL auto inherited", HFILL }},
  2603. { &hf_nt_sec_desc_type_sacl_auto_inherited,
  2604. { "SACL Auto Inherited", "nt.sec_desc.type.sacl_auto_inherited", FT_BOOLEAN, 16,
  2605. TFS(&tfs_sec_desc_type_sacl_auto_inherited), 0x0800, "Is this SACL auto inherited", HFILL }},
  2606. { &hf_nt_sec_desc_type_dacl_protected,
  2607. { "DACL Protected", "nt.sec_desc.type.dacl_protected", FT_BOOLEAN, 16,
  2608. TFS(&tfs_sec_desc_type_dacl_protected), 0x1000, "Is the DACL structure protected?", HFILL }},
  2609. { &hf_nt_sec_desc_type_sacl_protected,
  2610. { "SACL Protected", "nt.sec_desc.type.sacl_protected", FT_BOOLEAN, 16,
  2611. TFS(&tfs_sec_desc_type_sacl_protected), 0x2000, "Is the SACL structure protected?", HFILL }},
  2612. { &hf_nt_sec_desc_type_self_relative,
  2613. { "Self Relative", "nt.sec_desc.type.self_relative", FT_BOOLEAN, 16,
  2614. TFS(&tfs_sec_desc_type_self_relative), 0x8000, "Is this SecDesc self relative?", HFILL }},
  2615. { &hf_nt_sec_desc_type_rm_control_valid,
  2616. { "RM Control Valid", "nt.sec_desc.type.rm_control_valid", FT_BOOLEAN, 16,
  2617. TFS(&tfs_sec_desc_type_rm_control_valid), 0x4000, "Is RM Control Valid set?", HFILL }},
  2618. /* SIDs */
  2619. { &hf_nt_sid,
  2620. { "SID", "nt.sid", FT_STRING, BASE_NONE,
  2621. NULL, 0, "SID: Security Identifier", HFILL }},
  2622. { &hf_nt_sid_revision,
  2623. { "Revision", "nt.sid.revision", FT_UINT8, BASE_DEC,
  2624. NULL, 0, "Version of SID structure", HFILL }},
  2625. { &hf_nt_sid_num_auth,
  2626. { "Num Auth", "nt.sid.num_auth", FT_UINT8, BASE_DEC,
  2627. NULL, 0, "Number of authorities for this SID", HFILL }},
  2628. { &hf_nt_sid_auth_dec,
  2629. { "Authority", "nt.sid.auth", FT_UINT64, BASE_DEC,
  2630. NULL, 0, "Identifier Authority", HFILL }},
  2631. { &hf_nt_sid_auth_hex,
  2632. { "Authority", "nt.sid.auth", FT_UINT64, BASE_HEX,
  2633. NULL, 0, "Identifier Authority", HFILL }},
  2634. { &hf_nt_sid_subauth,
  2635. { "Subauthorities", "nt.sid.subauth", FT_STRING, BASE_NONE,
  2636. NULL, 0, "Subauthorities fields", HFILL }},
  2637. { &hf_nt_sid_rid_dec,
  2638. { "RID", "nt.sid.rid", FT_UINT32, BASE_DEC,
  2639. NULL, 0, "Relative IDentifier: identifies a user or group", HFILL }},
  2640. { &hf_nt_sid_rid_hex,
  2641. { "RID", "nt.sid.rid", FT_UINT32, BASE_HEX,
  2642. NULL, 0, "Relative IDentifier: identifies a user or group", HFILL }},
  2643. { &hf_nt_sid_wkwn,
  2644. { "Well-known SID", "nt.sid.wkwn", FT_STRING, BASE_NONE,
  2645. NULL, 0, NULL, HFILL }},
  2646. { &hf_nt_sid_domain,
  2647. { "Domain:", "nt.sid.domain", FT_STRING, BASE_NONE,
  2648. NULL, 0, NULL, HFILL }},
  2649. /* ACLs */
  2650. { &hf_nt_acl_revision,
  2651. { "Revision", "nt.acl.revision", FT_UINT16, BASE_DEC,
  2652. VALS(acl_revision_vals), 0, "Version of NT ACL structure", HFILL }},
  2653. { &hf_nt_acl_size,
  2654. { "Size", "nt.acl.size", FT_UINT16, BASE_DEC,
  2655. NULL, 0, "Size of NT ACL structure", HFILL }},
  2656. { &hf_nt_acl_num_aces,
  2657. { "Num ACEs", "nt.acl.num_aces", FT_UINT32, BASE_DEC,
  2658. NULL, 0, "Number of ACE structures for this ACL", HFILL }},
  2659. /* ACEs */
  2660. { &hf_nt_ace_type,
  2661. { "Type", "nt.ace.type",
  2662. FT_UINT8, BASE_DEC, VALS(ace_type_vals), 0, "Type of ACE",
  2663. HFILL }},
  2664. { &hf_nt_ace_size,
  2665. { "Size", "nt.ace.size", FT_UINT16, BASE_DEC, NULL, 0,
  2666. "Size of this ACE", HFILL }},
  2667. { &hf_nt_ace_flags_object_inherit,
  2668. { "Object Inherit", "nt.ace.flags.object_inherit", FT_BOOLEAN, 8,
  2669. TFS(&tfs_ace_flags_object_inherit), 0x01, "Will subordinate files inherit this ACE?", HFILL }},
  2670. { &hf_nt_ace_flags_container_inherit,
  2671. { "Container Inherit", "nt.ace.flags.container_inherit", FT_BOOLEAN, 8,
  2672. TFS(&tfs_ace_flags_container_inherit), 0x02, "Will subordinate containers inherit this ACE?", HFILL }},
  2673. { &hf_nt_ace_flags_non_propagate_inherit,
  2674. { "Non-Propagate Inherit", "nt.ace.flags.non_propagate_inherit", FT_BOOLEAN, 8,
  2675. TFS(&tfs_ace_flags_non_propagate_inherit), 0x04, "Will subordinate object propagate this ACE further?", HFILL }},
  2676. { &hf_nt_ace_flags_inherit_only,
  2677. { "Inherit Only", "nt.ace.flags.inherit_only", FT_BOOLEAN, 8,
  2678. TFS(&tfs_ace_flags_inherit_only), 0x08, "Does this ACE apply to the current object?", HFILL }},
  2679. { &hf_nt_ace_flags_inherited_ace,
  2680. { "Inherited ACE", "nt.ace.flags.inherited_ace", FT_BOOLEAN, 8,
  2681. TFS(&tfs_ace_flags_inherited_ace), 0x10, "Was this ACE inherited from its parent object?", HFILL }},
  2682. { &hf_nt_ace_flags_successful_access,
  2683. { "Audit Successful Accesses", "nt.ace.flags.successful_access", FT_BOOLEAN, 8,
  2684. TFS(&tfs_ace_flags_successful_access), 0x40, "Should successful accesses be audited?", HFILL }},
  2685. { &hf_nt_ace_flags_failed_access,
  2686. { "Audit Failed Accesses", "nt.ace.flags.failed_access", FT_BOOLEAN, 8,
  2687. TFS(&tfs_ace_flags_failed_access), 0x80, "Should failed accesses be audited?", HFILL }},
  2688. /* Access masks */
  2689. { &hf_nt_access_mask,
  2690. { "Access required", "nt.access_mask",
  2691. FT_UINT32, BASE_HEX, NULL, 0x0, "Access mask",
  2692. HFILL }},
  2693. { &hf_access_generic_read,
  2694. { "Generic read", "nt.access_mask.generic_read",
  2695. FT_BOOLEAN, 32, TFS(&tfs_set_notset),
  2696. GENERIC_READ_ACCESS, NULL, HFILL }},
  2697. { &hf_access_generic_write,
  2698. { "Generic write", "nt.access_mask.generic_write",
  2699. FT_BOOLEAN, 32, TFS(&tfs_set_notset),
  2700. GENERIC_WRITE_ACCESS, NULL, HFILL }},
  2701. { &hf_access_generic_execute,
  2702. { "Generic execute", "nt.access_mask.generic_execute",
  2703. FT_BOOLEAN, 32, TFS(&tfs_set_notset),
  2704. GENERIC_EXECUTE_ACCESS, NULL, HFILL }},
  2705. { &hf_access_generic_all,
  2706. { "Generic all", "nt.access_mask.generic_all",
  2707. FT_BOOLEAN, 32, TFS(&tfs_set_notset),
  2708. GENERIC_ALL_ACCESS, NULL, HFILL }},
  2709. { &hf_access_maximum_allowed,
  2710. { "Maximum allowed", "nt.access_mask.maximum_allowed",
  2711. FT_BOOLEAN, 32, TFS(&tfs_set_notset),
  2712. MAXIMUM_ALLOWED_ACCESS, NULL, HFILL }},
  2713. { &hf_access_sacl,
  2714. { "Access SACL", "nt.access_mask.access_sacl",
  2715. FT_BOOLEAN, 32, TFS(&tfs_set_notset),
  2716. ACCESS_SACL_ACCESS, NULL, HFILL }},
  2717. { &hf_access_standard_read_control,
  2718. { "Read control", "nt.access_mask.read_control",
  2719. FT_BOOLEAN, 32, TFS(&tfs_set_notset),
  2720. READ_CONTROL_ACCESS, NULL, HFILL }},
  2721. { &hf_access_standard_delete,
  2722. { "Delete", "nt.access_mask.delete",
  2723. FT_BOOLEAN, 32, TFS(&tfs_set_notset),
  2724. DELETE_ACCESS, NULL, HFILL }},
  2725. { &hf_access_standard_synchronise,
  2726. { "Synchronise", "nt.access_mask.synchronise",
  2727. FT_BOOLEAN, 32, TFS(&tfs_set_notset),
  2728. SYNCHRONIZE_ACCESS, NULL, HFILL }},
  2729. { &hf_access_standard_write_dac,
  2730. { "Write DAC", "nt.access_mask.write_dac",
  2731. FT_BOOLEAN, 32, TFS(&tfs_set_notset),
  2732. WRITE_DAC_ACCESS, NULL, HFILL }},
  2733. { &hf_access_standard_write_owner,
  2734. { "Write owner", "nt.access_mask.write_owner",
  2735. FT_BOOLEAN, 32, TFS(&tfs_set_notset),
  2736. WRITE_OWNER_ACCESS, NULL, HFILL }},
  2737. { &hf_access_specific_15,
  2738. { "Specific access, bit 15", "nt.access_mask.specific_15",
  2739. FT_BOOLEAN, 32, TFS(&tfs_set_notset),
  2740. 0x8000, NULL, HFILL }},
  2741. { &hf_access_specific_14,
  2742. { "Specific access, bit 14", "nt.access_mask.specific_14",
  2743. FT_BOOLEAN, 32, TFS(&tfs_set_notset),
  2744. 0x4000, NULL, HFILL }},
  2745. { &hf_access_specific_13,
  2746. { "Specific access, bit 13", "nt.access_mask.specific_13",
  2747. FT_BOOLEAN, 32, TFS(&tfs_set_notset),
  2748. 0x2000, NULL, HFILL }},
  2749. { &hf_access_specific_12,
  2750. { "Specific access, bit 12", "nt.access_mask.specific_12",
  2751. FT_BOOLEAN, 32, TFS(&tfs_set_notset),
  2752. 0x1000, NULL, HFILL }},
  2753. { &hf_access_specific_11,
  2754. { "Specific access, bit 11", "nt.access_mask.specific_11",
  2755. FT_BOOLEAN, 32, TFS(&tfs_set_notset),
  2756. 0x0800, NULL, HFILL }},
  2757. { &hf_access_specific_10,
  2758. { "Specific access, bit 10", "nt.access_mask.specific_10",
  2759. FT_BOOLEAN, 32, TFS(&tfs_set_notset),
  2760. 0x0400, NULL, HFILL }},
  2761. { &hf_access_specific_9,
  2762. { "Specific access, bit 9", "nt.access_mask.specific_9",
  2763. FT_BOOLEAN, 32, TFS(&tfs_set_notset),
  2764. 0x0200, NULL, HFILL }},
  2765. { &hf_access_specific_8,
  2766. { "Specific access, bit 8", "nt.access_mask.specific_8",
  2767. FT_BOOLEAN, 32, TFS(&tfs_set_notset),
  2768. 0x0100, NULL, HFILL }},
  2769. { &hf_access_specific_7,
  2770. { "Specific access, bit 7", "nt.access_mask.specific_7",
  2771. FT_BOOLEAN, 32, TFS(&tfs_set_notset),
  2772. 0x0080, NULL, HFILL }},
  2773. { &hf_access_specific_6,
  2774. { "Specific access, bit 6", "nt.access_mask.specific_6",
  2775. FT_BOOLEAN, 32, TFS(&tfs_set_notset),
  2776. 0x0040, NULL, HFILL }},
  2777. { &hf_access_specific_5,
  2778. { "Specific access, bit 5", "nt.access_mask.specific_5",
  2779. FT_BOOLEAN, 32, TFS(&tfs_set_notset),
  2780. 0x0020, NULL, HFILL }},
  2781. { &hf_access_specific_4,
  2782. { "Specific access, bit 4", "nt.access_mask.specific_4",
  2783. FT_BOOLEAN, 32, TFS(&tfs_set_notset),
  2784. 0x0010, NULL, HFILL }},
  2785. { &hf_access_specific_3,
  2786. { "Specific access, bit 3", "nt.access_mask.specific_3",
  2787. FT_BOOLEAN, 32, TFS(&tfs_set_notset),
  2788. 0x0008, NULL, HFILL }},
  2789. { &hf_access_specific_2,
  2790. { "Specific access, bit 2", "nt.access_mask.specific_2",
  2791. FT_BOOLEAN, 32, TFS(&tfs_set_notset),
  2792. 0x0004, NULL, HFILL }},
  2793. { &hf_access_specific_1,
  2794. { "Specific access, bit 1", "nt.access_mask.specific_1",
  2795. FT_BOOLEAN, 32, TFS(&tfs_set_notset),
  2796. 0x0002, NULL, HFILL }},
  2797. { &hf_access_specific_0,
  2798. { "Specific access, bit 0", "nt.access_mask.specific_0",
  2799. FT_BOOLEAN, 32, TFS(&tfs_set_notset),
  2800. 0x0001, NULL, HFILL }},
  2801. { &hf_nt_ace_flags_object_type_present,
  2802. { "Object Type Present", "nt.ace.object.flags.object_type_present",
  2803. FT_BOOLEAN, 32, TFS(&tfs_set_notset),
  2804. 0x00000001, NULL, HFILL }},
  2805. { &hf_nt_ace_flags_inherited_object_type_present,
  2806. { "Inherited Object Type Present", "nt.ace.object.flags.inherited_object_type_present",
  2807. FT_BOOLEAN, 32, TFS(&tfs_set_notset),
  2808. 0x00000002, NULL, HFILL }},
  2809. { &hf_nt_ace_guid,
  2810. { "GUID", "nt.ace.object.guid", FT_GUID, BASE_NONE,
  2811. NULL, 0, NULL, HFILL }},
  2812. { &hf_nt_ace_inherited_guid,
  2813. { "Inherited GUID", "nt.ace.object.inherited_guid", FT_GUID, BASE_NONE,
  2814. NULL, 0, NULL, HFILL }},
  2815. { &hf_nt_security_information_sacl,
  2816. { "SACL", "nt.sec_info.sacl", FT_BOOLEAN, 32,
  2817. TFS(&flags_sec_info_sacl), 0x00000008, NULL, HFILL }},
  2818. { &hf_nt_security_information_dacl,
  2819. { "DACL", "nt.sec_info.dacl", FT_BOOLEAN, 32,
  2820. TFS(&flags_sec_info_dacl), 0x00000004, NULL, HFILL }},
  2821. { &hf_nt_security_information_group,
  2822. { "Group", "nt.sec_info.group", FT_BOOLEAN, 32,
  2823. TFS(&flags_sec_info_group), 0x00000002, NULL, HFILL }},
  2824. { &hf_nt_security_information_owner,
  2825. { "Owner", "nt.sec_info.owner", FT_BOOLEAN, 32,
  2826. TFS(&flags_sec_info_owner), 0x00000001, NULL, HFILL }},
  2827. };
  2828. static gint *ett[] = {
  2829. &ett_nt_sec_desc,
  2830. &ett_nt_sec_desc_type,
  2831. &ett_nt_sid,
  2832. &ett_nt_acl,
  2833. &ett_nt_ace,
  2834. &ett_nt_ace_flags,
  2835. &ett_nt_ace_object,
  2836. &ett_nt_ace_object_flags,
  2837. &ett_nt_access_mask,
  2838. &ett_nt_access_mask_generic,
  2839. &ett_nt_access_mask_standard,
  2840. &ett_nt_access_mask_specific,
  2841. &ett_nt_security_information,
  2842. };
  2843. proto_register_subtree_array(ett, array_length(ett));
  2844. proto_register_field_array(proto_smb, hf, array_length(hf));
  2845. }