Source code of Windows XP (NT5)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

326 lines
6.6 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. } OBJECT_INFORMATION_CLASS;
  53. typedef struct _OBJECT_BASIC_INFORMATION {
  54. ULONG Attributes;
  55. ACCESS_MASK GrantedAccess;
  56. ULONG HandleCount;
  57. ULONG PointerCount;
  58. ULONG PagedPoolCharge;
  59. ULONG NonPagedPoolCharge;
  60. ULONG Reserved[ 3 ];
  61. ULONG NameInfoSize;
  62. ULONG TypeInfoSize;
  63. ULONG SecurityDescriptorSize;
  64. LARGE_INTEGER CreationTime;
  65. } OBJECT_BASIC_INFORMATION, *POBJECT_BASIC_INFORMATION;
  66. typedef struct _OBJECT_NAME_INFORMATION { // ntddk wdm nthal
  67. UNICODE_STRING Name; // ntddk wdm nthal
  68. } OBJECT_NAME_INFORMATION, *POBJECT_NAME_INFORMATION; // ntddk wdm nthal
  69. typedef struct _OBJECT_TYPE_INFORMATION {
  70. UNICODE_STRING TypeName;
  71. ULONG TotalNumberOfObjects;
  72. ULONG TotalNumberOfHandles;
  73. ULONG TotalPagedPoolUsage;
  74. ULONG TotalNonPagedPoolUsage;
  75. ULONG TotalNamePoolUsage;
  76. ULONG TotalHandleTableUsage;
  77. ULONG HighWaterNumberOfObjects;
  78. ULONG HighWaterNumberOfHandles;
  79. ULONG HighWaterPagedPoolUsage;
  80. ULONG HighWaterNonPagedPoolUsage;
  81. ULONG HighWaterNamePoolUsage;
  82. ULONG HighWaterHandleTableUsage;
  83. ULONG InvalidAttributes;
  84. GENERIC_MAPPING GenericMapping;
  85. ULONG ValidAccessMask;
  86. BOOLEAN SecurityRequired;
  87. BOOLEAN MaintainHandleCount;
  88. ULONG PoolType;
  89. ULONG DefaultPagedPoolCharge;
  90. ULONG DefaultNonPagedPoolCharge;
  91. } OBJECT_TYPE_INFORMATION, *POBJECT_TYPE_INFORMATION;
  92. typedef struct _OBJECT_TYPES_INFORMATION {
  93. ULONG NumberOfTypes;
  94. // OBJECT_TYPE_INFORMATION TypeInformation;
  95. } OBJECT_TYPES_INFORMATION, *POBJECT_TYPES_INFORMATION;
  96. typedef struct _OBJECT_HANDLE_FLAG_INFORMATION {
  97. BOOLEAN Inherit;
  98. BOOLEAN ProtectFromClose;
  99. } OBJECT_HANDLE_FLAG_INFORMATION, *POBJECT_HANDLE_FLAG_INFORMATION;
  100. NTSYSCALLAPI
  101. NTSTATUS
  102. NTAPI
  103. NtQueryObject(
  104. IN HANDLE Handle,
  105. IN OBJECT_INFORMATION_CLASS ObjectInformationClass,
  106. OUT PVOID ObjectInformation,
  107. IN ULONG Length,
  108. OUT PULONG ReturnLength OPTIONAL
  109. );
  110. NTSYSCALLAPI
  111. NTSTATUS
  112. NTAPI
  113. NtSetInformationObject(
  114. IN HANDLE Handle,
  115. IN OBJECT_INFORMATION_CLASS ObjectInformationClass,
  116. IN PVOID ObjectInformation,
  117. IN ULONG ObjectInformationLength
  118. );
  119. NTSYSCALLAPI
  120. NTSTATUS
  121. NTAPI
  122. NtDuplicateObject(
  123. IN HANDLE SourceProcessHandle,
  124. IN HANDLE SourceHandle,
  125. IN HANDLE TargetProcessHandle OPTIONAL,
  126. OUT PHANDLE TargetHandle OPTIONAL,
  127. IN ACCESS_MASK DesiredAccess,
  128. IN ULONG HandleAttributes,
  129. IN ULONG Options
  130. );
  131. // begin_ntddk begin_wdm
  132. #define DUPLICATE_CLOSE_SOURCE 0x00000001 // winnt
  133. #define DUPLICATE_SAME_ACCESS 0x00000002 // winnt
  134. #define DUPLICATE_SAME_ATTRIBUTES 0x00000004
  135. // end_ntddk end_wdm
  136. NTSYSCALLAPI
  137. NTSTATUS
  138. NTAPI
  139. NtMakeTemporaryObject(
  140. IN HANDLE Handle
  141. );
  142. NTSYSCALLAPI
  143. NTSTATUS
  144. NTAPI
  145. NtMakePermanentObject(
  146. IN HANDLE Handle
  147. );
  148. NTSYSCALLAPI
  149. NTSTATUS
  150. NTAPI
  151. NtSignalAndWaitForSingleObject(
  152. IN HANDLE SignalHandle,
  153. IN HANDLE WaitHandle,
  154. IN BOOLEAN Alertable,
  155. IN PLARGE_INTEGER Timeout OPTIONAL
  156. );
  157. NTSYSCALLAPI
  158. NTSTATUS
  159. NTAPI
  160. NtWaitForSingleObject(
  161. IN HANDLE Handle,
  162. IN BOOLEAN Alertable,
  163. IN PLARGE_INTEGER Timeout OPTIONAL
  164. );
  165. NTSYSCALLAPI
  166. NTSTATUS
  167. NTAPI
  168. NtWaitForMultipleObjects(
  169. IN ULONG Count,
  170. IN HANDLE Handles[],
  171. IN WAIT_TYPE WaitType,
  172. IN BOOLEAN Alertable,
  173. IN PLARGE_INTEGER Timeout OPTIONAL
  174. );
  175. // begin_ntifs
  176. NTSYSCALLAPI
  177. NTSTATUS
  178. NTAPI
  179. NtSetSecurityObject(
  180. IN HANDLE Handle,
  181. IN SECURITY_INFORMATION SecurityInformation,
  182. IN PSECURITY_DESCRIPTOR SecurityDescriptor
  183. );
  184. NTSYSCALLAPI
  185. NTSTATUS
  186. NTAPI
  187. NtQuerySecurityObject(
  188. IN HANDLE Handle,
  189. IN SECURITY_INFORMATION SecurityInformation,
  190. OUT PSECURITY_DESCRIPTOR SecurityDescriptor,
  191. IN ULONG Length,
  192. OUT PULONG LengthNeeded
  193. );
  194. NTSYSCALLAPI
  195. NTSTATUS
  196. NTAPI
  197. NtClose(
  198. IN HANDLE Handle
  199. );
  200. // end_ntifs
  201. NTSYSCALLAPI
  202. NTSTATUS
  203. NTAPI
  204. NtCreateDirectoryObject(
  205. OUT PHANDLE DirectoryHandle,
  206. IN ACCESS_MASK DesiredAccess,
  207. IN POBJECT_ATTRIBUTES ObjectAttributes
  208. );
  209. NTSYSCALLAPI
  210. NTSTATUS
  211. NTAPI
  212. NtOpenDirectoryObject(
  213. OUT PHANDLE DirectoryHandle,
  214. IN ACCESS_MASK DesiredAccess,
  215. IN POBJECT_ATTRIBUTES ObjectAttributes
  216. );
  217. typedef struct _OBJECT_DIRECTORY_INFORMATION {
  218. UNICODE_STRING Name;
  219. UNICODE_STRING TypeName;
  220. } OBJECT_DIRECTORY_INFORMATION, *POBJECT_DIRECTORY_INFORMATION;
  221. NTSYSCALLAPI
  222. NTSTATUS
  223. NTAPI
  224. NtQueryDirectoryObject(
  225. IN HANDLE DirectoryHandle,
  226. OUT PVOID Buffer,
  227. IN ULONG Length,
  228. IN BOOLEAN ReturnSingleEntry,
  229. IN BOOLEAN RestartScan,
  230. IN OUT PULONG Context,
  231. OUT PULONG ReturnLength OPTIONAL
  232. );
  233. NTSYSCALLAPI
  234. NTSTATUS
  235. NTAPI
  236. NtCreateSymbolicLinkObject(
  237. OUT PHANDLE LinkHandle,
  238. IN ACCESS_MASK DesiredAccess,
  239. IN POBJECT_ATTRIBUTES ObjectAttributes,
  240. IN PUNICODE_STRING LinkTarget
  241. );
  242. NTSYSCALLAPI
  243. NTSTATUS
  244. NTAPI
  245. NtOpenSymbolicLinkObject(
  246. OUT PHANDLE LinkHandle,
  247. IN ACCESS_MASK DesiredAccess,
  248. IN POBJECT_ATTRIBUTES ObjectAttributes
  249. );
  250. NTSYSCALLAPI
  251. NTSTATUS
  252. NTAPI
  253. NtQuerySymbolicLinkObject(
  254. IN HANDLE LinkHandle,
  255. IN OUT PUNICODE_STRING LinkTarget,
  256. OUT PULONG ReturnedLength OPTIONAL
  257. );
  258. #ifdef __cplusplus
  259. }
  260. #endif
  261. #endif // _NTOBAPI_