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

328 lines
7.0 KiB

  1. /*++ BUILD Version: 0002 // Increment this if a change has global effects
  2. Copyright (c) Microsoft Corporation. All rights reserved.
  3. Module Name:
  4. ntobapi.h
  5. Abstract:
  6. This is the include file for the Object Manager sub-component of NTOS
  7. Author:
  8. Steve Wood (stevewo) 28-Mar-1989
  9. Revision History:
  10. --*/
  11. #ifndef _NTOBAPI_
  12. #define _NTOBAPI_
  13. #if _MSC_VER > 1000
  14. #pragma once
  15. #endif
  16. #ifdef __cplusplus
  17. extern "C" {
  18. #endif
  19. // begin_ntddk begin_wdm
  20. #define OBJ_NAME_PATH_SEPARATOR ((WCHAR)L'\\')
  21. // end_ntddk end_wdm
  22. #define OBJ_MAX_REPARSE_ATTEMPTS 32
  23. // begin_ntddk begin_wdm begin_nthal
  24. //
  25. // Object Manager Object Type Specific Access Rights.
  26. //
  27. #define OBJECT_TYPE_CREATE (0x0001)
  28. #define OBJECT_TYPE_ALL_ACCESS (STANDARD_RIGHTS_REQUIRED | 0x1)
  29. //
  30. // Object Manager Directory Specific Access Rights.
  31. //
  32. #define DIRECTORY_QUERY (0x0001)
  33. #define DIRECTORY_TRAVERSE (0x0002)
  34. #define DIRECTORY_CREATE_OBJECT (0x0004)
  35. #define DIRECTORY_CREATE_SUBDIRECTORY (0x0008)
  36. #define DIRECTORY_ALL_ACCESS (STANDARD_RIGHTS_REQUIRED | 0xF)
  37. //
  38. // Object Manager Symbolic Link Specific Access Rights.
  39. //
  40. #define SYMBOLIC_LINK_QUERY (0x0001)
  41. #define SYMBOLIC_LINK_ALL_ACCESS (STANDARD_RIGHTS_REQUIRED | 0x1)
  42. // end_ntddk end_wdm end_nthal
  43. //
  44. // Object Information Classes
  45. //
  46. typedef enum _OBJECT_INFORMATION_CLASS {
  47. ObjectBasicInformation,
  48. ObjectNameInformation,
  49. ObjectTypeInformation,
  50. ObjectTypesInformation,
  51. ObjectHandleFlagInformation,
  52. ObjectSessionInformation,
  53. MaxObjectInfoClass // MaxObjectInfoClass should always be the last enum
  54. } OBJECT_INFORMATION_CLASS;
  55. typedef struct _OBJECT_BASIC_INFORMATION {
  56. ULONG Attributes;
  57. ACCESS_MASK GrantedAccess;
  58. ULONG HandleCount;
  59. ULONG PointerCount;
  60. ULONG PagedPoolCharge;
  61. ULONG NonPagedPoolCharge;
  62. ULONG Reserved[ 3 ];
  63. ULONG NameInfoSize;
  64. ULONG TypeInfoSize;
  65. ULONG SecurityDescriptorSize;
  66. LARGE_INTEGER CreationTime;
  67. } OBJECT_BASIC_INFORMATION, *POBJECT_BASIC_INFORMATION;
  68. typedef struct _OBJECT_NAME_INFORMATION { // ntddk wdm nthal
  69. UNICODE_STRING Name; // ntddk wdm nthal
  70. } OBJECT_NAME_INFORMATION, *POBJECT_NAME_INFORMATION; // ntddk wdm nthal
  71. typedef struct _OBJECT_TYPE_INFORMATION {
  72. UNICODE_STRING TypeName;
  73. ULONG TotalNumberOfObjects;
  74. ULONG TotalNumberOfHandles;
  75. ULONG TotalPagedPoolUsage;
  76. ULONG TotalNonPagedPoolUsage;
  77. ULONG TotalNamePoolUsage;
  78. ULONG TotalHandleTableUsage;
  79. ULONG HighWaterNumberOfObjects;
  80. ULONG HighWaterNumberOfHandles;
  81. ULONG HighWaterPagedPoolUsage;
  82. ULONG HighWaterNonPagedPoolUsage;
  83. ULONG HighWaterNamePoolUsage;
  84. ULONG HighWaterHandleTableUsage;
  85. ULONG InvalidAttributes;
  86. GENERIC_MAPPING GenericMapping;
  87. ULONG ValidAccessMask;
  88. BOOLEAN SecurityRequired;
  89. BOOLEAN MaintainHandleCount;
  90. ULONG PoolType;
  91. ULONG DefaultPagedPoolCharge;
  92. ULONG DefaultNonPagedPoolCharge;
  93. } OBJECT_TYPE_INFORMATION, *POBJECT_TYPE_INFORMATION;
  94. typedef struct _OBJECT_TYPES_INFORMATION {
  95. ULONG NumberOfTypes;
  96. // OBJECT_TYPE_INFORMATION TypeInformation;
  97. } OBJECT_TYPES_INFORMATION, *POBJECT_TYPES_INFORMATION;
  98. typedef struct _OBJECT_HANDLE_FLAG_INFORMATION {
  99. BOOLEAN Inherit;
  100. BOOLEAN ProtectFromClose;
  101. } OBJECT_HANDLE_FLAG_INFORMATION, *POBJECT_HANDLE_FLAG_INFORMATION;
  102. NTSYSCALLAPI
  103. NTSTATUS
  104. NTAPI
  105. NtQueryObject(
  106. IN HANDLE Handle,
  107. IN OBJECT_INFORMATION_CLASS ObjectInformationClass,
  108. OUT PVOID ObjectInformation,
  109. IN ULONG Length,
  110. OUT PULONG ReturnLength OPTIONAL
  111. );
  112. NTSYSCALLAPI
  113. NTSTATUS
  114. NTAPI
  115. NtSetInformationObject(
  116. IN HANDLE Handle,
  117. IN OBJECT_INFORMATION_CLASS ObjectInformationClass,
  118. IN PVOID ObjectInformation,
  119. IN ULONG ObjectInformationLength
  120. );
  121. NTSYSCALLAPI
  122. NTSTATUS
  123. NTAPI
  124. NtDuplicateObject(
  125. IN HANDLE SourceProcessHandle,
  126. IN HANDLE SourceHandle,
  127. IN HANDLE TargetProcessHandle OPTIONAL,
  128. OUT PHANDLE TargetHandle OPTIONAL,
  129. IN ACCESS_MASK DesiredAccess,
  130. IN ULONG HandleAttributes,
  131. IN ULONG Options
  132. );
  133. // begin_ntddk begin_wdm
  134. #define DUPLICATE_CLOSE_SOURCE 0x00000001 // winnt
  135. #define DUPLICATE_SAME_ACCESS 0x00000002 // winnt
  136. #define DUPLICATE_SAME_ATTRIBUTES 0x00000004
  137. // end_ntddk end_wdm
  138. NTSYSCALLAPI
  139. NTSTATUS
  140. NTAPI
  141. NtMakeTemporaryObject(
  142. IN HANDLE Handle
  143. );
  144. NTSYSCALLAPI
  145. NTSTATUS
  146. NTAPI
  147. NtMakePermanentObject(
  148. IN HANDLE Handle
  149. );
  150. NTSYSCALLAPI
  151. NTSTATUS
  152. NTAPI
  153. NtSignalAndWaitForSingleObject(
  154. IN HANDLE SignalHandle,
  155. IN HANDLE WaitHandle,
  156. IN BOOLEAN Alertable,
  157. IN PLARGE_INTEGER Timeout OPTIONAL
  158. );
  159. NTSYSCALLAPI
  160. NTSTATUS
  161. NTAPI
  162. NtWaitForSingleObject(
  163. IN HANDLE Handle,
  164. IN BOOLEAN Alertable,
  165. IN PLARGE_INTEGER Timeout OPTIONAL
  166. );
  167. NTSYSCALLAPI
  168. NTSTATUS
  169. NTAPI
  170. NtWaitForMultipleObjects(
  171. IN ULONG Count,
  172. IN HANDLE Handles[],
  173. IN WAIT_TYPE WaitType,
  174. IN BOOLEAN Alertable,
  175. IN PLARGE_INTEGER Timeout OPTIONAL
  176. );
  177. // begin_ntifs
  178. NTSYSCALLAPI
  179. NTSTATUS
  180. NTAPI
  181. NtSetSecurityObject(
  182. IN HANDLE Handle,
  183. IN SECURITY_INFORMATION SecurityInformation,
  184. IN PSECURITY_DESCRIPTOR SecurityDescriptor
  185. );
  186. NTSYSCALLAPI
  187. NTSTATUS
  188. NTAPI
  189. NtQuerySecurityObject(
  190. IN HANDLE Handle,
  191. IN SECURITY_INFORMATION SecurityInformation,
  192. OUT PSECURITY_DESCRIPTOR SecurityDescriptor,
  193. IN ULONG Length,
  194. OUT PULONG LengthNeeded
  195. );
  196. NTSYSCALLAPI
  197. NTSTATUS
  198. NTAPI
  199. NtClose(
  200. IN HANDLE Handle
  201. );
  202. // end_ntifs
  203. NTSYSCALLAPI
  204. NTSTATUS
  205. NTAPI
  206. NtCreateDirectoryObject(
  207. OUT PHANDLE DirectoryHandle,
  208. IN ACCESS_MASK DesiredAccess,
  209. IN POBJECT_ATTRIBUTES ObjectAttributes
  210. );
  211. NTSYSCALLAPI
  212. NTSTATUS
  213. NTAPI
  214. NtOpenDirectoryObject(
  215. OUT PHANDLE DirectoryHandle,
  216. IN ACCESS_MASK DesiredAccess,
  217. IN POBJECT_ATTRIBUTES ObjectAttributes
  218. );
  219. typedef struct _OBJECT_DIRECTORY_INFORMATION {
  220. UNICODE_STRING Name;
  221. UNICODE_STRING TypeName;
  222. } OBJECT_DIRECTORY_INFORMATION, *POBJECT_DIRECTORY_INFORMATION;
  223. NTSYSCALLAPI
  224. NTSTATUS
  225. NTAPI
  226. NtQueryDirectoryObject(
  227. IN HANDLE DirectoryHandle,
  228. OUT PVOID Buffer,
  229. IN ULONG Length,
  230. IN BOOLEAN ReturnSingleEntry,
  231. IN BOOLEAN RestartScan,
  232. IN OUT PULONG Context,
  233. OUT PULONG ReturnLength OPTIONAL
  234. );
  235. NTSYSCALLAPI
  236. NTSTATUS
  237. NTAPI
  238. NtCreateSymbolicLinkObject(
  239. OUT PHANDLE LinkHandle,
  240. IN ACCESS_MASK DesiredAccess,
  241. IN POBJECT_ATTRIBUTES ObjectAttributes,
  242. IN PUNICODE_STRING LinkTarget
  243. );
  244. NTSYSCALLAPI
  245. NTSTATUS
  246. NTAPI
  247. NtOpenSymbolicLinkObject(
  248. OUT PHANDLE LinkHandle,
  249. IN ACCESS_MASK DesiredAccess,
  250. IN POBJECT_ATTRIBUTES ObjectAttributes
  251. );
  252. NTSYSCALLAPI
  253. NTSTATUS
  254. NTAPI
  255. NtQuerySymbolicLinkObject(
  256. IN HANDLE LinkHandle,
  257. IN OUT PUNICODE_STRING LinkTarget,
  258. OUT PULONG ReturnedLength OPTIONAL
  259. );
  260. #ifdef __cplusplus
  261. }
  262. #endif
  263. #endif // _NTOBAPI_