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.

2317 lines
48 KiB

  1. !INCLUDE $(NTMAKEENV)\makefile.plt
  2. !IFNDEF NTOSINC
  3. NTOSINC = $(PROJECT_ROOT)\ntos\inc
  4. !ENDIF
  5. PRVINC = $(PRIVATE_INC_PATH)
  6. PUBLISHEDDIR = $(PROJECT_ROOT)\published
  7. NTDDK_DEPENDS = $(NTOSINC)\ntosdef.h \
  8. $(SDK_INC_PATH)\nti386.h \
  9. $(SDK_INC_PATH)\ntamd64.h \
  10. $(SDK_INC_PATH)\ntia64.h \
  11. $(SDK_INC_PATH)\ntseapi.h \
  12. $(SDK_INC_PATH)\ntkeapi.h \
  13. $(SDK_INC_PATH)\ntrtl.h \
  14. $(SDK_INC_PATH)\devioctl.h \
  15. $(SDK_INC_PATH)\ntioapi.h \
  16. $(SDK_INC_PATH)\ntiolog.h \
  17. $(SDK_INC_PATH)\ntlpcapi.h \
  18. $(SDK_INC_PATH)\ntregapi.h \
  19. $(SDK_INC_PATH)\ntobapi.h \
  20. $(SDK_INC_PATH)\ntmmapi.h \
  21. $(SDK_INC_PATH)\ntpsapi.h \
  22. $(SDK_INC_PATH)\ntpoapi.h \
  23. $(SDK_INC_PATH)\ntpnpapi.h
  24. NTDDK_DEPENDS1= $(NTOSINC)\i386.h \
  25. $(NTOSINC)\amd64.h \
  26. $(NTOSINC)\ia64.h \
  27. $(SDK_INC_PATH)\ntexapi.h \
  28. $(SDK_INC_PATH)\ntconfig.h \
  29. $(SDK_INC_PATH)\ntxcapi.h \
  30. $(PUBLISHEDDIR)\arc.w \
  31. $(NTOSINC)\ke.h \
  32. $(NTOSINC)\kd.h \
  33. $(NTOSINC)\ex.h \
  34. $(NTOSINC)\cm.h \
  35. $(NTOSINC)\exboosts.h \
  36. $(NTOSINC)\mm.h \
  37. $(NTOSINC)\se.h \
  38. $(NTOSINC)\ps.h \
  39. $(NTOSINC)\io.h \
  40. $(NTOSINC)\wmi.h \
  41. $(PUBLISHEDDIR)\ntwmi.w \
  42. $(NTOSINC)\pnp.h \
  43. $(NTOSINC)\hal.h \
  44. $(NTOSINC)\po.h \
  45. $(NTOSINC)\fsrtl.h \
  46. $(NTOSINC)\ob.h \
  47. $(NTOSINC)\pci.h
  48. NTWDM_DEPENDS = $(NTOSINC)\ntosdef.h \
  49. $(SDK_INC_PATH)\nti386.h \
  50. $(SDK_INC_PATH)\ntamd64.h \
  51. $(SDK_INC_PATH)\ntia64.h \
  52. $(SDK_INC_PATH)\ntseapi.h \
  53. $(SDK_INC_PATH)\ntkeapi.h \
  54. $(SDK_INC_PATH)\ntrtl.h \
  55. $(SDK_INC_PATH)\devioctl.h \
  56. $(SDK_INC_PATH)\ntioapi.h \
  57. $(SDK_INC_PATH)\ntiolog.h \
  58. $(SDK_INC_PATH)\ntlpcapi.h \
  59. $(SDK_INC_PATH)\ntregapi.h \
  60. $(SDK_INC_PATH)\ntobapi.h \
  61. $(SDK_INC_PATH)\ntmmapi.h \
  62. $(SDK_INC_PATH)\ntpsapi.h \
  63. $(SDK_INC_PATH)\ntpoapi.h \
  64. $(SDK_INC_PATH)\ntpnpapi.h
  65. NTWDM_DEPENDS1= $(NTOSINC)\i386.h \
  66. $(NTOSINC)\amd64.h \
  67. $(NTOSINC)\ia64.h \
  68. $(SDK_INC_PATH)\ntexapi.h \
  69. $(SDK_INC_PATH)\ntconfig.h \
  70. $(SDK_INC_PATH)\ntxcapi.h \
  71. $(NTOSINC)\ke.h \
  72. $(NTOSINC)\kd.h \
  73. $(NTOSINC)\ex.h \
  74. $(NTOSINC)\cm.h \
  75. $(NTOSINC)\exboosts.h \
  76. $(NTOSINC)\mm.h \
  77. $(NTOSINC)\se.h \
  78. $(NTOSINC)\ps.h \
  79. $(NTOSINC)\io.h \
  80. $(NTOSINC)\wmi.h \
  81. $(PUBLISHEDDIR)\ntwmi.w \
  82. $(NTOSINC)\pnp.h \
  83. $(NTOSINC)\hal.h \
  84. $(NTOSINC)\po.h \
  85. $(NTOSINC)\ob.h \
  86. $(NTOSINC)\pci.h
  87. NTHAL_DEPENDS1= $(SDK_INC_PATH)\nti386.h \
  88. $(SDK_INC_PATH)\ntamd64.h \
  89. $(SDK_INC_PATH)\ntia64.h \
  90. $(SDK_INC_PATH)\ntpsapi.h \
  91. $(SDK_INC_PATH)\devioctl.h \
  92. $(SDK_INC_PATH)\ntseapi.h \
  93. $(SDK_INC_PATH)\ntkeapi.h \
  94. $(SDK_INC_PATH)\ntlpcapi.h \
  95. $(SDK_INC_PATH)\ntrtl.h \
  96. $(SDK_INC_PATH)\ntregapi.h \
  97. $(SDK_INC_PATH)\ntioapi.h \
  98. $(SDK_INC_PATH)\ntiolog.h \
  99. $(SDK_INC_PATH)\ntexapi.h \
  100. $(SDK_INC_PATH)\ntobapi.h \
  101. $(SDK_INC_PATH)\ntconfig.h \
  102. $(SDK_INC_PATH)\ntpnpapi.h \
  103. $(SDK_INC_PATH)\ntpoapi.h \
  104. $(SDK_INC_PATH)\ntxcapi.h \
  105. $(NTOSINC)\ntosdef.h \
  106. $(NTOSINC)\i386.h \
  107. $(NTOSINC)\amd64.h \
  108. $(NTOSINC)\ia64.h
  109. NTHAL_DEPENDS2= $(NTOSINC)\ke.h \
  110. $(NTOSINC)\kd.h \
  111. $(NTOSINC)\ex.h \
  112. $(NTOSINC)\se.h \
  113. $(NTOSINC)\ps.h \
  114. $(NTOSINC)\io.h \
  115. $(NTOSINC)\pnp.h \
  116. $(NTOSINC)\po.h \
  117. $(NTOSINC)\mm.h \
  118. $(NTOSINC)\ob.h \
  119. $(NTOSINC)\hal.h
  120. NTMINIPORT_DEPENDS = \
  121. $(SDK_INC_PATH)\ntdef.h \
  122. $(SDK_INC_PATH)\nti386.h \
  123. $(SDK_INC_PATH)\ntia64.h \
  124. $(SDK_INC_PATH)\ntioapi.h \
  125. $(SDK_INC_PATH)\ntrtl.h \
  126. $(NTOSINC)\ke.h \
  127. $(NTOSINC)\v86emul.h \
  128. $(NTOSINC)\pci.h \
  129. $(NTOSINC)\mm.h \
  130. $(NTOSINC)\io.h \
  131. $(NTOSINC)\pnp.h \
  132. $(SDK_INC_PATH)\ntconfig.h
  133. NTIFS_DEPENDS = $(SDK_INC_PATH)\ntseapi.h \
  134. $(NTOSINC)\ntosdef.h \
  135. $(SDK_INC_PATH)\ntkeapi.h
  136. NTIFS_DEPENDS1= $(SDK_INC_PATH)\nti386.h \
  137. $(SDK_INC_PATH)\ntamd64.h \
  138. $(SDK_INC_PATH)\ntia64.h
  139. NTIFS_DEPENDS2= $(SDK_INC_PATH)\ntrtl.h \
  140. $(SDK_INC_PATH)\ntpoapi.h \
  141. $(SDK_INC_PATH)\devioctl.h \
  142. $(SDK_INC_PATH)\ntpsapi.h \
  143. $(SDK_INC_PATH)\ntlsa.h \
  144. $(SDK_INC_PATH)\ntmsv1_0.h \
  145. $(SDK_INC_PATH)\ntioapi.h \
  146. $(SDK_INC_PATH)\ntlpcapi.h \
  147. $(SDK_INC_PATH)\ntobapi.h \
  148. $(SDK_INC_PATH)\ntmmapi.h \
  149. $(NTOSINC)\exboosts.h
  150. NTIFS_DEPENDS3= $(NTOSINC)\i386.h \
  151. $(NTOSINC)\amd64.h \
  152. $(NTOSINC)\ia64.h \
  153. $(BASE_INC_PATH)\arc.h \
  154. $(SDK_INC_PATH)\ntobapi.h \
  155. $(SDK_INC_PATH)\ntconfig.h \
  156. $(SDK_INC_PATH)\ntregapi.h \
  157. $(SDK_INC_PATH)\ntmmapi.h \
  158. $(SDK_INC_PATH)\ntxcapi.h \
  159. $(SDK_INC_PATH)\ntlpcapi.h \
  160. $(SDK_INC_PATH)\ntiolog.h
  161. NTIFS_DEPENDS4= $(SDK_INC_PATH)\ntexapi.h \
  162. $(NTOSINC)\ke.h \
  163. $(NTOSINC)\ex.h \
  164. $(NTOSINC)\se.h \
  165. $(NTOSINC)\ps.h \
  166. $(NTOSINC)\io.h \
  167. $(NTOSINC)\po.h \
  168. $(NTOSINC)\hal.h \
  169. $(NTOSINC)\mm.h \
  170. $(NTOSINC)\ob.h \
  171. $(NTOSINC)\fsrtl.h \
  172. $(NTOSINC)\cache.h \
  173. $(SDK_INC_PATH)\sspi.h \
  174. $(DS_INC_PATH)\secint.h \
  175. $(BASE_INC_PATH)\zwapi.h \
  176. $(NTOSINC)\kd.h \
  177. $(DRIVERS_INC_PATH)\ntddsnap.h
  178. NTWMIKM_DEPENDS = $(NTOSINC)\io.h \
  179. $(PUBLISHEDDIR)\ntwmi.w \
  180. $(NTOSINC)\wmi.h
  181. NTOSP_DEPENDS = $(NTOSINC)\ntosdef.h \
  182. $(SDK_INC_PATH)\ntkeapi.h \
  183. $(SDK_INC_PATH)\ntrtl.h \
  184. $(NTOSINC)\v86emul.h \
  185. $(NTOSINC)\i386.h \
  186. $(NTOSINC)\init.h \
  187. $(NTOSINC)\amd64.h \
  188. $(NTOSINC)\ia64.h \
  189. $(SDK_INC_PATH)\ntseapi.h \
  190. $(NTOSINC)\cm.h \
  191. $(PUBLISHEDDIR)\arc.w \
  192. $(NTOSINC)\ke.h \
  193. $(NTOSINC)\ex.h \
  194. $(NTOSINC)\kd.h \
  195. $(NTOSINC)\exboosts.h \
  196. $(NTOSINC)\io.h \
  197. $(NTOSINC)\pnp.h \
  198. $(NTOSINC)\hal.h \
  199. $(NTOSINC)\mm.h \
  200. $(NTOSINC)\se.h \
  201. $(NTOSINC)\po.h \
  202. $(NTOSINC)\ps.h \
  203. $(NTOSINC)\ob.h \
  204. $(NTOSINC)\pci.h \
  205. $(NTOSINC)\fsrtl.h \
  206. $(NTOSINC)\lpc.h
  207. NDIS_BASE_DEPENDS = \
  208. $(SDK_INC_PATH)\ntdef.h \
  209. $(NTOSINC)\ntosdef.h \
  210. $(SDK_INC_PATH)\ntkeapi.h \
  211. $(SDK_INC_PATH)\ntioapi.h \
  212. $(SDK_INC_PATH)\ntrtl.h \
  213. $(SDK_INC_PATH)\ntiolog.h \
  214. $(NTOSINC)\i386.h \
  215. $(NTOSINC)\amd64.h \
  216. $(NTOSINC)\ia64.h \
  217. $(SDK_INC_PATH)\ntconfig.h \
  218. $(NTOSINC)\ke.h \
  219. $(NTOSINC)\io.h \
  220. $(NTOSINC)\hal.h \
  221. $(NTOSINC)\ex.h \
  222. $(NTOSINC)\pci.h \
  223. $(NTOSINC)\mm.h \
  224. !ifndef O
  225. O=$(_OBJ_DIR)\$(TARGET_DIRECTORY)
  226. !endif
  227. !if !exist($(O))
  228. !if [-mkdir $(O)]
  229. !endif
  230. !endif
  231. all: $(DDK_INC_PATH)\ntddk.h \
  232. $(SDK_INC_PATH)\wdm.nt \
  233. $(HALKIT_INC_PATH)\nthal.h \
  234. $(DDK_INC_PATH)\miniport.h \
  235. $(PRVINC)\wmikm.h \
  236. $(IFSKIT_INC_PATH)\ntifs.h \
  237. $(PRVINC)\ntosp.h \
  238. $(PRVINC)\class.h \
  239. $(PRVINC)\tape.h \
  240. $(PRVINC)\ndisbase.w \
  241. keheaders
  242. !IF "$(BUILDMSG)" != ""
  243. echo $(BUILDMSG)
  244. !ENDIF
  245. clean: cleaninc all
  246. cleaninc:
  247. -del $(O)\*.* /q
  248. $(DDK_INC_PATH)\ntddk.h: $(O)\ntddk.h
  249. $(PUBLISH_CMD) {$?=$@}
  250. $(SDK_INC_PATH)\wdm.nt: $(O)\wdm.nt
  251. $(PUBLISH_CMD) {$?=$@}
  252. $(HALKIT_INC_PATH)\nthal.h: $(O)\nthal.h
  253. $(PUBLISH_CMD) {$?=$@}
  254. $(DDK_INC_PATH)\miniport.h: $(O)\miniport.h
  255. $(PUBLISH_CMD) {$?=$(DDK_INC_PATH)\miniport.h}
  256. $(PRVINC)\ndisbase.w: $(O)\ndisbase.w
  257. $(PUBLISH_CMD) {$?=$@}
  258. $(IFSKIT_INC_PATH)\ntifs.h: $(O)\ntifs.h
  259. $(PUBLISH_CMD) {$?=$@}
  260. $(PRVINC)\wmikm.h: $(O)\wmikm.h
  261. $(PUBLISH_CMD) {$?=$@}
  262. $(PRVINC)\ntosp.h: $(O)\ntosp.h
  263. $(PUBLISH_CMD) {$?=$@}
  264. $(PRVINC)\class.h: inc\class.h
  265. $(PUBLISH_CMD) {$?=$@}
  266. $(PRVINC)\tape.h: inc\tape.h
  267. $(PUBLISH_CMD) {$?=$@}
  268. $(O)\ntddk.h: $(NTDDK_DEPENDS) $(NTDDK_DEPENDS1) makefil0
  269. type << > $@
  270. /*++ BUILD Version: ???? // Increment this if a change has global effects
  271. $(COPYRIGHT_STRING)
  272. Module Name:
  273. ntddk.h
  274. Abstract:
  275. This module defines the NT types, constants, and functions that are
  276. exposed to device drivers.
  277. Revision History:
  278. --*/
  279. #ifndef _NTDDK_
  280. #define _NTDDK_
  281. #ifndef RC_INVOKED
  282. #if _MSC_VER < 1300
  283. #error Compiler version not supported by Windows DDK
  284. #endif
  285. #endif // RC_INVOKED
  286. #define NT_INCLUDED
  287. #define _CTYPE_DISABLE_MACROS
  288. #include <excpt.h>
  289. #include <ntdef.h>
  290. #include <ntstatus.h>
  291. #include <bugcodes.h>
  292. #include <ntiologc.h>
  293. <<
  294. type $(NTOSINC)\exlevels.h >> $@
  295. type << >> $@
  296. //
  297. // Define types that are not exported.
  298. //
  299. typedef struct _BUS_HANDLER *PBUS_HANDLER;
  300. typedef struct _CALLBACK_OBJECT *PCALLBACK_OBJECT;
  301. typedef struct _DEVICE_HANDLER_OBJECT *PDEVICE_HANDLER_OBJECT;
  302. typedef struct _EPROCESS *PEPROCESS;
  303. typedef struct _ETHREAD *PETHREAD;
  304. typedef struct _IO_TIMER *PIO_TIMER;
  305. typedef struct _KINTERRUPT *PKINTERRUPT;
  306. typedef struct _KTHREAD *PKTHREAD, *PRKTHREAD;
  307. typedef struct _OBJECT_TYPE *POBJECT_TYPE;
  308. typedef struct _PEB *PPEB;
  309. #if defined(_M_AMD64)
  310. PKTHREAD
  311. NTAPI
  312. KeGetCurrentThread(
  313. VOID
  314. );
  315. #endif // defined(_M_AMD64)
  316. #if defined(_M_IX86)
  317. PKTHREAD NTAPI KeGetCurrentThread();
  318. #endif // defined(_M_IX86)
  319. #if defined(_M_IA64)
  320. //
  321. // Define Address of Processor Control Registers.
  322. //
  323. #define KIPCR ((ULONG_PTR)(KADDRESS_BASE + 0xffff0000)) // kernel address of first PCR
  324. //
  325. // Define Pointer to Processor Control Registers.
  326. //
  327. #define PCR ((volatile KPCR * const)KIPCR)
  328. PKTHREAD NTAPI KeGetCurrentThread();
  329. #endif // defined(_M_IA64)
  330. #define PsGetCurrentProcess() IoGetCurrentProcess()
  331. #define PsGetCurrentThread() ((PETHREAD) (KeGetCurrentThread()))
  332. extern NTSYSAPI CCHAR KeNumberProcessors;
  333. #include <mce.h>
  334. #ifndef FAR
  335. #define FAR
  336. #endif
  337. <<
  338. hextract -o $@ -lt ntddk -bt begin_ntddk end_ntddk $(NTDDK_DEPENDS)
  339. hextract -o $@ -lt ntddk -bt begin_ntddk end_ntddk $(NTDDK_DEPENDS1)
  340. type << >> $@
  341. #ifdef POOL_TAGGING
  342. #define ExAllocatePool(a,b) ExAllocatePoolWithTag(a,b,' kdD')
  343. #define ExAllocatePoolWithQuota(a,b) ExAllocatePoolWithQuotaTag(a,b,' kdD')
  344. #endif
  345. extern POBJECT_TYPE *IoFileObjectType;
  346. extern POBJECT_TYPE *ExEventObjectType;
  347. extern POBJECT_TYPE *ExSemaphoreObjectType;
  348. //
  349. // Define exported ZwXxx routines to device drivers.
  350. //
  351. NTSYSAPI
  352. NTSTATUS
  353. NTAPI
  354. ZwCreateFile(
  355. OUT PHANDLE FileHandle,
  356. IN ACCESS_MASK DesiredAccess,
  357. IN POBJECT_ATTRIBUTES ObjectAttributes,
  358. OUT PIO_STATUS_BLOCK IoStatusBlock,
  359. IN PLARGE_INTEGER AllocationSize OPTIONAL,
  360. IN ULONG FileAttributes,
  361. IN ULONG ShareAccess,
  362. IN ULONG CreateDisposition,
  363. IN ULONG CreateOptions,
  364. IN PVOID EaBuffer OPTIONAL,
  365. IN ULONG EaLength
  366. );
  367. NTSYSAPI
  368. NTSTATUS
  369. NTAPI
  370. ZwOpenFile(
  371. OUT PHANDLE FileHandle,
  372. IN ACCESS_MASK DesiredAccess,
  373. IN POBJECT_ATTRIBUTES ObjectAttributes,
  374. OUT PIO_STATUS_BLOCK IoStatusBlock,
  375. IN ULONG ShareAccess,
  376. IN ULONG OpenOptions
  377. );
  378. NTSYSAPI
  379. NTSTATUS
  380. NTAPI
  381. ZwQueryInformationFile(
  382. IN HANDLE FileHandle,
  383. OUT PIO_STATUS_BLOCK IoStatusBlock,
  384. OUT PVOID FileInformation,
  385. IN ULONG Length,
  386. IN FILE_INFORMATION_CLASS FileInformationClass
  387. );
  388. NTSYSAPI
  389. NTSTATUS
  390. NTAPI
  391. ZwSetInformationFile(
  392. IN HANDLE FileHandle,
  393. OUT PIO_STATUS_BLOCK IoStatusBlock,
  394. IN PVOID FileInformation,
  395. IN ULONG Length,
  396. IN FILE_INFORMATION_CLASS FileInformationClass
  397. );
  398. NTSYSAPI
  399. NTSTATUS
  400. NTAPI
  401. ZwReadFile(
  402. IN HANDLE FileHandle,
  403. IN HANDLE Event OPTIONAL,
  404. IN PIO_APC_ROUTINE ApcRoutine OPTIONAL,
  405. IN PVOID ApcContext OPTIONAL,
  406. OUT PIO_STATUS_BLOCK IoStatusBlock,
  407. OUT PVOID Buffer,
  408. IN ULONG Length,
  409. IN PLARGE_INTEGER ByteOffset OPTIONAL,
  410. IN PULONG Key OPTIONAL
  411. );
  412. NTSYSAPI
  413. NTSTATUS
  414. NTAPI
  415. ZwWriteFile(
  416. IN HANDLE FileHandle,
  417. IN HANDLE Event OPTIONAL,
  418. IN PIO_APC_ROUTINE ApcRoutine OPTIONAL,
  419. IN PVOID ApcContext OPTIONAL,
  420. OUT PIO_STATUS_BLOCK IoStatusBlock,
  421. IN PVOID Buffer,
  422. IN ULONG Length,
  423. IN PLARGE_INTEGER ByteOffset OPTIONAL,
  424. IN PULONG Key OPTIONAL
  425. );
  426. NTSYSAPI
  427. NTSTATUS
  428. NTAPI
  429. ZwClose(
  430. IN HANDLE Handle
  431. );
  432. NTSYSAPI
  433. NTSTATUS
  434. NTAPI
  435. ZwCreateDirectoryObject(
  436. OUT PHANDLE DirectoryHandle,
  437. IN ACCESS_MASK DesiredAccess,
  438. IN POBJECT_ATTRIBUTES ObjectAttributes
  439. );
  440. NTSYSAPI
  441. NTSTATUS
  442. NTAPI
  443. ZwMakeTemporaryObject(
  444. IN HANDLE Handle
  445. );
  446. NTSYSAPI
  447. NTSTATUS
  448. NTAPI
  449. ZwOpenSection(
  450. OUT PHANDLE SectionHandle,
  451. IN ACCESS_MASK DesiredAccess,
  452. IN POBJECT_ATTRIBUTES ObjectAttributes
  453. );
  454. NTSYSAPI
  455. NTSTATUS
  456. NTAPI
  457. ZwMapViewOfSection(
  458. IN HANDLE SectionHandle,
  459. IN HANDLE ProcessHandle,
  460. IN OUT PVOID *BaseAddress,
  461. IN ULONG ZeroBits,
  462. IN ULONG CommitSize,
  463. IN OUT PLARGE_INTEGER SectionOffset OPTIONAL,
  464. IN OUT PSIZE_T ViewSize,
  465. IN SECTION_INHERIT InheritDisposition,
  466. IN ULONG AllocationType,
  467. IN ULONG Protect
  468. );
  469. NTSYSAPI
  470. NTSTATUS
  471. NTAPI
  472. ZwUnmapViewOfSection(
  473. IN HANDLE ProcessHandle,
  474. IN PVOID BaseAddress
  475. );
  476. NTSYSAPI
  477. NTSTATUS
  478. NTAPI
  479. ZwSetInformationThread(
  480. IN HANDLE ThreadHandle,
  481. IN THREADINFOCLASS ThreadInformationClass,
  482. IN PVOID ThreadInformation,
  483. IN ULONG ThreadInformationLength
  484. );
  485. NTSYSAPI
  486. NTSTATUS
  487. NTAPI
  488. ZwCreateKey(
  489. OUT PHANDLE KeyHandle,
  490. IN ACCESS_MASK DesiredAccess,
  491. IN POBJECT_ATTRIBUTES ObjectAttributes,
  492. IN ULONG TitleIndex,
  493. IN PUNICODE_STRING Class OPTIONAL,
  494. IN ULONG CreateOptions,
  495. OUT PULONG Disposition OPTIONAL
  496. );
  497. NTSYSAPI
  498. NTSTATUS
  499. NTAPI
  500. ZwOpenKey(
  501. OUT PHANDLE KeyHandle,
  502. IN ACCESS_MASK DesiredAccess,
  503. IN POBJECT_ATTRIBUTES ObjectAttributes
  504. );
  505. NTSYSAPI
  506. NTSTATUS
  507. NTAPI
  508. ZwDeleteKey(
  509. IN HANDLE KeyHandle
  510. );
  511. NTSYSAPI
  512. NTSTATUS
  513. NTAPI
  514. ZwDeleteValueKey(
  515. IN HANDLE KeyHandle,
  516. IN PUNICODE_STRING ValueName
  517. );
  518. NTSYSAPI
  519. NTSTATUS
  520. NTAPI
  521. ZwEnumerateKey(
  522. IN HANDLE KeyHandle,
  523. IN ULONG Index,
  524. IN KEY_INFORMATION_CLASS KeyInformationClass,
  525. OUT PVOID KeyInformation,
  526. IN ULONG Length,
  527. OUT PULONG ResultLength
  528. );
  529. NTSYSAPI
  530. NTSTATUS
  531. NTAPI
  532. ZwEnumerateValueKey(
  533. IN HANDLE KeyHandle,
  534. IN ULONG Index,
  535. IN KEY_VALUE_INFORMATION_CLASS KeyValueInformationClass,
  536. OUT PVOID KeyValueInformation,
  537. IN ULONG Length,
  538. OUT PULONG ResultLength
  539. );
  540. NTSYSAPI
  541. NTSTATUS
  542. NTAPI
  543. ZwFlushKey(
  544. IN HANDLE KeyHandle
  545. );
  546. NTSYSAPI
  547. NTSTATUS
  548. NTAPI
  549. ZwQueryKey(
  550. IN HANDLE KeyHandle,
  551. IN KEY_INFORMATION_CLASS KeyInformationClass,
  552. OUT PVOID KeyInformation,
  553. IN ULONG Length,
  554. OUT PULONG ResultLength
  555. );
  556. NTSYSAPI
  557. NTSTATUS
  558. NTAPI
  559. ZwQueryValueKey(
  560. IN HANDLE KeyHandle,
  561. IN PUNICODE_STRING ValueName,
  562. IN KEY_VALUE_INFORMATION_CLASS KeyValueInformationClass,
  563. OUT PVOID KeyValueInformation,
  564. IN ULONG Length,
  565. OUT PULONG ResultLength
  566. );
  567. NTSYSAPI
  568. NTSTATUS
  569. NTAPI
  570. ZwSetValueKey(
  571. IN HANDLE KeyHandle,
  572. IN PUNICODE_STRING ValueName,
  573. IN ULONG TitleIndex OPTIONAL,
  574. IN ULONG Type,
  575. IN PVOID Data,
  576. IN ULONG DataSize
  577. );
  578. NTSYSAPI
  579. NTSTATUS
  580. NTAPI
  581. ZwOpenSymbolicLinkObject(
  582. OUT PHANDLE LinkHandle,
  583. IN ACCESS_MASK DesiredAccess,
  584. IN POBJECT_ATTRIBUTES ObjectAttributes
  585. );
  586. NTSYSAPI
  587. NTSTATUS
  588. NTAPI
  589. ZwQuerySymbolicLinkObject(
  590. IN HANDLE LinkHandle,
  591. IN OUT PUNICODE_STRING LinkTarget,
  592. OUT PULONG ReturnedLength OPTIONAL
  593. );
  594. NTSTATUS
  595. ZwCreateTimer (
  596. OUT PHANDLE TimerHandle,
  597. IN ACCESS_MASK DesiredAccess,
  598. IN POBJECT_ATTRIBUTES ObjectAttributes OPTIONAL,
  599. IN TIMER_TYPE TimerType
  600. );
  601. NTSTATUS
  602. ZwOpenTimer (
  603. OUT PHANDLE TimerHandle,
  604. IN ACCESS_MASK DesiredAccess,
  605. IN POBJECT_ATTRIBUTES ObjectAttributes
  606. );
  607. NTSTATUS
  608. ZwCancelTimer (
  609. IN HANDLE TimerHandle,
  610. OUT PBOOLEAN CurrentState OPTIONAL
  611. );
  612. NTSTATUS
  613. ZwSetTimer (
  614. IN HANDLE TimerHandle,
  615. IN PLARGE_INTEGER DueTime,
  616. IN PTIMER_APC_ROUTINE TimerApcRoutine OPTIONAL,
  617. IN PVOID TimerContext OPTIONAL,
  618. IN BOOLEAN WakeTimer,
  619. IN LONG Period OPTIONAL,
  620. OUT PBOOLEAN PreviousState OPTIONAL
  621. );
  622. #endif // _NTDDK_
  623. <<
  624. $(O)\wdm.nt: $(NTWDM_DEPENDS) $(NTWDM_DEPENDS1) makefil0 wdm.mng
  625. type << > $@
  626. /*++ BUILD Version: ???? // Increment this if a change has global effects
  627. $(COPYRIGHT_STRING)
  628. Module Name:
  629. wdm.h
  630. Abstract:
  631. This module defines the WDM types, constants, and functions that are
  632. exposed to device drivers.
  633. Revision History:
  634. --*/
  635. #ifndef _WDMDDK_
  636. #define _WDMDDK_
  637. #define _NTDDK_
  638. #ifndef RC_INVOKED
  639. #if _MSC_VER < 1300
  640. #error Compiler version not supported by Windows DDK
  641. #endif
  642. #endif // RC_INVOKED
  643. #define NT_INCLUDED
  644. #define _CTYPE_DISABLE_MACROS
  645. #include <excpt.h>
  646. #include <ntdef.h>
  647. #include <ntstatus.h>
  648. #include <bugcodes.h>
  649. #include <ntiologc.h>
  650. //
  651. // Define types that are not exported.
  652. //
  653. typedef struct _ACCESS_STATE *PACCESS_STATE;
  654. typedef struct _CALLBACK_OBJECT *PCALLBACK_OBJECT;
  655. typedef struct _EPROCESS *PEPROCESS;
  656. typedef struct _ETHREAD *PETHREAD;
  657. typedef struct _IO_TIMER *PIO_TIMER;
  658. typedef struct _KINTERRUPT *PKINTERRUPT;
  659. typedef struct _KTHREAD *PKTHREAD, *PRKTHREAD;
  660. typedef struct _OBJECT_TYPE *POBJECT_TYPE;
  661. typedef struct _SECURITY_QUALITY_OF_SERVICE *PSECURITY_QUALITY_OF_SERVICE;
  662. #if defined(_M_AMD64)
  663. PKTHREAD
  664. NTAPI
  665. KeGetCurrentThread(
  666. VOID
  667. );
  668. #endif // defined(_M_AMD64)
  669. #if defined(_M_IX86)
  670. PKTHREAD NTAPI KeGetCurrentThread();
  671. #endif // defined(_M_IX86)
  672. #if defined(_M_IA64)
  673. //
  674. // Define base address for kernel and user space
  675. //
  676. #ifdef _WIN64
  677. #define UREGION_INDEX 1
  678. #define KREGION_INDEX 7
  679. #define UADDRESS_BASE ((ULONG_PTR)UREGION_INDEX << 61)
  680. #define KADDRESS_BASE ((ULONG_PTR)KREGION_INDEX << 61)
  681. #else // !_WIN64
  682. #define KADDRESS_BASE 0
  683. #define UADDRESS_BASE 0
  684. #endif // !_WIN64
  685. //
  686. // Define Address of Processor Control Registers.
  687. //
  688. #define KIPCR ((ULONG_PTR)(KADDRESS_BASE + 0xffff0000)) // kernel address of first PCR
  689. //
  690. // Define Pointer to Processor Control Registers.
  691. //
  692. #define PCR ((volatile KPCR * const)KIPCR)
  693. PKTHREAD NTAPI KeGetCurrentThread();
  694. #endif // defined(_M_IA64)
  695. #include <mce.h>
  696. #ifndef FAR
  697. #define FAR
  698. #endif
  699. #define PsGetCurrentProcess() IoGetCurrentProcess()
  700. #define PsGetCurrentThread() ((PETHREAD) (KeGetCurrentThread()))
  701. extern NTSYSAPI CCHAR KeNumberProcessors;
  702. <<
  703. hextract -o $@ -lt wdm -bt begin_wdm end_wdm $(NTWDM_DEPENDS)
  704. hextract -o $@ -lt wdm -bt begin_wdm end_wdm $(NTWDM_DEPENDS1)
  705. type << >> $@
  706. #ifdef POOL_TAGGING
  707. #define ExAllocatePool(a,b) ExAllocatePoolWithTag(a,b,' mdW')
  708. #define ExAllocatePoolWithQuota(a,b) ExAllocatePoolWithQuotaTag(a,b,' kdD')
  709. #endif
  710. extern POBJECT_TYPE *IoFileObjectType;
  711. extern POBJECT_TYPE *ExEventObjectType;
  712. extern POBJECT_TYPE *ExSemaphoreObjectType;
  713. //
  714. // Define exported ZwXxx routines to device drivers.
  715. //
  716. NTSYSAPI
  717. NTSTATUS
  718. NTAPI
  719. ZwCreateFile(
  720. OUT PHANDLE FileHandle,
  721. IN ACCESS_MASK DesiredAccess,
  722. IN POBJECT_ATTRIBUTES ObjectAttributes,
  723. OUT PIO_STATUS_BLOCK IoStatusBlock,
  724. IN PLARGE_INTEGER AllocationSize OPTIONAL,
  725. IN ULONG FileAttributes,
  726. IN ULONG ShareAccess,
  727. IN ULONG CreateDisposition,
  728. IN ULONG CreateOptions,
  729. IN PVOID EaBuffer OPTIONAL,
  730. IN ULONG EaLength
  731. );
  732. NTSYSAPI
  733. NTSTATUS
  734. NTAPI
  735. ZwOpenFile(
  736. OUT PHANDLE FileHandle,
  737. IN ACCESS_MASK DesiredAccess,
  738. IN POBJECT_ATTRIBUTES ObjectAttributes,
  739. OUT PIO_STATUS_BLOCK IoStatusBlock,
  740. IN ULONG ShareAccess,
  741. IN ULONG OpenOptions
  742. );
  743. NTSYSAPI
  744. NTSTATUS
  745. NTAPI
  746. ZwQueryInformationFile(
  747. IN HANDLE FileHandle,
  748. OUT PIO_STATUS_BLOCK IoStatusBlock,
  749. OUT PVOID FileInformation,
  750. IN ULONG Length,
  751. IN FILE_INFORMATION_CLASS FileInformationClass
  752. );
  753. NTSYSAPI
  754. NTSTATUS
  755. NTAPI
  756. ZwSetInformationFile(
  757. IN HANDLE FileHandle,
  758. OUT PIO_STATUS_BLOCK IoStatusBlock,
  759. IN PVOID FileInformation,
  760. IN ULONG Length,
  761. IN FILE_INFORMATION_CLASS FileInformationClass
  762. );
  763. NTSYSAPI
  764. NTSTATUS
  765. NTAPI
  766. ZwReadFile(
  767. IN HANDLE FileHandle,
  768. IN HANDLE Event OPTIONAL,
  769. IN PIO_APC_ROUTINE ApcRoutine OPTIONAL,
  770. IN PVOID ApcContext OPTIONAL,
  771. OUT PIO_STATUS_BLOCK IoStatusBlock,
  772. OUT PVOID Buffer,
  773. IN ULONG Length,
  774. IN PLARGE_INTEGER ByteOffset OPTIONAL,
  775. IN PULONG Key OPTIONAL
  776. );
  777. NTSYSAPI
  778. NTSTATUS
  779. NTAPI
  780. ZwWriteFile(
  781. IN HANDLE FileHandle,
  782. IN HANDLE Event OPTIONAL,
  783. IN PIO_APC_ROUTINE ApcRoutine OPTIONAL,
  784. IN PVOID ApcContext OPTIONAL,
  785. OUT PIO_STATUS_BLOCK IoStatusBlock,
  786. IN PVOID Buffer,
  787. IN ULONG Length,
  788. IN PLARGE_INTEGER ByteOffset OPTIONAL,
  789. IN PULONG Key OPTIONAL
  790. );
  791. NTSYSAPI
  792. NTSTATUS
  793. NTAPI
  794. ZwClose(
  795. IN HANDLE Handle
  796. );
  797. NTSYSAPI
  798. NTSTATUS
  799. NTAPI
  800. ZwCreateDirectoryObject(
  801. OUT PHANDLE DirectoryHandle,
  802. IN ACCESS_MASK DesiredAccess,
  803. IN POBJECT_ATTRIBUTES ObjectAttributes
  804. );
  805. NTSYSAPI
  806. NTSTATUS
  807. NTAPI
  808. ZwMakeTemporaryObject(
  809. IN HANDLE Handle
  810. );
  811. NTSYSAPI
  812. NTSTATUS
  813. NTAPI
  814. ZwOpenSection(
  815. OUT PHANDLE SectionHandle,
  816. IN ACCESS_MASK DesiredAccess,
  817. IN POBJECT_ATTRIBUTES ObjectAttributes
  818. );
  819. NTSYSAPI
  820. NTSTATUS
  821. NTAPI
  822. ZwMapViewOfSection(
  823. IN HANDLE SectionHandle,
  824. IN HANDLE ProcessHandle,
  825. IN OUT PVOID *BaseAddress,
  826. IN ULONG ZeroBits,
  827. IN ULONG CommitSize,
  828. IN OUT PLARGE_INTEGER SectionOffset OPTIONAL,
  829. IN OUT PSIZE_T ViewSize,
  830. IN SECTION_INHERIT InheritDisposition,
  831. IN ULONG AllocationType,
  832. IN ULONG Protect
  833. );
  834. NTSYSAPI
  835. NTSTATUS
  836. NTAPI
  837. ZwUnmapViewOfSection(
  838. IN HANDLE ProcessHandle,
  839. IN PVOID BaseAddress
  840. );
  841. NTSYSAPI
  842. NTSTATUS
  843. NTAPI
  844. ZwCreateKey(
  845. OUT PHANDLE KeyHandle,
  846. IN ACCESS_MASK DesiredAccess,
  847. IN POBJECT_ATTRIBUTES ObjectAttributes,
  848. IN ULONG TitleIndex,
  849. IN PUNICODE_STRING Class OPTIONAL,
  850. IN ULONG CreateOptions,
  851. OUT PULONG Disposition OPTIONAL
  852. );
  853. NTSYSAPI
  854. NTSTATUS
  855. NTAPI
  856. ZwOpenKey(
  857. OUT PHANDLE KeyHandle,
  858. IN ACCESS_MASK DesiredAccess,
  859. IN POBJECT_ATTRIBUTES ObjectAttributes
  860. );
  861. NTSYSAPI
  862. NTSTATUS
  863. NTAPI
  864. ZwDeleteKey(
  865. IN HANDLE KeyHandle
  866. );
  867. NTSYSAPI
  868. NTSTATUS
  869. NTAPI
  870. ZwDeleteValueKey(
  871. IN HANDLE KeyHandle,
  872. IN PUNICODE_STRING ValueName
  873. );
  874. NTSYSAPI
  875. NTSTATUS
  876. NTAPI
  877. ZwEnumerateKey(
  878. IN HANDLE KeyHandle,
  879. IN ULONG Index,
  880. IN KEY_INFORMATION_CLASS KeyInformationClass,
  881. OUT PVOID KeyInformation,
  882. IN ULONG Length,
  883. OUT PULONG ResultLength
  884. );
  885. NTSYSAPI
  886. NTSTATUS
  887. NTAPI
  888. ZwEnumerateValueKey(
  889. IN HANDLE KeyHandle,
  890. IN ULONG Index,
  891. IN KEY_VALUE_INFORMATION_CLASS KeyValueInformationClass,
  892. OUT PVOID KeyValueInformation,
  893. IN ULONG Length,
  894. OUT PULONG ResultLength
  895. );
  896. NTSYSAPI
  897. NTSTATUS
  898. NTAPI
  899. ZwFlushKey(
  900. IN HANDLE KeyHandle
  901. );
  902. NTSYSAPI
  903. NTSTATUS
  904. NTAPI
  905. ZwQueryKey(
  906. IN HANDLE KeyHandle,
  907. IN KEY_INFORMATION_CLASS KeyInformationClass,
  908. OUT PVOID KeyInformation,
  909. IN ULONG Length,
  910. OUT PULONG ResultLength
  911. );
  912. NTSYSAPI
  913. NTSTATUS
  914. NTAPI
  915. ZwQueryValueKey(
  916. IN HANDLE KeyHandle,
  917. IN PUNICODE_STRING ValueName,
  918. IN KEY_VALUE_INFORMATION_CLASS KeyValueInformationClass,
  919. OUT PVOID KeyValueInformation,
  920. IN ULONG Length,
  921. OUT PULONG ResultLength
  922. );
  923. NTSYSAPI
  924. NTSTATUS
  925. NTAPI
  926. ZwSetValueKey(
  927. IN HANDLE KeyHandle,
  928. IN PUNICODE_STRING ValueName,
  929. IN ULONG TitleIndex OPTIONAL,
  930. IN ULONG Type,
  931. IN PVOID Data,
  932. IN ULONG DataSize
  933. );
  934. NTSYSAPI
  935. NTSTATUS
  936. NTAPI
  937. ZwOpenSymbolicLinkObject(
  938. OUT PHANDLE LinkHandle,
  939. IN ACCESS_MASK DesiredAccess,
  940. IN POBJECT_ATTRIBUTES ObjectAttributes
  941. );
  942. NTSYSAPI
  943. NTSTATUS
  944. NTAPI
  945. ZwQuerySymbolicLinkObject(
  946. IN HANDLE LinkHandle,
  947. IN OUT PUNICODE_STRING LinkTarget,
  948. OUT PULONG ReturnedLength OPTIONAL
  949. );
  950. #endif // _WDMDDK_
  951. <<
  952. -munge wdm.mng -k -m -i -t $@
  953. $(O)\nthal.h: $(NTHAL_DEPENDS1) $(NTHAL_DEPENDS2) makefil0
  954. type << > $@
  955. /*++ BUILD Version: ???? // Increment this if a change has global effects
  956. $(COPYRIGHT_STRING)
  957. Module Name:
  958. nthal.h
  959. Abstract:
  960. This module defines the NT types, constants, and functions that are
  961. exposed to HALs.
  962. Revision History:
  963. --*/
  964. #ifndef _NTHAL_
  965. #define _NTHAL_
  966. #ifndef RC_INVOKED
  967. #if _MSC_VER < 1300
  968. #error Compiler version not supported by Windows DDK
  969. #endif
  970. #endif // RC_INVOKED
  971. #include <excpt.h>
  972. #include <ntdef.h>
  973. #include <ntstatus.h>
  974. #include <bugcodes.h>
  975. #include <ntiologc.h>
  976. //
  977. // Define types that are not exported.
  978. //
  979. typedef struct _CALLBACK_OBJECT *PCALLBACK_OBJECT;
  980. typedef struct _ETHREAD *PETHREAD;
  981. typedef struct _FAST_IO_DISPATCH *PFAST_IO_DISPATCH;
  982. typedef struct _IO_SECURITY_CONTEXT *PIO_SECURITY_CONTEXT;
  983. typedef struct _IO_TIMER *PIO_TIMER;
  984. typedef struct _KTHREAD *PKTHREAD, *PRKTHREAD;
  985. typedef struct _OBJECT_TYPE *POBJECT_TYPE;
  986. struct _IRP;
  987. #if defined(_M_AMD64)
  988. PKTHREAD
  989. NTAPI
  990. KeGetCurrentThread(
  991. VOID
  992. );
  993. #endif // defined(_M_AMD64)
  994. #if defined(_M_IX86)
  995. PKTHREAD NTAPI KeGetCurrentThread();
  996. #endif // defined(_M_IX86)
  997. #include <mce.h>
  998. <<
  999. hextract -o $@ -lt nthal -bt begin_nthal end_nthal $(NTHAL_DEPENDS1)
  1000. type << >> $@
  1001. #include <arc.h>
  1002. <<
  1003. hextract -o $@ -lt nthal -bt begin_nthal end_nthal $(NTHAL_DEPENDS2)
  1004. type << >> $@
  1005. //
  1006. // Define exported ZwXxx routines to device drivers & hal
  1007. //
  1008. NTSYSAPI
  1009. NTSTATUS
  1010. NTAPI
  1011. ZwClose(
  1012. IN HANDLE Handle
  1013. );
  1014. NTSYSAPI
  1015. NTSTATUS
  1016. NTAPI
  1017. ZwCreateDirectoryObject(
  1018. OUT PHANDLE DirectoryHandle,
  1019. IN ACCESS_MASK DesiredAccess,
  1020. IN POBJECT_ATTRIBUTES ObjectAttributes
  1021. );
  1022. NTSYSAPI
  1023. NTSTATUS
  1024. NTAPI
  1025. ZwCreateKey(
  1026. OUT PHANDLE KeyHandle,
  1027. IN ACCESS_MASK DesiredAccess,
  1028. IN POBJECT_ATTRIBUTES ObjectAttributes,
  1029. IN ULONG TitleIndex,
  1030. IN PUNICODE_STRING Class OPTIONAL,
  1031. IN ULONG CreateOptions,
  1032. OUT PULONG Disposition OPTIONAL
  1033. );
  1034. NTSYSAPI
  1035. NTSTATUS
  1036. NTAPI
  1037. ZwOpenKey(
  1038. OUT PHANDLE KeyHandle,
  1039. IN ACCESS_MASK DesiredAccess,
  1040. IN POBJECT_ATTRIBUTES ObjectAttributes
  1041. );
  1042. NTSYSAPI
  1043. NTSTATUS
  1044. NTAPI
  1045. ZwEnumerateKey(
  1046. IN HANDLE KeyHandle,
  1047. IN ULONG Index,
  1048. IN KEY_INFORMATION_CLASS KeyInformationClass,
  1049. OUT PVOID KeyInformation,
  1050. IN ULONG Length,
  1051. OUT PULONG ResultLength
  1052. );
  1053. NTSYSAPI
  1054. NTSTATUS
  1055. NTAPI
  1056. ZwEnumerateValueKey(
  1057. IN HANDLE KeyHandle,
  1058. IN ULONG Index,
  1059. IN KEY_VALUE_INFORMATION_CLASS KeyValueInformationClass,
  1060. OUT PVOID KeyValueInformation,
  1061. IN ULONG Length,
  1062. OUT PULONG ResultLength
  1063. );
  1064. NTSYSAPI
  1065. NTSTATUS
  1066. NTAPI
  1067. ZwFlushKey(
  1068. IN HANDLE KeyHandle
  1069. );
  1070. NTSYSAPI
  1071. NTSTATUS
  1072. NTAPI
  1073. ZwQueryKey(
  1074. IN HANDLE KeyHandle,
  1075. IN KEY_INFORMATION_CLASS KeyInformationClass,
  1076. OUT PVOID KeyInformation,
  1077. IN ULONG Length,
  1078. OUT PULONG ResultLength
  1079. );
  1080. NTSYSAPI
  1081. NTSTATUS
  1082. NTAPI
  1083. ZwQueryValueKey(
  1084. IN HANDLE KeyHandle,
  1085. IN PUNICODE_STRING ValueName,
  1086. IN KEY_VALUE_INFORMATION_CLASS KeyValueInformationClass,
  1087. OUT PVOID KeyValueInformation,
  1088. IN ULONG Length,
  1089. OUT PULONG ResultLength
  1090. );
  1091. NTSYSAPI
  1092. NTSTATUS
  1093. NTAPI
  1094. ZwSetValueKey(
  1095. IN HANDLE KeyHandle,
  1096. IN PUNICODE_STRING ValueName,
  1097. IN ULONG TitleIndex OPTIONAL,
  1098. IN ULONG Type,
  1099. IN PVOID Data,
  1100. IN ULONG DataSize
  1101. );
  1102. NTSYSAPI
  1103. NTSTATUS
  1104. NTAPI
  1105. ZwMakeTemporaryObject(
  1106. IN HANDLE Handle
  1107. );
  1108. NTSYSAPI
  1109. NTSTATUS
  1110. NTAPI
  1111. ZwQueryVolumeInformationFile(
  1112. IN HANDLE FileHandle,
  1113. OUT PIO_STATUS_BLOCK IoStatusBlock,
  1114. OUT PVOID FsInformation,
  1115. IN ULONG Length,
  1116. IN FS_INFORMATION_CLASS FsInformationClass
  1117. );
  1118. NTSYSAPI
  1119. NTSTATUS
  1120. NTAPI
  1121. ZwOpenFile(
  1122. OUT PHANDLE FileHandle,
  1123. IN ACCESS_MASK DesiredAccess,
  1124. IN POBJECT_ATTRIBUTES ObjectAttributes,
  1125. OUT PIO_STATUS_BLOCK IoStatusBlock,
  1126. IN ULONG ShareAccess,
  1127. IN ULONG OpenOptions
  1128. );
  1129. NTSYSAPI
  1130. NTSTATUS
  1131. NTAPI
  1132. ZwDeviceIoControlFile(
  1133. IN HANDLE FileHandle,
  1134. IN HANDLE Event OPTIONAL,
  1135. IN PIO_APC_ROUTINE ApcRoutine OPTIONAL,
  1136. IN PVOID ApcContext OPTIONAL,
  1137. OUT PIO_STATUS_BLOCK IoStatusBlock,
  1138. IN ULONG IoControlCode,
  1139. IN PVOID InputBuffer OPTIONAL,
  1140. IN ULONG InputBufferLength,
  1141. OUT PVOID OutputBuffer OPTIONAL,
  1142. IN ULONG OutputBufferLength
  1143. );
  1144. NTSYSAPI
  1145. NTSTATUS
  1146. NTAPI
  1147. ZwDisplayString(
  1148. IN PUNICODE_STRING String
  1149. );
  1150. NTSYSAPI
  1151. NTSTATUS
  1152. NTAPI
  1153. ZwPowerInformation(
  1154. IN POWER_INFORMATION_LEVEL InformationLevel,
  1155. IN PVOID InputBuffer OPTIONAL,
  1156. IN ULONG InputBufferLength,
  1157. OUT PVOID OutputBuffer OPTIONAL,
  1158. IN ULONG OutputBufferLength
  1159. );
  1160. #endif // _NTHAL_
  1161. <<
  1162. $(O)\miniport.h: $(NTMINIPORT_DEPENDS) makefil0
  1163. type << > $@
  1164. /*++
  1165. $(COPYRIGHT_STRING)
  1166. Module Name:
  1167. miniport.h
  1168. Abstract:
  1169. Type definitions for miniport drivers.
  1170. Revision History:
  1171. --*/
  1172. #ifndef _MINIPORT_
  1173. #define _MINIPORT_
  1174. #include "stddef.h"
  1175. #define ASSERT( exp )
  1176. #ifndef FAR
  1177. #define FAR
  1178. #endif
  1179. <<
  1180. hextract -o $@ -lt ntminiport -bt begin_ntminiport end_ntminiport $(NTMINIPORT_DEPENDS)
  1181. type << >> $@
  1182. #endif /* _MINIPORT_ */
  1183. <<
  1184. $(O)\ntifs.h: $(NTIFS_DEPENDS) $(NTIFS_DEPENDS1) $(NTIFS_DEPENDS2) $(NTIFS_DEPENDS3) $(NTIFS_DEPENDS4) makefil0
  1185. type << > $@
  1186. /*++ BUILD Version: ???? // Increment this if a change has global effects
  1187. $(COPYRIGHT_STRING)
  1188. Module Name:
  1189. ntifs.h
  1190. Abstract:
  1191. This module defines the NT types, constants, and functions that are
  1192. exposed to file system drivers.
  1193. Revision History:
  1194. --*/
  1195. #ifndef _NTIFS_
  1196. #define _NTIFS_
  1197. #ifndef RC_INVOKED
  1198. #if _MSC_VER < 1300
  1199. #error Compiler version not supported by Windows DDK
  1200. #endif
  1201. #endif // RC_INVOKED
  1202. #ifndef __cplusplus
  1203. #pragma warning(disable:4116) // TYPE_ALIGNMENT generates this - move it
  1204. // outside the warning push/pop scope.
  1205. #endif
  1206. #define NT_INCLUDED
  1207. #define _NTMSV1_0_
  1208. #define _CTYPE_DISABLE_MACROS
  1209. #include <excpt.h>
  1210. #include <ntdef.h>
  1211. #include <ntnls.h>
  1212. #include <ntstatus.h>
  1213. #include <bugcodes.h>
  1214. #include <ntiologc.h>
  1215. <<
  1216. type $(NTOSINC)\exlevels.h >> $@
  1217. type << >> $@
  1218. //
  1219. // These macros are used to test, set and clear flags respectivly
  1220. //
  1221. #ifndef FlagOn
  1222. #define FlagOn(_F,_SF) ((_F) & (_SF))
  1223. #endif
  1224. #ifndef BooleanFlagOn
  1225. #define BooleanFlagOn(F,SF) ((BOOLEAN)(((F) & (SF)) != 0))
  1226. #endif
  1227. #ifndef SetFlag
  1228. #define SetFlag(_F,_SF) ((_F) |= (_SF))
  1229. #endif
  1230. #ifndef ClearFlag
  1231. #define ClearFlag(_F,_SF) ((_F) &= ~(_SF))
  1232. #endif
  1233. //
  1234. // Define types that are not exported.
  1235. //
  1236. typedef struct _BUS_HANDLER *PBUS_HANDLER;
  1237. typedef struct _CALLBACK_OBJECT *PCALLBACK_OBJECT;
  1238. typedef struct _DEVICE_HANDLER_OBJECT *PDEVICE_HANDLER_OBJECT;
  1239. typedef struct _IO_TIMER *PIO_TIMER;
  1240. typedef struct _KINTERRUPT *PKINTERRUPT;
  1241. typedef struct _KPROCESS *PKPROCESS ,*PRKPROCESS, *PEPROCESS;
  1242. typedef struct _KTHREAD *PKTHREAD, *PRKTHREAD, *PETHREAD;
  1243. typedef struct _OBJECT_TYPE *POBJECT_TYPE;
  1244. typedef struct _PEB *PPEB;
  1245. #if defined(_M_AMD64)
  1246. PKTHREAD
  1247. NTAPI
  1248. KeGetCurrentThread(
  1249. VOID
  1250. );
  1251. #endif // defined(_M_AMD64)
  1252. #if defined(_M_IX86)
  1253. PKTHREAD NTAPI KeGetCurrentThread();
  1254. #endif // defined(_M_IX86)
  1255. #if defined(_M_IA64)
  1256. //
  1257. // Define Address of Processor Control Registers.
  1258. //
  1259. #define KIPCR ((ULONG_PTR)(KADDRESS_BASE + 0xffff0000)) // kernel address of first PCR
  1260. //
  1261. // Define Pointer to Processor Control Registers.
  1262. //
  1263. #define PCR ((volatile KPCR * const)KIPCR)
  1264. PKTHREAD NTAPI KeGetCurrentThread();
  1265. #endif // defined(_M_IA64)
  1266. #define PsGetCurrentProcess() IoGetCurrentProcess()
  1267. #define PsGetCurrentThread() ((PETHREAD) (KeGetCurrentThread()))
  1268. extern NTSYSAPI CCHAR KeNumberProcessors;
  1269. <<
  1270. hextract -o $@ -lt ntifs -bt begin_ntifs end_ntifs $(NTIFS_DEPENDS)
  1271. hextract -o $@ -lt ntddk -bt begin_ntddk end_ntddk $(NTIFS_DEPENDS1)
  1272. hextract -o $@ -lt ntifs -bt begin_ntifs end_ntifs $(NTIFS_DEPENDS2)
  1273. hextract -o $@ -lt ntddk -bt begin_ntddk end_ntddk $(NTIFS_DEPENDS3)
  1274. hextract -o $@ -lt ntifs -bt begin_ntifs end_ntifs $(NTIFS_DEPENDS4)
  1275. type << >> $@
  1276. //
  1277. // Runtime Library function prototypes.
  1278. //
  1279. NTSYSAPI
  1280. VOID
  1281. NTAPI
  1282. RtlCaptureContext (
  1283. OUT PCONTEXT ContextRecord
  1284. );
  1285. #ifdef POOL_TAGGING
  1286. #define ExAllocatePool(a,b) ExAllocatePoolWithTag(a,b,' sfI')
  1287. #define ExAllocatePoolWithQuota(a,b) ExAllocatePoolWithQuotaTag(a,b,' sfI')
  1288. #endif
  1289. extern POBJECT_TYPE *PsThreadType;
  1290. extern POBJECT_TYPE *IoFileObjectType;
  1291. extern POBJECT_TYPE *ExEventObjectType;
  1292. extern POBJECT_TYPE *ExSemaphoreObjectType;
  1293. //
  1294. // Define exported ZwXxx routines to device drivers.
  1295. //
  1296. NTSYSAPI
  1297. NTSTATUS
  1298. NTAPI
  1299. ZwCreateEvent (
  1300. OUT PHANDLE EventHandle,
  1301. IN ACCESS_MASK DesiredAccess,
  1302. IN POBJECT_ATTRIBUTES ObjectAttributes OPTIONAL,
  1303. IN EVENT_TYPE EventType,
  1304. IN BOOLEAN InitialState
  1305. );
  1306. NTSYSAPI
  1307. NTSTATUS
  1308. NTAPI
  1309. ZwCreateFile(
  1310. OUT PHANDLE FileHandle,
  1311. IN ACCESS_MASK DesiredAccess,
  1312. IN POBJECT_ATTRIBUTES ObjectAttributes,
  1313. OUT PIO_STATUS_BLOCK IoStatusBlock,
  1314. IN PLARGE_INTEGER AllocationSize OPTIONAL,
  1315. IN ULONG FileAttributes,
  1316. IN ULONG ShareAccess,
  1317. IN ULONG CreateDisposition,
  1318. IN ULONG CreateOptions,
  1319. IN PVOID EaBuffer OPTIONAL,
  1320. IN ULONG EaLength
  1321. );
  1322. NTSYSAPI
  1323. NTSTATUS
  1324. NTAPI
  1325. ZwDeleteFile(
  1326. IN POBJECT_ATTRIBUTES ObjectAttributes
  1327. );
  1328. NTSYSAPI
  1329. NTSTATUS
  1330. NTAPI
  1331. ZwDeviceIoControlFile(
  1332. IN HANDLE FileHandle,
  1333. IN HANDLE Event OPTIONAL,
  1334. IN PIO_APC_ROUTINE ApcRoutine OPTIONAL,
  1335. IN PVOID ApcContext OPTIONAL,
  1336. OUT PIO_STATUS_BLOCK IoStatusBlock,
  1337. IN ULONG IoControlCode,
  1338. IN PVOID InputBuffer OPTIONAL,
  1339. IN ULONG InputBufferLength,
  1340. OUT PVOID OutputBuffer OPTIONAL,
  1341. IN ULONG OutputBufferLength
  1342. );
  1343. NTSYSAPI
  1344. NTSTATUS
  1345. NTAPI
  1346. ZwOpenFile(
  1347. OUT PHANDLE FileHandle,
  1348. IN ACCESS_MASK DesiredAccess,
  1349. IN POBJECT_ATTRIBUTES ObjectAttributes,
  1350. OUT PIO_STATUS_BLOCK IoStatusBlock,
  1351. IN ULONG ShareAccess,
  1352. IN ULONG OpenOptions
  1353. );
  1354. NTSYSAPI
  1355. NTSTATUS
  1356. NTAPI
  1357. ZwQueryDirectoryFile(
  1358. IN HANDLE FileHandle,
  1359. IN HANDLE Event OPTIONAL,
  1360. IN PIO_APC_ROUTINE ApcRoutine OPTIONAL,
  1361. IN PVOID ApcContext OPTIONAL,
  1362. OUT PIO_STATUS_BLOCK IoStatusBlock,
  1363. OUT PVOID FileInformation,
  1364. IN ULONG Length,
  1365. IN FILE_INFORMATION_CLASS FileInformationClass,
  1366. IN BOOLEAN ReturnSingleEntry,
  1367. IN PUNICODE_STRING FileName OPTIONAL,
  1368. IN BOOLEAN RestartScan
  1369. );
  1370. NTSYSAPI
  1371. NTSTATUS
  1372. NTAPI
  1373. ZwQueryInformationFile(
  1374. IN HANDLE FileHandle,
  1375. OUT PIO_STATUS_BLOCK IoStatusBlock,
  1376. OUT PVOID FileInformation,
  1377. IN ULONG Length,
  1378. IN FILE_INFORMATION_CLASS FileInformationClass
  1379. );
  1380. NTSYSAPI
  1381. NTSTATUS
  1382. NTAPI
  1383. ZwSetInformationFile(
  1384. IN HANDLE FileHandle,
  1385. OUT PIO_STATUS_BLOCK IoStatusBlock,
  1386. IN PVOID FileInformation,
  1387. IN ULONG Length,
  1388. IN FILE_INFORMATION_CLASS FileInformationClass
  1389. );
  1390. NTSYSAPI
  1391. NTSTATUS
  1392. NTAPI
  1393. ZwQueryVolumeInformationFile(
  1394. IN HANDLE FileHandle,
  1395. OUT PIO_STATUS_BLOCK IoStatusBlock,
  1396. OUT PVOID FsInformation,
  1397. IN ULONG Length,
  1398. IN FS_INFORMATION_CLASS FsInformationClass
  1399. );
  1400. NTSYSAPI
  1401. NTSTATUS
  1402. NTAPI
  1403. ZwReadFile(
  1404. IN HANDLE FileHandle,
  1405. IN HANDLE Event OPTIONAL,
  1406. IN PIO_APC_ROUTINE ApcRoutine OPTIONAL,
  1407. IN PVOID ApcContext OPTIONAL,
  1408. OUT PIO_STATUS_BLOCK IoStatusBlock,
  1409. OUT PVOID Buffer,
  1410. IN ULONG Length,
  1411. IN PLARGE_INTEGER ByteOffset OPTIONAL,
  1412. IN PULONG Key OPTIONAL
  1413. );
  1414. NTSYSAPI
  1415. NTSTATUS
  1416. NTAPI
  1417. ZwWriteFile(
  1418. IN HANDLE FileHandle,
  1419. IN HANDLE Event OPTIONAL,
  1420. IN PIO_APC_ROUTINE ApcRoutine OPTIONAL,
  1421. IN PVOID ApcContext OPTIONAL,
  1422. OUT PIO_STATUS_BLOCK IoStatusBlock,
  1423. IN PVOID Buffer,
  1424. IN ULONG Length,
  1425. IN PLARGE_INTEGER ByteOffset OPTIONAL,
  1426. IN PULONG Key OPTIONAL
  1427. );
  1428. NTSYSAPI
  1429. NTSTATUS
  1430. NTAPI
  1431. ZwFsControlFile(
  1432. IN HANDLE FileHandle,
  1433. IN HANDLE Event OPTIONAL,
  1434. IN PIO_APC_ROUTINE ApcRoutine OPTIONAL,
  1435. IN PVOID ApcContext OPTIONAL,
  1436. OUT PIO_STATUS_BLOCK IoStatusBlock,
  1437. IN ULONG FsControlCode,
  1438. IN PVOID InputBuffer OPTIONAL,
  1439. IN ULONG InputBufferLength,
  1440. OUT PVOID OutputBuffer OPTIONAL,
  1441. IN ULONG OutputBufferLength
  1442. );
  1443. NTSYSAPI
  1444. NTSTATUS
  1445. NTAPI
  1446. ZwClose(
  1447. IN HANDLE Handle
  1448. );
  1449. NTSYSAPI
  1450. NTSTATUS
  1451. NTAPI
  1452. ZwDuplicateObject(
  1453. IN HANDLE SourceProcessHandle,
  1454. IN HANDLE SourceHandle,
  1455. IN HANDLE TargetProcessHandle OPTIONAL,
  1456. OUT PHANDLE TargetHandle OPTIONAL,
  1457. IN ACCESS_MASK DesiredAccess,
  1458. IN ULONG HandleAttributes,
  1459. IN ULONG Options
  1460. );
  1461. NTSYSAPI
  1462. NTSTATUS
  1463. NTAPI
  1464. ZwCreateDirectoryObject(
  1465. OUT PHANDLE DirectoryHandle,
  1466. IN ACCESS_MASK DesiredAccess,
  1467. IN POBJECT_ATTRIBUTES ObjectAttributes
  1468. );
  1469. NTSYSAPI
  1470. NTSTATUS
  1471. NTAPI
  1472. ZwOpenDirectoryObject(
  1473. OUT PHANDLE DirectoryHandle,
  1474. IN ACCESS_MASK DesiredAccess,
  1475. IN POBJECT_ATTRIBUTES ObjectAttributes
  1476. );
  1477. NTSYSAPI
  1478. NTSTATUS
  1479. NTAPI
  1480. ZwOpenSymbolicLinkObject(
  1481. OUT PHANDLE LinkHandle,
  1482. IN ACCESS_MASK DesiredAccess,
  1483. IN POBJECT_ATTRIBUTES ObjectAttributes
  1484. );
  1485. NTSYSAPI
  1486. NTSTATUS
  1487. NTAPI
  1488. ZwQuerySymbolicLinkObject(
  1489. IN HANDLE LinkHandle,
  1490. IN OUT PUNICODE_STRING LinkTarget,
  1491. OUT PULONG ReturnedLength OPTIONAL
  1492. );
  1493. NTSYSAPI
  1494. NTSTATUS
  1495. NTAPI
  1496. ZwMakeTemporaryObject(
  1497. IN HANDLE Handle
  1498. );
  1499. NTSYSAPI
  1500. NTSTATUS
  1501. NTAPI
  1502. ZwCreateKey(
  1503. OUT PHANDLE KeyHandle,
  1504. IN ACCESS_MASK DesiredAccess,
  1505. IN POBJECT_ATTRIBUTES ObjectAttributes,
  1506. IN ULONG TitleIndex,
  1507. IN PUNICODE_STRING Class OPTIONAL,
  1508. IN ULONG CreateOptions,
  1509. OUT PULONG Disposition OPTIONAL
  1510. );
  1511. NTSYSAPI
  1512. NTSTATUS
  1513. NTAPI
  1514. ZwOpenKey(
  1515. OUT PHANDLE KeyHandle,
  1516. IN ACCESS_MASK DesiredAccess,
  1517. IN POBJECT_ATTRIBUTES ObjectAttributes
  1518. );
  1519. NTSYSAPI
  1520. NTSTATUS
  1521. NTAPI
  1522. ZwDeleteKey(
  1523. IN HANDLE KeyHandle
  1524. );
  1525. NTSYSAPI
  1526. NTSTATUS
  1527. NTAPI
  1528. ZwDeleteValueKey(
  1529. IN HANDLE KeyHandle,
  1530. IN PUNICODE_STRING ValueName
  1531. );
  1532. NTSYSAPI
  1533. NTSTATUS
  1534. NTAPI
  1535. ZwEnumerateKey(
  1536. IN HANDLE KeyHandle,
  1537. IN ULONG Index,
  1538. IN KEY_INFORMATION_CLASS KeyInformationClass,
  1539. OUT PVOID KeyInformation,
  1540. IN ULONG Length,
  1541. OUT PULONG ResultLength
  1542. );
  1543. NTSYSAPI
  1544. NTSTATUS
  1545. NTAPI
  1546. ZwEnumerateValueKey(
  1547. IN HANDLE KeyHandle,
  1548. IN ULONG Index,
  1549. IN KEY_VALUE_INFORMATION_CLASS KeyValueInformationClass,
  1550. OUT PVOID KeyValueInformation,
  1551. IN ULONG Length,
  1552. OUT PULONG ResultLength
  1553. );
  1554. NTSYSAPI
  1555. NTSTATUS
  1556. NTAPI
  1557. ZwFlushKey(
  1558. IN HANDLE KeyHandle
  1559. );
  1560. NTSYSAPI
  1561. NTSTATUS
  1562. NTAPI
  1563. ZwQueryKey(
  1564. IN HANDLE KeyHandle,
  1565. IN KEY_INFORMATION_CLASS KeyInformationClass,
  1566. OUT PVOID KeyInformation,
  1567. IN ULONG Length,
  1568. OUT PULONG ResultLength
  1569. );
  1570. NTSYSAPI
  1571. NTSTATUS
  1572. NTAPI
  1573. ZwQueryValueKey(
  1574. IN HANDLE KeyHandle,
  1575. IN PUNICODE_STRING ValueName,
  1576. IN KEY_VALUE_INFORMATION_CLASS KeyValueInformationClass,
  1577. OUT PVOID KeyValueInformation,
  1578. IN ULONG Length,
  1579. OUT PULONG ResultLength
  1580. );
  1581. NTSYSAPI
  1582. NTSTATUS
  1583. NTAPI
  1584. ZwSetValueKey(
  1585. IN HANDLE KeyHandle,
  1586. IN PUNICODE_STRING ValueName,
  1587. IN ULONG TitleIndex OPTIONAL,
  1588. IN ULONG Type,
  1589. IN PVOID Data,
  1590. IN ULONG DataSize
  1591. );
  1592. NTSYSAPI
  1593. NTSTATUS
  1594. NTAPI
  1595. ZwOpenSection(
  1596. OUT PHANDLE SectionHandle,
  1597. IN ACCESS_MASK DesiredAccess,
  1598. IN POBJECT_ATTRIBUTES ObjectAttributes
  1599. );
  1600. NTSYSAPI
  1601. NTSTATUS
  1602. NTAPI
  1603. ZwMapViewOfSection(
  1604. IN HANDLE SectionHandle,
  1605. IN HANDLE ProcessHandle,
  1606. IN OUT PVOID *BaseAddress,
  1607. IN ULONG ZeroBits,
  1608. IN ULONG CommitSize,
  1609. IN OUT PLARGE_INTEGER SectionOffset OPTIONAL,
  1610. IN OUT PSIZE_T ViewSize,
  1611. IN SECTION_INHERIT InheritDisposition,
  1612. IN ULONG AllocationType,
  1613. IN ULONG Protect
  1614. );
  1615. NTSYSAPI
  1616. NTSTATUS
  1617. NTAPI
  1618. ZwUnmapViewOfSection(
  1619. IN HANDLE ProcessHandle,
  1620. IN PVOID BaseAddress
  1621. );
  1622. NTSYSAPI
  1623. NTSTATUS
  1624. NTAPI
  1625. ZwSetInformationThread(
  1626. IN HANDLE ThreadHandle,
  1627. IN THREADINFOCLASS ThreadInformationClass,
  1628. IN PVOID ThreadInformation,
  1629. IN ULONG ThreadInformationLength
  1630. );
  1631. NTSYSAPI
  1632. NTSTATUS
  1633. NTAPI
  1634. ZwCreateSection (
  1635. OUT PHANDLE SectionHandle,
  1636. IN ACCESS_MASK DesiredAccess,
  1637. IN POBJECT_ATTRIBUTES ObjectAttributes OPTIONAL,
  1638. IN PLARGE_INTEGER MaximumSize OPTIONAL,
  1639. IN ULONG SectionPageProtection,
  1640. IN ULONG AllocationAttributes,
  1641. IN HANDLE FileHandle OPTIONAL
  1642. );
  1643. NTSYSAPI
  1644. NTSTATUS
  1645. NTAPI
  1646. ZwAllocateVirtualMemory(
  1647. IN HANDLE ProcessHandle,
  1648. IN OUT PVOID *BaseAddress,
  1649. IN ULONG ZeroBits,
  1650. IN OUT PSIZE_T RegionSize,
  1651. IN ULONG AllocationType,
  1652. IN ULONG Protect
  1653. );
  1654. NTSYSAPI
  1655. NTSTATUS
  1656. NTAPI
  1657. ZwFreeVirtualMemory(
  1658. IN HANDLE ProcessHandle,
  1659. IN OUT PVOID *BaseAddress,
  1660. IN OUT PSIZE_T RegionSize,
  1661. IN ULONG FreeType
  1662. );
  1663. NTSYSAPI
  1664. NTSTATUS
  1665. NTAPI
  1666. ZwWaitForSingleObject(
  1667. IN HANDLE Handle,
  1668. IN BOOLEAN Alertable,
  1669. IN PLARGE_INTEGER Timeout OPTIONAL
  1670. );
  1671. NTSYSAPI
  1672. NTSTATUS
  1673. NTAPI
  1674. ZwSetEvent (
  1675. IN HANDLE Handle,
  1676. OUT PLONG PreviousState OPTIONAL
  1677. );
  1678. NTSYSAPI
  1679. NTSTATUS
  1680. NTAPI
  1681. ZwFlushVirtualMemory(
  1682. IN HANDLE ProcessHandle,
  1683. IN OUT PVOID *BaseAddress,
  1684. IN OUT PSIZE_T RegionSize,
  1685. OUT PIO_STATUS_BLOCK IoStatus
  1686. );
  1687. NTSYSAPI
  1688. NTSTATUS
  1689. NTAPI
  1690. ZwOpenProcessTokenEx(
  1691. IN HANDLE ProcessHandle,
  1692. IN ACCESS_MASK DesiredAccess,
  1693. IN ULONG HandleAttributes,
  1694. OUT PHANDLE TokenHandle
  1695. );
  1696. NTSYSAPI
  1697. NTSTATUS
  1698. NTAPI
  1699. ZwOpenThreadTokenEx(
  1700. IN HANDLE ThreadHandle,
  1701. IN ACCESS_MASK DesiredAccess,
  1702. IN BOOLEAN OpenAsSelf,
  1703. IN ULONG HandleAttributes,
  1704. OUT PHANDLE TokenHandle
  1705. );
  1706. NTSYSAPI
  1707. NTSTATUS
  1708. NTAPI
  1709. ZwSetInformationToken (
  1710. IN HANDLE TokenHandle,
  1711. IN TOKEN_INFORMATION_CLASS TokenInformationClass,
  1712. IN PVOID TokenInformation,
  1713. IN ULONG TokenInformationLength
  1714. );
  1715. NTSYSAPI
  1716. NTSTATUS
  1717. NTAPI
  1718. ZwQueryInformationToken (
  1719. IN HANDLE TokenHandle,
  1720. IN TOKEN_INFORMATION_CLASS TokenInformationClass,
  1721. OUT PVOID TokenInformation,
  1722. IN ULONG TokenInformationLength,
  1723. OUT PULONG ReturnLength
  1724. );
  1725. NTSYSAPI
  1726. NTSTATUS
  1727. NTAPI
  1728. ZwSetSecurityObject(
  1729. IN HANDLE Handle,
  1730. IN SECURITY_INFORMATION SecurityInformation,
  1731. IN PSECURITY_DESCRIPTOR SecurityDescriptor
  1732. );
  1733. NTSYSAPI
  1734. NTSTATUS
  1735. NTAPI
  1736. ZwQuerySecurityObject(
  1737. IN HANDLE Handle,
  1738. IN SECURITY_INFORMATION SecurityInformation,
  1739. OUT PSECURITY_DESCRIPTOR SecurityDescriptor,
  1740. IN ULONG Length,
  1741. OUT PULONG LengthNeeded
  1742. );
  1743. NTSYSAPI
  1744. NTSTATUS
  1745. NTAPI
  1746. ZwLoadDriver(
  1747. IN PUNICODE_STRING DriverServiceName
  1748. );
  1749. NTSYSAPI
  1750. NTSTATUS
  1751. NTAPI
  1752. ZwUnloadDriver(
  1753. IN PUNICODE_STRING DriverServiceName
  1754. );
  1755. #endif // _NTIFS_
  1756. <<
  1757. $(O)\wmikm.h: $(NTWMIKM_DEPENDS) makefil0
  1758. type << > $@
  1759. /*++ BUILD Version: ???? // Increment this if a change has global effects
  1760. $(COPYRIGHT_STRING)
  1761. Module Name:
  1762. wmikm.h
  1763. Abstract:
  1764. This module defines the WMI types, constants, and functions that are
  1765. exposed to internal device drivers.
  1766. Revision History:
  1767. --*/
  1768. #ifndef _WMIKM_H_
  1769. #define _WMIKM_H_
  1770. #include <evntrace.h>
  1771. #include <wmistr.h>
  1772. <<
  1773. hextract -o $@ -lt wmikm -bt begin_wmikm end_wmikm $(NTWMIKM_DEPENDS)
  1774. type << >> $@
  1775. #endif // _WMIKM_H_
  1776. <<
  1777. $(O)\ntosp.h: $(NTOSP_DEPENDS) makefil0
  1778. type << > $@
  1779. /*++ BUILD Version: ???? // Increment this if a change has global effects
  1780. $(COPYRIGHT_STRING)
  1781. Module Name:
  1782. ntosp.h
  1783. Abstract:
  1784. This module defines the NT types, constants, and functions that are
  1785. exposed to external projects like Windows and Termsrv
  1786. Revision History:
  1787. --*/
  1788. #ifndef _NTOSP_
  1789. #define _NTOSP_
  1790. #ifdef _NTDDK_
  1791. #error "Can't include ntddk.h and ntosp.h"
  1792. #else
  1793. #define _NTDDK_
  1794. #endif
  1795. #include <nt.h>
  1796. #include <ntrtl.h>
  1797. #include <excpt.h>
  1798. #include <ntdef.h>
  1799. #include <bugcodes.h>
  1800. #include <arc.h>
  1801. #include <arccodes.h>
  1802. <<
  1803. type $(NTOSINC)\exlevels.h >> $@
  1804. type << >> $@
  1805. #ifdef __cplusplus
  1806. extern "C" { // extern "C"
  1807. #endif
  1808. //
  1809. // Define types that are not exported.
  1810. //
  1811. typedef struct _ACCESS_STATE *PACCESS_STATE;
  1812. typedef struct _BUS_HANDLER *PBUS_HANDLER;
  1813. typedef struct _EJOB *PEJOB;
  1814. typedef struct _EPROCESS *PEPROCESS;
  1815. typedef struct _ERESOURCE *PERESOURCE;
  1816. typedef struct _ETHREAD *PETHREAD;
  1817. typedef struct _IO_TIMER *PIO_TIMER;
  1818. typedef struct _IRP *PIRP;
  1819. typedef struct _KPROCESS *PKPROCESS, *RESTRICTED_POINTER PRKPROCESS;
  1820. typedef struct _KTHREAD *PKTHREAD, *PRKTHREAD;
  1821. typedef struct _KTRAP_FRAME *PKTRAP_FRAME;
  1822. typedef struct _LOADER_PARAMETER_BLOCK *PLOADER_PARAMETER_BLOCK;
  1823. typedef struct _TRANSLATOR_INTERFACE *PTRANSLATOR_INTERFACE;
  1824. typedef struct _HANDLE_TABLE *PHANDLE_TABLE;
  1825. //
  1826. // Define macros to fix up structure references
  1827. //
  1828. #define PEProcessToPKProcess(P) ((PKPROCESS)P)
  1829. #if defined(_M_AMD64)
  1830. PKTHREAD
  1831. NTAPI
  1832. KeGetCurrentThread(
  1833. VOID
  1834. );
  1835. #endif // defined(_M_AMD64)
  1836. #if defined(_M_IX86)
  1837. PKTHREAD NTAPI KeGetCurrentThread();
  1838. #endif // defined(_M_IX86)
  1839. #if defined(_M_IA64)
  1840. //
  1841. // Define Address of Processor Control Registers.
  1842. //
  1843. #define KIPCR ((ULONG_PTR)(KADDRESS_BASE + 0xffff0000)) // kernel address of first PCR
  1844. //
  1845. // Define Pointer to Processor Control Registers.
  1846. //
  1847. #define PCR ((volatile KPCR * const)KIPCR)
  1848. PKTHREAD NTAPI KeGetCurrentThread();
  1849. #endif // defined(_M_IA64)
  1850. <<
  1851. hextract -o $@ -lt ntosp -bt begin_ntosp end_ntosp $(NTOSP_DEPENDS)
  1852. type << >> $@
  1853. extern POBJECT_TYPE *ExEventPairObjectType;
  1854. extern POBJECT_TYPE *IoFileObjectType;
  1855. extern POBJECT_TYPE *IoDriverObjectType;
  1856. extern POBJECT_TYPE *PsProcessType;
  1857. extern POBJECT_TYPE *PsThreadType;
  1858. extern POBJECT_TYPE *PsJobType;
  1859. extern POBJECT_TYPE *LpcPortObjectType;
  1860. extern POBJECT_TYPE *LpcWaitablePortObjectType;
  1861. extern POBJECT_TYPE MmSectionObjectType;
  1862. #ifdef __cplusplus
  1863. } // extern "C"
  1864. #endif
  1865. #endif // _NTOSP_
  1866. <<
  1867. $(O)\ndisbase.w: $(NDIS_BASE_DEPENDS) makefil0
  1868. type << > $@
  1869. /*++ BUILD Version: ???? // Increment this if a change has global effects
  1870. $(COPYRIGHT_STRING)
  1871. Module Name:
  1872. ndis.h
  1873. Abstract:
  1874. This module defines the structures, macros, and functions available
  1875. to NDIS drivers.
  1876. Revision History:
  1877. --*/
  1878. #if !defined(_NDIS_)
  1879. #define _NDIS_
  1880. #if !defined(NDIS_WDM)
  1881. #define NDIS_WDM 0
  1882. #endif
  1883. //
  1884. // If we're building a miniport on x86, set BINARY_COMPATIBLE so that
  1885. // we don't use functions that aren't available on Windows 9x.
  1886. //
  1887. #if !defined(BINARY_COMPATIBLE)
  1888. #if defined(NDIS_MINIPORT_DRIVER) && defined(_M_IX86)
  1889. #define BINARY_COMPATIBLE 1
  1890. #else
  1891. #define BINARY_COMPATIBLE 0
  1892. #endif
  1893. #endif
  1894. #if !defined(_M_IX86)
  1895. #undef BINARY_COMPATIBLE
  1896. #define BINARY_COMPATIBLE 0
  1897. #endif
  1898. //
  1899. // BEGIN INTERNAL DEFINITIONS
  1900. //
  1901. //
  1902. // BINARY_COMPATIBLE = 1 and NDIS_WDM = 1 then use wdm.h
  1903. // BINARY_COMPATIBLE = 1 and NDIS_WDM = 0 then use ndis.h only
  1904. // BINARY_COMPATIBLE = 0 and NDIS_WDM = 1 then use ntddk.h
  1905. // BINARY_COMPATIBLE = 0 and NDIS_WDM = 0 then use ntddk.h
  1906. //
  1907. #if (BINARY_COMPATIBLE && !NDIS_WDM)
  1908. //
  1909. // BINARY_COMPATIBLE = 1 and NDIS_WDM = 0 then use ndis.h only
  1910. //
  1911. // The following internal definitions are included here in order to allow
  1912. // the exported NDIS structures, macros, and functions to compile. They
  1913. // must not be used directly by miniport drivers.
  1914. //
  1915. #define _NTDDK_
  1916. <<
  1917. hextract -o $@ -lt ntndis -bt begin_ntndis end_ntndis $(NDIS_BASE_DEPENDS)
  1918. type << >> $@
  1919. #else // BINARY_COMPATIBLE && !NDIS_WDM
  1920. #if (!BINARY_COMPATIBLE)
  1921. //
  1922. // BINARY_COMPATIBLE = 0 and NDIS_WDM = 1 then use ntddk.h
  1923. // BINARY_COMPATIBLE = 0 and NDIS_WDM = 0 then use ntddk.h
  1924. //
  1925. //
  1926. // The definitions available in ntddk.h must not be used directly by non-WDM miniport drivers.
  1927. //
  1928. #include <ntddk.h>
  1929. #else // !BINARY_COMPATIBLE
  1930. //
  1931. // BINARY_COMPATIBLE = 1 and NDIS_WDM = 1 then use wdm.h
  1932. //
  1933. #include <wdm.h>
  1934. #endif // else !BINARY_COMPATIBLE
  1935. #endif // else BINARY_COMPATIBLE && !NDIS_WDM
  1936. <<
  1937. keheaders:
  1938. cd $(PROJECT_ROOT)\ntos\ke\up
  1939. build -OZ
  1940. nmake -l genxx BUILDMSG=
  1941. cd $(MAKEDIR)