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.

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