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.

4522 lines
86 KiB

  1. ifndef _VMM_
  2. _VMM_ EQU 1
  3. FALSE EQU 0
  4. VMM_TRUE EQU (NOT FALSE)
  5. DEBLEVELRETAIL EQU 0
  6. DEBLEVELNORMAL EQU 1
  7. DEBLEVELMAX EQU 2
  8. ifndef DEBLEVEL
  9. ifdef DEBUG
  10. DEBLEVEL EQU DEBLEVELNORMAL
  11. else
  12. DEBLEVEL EQU DEBLEVELRETAIL
  13. endif
  14. endif
  15. ifndef WIN31COMPAT
  16. WIN40SERVICES EQU 1
  17. WIN403SERVICES EQU 1
  18. endif
  19. ifndef WIN40COMPAT
  20. WIN41SERVICES EQU 1
  21. endif
  22. ifdef MASM6
  23. ifndef NO_MASM6_OPTIONS
  24. option oldmacros
  25. ifndef NEWSTRUCTS
  26. option oldstructs
  27. endif
  28. option noscoped
  29. option segment:flat
  30. option offset:flat
  31. option proc:private
  32. endif
  33. endif
  34. IFDEF MASM6
  35. BeginDoc MACRO
  36. ENDM
  37. EndDoc MACRO
  38. ENDM
  39. BeginMsg MACRO
  40. ENDM
  41. EndMsg MACRO
  42. ENDM
  43. ELSE
  44. BeginDoc EQU <>
  45. EndDoc EQU <>
  46. BeginMsg EQU <>
  47. EndMsg EQU <>
  48. ENDIF
  49. UNDEFINED_DEVICE_ID EQU 00000H
  50. VMM_DEVICE_ID EQU 00001H
  51. DEBUG_DEVICE_ID EQU 00002H
  52. VPICD_DEVICE_ID EQU 00003H
  53. VDMAD_DEVICE_ID EQU 00004H
  54. VTD_DEVICE_ID EQU 00005H
  55. V86MMGR_DEVICE_ID EQU 00006H
  56. PAGESWAP_DEVICE_ID EQU 00007H
  57. PARITY_DEVICE_ID EQU 00008H
  58. REBOOT_DEVICE_ID EQU 00009H
  59. VDD_DEVICE_ID EQU 0000AH
  60. VSD_DEVICE_ID EQU 0000BH
  61. VMD_DEVICE_ID EQU 0000CH
  62. VKD_DEVICE_ID EQU 0000DH
  63. VCD_DEVICE_ID EQU 0000EH
  64. VPD_DEVICE_ID EQU 0000FH
  65. BLOCKDEV_DEVICE_ID EQU 00010H
  66. VMCPD_DEVICE_ID EQU 00011H
  67. EBIOS_DEVICE_ID EQU 00012H
  68. BIOSXLAT_DEVICE_ID EQU 00013H
  69. VNETBIOS_DEVICE_ID EQU 00014H
  70. DOSMGR_DEVICE_ID EQU 00015H
  71. WINLOAD_DEVICE_ID EQU 00016H
  72. SHELL_DEVICE_ID EQU 00017H
  73. VMPOLL_DEVICE_ID EQU 00018H
  74. VPROD_DEVICE_ID EQU 00019H
  75. DOSNET_DEVICE_ID EQU 0001AH
  76. VFD_DEVICE_ID EQU 0001BH
  77. VDD2_DEVICE_ID EQU 0001CH
  78. WINDEBUG_DEVICE_ID EQU 0001DH
  79. TSRLOAD_DEVICE_ID EQU 0001EH
  80. BIOSHOOK_DEVICE_ID EQU 0001FH
  81. INT13_DEVICE_ID EQU 00020H
  82. PAGEFILE_DEVICE_ID EQU 00021H
  83. SCSI_DEVICE_ID EQU 00022H
  84. MCA_POS_DEVICE_ID EQU 00023H
  85. SCSIFD_DEVICE_ID EQU 00024H
  86. VPEND_DEVICE_ID EQU 00025H
  87. APM_DEVICE_ID EQU 00026H
  88. VPOWERD_DEVICE_ID EQU APM_DEVICE_ID
  89. VXDLDR_DEVICE_ID EQU 00027H
  90. NDIS_DEVICE_ID EQU 00028H
  91. BIOS_EXT_DEVICE_ID EQU 00029H
  92. VWIN32_DEVICE_ID EQU 0002AH
  93. VCOMM_DEVICE_ID EQU 0002BH
  94. SPOOLER_DEVICE_ID EQU 0002CH
  95. WIN32S_DEVICE_ID EQU 0002DH
  96. DEBUGCMD_DEVICE_ID EQU 0002EH
  97. CONFIGMG_DEVICE_ID EQU 00033H
  98. DWCFGMG_DEVICE_ID EQU 00034H
  99. SCSIPORT_DEVICE_ID EQU 00035H
  100. VFBACKUP_DEVICE_ID EQU 00036H
  101. ENABLE_DEVICE_ID EQU 00037H
  102. VCOND_DEVICE_ID EQU 00038H
  103. ISAPNP_DEVICE_ID EQU 0003CH
  104. BIOS_DEVICE_ID EQU 0003DH
  105. IFSMgr_Device_ID EQU 00040H
  106. VCDFSD_DEVICE_ID EQU 00041H
  107. MRCI2_DEVICE_ID EQU 00042H
  108. PCI_DEVICE_ID EQU 00043H
  109. PELOADER_DEVICE_ID EQU 00044H
  110. EISA_DEVICE_ID EQU 00045H
  111. DRAGCLI_DEVICE_ID EQU 00046H
  112. DRAGSRV_DEVICE_ID EQU 00047H
  113. PERF_DEVICE_ID EQU 00048H
  114. AWREDIR_DEVICE_ID EQU 00049H
  115. DDS_DEVICE_ID EQU 0004AH
  116. NTKERN_DEVICE_ID EQU 0004BH
  117. VDOSKEYD_DEVICE_ID EQU 0004BH
  118. ACPI_DEVICE_ID EQU 0004CH
  119. UDF_DEVICE_ID EQU 0004DH
  120. SMCLIB_DEVICE_ID EQU 0004EH
  121. ETEN_Device_ID EQU 00060H
  122. CHBIOS_Device_ID EQU 00061H
  123. VMSGD_Device_ID EQU 00062H
  124. VPPID_Device_ID EQU 00063H
  125. VIME_Device_ID EQU 00064H
  126. VHBIOSD_Device_ID EQU 00065H
  127. BASEID_FOR_NAMEBASEDVXD EQU 0f000H
  128. BASEID_FOR_NAMEBASEDVXD_MASK EQU 0fffH
  129. VMM_INIT_ORDER EQU 000000000H
  130. DEBUG_INIT_ORDER EQU 000000000H
  131. DEBUGCMD_INIT_ORDER EQU 000000000H
  132. PERF_INIT_ORDER EQU 000900000H
  133. APM_INIT_ORDER EQU 001000000H
  134. VPOWERD_INIT_ORDER EQU APM_INIT_ORDER
  135. BIOSHOOK_INIT_ORDER EQU 006000000H
  136. VPROD_INIT_ORDER EQU 008000000H
  137. VPICD_INIT_ORDER EQU 00C000000H
  138. VTD_INIT_ORDER EQU 014000000H
  139. VWIN32_INIT_ORDER EQU 014100000H
  140. VXDLDR_INIT_ORDER EQU 016000000H
  141. NTKERN_INIT_ORDER EQU 016200000H
  142. CONFIGMG_INIT_ORDER EQU 016400000H
  143. ENUMERATOR_INIT_ORDER EQU 016800000H
  144. ISAPNP_INIT_ORDER EQU ENUMERATOR_INIT_ORDER
  145. EISA_INIT_ORDER EQU ENUMERATOR_INIT_ORDER
  146. PCI_INIT_ORDER EQU ENUMERATOR_INIT_ORDER
  147. BIOS_INIT_ORDER EQU ENUMERATOR_INIT_ORDER+1
  148. ACPI_INIT_ORDER EQU ENUMERATOR_INIT_ORDER+2
  149. VCDFSD_INIT_ORDER EQU 016F00000H
  150. IOS_INIT_ORDER EQU 017000000H
  151. PAGEFILE_INIT_ORDER EQU 018000000H
  152. PAGESWAP_INIT_ORDER EQU 01C000000H
  153. PARITY_INIT_ORDER EQU 020000000H
  154. REBOOT_INIT_ORDER EQU 024000000H
  155. EBIOS_INIT_ORDER EQU 026000000H
  156. VDD_INIT_ORDER EQU 028000000H
  157. VSD_INIT_ORDER EQU 02C000000H
  158. VCD_INIT_ORDER EQU 030000000H
  159. COMMDRVR_INIT_ORDER EQU (VCD_INIT_ORDER-1)
  160. PRTCL_INIT_ORDER EQU (COMMDRVR_INIT_ORDER-2)
  161. MODEM_INIT_ORDER EQU (COMMDRVR_INIT_ORDER-3)
  162. PORT_INIT_ORDER EQU (COMMDRVR_INIT_ORDER-4)
  163. VMD_INIT_ORDER EQU 034000000H
  164. VKD_INIT_ORDER EQU 038000000H
  165. VPD_INIT_ORDER EQU 03C000000H
  166. BLOCKDEV_INIT_ORDER EQU 040000000H
  167. MCA_POS_INIT_ORDER EQU 041000000H
  168. SCSIFD_INIT_ORDER EQU 041400000H
  169. SCSIMASTER_INIT_ORDER EQU 041800000H
  170. INT13_INIT_ORDER EQU 042000000H
  171. VMCPD_INIT_ORDER EQU 048000000H
  172. BIOSXLAT_INIT_ORDER EQU 050000000H
  173. VNETBIOS_INIT_ORDER EQU 054000000H
  174. DOSMGR_INIT_ORDER EQU 058000000H
  175. DOSNET_INIT_ORDER EQU 05C000000H
  176. WINLOAD_INIT_ORDER EQU 060000000H
  177. VMPOLL_INIT_ORDER EQU 064000000H
  178. UNDEFINED_INIT_ORDER EQU 080000000H
  179. VCOND_INIT_ORDER EQU UNDEFINED_INIT_ORDER
  180. WINDEBUG_INIT_ORDER EQU 081000000H
  181. VDMAD_INIT_ORDER EQU 090000000H
  182. V86MMGR_INIT_ORDER EQU 0A0000000H
  183. IFSMgr_Init_Order EQU 10000H+V86MMGR_Init_Order
  184. FSD_Init_Order EQU 00100H+IFSMgr_Init_Order
  185. VFD_INIT_ORDER EQU 50000H+IFSMgr_Init_Order
  186. UNDEF_TOUCH_MEM_INIT_ORDER EQU 0A8000000H
  187. SHELL_INIT_ORDER EQU 0B0000000H
  188. IO_Delay macro
  189. jmp $+2
  190. ENDM
  191. VXD_FAILURE EQU 0
  192. VXD_SUCCESS EQU 1
  193. Pushad_Struc STRUC
  194. Pushad_EDI DD ?
  195. Pushad_ESI DD ?
  196. Pushad_EBP DD ?
  197. Pushad_ESP DD ?
  198. Pushad_EBX DD ?
  199. Pushad_EDX DD ?
  200. Pushad_ECX DD ?
  201. Pushad_EAX DD ?
  202. Pushad_Struc ENDS
  203. ifndef Not_VxD
  204. ??_CUR_CODE_SEG = 0
  205. ??_LCODE = 1
  206. ??_ICODE = 2
  207. ??_PCODE = 3
  208. ??_SCODE = 4
  209. ??_DBOCODE = 5
  210. ??_16ICODE = 6
  211. ??_RCODE = 7
  212. ??_LOCKABLECODE = 8
  213. ?_LCODE equ <(??_CUR_CODE_SEG MOD 16) - ??_LCODE>
  214. ?_ICODE equ <(??_CUR_CODE_SEG MOD 16) - ??_ICODE>
  215. ?_PCODE equ <(??_CUR_CODE_SEG MOD 16) - ??_PCODE>
  216. ?_SCODE equ <(??_CUR_CODE_SEG MOD 16) - ??_SCODE>
  217. ?_DBOCODE equ <(??_CUR_CODE_SEG MOD 16) - ??_DBOCODE>
  218. ?_16ICODE equ <(??_CUR_CODE_SEG MOD 16) - ??_16ICODE>
  219. ?_RCODE equ <(??_CUR_CODE_SEG MOD 16) - ??_RCODE>
  220. ?_LOCKABLECODE equ <(??_CUR_CODE_SEG MOD 16) - ??_LOCKABLECODE>
  221. ifndef NO_SEGMENTS
  222. IFDEF MASM6
  223. _FLAT EQU FLAT
  224. ELSE
  225. _FLAT EQU USE32
  226. ENDIF
  227. _LTEXT SEGMENT DWORD PUBLIC _FLAT 'LCODE'
  228. _LTEXT ENDS
  229. _TEXT SEGMENT DWORD PUBLIC _FLAT 'LCODE'
  230. _TEXT ENDS
  231. _PTEXT SEGMENT DWORD PUBLIC _FLAT 'PCODE'
  232. _PTEXT ENDS
  233. MakeCodeSeg MACRO seglist, classname, grpname, iseg
  234. IRP segname,<seglist>
  235. IFNB <classname>
  236. segname SEGMENT DWORD PUBLIC _FLAT "&classname&CODE"
  237. ELSE
  238. segname SEGMENT DWORD PUBLIC _FLAT "&segname&CODE"
  239. ENDIF
  240. IFB <iseg>
  241. VxD_&&segname&&_CODE_SEG MACRO
  242. segname SEGMENT
  243. ??_CUR_CODE_SEG = ??_CUR_CODE_SEG SHL 4 + ??_PCODE
  244. ASSUME cs:FLAT, ds:FLAT, es:FLAT, ss:FLAT
  245. ENDM
  246. ELSE
  247. VxD_&&segname&&_CODE_SEG MACRO
  248. segname SEGMENT
  249. ??_CUR_CODE_SEG = ??_CUR_CODE_SEG SHL 4 + iseg
  250. ASSUME cs:FLAT, ds:FLAT, es:FLAT, ss:FLAT
  251. ENDM
  252. ENDIF
  253. VxD_&&segname&&_CODE_ENDS MACRO
  254. ??_CUR_CODE_SEG = ??_CUR_CODE_SEG SHR 4
  255. segname ENDS
  256. ENDM
  257. segname ENDS
  258. IFNDEF BLD_COFF
  259. IFNB <grpname>
  260. _&grpname GROUP segname
  261. ELSE
  262. _&&segname GROUP segname
  263. ENDIF
  264. ENDIF
  265. ENDM
  266. ENDM
  267. MakeCodeSeg <L0CKABLE_BEGIN, LOCKABLE, LOCKABLE_END>, \
  268. LOCKABLE, LOCKABLE, ??_LOCKABLECODE
  269. MakeCodeSeg INT21
  270. MakeCodeSeg SYSEXIT
  271. MakeCodeSeg RARE
  272. MakeCodeSeg W16
  273. MakeCodeSeg W32
  274. MakeCodeSeg VMCREATE
  275. MakeCodeSeg VMDESTROY
  276. MakeCodeSeg THCREATE
  277. MakeCodeSeg THDESTROY
  278. MakeCodeSeg VMSUSPEND
  279. MakeCodeSeg VMRESUME
  280. MakeCodeSeg PNP
  281. MakeCodeSeg DOSVM
  282. DefLockableCodeBegin MACRO name, private
  283. VxD_L0CKABLE_BEGIN_CODE_SEG
  284. IFB <private>
  285. PUBLIC name
  286. ENDIF
  287. name LABEL NEAR
  288. ifdef BLD_COFF
  289. DD ?
  290. endif
  291. VxD_L0CKABLE_BEGIN_CODE_ENDS
  292. ifndef WIN31COMPAT
  293. if DEBLEVEL
  294. VxD_LOCKED_DATA_SEG
  295. PUBLIC name&_Debug_Flags
  296. name&_Debug_Flags DD DFS_TEST_BLOCK
  297. VxD_LOCKED_DATA_ENDS
  298. ??_debug_flags equ <name&_Debug_Flags>
  299. endif
  300. endif
  301. ENDM
  302. DefLockableCodeEnd MACRO name, private
  303. VxD_LOCKABLE_END_CODE_SEG
  304. IFB <private>
  305. PUBLIC name
  306. ENDIF
  307. name LABEL NEAR
  308. ifdef BLD_COFF
  309. DD ?
  310. endif
  311. VxD_LOCKABLE_END_CODE_ENDS
  312. ENDM
  313. CodeLockFlags MACRO name
  314. ifndef WIN31COMPAT
  315. if DEBLEVEL
  316. ifndef name&_Debug_Flags
  317. VxD_LOCKED_DATA_SEG
  318. extrn name&_Debug_Flags:dword
  319. VxD_LOCKED_DATA_ENDS
  320. ??_debug_flags equ <name&_Debug_Flags>
  321. endif
  322. endif
  323. endif
  324. ENDM
  325. MarkCodeLocked MACRO
  326. ifndef WIN31COMPAT
  327. if DEBLEVEL
  328. ifdef ??_debug_flags
  329. pushfd
  330. and ??_debug_flags,NOT DFS_TEST_BLOCK
  331. popfd
  332. endif
  333. endif
  334. endif
  335. ENDM
  336. MarkCodeUnlocked MACRO
  337. ifndef WIN31COMPAT
  338. if DEBLEVEL
  339. ifdef ??_debug_flags
  340. pushfd
  341. or ??_debug_flags,DFS_TEST_BLOCK
  342. popfd
  343. endif
  344. endif
  345. endif
  346. ENDM
  347. _ITEXT SEGMENT DWORD PUBLIC _FLAT 'ICODE'
  348. _ITEXT ENDS
  349. _LDATA SEGMENT DWORD PUBLIC _FLAT 'LCODE'
  350. _LDATA ENDS
  351. _DATA SEGMENT DWORD PUBLIC _FLAT 'LCODE'
  352. _DATA ENDS
  353. _PDATA SEGMENT DWORD PUBLIC _FLAT 'PDATA'
  354. _PDATA ENDS
  355. _IDATA SEGMENT DWORD PUBLIC _FLAT 'ICODE'
  356. _IDATA ENDS
  357. _BSS SEGMENT DWORD PUBLIC _FLAT 'LCODE'
  358. _BSS ENDS
  359. CONST SEGMENT DWORD PUBLIC _FLAT 'LCODE'
  360. CONST ENDS
  361. _TLS SEGMENT DWORD PUBLIC _FLAT 'LCODE'
  362. _TLS ENDS
  363. _STEXT SEGMENT DWORD PUBLIC _FLAT 'SCODE'
  364. _STEXT ENDS
  365. _SDATA SEGMENT DWORD PUBLIC _FLAT 'SCODE'
  366. _SDATA ENDS
  367. _DB0START SEGMENT DWORD PUBLIC _FLAT 'DBOCODE'
  368. _DB0START ENDS
  369. _DB1CODE SEGMENT DWORD PUBLIC _FLAT 'DBOCODE'
  370. _DB1CODE ENDS
  371. _DB2DATA SEGMENT DWORD PUBLIC _FLAT 'DBOCODE'
  372. _DB2DATA ENDS
  373. if DEBLEVEL
  374. _PATHSTART SEGMENT DWORD PUBLIC _FLAT 'LCODE'
  375. _PATHSTART ENDS
  376. _PATHDATA SEGMENT DWORD PUBLIC _FLAT 'LCODE'
  377. _PATHDATA ENDS
  378. _PATHEND SEGMENT DWORD PUBLIC _FLAT 'LCODE'
  379. _PATHEND ENDS
  380. endif
  381. _16ICODE SEGMENT WORD USE16 PUBLIC '16ICODE'
  382. _16ICODE ENDS
  383. _RCODE SEGMENT WORD USE16 PUBLIC 'RCODE'
  384. _RCODE ENDS
  385. IFNDEF BLD_COFF
  386. _LGROUP GROUP _LTEXT, _TEXT, _LDATA, _DATA, _BSS, CONST, _TLS
  387. _IGROUP GROUP _ITEXT, _IDATA
  388. _SGROUP GROUP _STEXT, _SDATA
  389. _DBOGROUP GROUP _DB0START, _DB1CODE, _DB2DATA
  390. IF DEBLEVEL
  391. _PGROUP GROUP _PATHSTART, _PATHDATA, _PATHEND
  392. ENDIF
  393. ENDIF
  394. endif
  395. ASSUME CS:FLAT, DS:FLAT, ES:FLAT, SS:FLAT
  396. OFFSET32 EQU <OFFSET FLAT:>
  397. BeginDoc
  398. EndDoc
  399. Begin_Service_Table MACRO Device_Name, Def_Segment
  400. IFDEF Device_Name&_Name_Based
  401. IFNDEF @@NextInternalID
  402. @@NextInternalID = 0
  403. ENDIF
  404. @@NextInternalID = (@@NextInternalID + 1)
  405. Device_Name&_Internal_ID = @@NextInternalID + BASEID_FOR_NAMEBASEDVXD
  406. DefineVxDName Device_Name, %Device_Name&_Internal_ID
  407. ENDIF
  408. IFB <Def_Segment>
  409. BST2 Device_Name, VxD
  410. ELSE
  411. BST2 Device_Name, Def_Segment
  412. ENDIF
  413. ENDM
  414. DefineVxDName MACRO Device_Name, InternalID
  415. @@VxDName&InternalID EQU <___&Device_Name&STable>
  416. ENDM
  417. BST2 MACRO Device_Name, Def_Segment
  418. Num_&Device_Name&_Services = 0
  419. IFDEF Create_&Device_Name&_Service_Table
  420. Def_Segment&_LOCKED_DATA_SEG
  421. Device_Name&_Service_Table LABEL DWORD
  422. Device_Name&_Service MACRO Procedure, Local_Seg, Condition, StdCallBytes, fastcall
  423. LOCAL $$&Procedure, extrnproc, tableproc
  424. extrnproc MACRO
  425. IFNB <fastcall>
  426. IFB <StdCallBytes>
  427. .err
  428. ENDIF
  429. EXTRN @&&Procedure&&@&&StdCallBytes:NEAR
  430. ELSE
  431. IFNB <StdCallBytes>
  432. EXTRN _&&Procedure&&@&&StdCallBytes:NEAR
  433. ELSE
  434. EXTRN Procedure:NEAR
  435. ENDIF
  436. ENDIF
  437. ENDM
  438. tableproc MACRO
  439. IFNB <fastcall>
  440. dd OFFSET32 @&&Procedure&&@&&StdCallBytes
  441. ELSE
  442. IFNB <StdCallBytes>
  443. dd OFFSET32 _&&Procedure&&@&&StdCallBytes
  444. ELSE
  445. dd OFFSET32 Procedure
  446. ENDIF
  447. ENDIF
  448. ENDM
  449. IFNB <Condition>
  450. $$&&Procedure MACRO extern
  451. IFDEF &Condition
  452. IFNB <extern>
  453. extrnproc
  454. ELSE
  455. tableproc
  456. ENDIF
  457. ELSE
  458. IFB <extern>
  459. dd 0
  460. ENDIF
  461. ENDIF
  462. ENDM
  463. ENDIF
  464. IFDIFI <Procedure>, <RESERVED>
  465. PUBLIC _&&Procedure
  466. IF1
  467. _&&Procedure LABEL DWORD
  468. IFNB <fastcall>
  469. PUBLIC __&&Procedure
  470. __&&Procedure LABEL DWORD
  471. ENDIF
  472. ENDIF
  473. IFDIFI <Local_Seg>, <LOCAL>
  474. IFNB <Local_Seg>
  475. Local_Seg&&_SEG
  476. ELSE
  477. Def_Segment&_CODE_SEG
  478. ENDIF
  479. IFNB <Condition>
  480. $$&&Procedure extern
  481. ELSE
  482. extrnproc
  483. ENDIF
  484. IFNB <Local_Seg>
  485. Local_Seg&&_ENDS
  486. ELSE
  487. Def_Segment&_CODE_ENDS
  488. ENDIF
  489. ENDIF
  490. IFNB <Condition>
  491. $$&&Procedure
  492. ELSE
  493. tableproc
  494. ENDIF
  495. IFDEF Device_Name&_Name_Based
  496. @@&&Procedure = (Device_Name&_Internal_ID SHL 16) + Num_&Device_Name&_Services
  497. ELSE
  498. @@&&Procedure = (Device_Name&_Device_ID SHL 16) + Num_&Device_Name&_Services
  499. ENDIF
  500. ELSE
  501. dd 0
  502. ENDIF
  503. Num_&Device_Name&_Services = Num_&Device_Name&_Services + 1
  504. IFNB <Condition>
  505. Purge $$&&Procedure
  506. ENDIF
  507. Purge extrnproc
  508. Purge tableproc
  509. ENDM
  510. Device_Name&_StdCall_Service MACRO Procedure, Args, Local_Seg, Condition
  511. Device_Name&_Service Procedure, Local_Seg, Condition, %Args*4
  512. ??_standardccall&&_Procedure = Args
  513. ENDM
  514. Device_Name&_FastCall_Service MACRO Procedure, Args, Local_Seg, Condition
  515. Device_Name&_Service Procedure, Local_Seg, Condition, %Args*4, TRUE
  516. ??_fastcall&&_Procedure = Args
  517. ENDM
  518. ELSE
  519. IFDEF Device_Name&_Name_Based
  520. Device_Name&_Service MACRO Procedure, Local_Seg, Condition
  521. IFDIFI <Procedure>, <RESERVED>
  522. @@&&Procedure = (Device_Name&_Internal_ID SHL 16) + Num_&Device_Name&_Services
  523. ENDIF
  524. Num_&Device_Name&_Services = Num_&Device_Name&_Services + 1
  525. ENDM
  526. ELSE
  527. Device_Name&_Service MACRO Procedure, Local_Seg, Condition
  528. IFDIFI <Procedure>, <RESERVED>
  529. @@&&Procedure = (Device_Name&_Device_ID SHL 16) + Num_&Device_Name&_Services
  530. ENDIF
  531. Num_&Device_Name&_Services = Num_&Device_Name&_Services + 1
  532. ENDM
  533. ENDIF
  534. Device_Name&_StdCall_Service MACRO Procedure, Args, Local_Seg, Condition
  535. Device_Name&_Service Procedure, Local_Seg, Condition
  536. ??_standardccall_&&Procedure = Args
  537. ENDM
  538. Device_Name&_FastCall_Service MACRO Procedure, Args, Local_Seg, Condition
  539. Device_Name&_Service Procedure, Local_Seg, Condition
  540. ??_fastcall_&&Procedure = Args
  541. ENDM
  542. ENDIF
  543. ENDM
  544. End_Service_Table MACRO Device_Name, Def_Segment
  545. PURGE Device_Name&_Service
  546. IFDEF Create_&Device_Name&_Service_Table
  547. IFB <Def_Segment>
  548. VxD_LOCKED_DATA_ENDS
  549. ELSE
  550. Def_Segment&_LOCKED_DATA_ENDS
  551. ENDIF
  552. ENDIF
  553. ENDM
  554. GetVxDServiceOrdinal macro reg,service
  555. mov reg,@@&service
  556. endm
  557. GetVxDServiceAddress macro reg,service
  558. mov reg,OFFSET32 service
  559. endm
  560. Begin_Win32_Services MACRO VxDName
  561. ifndef Create_Win32_Services
  562. Create_Win32_Services = 0
  563. endif
  564. .errb <VxDName>, <VxD name missing>
  565. ??w32svcno = 0
  566. if Create_Win32_Services
  567. VxDName&_Win32_Services label dword
  568. dd csvc&VxDName, 0
  569. endif
  570. ??inw32svc = 1
  571. VxDName&_Win32_Service MACRO Name
  572. .erre ??inw32svc, <Missing Begin_Win32_Services>
  573. if Create_Win32_Services
  574. dd OFFSET32 Name,cparm&&Name
  575. endif
  576. @32&&Name equ ((VxDName&_Device_ID SHL 16) + ??w32svcno)
  577. ??w32svcno = ??w32svcno + 1
  578. ENDM
  579. ENDM
  580. End_Win32_Services MACRO VxDName
  581. .errb <VxDName>, <VxD name misssing>
  582. if Create_Win32_Services
  583. csvc&VxDName equ ($ - VxDName&_Win32_Services)/8 - 1
  584. endif
  585. ??inw32svc = 0
  586. PURGE VxDName&_Win32_Service
  587. ENDM
  588. Declare_Win32_Service MACRO Name, cParms
  589. ifndef Create_Win32_Services
  590. Create_Win32_Services = 0
  591. endif
  592. if Create_Win32_Services
  593. ?merge <Name>,,,,<EQU>,<_>,<Name>,<@>,%(cParms*4 + 8)
  594. ?merge <cparm>,<Name>,,,<EQU>,<cParms>
  595. VxD_CODE_SEG
  596. ?merge <EXTRN>,,,,,<_>,<Name>,<@>,%(cParms*4 + 8),<:NEAR>
  597. VxD_CODE_ENDS
  598. endif
  599. ENDM
  600. Win32call MACRO Service, CallBack
  601. ifndef Create_Win32_Services
  602. Create_Win32_Services = 0
  603. endif
  604. ife Create_Win32_Services
  605. mov eax,@32&Service
  606. ifdef IS_16
  607. movzx esp,sp
  608. endif
  609. call fword ptr [CallBack]
  610. ifdef DEBUG
  611. int 3
  612. endif
  613. endif
  614. ENDM
  615. Dword_Align MACRO Seg_Name
  616. LOCAL segn
  617. IFDEF MASM6
  618. align 4
  619. ELSE
  620. IFNB <Seg_Name>
  621. segn equ Seg_Name
  622. ELSE
  623. IFE ?_LCODE
  624. segn equ <_LTEXT>
  625. ELSE
  626. IFE ?_ICODE
  627. segn equ <_ITEXT>
  628. ELSE
  629. IFE ?_PCODE
  630. segn equ <_PTEXT>
  631. ELSE
  632. IFE ?_SCODE
  633. segn equ <_STEXT>
  634. ELSE
  635. .err <Dword_Align not supported>
  636. ENDIF
  637. ENDIF
  638. ENDIF
  639. ENDIF
  640. ENDIF
  641. IF (($-OFFSET segn:0) MOD 4)
  642. db 4 - (($-OFFSET segn:0) MOD 4) DUP (90h)
  643. ENDIF
  644. ENDIF
  645. ENDM
  646. BeginDoc
  647. EndDoc
  648. Fatal_Error MACRO Msg_Ptr, Exit_Flags
  649. pushad
  650. IFB <Msg_Ptr>
  651. xor esi, esi
  652. ELSE
  653. mov esi, Msg_Ptr
  654. IFB <Exit_Flags>
  655. xor eax, eax
  656. ELSE
  657. mov eax, Exit_Flags
  658. ENDIF
  659. ENDIF
  660. VMMCall Fatal_Error_Handler
  661. ENDM
  662. EF_Hang_On_Exit EQU 1h
  663. cb_s STRUC
  664. CB_VM_Status DD ?
  665. CB_High_Linear DD ?
  666. CB_Client_Pointer DD ?
  667. CB_VMID DD ?
  668. CB_Signature DD ?
  669. cb_s ENDS
  670. VMCB_ID EQU 62634D56H
  671. VMSTAT_EXCLUSIVE_BIT EQU 00H
  672. VMSTAT_EXCLUSIVE EQU (1 SHL VMSTAT_EXCLUSIVE_BIT)
  673. VMSTAT_BACKGROUND_BIT EQU 01H
  674. VMSTAT_BACKGROUND EQU (1 SHL VMSTAT_BACKGROUND_BIT)
  675. VMSTAT_CREATING_BIT EQU 02H
  676. VMSTAT_CREATING EQU (1 SHL VMSTAT_CREATING_BIT)
  677. VMSTAT_SUSPENDED_BIT EQU 03H
  678. VMSTAT_SUSPENDED EQU (1 SHL VMSTAT_SUSPENDED_BIT)
  679. VMSTAT_NOT_EXECUTEABLE_BIT EQU 04H
  680. VMSTAT_NOT_EXECUTEABLE EQU (1 SHL VMSTAT_NOT_EXECUTEABLE_BIT)
  681. VMSTAT_PM_EXEC_BIT EQU 05H
  682. VMSTAT_PM_EXEC EQU (1 SHL VMSTAT_PM_EXEC_BIT)
  683. VMSTAT_PM_APP_BIT EQU 06H
  684. VMSTAT_PM_APP EQU (1 SHL VMSTAT_PM_APP_BIT)
  685. VMSTAT_PM_USE32_BIT EQU 07H
  686. VMSTAT_PM_USE32 EQU (1 SHL VMSTAT_PM_USE32_BIT)
  687. VMSTAT_VXD_EXEC_BIT EQU 08H
  688. VMSTAT_VXD_EXEC EQU (1 SHL VMSTAT_VXD_EXEC_BIT)
  689. VMSTAT_HIGH_PRI_BACK_BIT EQU 09H
  690. VMSTAT_HIGH_PRI_BACK EQU (1 SHL VMSTAT_HIGH_PRI_BACK_BIT)
  691. VMSTAT_BLOCKED_BIT EQU 0AH
  692. VMSTAT_BLOCKED EQU (1 SHL VMSTAT_BLOCKED_BIT)
  693. VMSTAT_AWAKENING_BIT EQU 0BH
  694. VMSTAT_AWAKENING EQU (1 SHL VMSTAT_AWAKENING_BIT)
  695. VMSTAT_PAGEABLEV86BIT EQU 0CH
  696. VMSTAT_PAGEABLEV86_BIT EQU VMSTAT_PAGEABLEV86BIT
  697. VMSTAT_PAGEABLEV86 EQU (1 SHL VMSTAT_PAGEABLEV86BIT)
  698. VMSTAT_V86INTSLOCKEDBIT EQU 0DH
  699. VMSTAT_V86INTSLOCKED_BIT EQU VMSTAT_V86INTSLOCKEDBIT
  700. VMSTAT_V86INTSLOCKED EQU (1 SHL VMSTAT_V86INTSLOCKEDBIT)
  701. VMSTAT_IDLE_TIMEOUT_BIT EQU 0EH
  702. VMSTAT_IDLE_TIMEOUT EQU (1 SHL VMSTAT_IDLE_TIMEOUT_BIT)
  703. VMSTAT_IDLE_BIT EQU 0FH
  704. VMSTAT_IDLE EQU (1 SHL VMSTAT_IDLE_BIT)
  705. VMSTAT_CLOSING_BIT EQU 10H
  706. VMSTAT_CLOSING EQU (1 SHL VMSTAT_CLOSING_BIT)
  707. VMSTAT_TS_SUSPENDED_BIT EQU 11H
  708. VMSTAT_TS_SUSPENDED EQU (1 SHL VMSTAT_TS_SUSPENDED_BIT)
  709. VMSTAT_TS_MAXPRI_BIT EQU 12H
  710. VMSTAT_TS_MAXPRI EQU (1 SHL VMSTAT_TS_MAXPRI_BIT)
  711. VMSTAT_USE32_MASK EQU (VMSTAT_PM_USE32 OR VMSTAT_VXD_EXEC)
  712. tcb_s STRUC
  713. TCB_Flags DD ?
  714. TCB_Reserved1 DD ?
  715. TCB_Reserved2 DD ?
  716. TCB_Signature DD ?
  717. TCB_ClientPtr DD ?
  718. TCB_VMHandle DD ?
  719. TCB_ThreadId DW ?
  720. TCB_PMLockOrigSS DW ?
  721. TCB_PMLockOrigESP DD ?
  722. TCB_PMLockOrigEIP DD ?
  723. TCB_PMLockStackCount DD ?
  724. TCB_PMLockOrigCS DW ?
  725. TCB_PMPSPSelector DW ?
  726. TCB_ThreadType DD ?
  727. TCB_pad1 DW ?
  728. TCB_pad2 DB ?
  729. TCB_extErrLocus DB ?
  730. TCB_extErr DW ?
  731. TCB_extErrAction DB ?
  732. TCB_extErrClass DB ?
  733. TCB_extErrPtr DD ?
  734. tcb_s ENDS
  735. SCHED_OBJ_ID_THREAD EQU 42434854H
  736. THFLAG_SUSPENDED_BIT EQU 03H
  737. THFLAG_SUSPENDED EQU (1 SHL THFLAG_SUSPENDED_BIT)
  738. THFLAG_NOT_EXECUTEABLE_BIT EQU 04H
  739. THFLAG_NOT_EXECUTEABLE EQU (1 SHL THFLAG_NOT_EXECUTEABLE_BIT)
  740. THFLAG_THREAD_CREATION_BIT EQU 08H
  741. THFLAG_THREAD_CREATION EQU (1 SHL THFLAG_THREAD_CREATION_BIT)
  742. THFLAG_THREAD_BLOCKED_BIT EQU 0AH
  743. THFLAG_THREAD_BLOCKED EQU (1 SHL THFLAG_THREAD_BLOCKED_BIT)
  744. THFLAG_RING0_THREAD_BIT EQU 1CH
  745. THFLAG_RING0_THREAD EQU (1 SHL THFLAG_RING0_THREAD_BIT)
  746. THFLAG_ASYNC_THREAD_BIT EQU 1FH
  747. THFLAG_ASYNC_THREAD EQU (1 SHL THFLAG_ASYNC_THREAD_BIT)
  748. THFLAG_CHARSET_BITS EQU 10H
  749. THFLAG_CHARSET_MASK EQU (3 SHL THFLAG_CHARSET_BITS)
  750. THFLAG_ANSI EQU (0 SHL THFLAG_CHARSET_BITS)
  751. THFLAG_OEM EQU (1 SHL THFLAG_CHARSET_BITS)
  752. THFLAG_UNICODE EQU (2 SHL THFLAG_CHARSET_BITS)
  753. THFLAG_RESERVED EQU (3 SHL THFLAG_CHARSET_BITS)
  754. THFLAG_EXTENDED_HANDLES_BIT EQU 12H
  755. THFLAG_EXTENDED_HANDLES EQU (1 SHL THFLAG_EXTENDED_HANDLES_BIT)
  756. THFLAG_OPEN_AS_IMMOVABLE_FILE_BIT EQU 13H
  757. THFLAG_OPEN_AS_IMMOVABLE_FILE EQU (1 SHL THFLAG_OPEN_AS_IMMOVABLE_FILE_BIT)
  758. pmcb_s STRUC
  759. PMCB_Flags DD ?
  760. PMCB_Parent DD ?
  761. pmcb_s ENDS
  762. VMFaultInfo STRUC
  763. VMFI_EIP DD ?
  764. VMFI_CS DW ?
  765. VMFI_Ints DW ?
  766. VMFaultInfo ENDS
  767. Begin_Service_Table VMM, VMM
  768. VMM_Service Get_VMM_Version, LOCAL
  769. VMM_Service Get_Cur_VM_Handle
  770. VMM_Service Test_Cur_VM_Handle
  771. VMM_Service Get_Sys_VM_Handle
  772. VMM_Service Test_Sys_VM_Handle
  773. VMM_Service Validate_VM_Handle
  774. VMM_Service Get_VMM_Reenter_Count
  775. VMM_Service Begin_Reentrant_Execution
  776. VMM_Service End_Reentrant_Execution
  777. VMM_Service Install_V86_Break_Point
  778. VMM_Service Remove_V86_Break_Point
  779. VMM_Service Allocate_V86_Call_Back
  780. VMM_Service Allocate_PM_Call_Back
  781. VMM_Service Call_When_VM_Returns
  782. VMM_Service Schedule_Global_Event
  783. VMM_Service Schedule_VM_Event
  784. VMM_Service Call_Global_Event
  785. VMM_Service Call_VM_Event
  786. VMM_Service Cancel_Global_Event
  787. VMM_Service Cancel_VM_Event
  788. VMM_Service Call_Priority_VM_Event
  789. VMM_Service Cancel_Priority_VM_Event
  790. VMM_Service Get_NMI_Handler_Addr
  791. VMM_Service Set_NMI_Handler_Addr
  792. VMM_Service Hook_NMI_Event
  793. VMM_Service Call_When_VM_Ints_Enabled
  794. VMM_Service Enable_VM_Ints
  795. VMM_Service Disable_VM_Ints
  796. VMM_Service Map_Flat
  797. VMM_Service Map_Lin_To_VM_Addr
  798. VMM_Service Adjust_Exec_Priority
  799. VMM_Service Begin_Critical_Section
  800. VMM_Service End_Critical_Section
  801. VMM_Service End_Crit_And_Suspend
  802. VMM_Service Claim_Critical_Section
  803. VMM_Service Release_Critical_Section
  804. VMM_Service Call_When_Not_Critical
  805. VMM_Service Create_Semaphore
  806. VMM_Service Destroy_Semaphore
  807. VMM_Service Wait_Semaphore
  808. VMM_Service Signal_Semaphore
  809. VMM_Service Get_Crit_Section_Status
  810. VMM_Service Call_When_Task_Switched
  811. VMM_Service Suspend_VM
  812. VMM_Service Resume_VM
  813. VMM_Service No_Fail_Resume_VM
  814. VMM_Service Nuke_VM
  815. VMM_Service Crash_Cur_VM
  816. VMM_Service Get_Execution_Focus
  817. VMM_Service Set_Execution_Focus
  818. VMM_Service Get_Time_Slice_Priority
  819. VMM_Service Set_Time_Slice_Priority
  820. VMM_Service Get_Time_Slice_Granularity
  821. VMM_Service Set_Time_Slice_Granularity
  822. VMM_Service Get_Time_Slice_Info
  823. VMM_Service Adjust_Execution_Time
  824. VMM_Service Release_Time_Slice
  825. VMM_Service Wake_Up_VM
  826. VMM_Service Call_When_Idle
  827. VMM_Service Get_Next_VM_Handle
  828. VMM_Service Set_Global_Time_Out
  829. VMM_Service Set_VM_Time_Out
  830. VMM_Service Cancel_Time_Out
  831. VMM_Service Get_System_Time
  832. VMM_Service Get_VM_Exec_Time
  833. VMM_Service Hook_V86_Int_Chain
  834. VMM_Service Get_V86_Int_Vector
  835. VMM_Service Set_V86_Int_Vector
  836. VMM_Service Get_PM_Int_Vector
  837. VMM_Service Set_PM_Int_Vector
  838. VMM_Service Simulate_Int
  839. VMM_Service Simulate_Iret
  840. VMM_Service Simulate_Far_Call
  841. VMM_Service Simulate_Far_Jmp
  842. VMM_Service Simulate_Far_Ret
  843. VMM_Service Simulate_Far_Ret_N
  844. VMM_Service Build_Int_Stack_Frame
  845. VMM_Service Simulate_Push
  846. VMM_Service Simulate_Pop
  847. VMM_Service _HeapAllocate
  848. VMM_Service _HeapReAllocate
  849. VMM_Service _HeapFree
  850. VMM_Service _HeapGetSize
  851. HEAPZEROINIT EQU 00000001H
  852. HEAPZEROREINIT EQU 00000002H
  853. HEAPNOCOPY EQU 00000004H
  854. HEAPALIGN_SHIFT EQU 16
  855. HEAPALIGN_MASK EQU 000F0000H
  856. HEAPALIGN_4 EQU 00000000H
  857. HEAPALIGN_8 EQU 00000000H
  858. HEAPALIGN_16 EQU 00000000H
  859. HEAPALIGN_32 EQU 00010000H
  860. HEAPALIGN_64 EQU 00020000H
  861. HEAPALIGN_128 EQU 00030000H
  862. HEAPALIGN_256 EQU 00040000H
  863. HEAPALIGN_512 EQU 00050000H
  864. HEAPALIGN_1K EQU 00060000H
  865. HEAPALIGN_2K EQU 00070000H
  866. HEAPALIGN_4K EQU 00080000H
  867. HEAPALIGN_8K EQU 00090000H
  868. HEAPALIGN_16K EQU 000A0000H
  869. HEAPALIGN_32K EQU 000B0000H
  870. HEAPALIGN_64K EQU 000C0000H
  871. HEAPALIGN_128K EQU 000D0000H
  872. HEAPTYPESHIFT EQU 8
  873. HEAPTYPEMASK EQU 00000700H
  874. HEAPLOCKEDHIGH EQU 00000000H
  875. HEAPLOCKEDIFDP EQU 00000100H
  876. HEAPSWAP EQU 00000200H
  877. HEAPINIT EQU 00000400H
  878. HEAPCLEAN EQU 00000800H
  879. HEAPCONTIG EQU 00001000H
  880. HEAPFORGET EQU 00002000H
  881. HEAPLOCKEDLOW EQU 00000300H
  882. HEAPSYSVM EQU 00000500H
  883. HEAPPREEMPT EQU 00000600H
  884. VMM_Service _PageAllocate
  885. VMM_Service _PageReAllocate
  886. VMM_Service _PageFree
  887. VMM_Service _PageLock
  888. VMM_Service _PageUnLock
  889. VMM_Service _PageGetSizeAddr
  890. VMM_Service _PageGetAllocInfo
  891. VMM_Service _GetFreePageCount
  892. VMM_Service _GetSysPageCount
  893. VMM_Service _GetVMPgCount
  894. VMM_Service _MapIntoV86
  895. VMM_Service _PhysIntoV86
  896. VMM_Service _TestGlobalV86Mem
  897. VMM_Service _ModifyPageBits
  898. VMM_Service _CopyPageTable
  899. VMM_Service _LinMapIntoV86
  900. VMM_Service _LinPageLock
  901. VMM_Service _LinPageUnLock
  902. VMM_Service _SetResetV86Pageable
  903. VMM_Service _GetV86PageableArray
  904. VMM_Service _PageCheckLinRange
  905. VMM_Service _PageOutDirtyPages
  906. VMM_Service _PageDiscardPages
  907. PAGEZEROINIT EQU 00000001H
  908. PAGEUSEALIGN EQU 00000002H
  909. PAGECONTIG EQU 00000004H
  910. PAGEFIXED EQU 00000008H
  911. PAGEDEBUGNULFAULT EQU 00000010H
  912. PAGEZEROREINIT EQU 00000020H
  913. PAGENOCOPY EQU 00000040H
  914. PAGELOCKED EQU 00000080H
  915. PAGELOCKEDIFDP EQU 00000100H
  916. PAGESETV86PAGEABLE EQU 00000200H
  917. PAGECLEARV86PAGEABLE EQU 00000400H
  918. PAGESETV86INTSLOCKED EQU 00000800H
  919. PAGECLEARV86INTSLOCKED EQU 00001000H
  920. PAGEMARKPAGEOUT EQU 00002000H
  921. PAGEPDPSETBASE EQU 00004000H
  922. PAGEPDPCLEARBASE EQU 00008000H
  923. PAGEDISCARD EQU 00010000H
  924. PAGEPDPQUERYDIRTY EQU 00020000H
  925. PAGEMAPFREEPHYSREG EQU 00040000H
  926. PAGEPHYSONLY EQU 04000000H
  927. PAGENOMOVE EQU 10000000H
  928. PAGEMAPGLOBAL EQU 40000000H
  929. PAGEMARKDIRTY EQU 80000000H
  930. MAPV86_IGNOREWRAP EQU 00000001H
  931. MPL_NonCached EQU 00000000H
  932. MPL_HardwareCoherentCached EQU 00000001H
  933. MPL_FrameBufferCached EQU 00000002H
  934. MPL_Cached EQU 00000004H
  935. VMM_Service _GetNulPageHandle
  936. VMM_Service _GetFirstV86Page
  937. VMM_Service _MapPhysToLinear
  938. VMM_Service _GetAppFlatDSAlias
  939. VMM_Service _SelectorMapFlat
  940. VMM_Service _GetDemandPageInfo
  941. VMM_Service _GetSetPageOutCount
  942. GSPOC_F_GET EQU 00000001H
  943. VMM_Service Hook_V86_Page
  944. VMM_Service _Assign_Device_V86_Pages
  945. VMM_Service _DeAssign_Device_V86_Pages
  946. VMM_Service _Get_Device_V86_Pages_Array
  947. VMM_Service MMGR_SetNULPageAddr
  948. VMM_Service _Allocate_GDT_Selector
  949. VMM_Service _Free_GDT_Selector
  950. VMM_Service _Allocate_LDT_Selector
  951. VMM_Service _Free_LDT_Selector
  952. VMM_Service _BuildDescriptorDWORDs
  953. VMM_Service _GetDescriptor
  954. VMM_Service _SetDescriptor
  955. ALLOCFROMEND EQU 40000000H
  956. BDDEXPLICITDPL EQU 00000001H
  957. ALDTSPECSEL EQU 00000001H
  958. VMM_Service _MMGR_Toggle_HMA
  959. MMGRHMAPHYSICAL EQU 00000001H
  960. MMGRHMAENABLE EQU 00000002H
  961. MMGRHMADISABLE EQU 00000004H
  962. MMGRHMAQUERY EQU 00000008H
  963. VMM_Service Get_Fault_Hook_Addrs
  964. VMM_Service Hook_V86_Fault
  965. VMM_Service Hook_PM_Fault
  966. VMM_Service Hook_VMM_Fault
  967. VMM_Service Begin_Nest_V86_Exec
  968. VMM_Service Begin_Nest_Exec
  969. VMM_Service Exec_Int
  970. VMM_Service Resume_Exec
  971. VMM_Service End_Nest_Exec
  972. VMM_Service Allocate_PM_App_CB_Area, VMM_ICODE
  973. VMM_Service Get_Cur_PM_App_CB
  974. VMM_Service Set_V86_Exec_Mode
  975. VMM_Service Set_PM_Exec_Mode
  976. VMM_Service Begin_Use_Locked_PM_Stack
  977. VMM_Service End_Use_Locked_PM_Stack
  978. VMM_Service Save_Client_State
  979. VMM_Service Restore_Client_State
  980. VMM_Service Exec_VxD_Int
  981. VMM_Service Hook_Device_Service
  982. VMM_Service Hook_Device_V86_API
  983. VMM_Service Hook_Device_PM_API
  984. VMM_Service System_Control
  985. VMM_Service Simulate_IO
  986. VMM_Service Install_Mult_IO_Handlers
  987. VMM_Service Install_IO_Handler
  988. VMM_Service Enable_Global_Trapping
  989. VMM_Service Enable_Local_Trapping
  990. VMM_Service Disable_Global_Trapping
  991. VMM_Service Disable_Local_Trapping
  992. VMM_Service List_Create
  993. VMM_Service List_Destroy
  994. VMM_Service List_Allocate
  995. VMM_Service List_Attach
  996. VMM_Service List_Attach_Tail
  997. VMM_Service List_Insert
  998. VMM_Service List_Remove
  999. VMM_Service List_Deallocate
  1000. VMM_Service List_Get_First
  1001. VMM_Service List_Get_Next
  1002. VMM_Service List_Remove_First
  1003. LF_ASYNC_BIT EQU 0
  1004. LF_ASYNC EQU (1 SHL LF_ASYNC_BIT)
  1005. LF_USE_HEAP_BIT EQU 1
  1006. LF_USE_HEAP EQU (1 SHL LF_USE_HEAP_BIT)
  1007. LF_ALLOC_ERROR_BIT EQU 2
  1008. LF_ALLOC_ERROR EQU (1 SHL LF_ALLOC_ERROR_BIT)
  1009. LF_SWAP EQU (LF_USE_HEAP+(1 SHL 3))
  1010. VMM_Service _AddInstanceItem
  1011. VMM_Service _Allocate_Device_CB_Area
  1012. VMM_Service _Allocate_Global_V86_Data_Area, VMM_ICODE
  1013. VMM_Service _Allocate_Temp_V86_Data_Area
  1014. VMM_Service _Free_Temp_V86_Data_Area
  1015. GVDAWordAlign EQU 00000001H
  1016. GVDADWordAlign EQU 00000002H
  1017. GVDAParaAlign EQU 00000004H
  1018. GVDAPageAlign EQU 00000008H
  1019. GVDAInstance EQU 00000100H
  1020. GVDAZeroInit EQU 00000200H
  1021. GVDAReclaim EQU 00000400H
  1022. GVDAInquire EQU 00000800H
  1023. GVDAHighSysCritOK EQU 00001000H
  1024. GVDAOptInstance EQU 00002000H
  1025. GVDAForceLow EQU 00004000H
  1026. TVDANeedTilInitComplete EQU 00000001H
  1027. VMM_Service Get_Profile_Decimal_Int, VMM_ICODE
  1028. VMM_Service Convert_Decimal_String, VMM_ICODE
  1029. VMM_Service Get_Profile_Fixed_Point, VMM_ICODE
  1030. VMM_Service Convert_Fixed_Point_String, VMM_ICODE
  1031. VMM_Service Get_Profile_Hex_Int, VMM_ICODE
  1032. VMM_Service Convert_Hex_String, VMM_ICODE
  1033. VMM_Service Get_Profile_Boolean, VMM_ICODE
  1034. VMM_Service Convert_Boolean_String, VMM_ICODE
  1035. VMM_Service Get_Profile_String, VMM_ICODE
  1036. VMM_Service Get_Next_Profile_String, VMM_ICODE
  1037. VMM_Service Get_Environment_String, VMM_ICODE
  1038. VMM_Service Get_Exec_Path, VMM_ICODE
  1039. VMM_Service Get_Config_Directory, VMM_ICODE
  1040. VMM_Service OpenFile, VMM_ICODE
  1041. VMM_OPENFILE_BUF_SIZE EQU 260
  1042. VMM_Service Get_PSP_Segment, VMM_ICODE
  1043. VMM_Service GetDOSVectors, VMM_ICODE
  1044. VMM_Service Get_Machine_Info
  1045. GMIF_80486_BIT EQU 10H
  1046. GMIF_80486 EQU (1 SHL GMIF_80486_BIT)
  1047. GMIF_PCXT_BIT EQU 11H
  1048. GMIF_PCXT EQU (1 SHL GMIF_PCXT_BIT)
  1049. GMIF_MCA_BIT EQU 12H
  1050. GMIF_MCA EQU (1 SHL GMIF_MCA_BIT)
  1051. GMIF_EISA_BIT EQU 13H
  1052. GMIF_EISA EQU (1 SHL GMIF_EISA_BIT)
  1053. GMIF_CPUID_BIT EQU 14H
  1054. GMIF_CPUID EQU (1 SHL GMIF_CPUID_BIT)
  1055. GMIF_80586_BIT EQU 15H
  1056. GMIF_80586 EQU (1 SHL GMIF_80586_BIT)
  1057. GMIF_4MEGPG_BIT EQU 16H
  1058. GMIF_4MEGPG EQU (1 SHL GMIF_4MEGPG_BIT)
  1059. GMIF_RDTSC_BIT EQU 17H
  1060. GMIF_RDTSC EQU (1 SHL GMIF_RDTSC_BIT)
  1061. VMM_Service GetSet_HMA_Info
  1062. VMM_Service Set_System_Exit_Code
  1063. VMM_Service Fatal_Error_Handler
  1064. VMM_Service Fatal_Memory_Error
  1065. VMM_Service Update_System_Clock
  1066. VMM_Service Test_Debug_Installed
  1067. VMM_Service Out_Debug_String
  1068. VMM_Service Out_Debug_Chr
  1069. VMM_Service In_Debug_Chr
  1070. VMM_Service Debug_Convert_Hex_Binary
  1071. VMM_Service Debug_Convert_Hex_Decimal
  1072. VMM_Service Debug_Test_Valid_Handle
  1073. VMM_Service Validate_Client_Ptr
  1074. VMM_Service Test_Reenter
  1075. VMM_Service Queue_Debug_String
  1076. VMM_Service Log_Proc_Call
  1077. VMM_Service Debug_Test_Cur_VM
  1078. VMM_Service Get_PM_Int_Type
  1079. VMM_Service Set_PM_Int_Type
  1080. VMM_Service Get_Last_Updated_System_Time
  1081. VMM_Service Get_Last_Updated_VM_Exec_Time
  1082. VMM_Service Test_DBCS_Lead_Byte
  1083. .errnz @@Test_DBCS_Lead_Byte - 100D1h
  1084. VMM_Service _AddFreePhysPage, VMM_ICODE
  1085. VMM_Service _PageResetHandlePAddr
  1086. VMM_Service _SetLastV86Page, VMM_ICODE
  1087. VMM_Service _GetLastV86Page
  1088. VMM_Service _MapFreePhysReg
  1089. VMM_Service _UnmapFreePhysReg
  1090. VMM_Service _XchgFreePhysReg
  1091. VMM_Service _SetFreePhysRegCalBk, VMM_ICODE
  1092. VMM_Service Get_Next_Arena, VMM_ICODE
  1093. VMM_Service Get_Name_Of_Ugly_TSR, VMM_ICODE
  1094. VMM_Service Get_Debug_Options, VMM_ICODE
  1095. AFPP_SWAPOUT EQU 0001H
  1096. PCP_CHANGEPAGER EQU 1H
  1097. PCP_CHANGEPAGERDATA EQU 2H
  1098. PCP_VIRGINONLY EQU 4H
  1099. GNA_HIDOSLINKED EQU 0002H
  1100. GNA_ISHIGHDOS EQU 0004H
  1101. VMM_Service Set_Physical_HMA_Alias, VMM_ICODE
  1102. VMM_Service _GetGlblRng0V86IntBase, VMM_ICODE
  1103. VMM_Service _Add_Global_V86_Data_Area, VMM_ICODE
  1104. VMM_Service GetSetDetailedVMError
  1105. GSDVME_PRIVINST EQU 00010001H
  1106. GSDVME_INVALINST EQU 00010002H
  1107. GSDVME_INVALPGFLT EQU 00010003H
  1108. GSDVME_INVALGPFLT EQU 00010004H
  1109. GSDVME_INVALFLT EQU 00010005H
  1110. GSDVME_USERNUKE EQU 00010006H
  1111. GSDVME_DEVNUKE EQU 00010007H
  1112. GSDVME_DEVNUKEHDWR EQU 00010008H
  1113. GSDVME_NUKENOMSG EQU 00010009H
  1114. GSDVME_OKNUKEMASK EQU 80000000H
  1115. GSDVME_INSMEMV86 EQU 00020001H
  1116. GSDVME_INSV86SPACE EQU 00020002H
  1117. GSDVME_INSMEMXMS EQU 00020003H
  1118. GSDVME_INSMEMEMS EQU 00020004H
  1119. GSDVME_INSMEMV86HI EQU 00020005H
  1120. GSDVME_INSMEMVID EQU 00020006H
  1121. GSDVME_INSMEMVM EQU 00020007H
  1122. GSDVME_INSMEMDEV EQU 00020008H
  1123. GSDVME_CRTNOMSG EQU 00020009H
  1124. VMM_Service Is_Debug_Chr
  1125. VMM_Service Clear_Mono_Screen
  1126. VMM_Service Out_Mono_Chr
  1127. VMM_Service Out_Mono_String
  1128. VMM_Service Set_Mono_Cur_Pos
  1129. VMM_Service Get_Mono_Cur_Pos
  1130. VMM_Service Get_Mono_Chr
  1131. VMM_Service Locate_Byte_In_ROM, VMM_ICODE
  1132. VMM_Service Hook_Invalid_Page_Fault
  1133. VMM_Service Unhook_Invalid_Page_Fault
  1134. IPF_PGDIR EQU 00000001H
  1135. IPF_V86PG EQU 00000002H
  1136. IPF_V86PGH EQU 00000004H
  1137. IPF_INVTYP EQU 00000008H
  1138. IPF_PGERR EQU 00000010H
  1139. IPF_REFLT EQU 00000020H
  1140. IPF_VMM EQU 00000040H
  1141. IPF_PM EQU 00000080H
  1142. IPF_V86 EQU 00000100H
  1143. VMM_Service Set_Delete_On_Exit_File
  1144. VMM_Service Close_VM
  1145. CVF_CONTINUE_EXEC_BIT EQU 0
  1146. CVF_CONTINUE_EXEC EQU (1 SHL CVF_CONTINUE_EXEC_BIT)
  1147. VMM_Service Enable_Touch_1st_Meg
  1148. VMM_Service Disable_Touch_1st_Meg
  1149. VMM_Service Install_Exception_Handler
  1150. VMM_Service Remove_Exception_Handler
  1151. VMM_Service Get_Crit_Status_No_Block
  1152. .errnz @@Get_Crit_Status_No_Block - 100F1h
  1153. ifdef WIN40SERVICES
  1154. VMM_Service _GetLastUpdatedThreadExecTime
  1155. VMM_Service _Trace_Out_Service
  1156. VMM_Service _Debug_Out_Service
  1157. VMM_Service _Debug_Flags_Service
  1158. endif
  1159. DFS_LOG_BIT EQU 0
  1160. DFS_LOG EQU (1 SHL DFS_LOG_BIT)
  1161. DFS_PROFILE_BIT EQU 1
  1162. DFS_PROFILE EQU (1 SHL DFS_PROFILE_BIT)
  1163. DFS_TEST_CLD_BIT EQU 2
  1164. DFS_TEST_CLD EQU (1 SHL DFS_TEST_CLD_BIT)
  1165. DFS_NEVER_REENTER_BIT EQU 3
  1166. DFS_NEVER_REENTER EQU (1 SHL DFS_NEVER_REENTER_BIT)
  1167. DFS_TEST_REENTER_BIT EQU 4
  1168. DFS_TEST_REENTER EQU (1 SHL DFS_TEST_REENTER_BIT)
  1169. DFS_NOT_SWAPPING_BIT EQU 5
  1170. DFS_NOT_SWAPPING EQU (1 SHL DFS_NOT_SWAPPING_BIT)
  1171. DFS_TEST_BLOCK_BIT EQU 6
  1172. DFS_TEST_BLOCK EQU (1 SHL DFS_TEST_BLOCK_BIT)
  1173. DFS_RARE_SERVICES EQU 0FFFFFF80H
  1174. DFS_EXIT_NOBLOCK EQU (DFS_RARE_SERVICES+0)
  1175. DFS_ENTER_NOBLOCK EQU (DFS_RARE_SERVICES+DFS_TEST_BLOCK)
  1176. DFS_TEST_NEST_EXEC EQU (DFS_RARE_SERVICES+1)
  1177. DFS_WIMP_DEBUG EQU (DFS_RARE_SERVICES+2)
  1178. ifdef WIN40SERVICES
  1179. VMM_Service VMMAddImportModuleName
  1180. VMM_Service VMM_Add_DDB
  1181. VMM_Service VMM_Remove_DDB
  1182. VMM_Service Test_VM_Ints_Enabled
  1183. VMM_Service _BlockOnID
  1184. VMM_Service Schedule_Thread_Event
  1185. VMM_Service Cancel_Thread_Event
  1186. VMM_Service Set_Thread_Time_Out
  1187. VMM_Service Set_Async_Time_Out
  1188. VMM_Service _AllocateThreadDataSlot
  1189. VMM_Service _FreeThreadDataSlot
  1190. MUTEX_MUST_COMPLETE EQU 1
  1191. MUTEX_NO_CLEANUP_THREAD_STATE EQU 2
  1192. VMM_Service _CreateMutex
  1193. VMM_Service _DestroyMutex
  1194. VMM_Service _GetMutexOwner
  1195. VMM_Service Call_When_Thread_Switched
  1196. VMM_Service VMMCreateThread
  1197. VMM_Service _GetThreadExecTime
  1198. VMM_Service VMMTerminateThread
  1199. VMM_Service Get_Cur_Thread_Handle
  1200. VMM_Service Test_Cur_Thread_Handle
  1201. VMM_Service Get_Sys_Thread_Handle
  1202. VMM_Service Test_Sys_Thread_Handle
  1203. VMM_Service Validate_Thread_Handle
  1204. VMM_Service Get_Initial_Thread_Handle
  1205. VMM_Service Test_Initial_Thread_Handle
  1206. VMM_Service Debug_Test_Valid_Thread_Handle
  1207. VMM_Service Debug_Test_Cur_Thread
  1208. VMM_Service VMM_GetSystemInitState
  1209. VMM_Service Cancel_Call_When_Thread_Switched
  1210. VMM_Service Get_Next_Thread_Handle
  1211. VMM_Service Adjust_Thread_Exec_Priority
  1212. VMM_Service _Deallocate_Device_CB_Area
  1213. VMM_Service Remove_IO_Handler
  1214. VMM_Service Remove_Mult_IO_Handlers
  1215. VMM_Service Unhook_V86_Int_Chain
  1216. VMM_Service Unhook_V86_Fault
  1217. VMM_Service Unhook_PM_Fault
  1218. VMM_Service Unhook_VMM_Fault
  1219. VMM_Service Unhook_Device_Service
  1220. VMM_Service _PageReserve
  1221. VMM_Service _PageCommit
  1222. VMM_Service _PageDecommit
  1223. VMM_Service _PagerRegister
  1224. VMM_Service _PagerQuery
  1225. VMM_Service _PagerDeregister
  1226. VMM_Service _ContextCreate
  1227. VMM_Service _ContextDestroy
  1228. VMM_Service _PageAttach
  1229. VMM_Service _PageFlush
  1230. VMM_Service _SignalID
  1231. VMM_Service _PageCommitPhys
  1232. VMM_Service _Register_Win32_Services
  1233. VMM_Service Cancel_Call_When_Not_Critical
  1234. VMM_Service Cancel_Call_When_Idle
  1235. VMM_Service Cancel_Call_When_Task_Switched
  1236. VMM_Service _Debug_Printf_Service
  1237. VMM_Service _EnterMutex
  1238. VMM_Service _LeaveMutex
  1239. VMM_Service Simulate_VM_IO
  1240. VMM_Service Signal_Semaphore_No_Switch
  1241. VMM_Service _ContextSwitch
  1242. VMM_Service _PageModifyPermissions
  1243. VMM_Service _PageQuery
  1244. VMM_Service _EnterMustComplete
  1245. VMM_Service _LeaveMustComplete
  1246. VMM_Service _ResumeExecMustComplete
  1247. THREAD_TERM_STATUS_CRASH_PEND EQU 1
  1248. THREAD_TERM_STATUS_NUKE_PEND EQU 2
  1249. THREAD_TERM_STATUS_SUSPEND_PEND EQU 4
  1250. VMM_Service _GetThreadTerminationStatus
  1251. VMM_Service _GetInstanceInfo
  1252. INSTINFO_NONE EQU 0
  1253. INSTINFO_SOME EQU 1
  1254. INSTINFO_ALL EQU 2
  1255. VMM_Service _ExecIntMustComplete
  1256. VMM_Service _ExecVxDIntMustComplete
  1257. VMM_Service Begin_V86_Serialization
  1258. VMM_Service Unhook_V86_Page
  1259. VMM_Service VMM_GetVxDLocationList
  1260. VMM_Service VMM_GetDDBList
  1261. VMM_Service Unhook_NMI_Event
  1262. VMM_Service Get_Instanced_V86_Int_Vector
  1263. VMM_Service Get_Set_Real_DOS_PSP
  1264. GSRDP_Set EQU 0001H
  1265. VMM_Service Call_Priority_Thread_Event
  1266. VMM_Service Get_System_Time_Address
  1267. VMM_Service Get_Crit_Status_Thread
  1268. VMM_Service Get_DDB
  1269. VMM_Service Directed_Sys_Control
  1270. VMM_Service _RegOpenKey
  1271. VMM_Service _RegCloseKey
  1272. VMM_Service _RegCreateKey
  1273. VMM_Service _RegDeleteKey
  1274. VMM_Service _RegEnumKey
  1275. VMM_Service _RegQueryValue
  1276. VMM_Service _RegSetValue
  1277. VMM_Service _RegDeleteValue
  1278. VMM_Service _RegEnumValue
  1279. VMM_Service _RegQueryValueEx
  1280. VMM_Service _RegSetValueEx
  1281. ifndef REG_SZ
  1282. REG_SZ EQU 0001H
  1283. REG_BINARY EQU 0003H
  1284. endif
  1285. ifndef HKEY_LOCAL_MACHINE
  1286. HKEY_CLASSES_ROOT EQU 80000000H
  1287. HKEY_CURRENT_USER EQU 80000001H
  1288. HKEY_LOCAL_MACHINE EQU 80000002H
  1289. HKEY_USERS EQU 80000003H
  1290. HKEY_PERFORMANCE_DATA EQU 80000004H
  1291. HKEY_CURRENT_CONFIG EQU 80000005H
  1292. HKEY_DYN_DATA EQU 80000006H
  1293. endif
  1294. VMM_Service _CallRing3
  1295. VMM_Service Exec_PM_Int
  1296. VMM_Service _RegFlushKey
  1297. VMM_Service _PageCommitContig
  1298. VMM_Service _GetCurrentContext
  1299. VMM_Service _LocalizeSprintf
  1300. VMM_Service _LocalizeStackSprintf
  1301. VMM_Service Call_Restricted_Event
  1302. VMM_Service Cancel_Restricted_Event
  1303. VMM_Service Register_PEF_Provider, VMM_ICODE
  1304. VMM_Service _GetPhysPageInfo
  1305. VMM_Service _RegQueryInfoKey
  1306. VMM_Service MemArb_Reserve_Pages
  1307. PHYSINFO_NONE EQU 0
  1308. PHYSINFO_SOME EQU 1
  1309. PHYSINFO_ALL EQU 2
  1310. VMM_Service Time_Slice_Sys_VM_Idle
  1311. VMM_Service Time_Slice_Sleep
  1312. VMM_Service Boost_With_Decay
  1313. VMM_Service Set_Inversion_Pri
  1314. VMM_Service Reset_Inversion_Pri
  1315. VMM_Service Release_Inversion_Pri
  1316. VMM_Service Get_Thread_Win32_Pri
  1317. VMM_Service Set_Thread_Win32_Pri
  1318. VMM_Service Set_Thread_Static_Boost
  1319. VMM_Service Set_VM_Static_Boost
  1320. VMM_Service Release_Inversion_Pri_ID
  1321. VMM_Service Attach_Thread_To_Group
  1322. VMM_Service Detach_Thread_From_Group
  1323. VMM_Service Set_Group_Static_Boost
  1324. VMM_Service _GetRegistryPath, VMM_ICODE
  1325. VMM_Service _GetRegistryKey
  1326. REGTYPE_ENUM EQU 0
  1327. REGTYPE_CLASS EQU 1
  1328. REGTYPE_VXD EQU 2
  1329. REGKEY_OPEN EQU 0
  1330. REGKEY_CREATE_IFNOTEXIST EQU 1
  1331. ASSERT_RANGE_NULL_BAD EQU 00000000H
  1332. ASSERT_RANGE_NULL_OK EQU 00000001H
  1333. ASSERT_RANGE_IS_ASCIIZ EQU 00000002H
  1334. ASSERT_RANGE_IS_NOT_ASCIIZ EQU 00000000H
  1335. ASSERT_RANGE_NO_DEBUG EQU 80000000H
  1336. ASSERT_RANGE_BITS EQU 80000003H
  1337. VMM_Service Cleanup_Thread_State
  1338. VMM_Service _RegRemapPreDefKey
  1339. VMM_Service End_V86_Serialization
  1340. VMM_Service _Assert_Range
  1341. VMM_Service _Sprintf
  1342. VMM_Service _PageChangePager
  1343. VMM_Service _RegCreateDynKey
  1344. VMM_Service _RegQueryMultipleValues
  1345. VMM_Service Boost_Thread_With_VM
  1346. BOOT_CLEAN EQU 00000001H
  1347. BOOT_DOSCLEAN EQU 00000002H
  1348. BOOT_NETCLEAN EQU 00000004H
  1349. BOOT_INTERACTIVE EQU 00000008H
  1350. VMM_Service Get_Boot_Flags
  1351. VMM_Service Set_Boot_Flags
  1352. VMM_Service _lstrcpyn
  1353. VMM_Service _lstrlen
  1354. VMM_Service _lmemcpy
  1355. VMM_Service _GetVxDName
  1356. VMM_Service Force_Mutexes_Free
  1357. VMM_Service Restore_Forced_Mutexes
  1358. VMM_Service _AddReclaimableItem
  1359. VMM_Service _SetReclaimableItem
  1360. VMM_Service _EnumReclaimableItem
  1361. VMM_Service Time_Slice_Wake_Sys_VM
  1362. VMM_Service VMM_Replace_Global_Environment
  1363. VMM_Service Begin_Non_Serial_Nest_V86_Exec
  1364. VMM_Service Get_Nest_Exec_Status
  1365. VMM_Service Open_Boot_Log
  1366. VMM_Service Write_Boot_Log
  1367. VMM_Service Close_Boot_Log
  1368. VMM_Service EnableDisable_Boot_Log
  1369. VMM_Service _Call_On_My_Stack
  1370. VMM_Service Get_Inst_V86_Int_Vec_Base
  1371. VMM_Service _lstrcmpi
  1372. VMM_Service _strupr
  1373. VMM_Service Log_Fault_Call_Out
  1374. VMM_Service _AtEventTime
  1375. endif
  1376. ifdef WIN403SERVICES
  1377. VMM_Service _PageOutPages
  1378. PAGEOUT_PRIVATE EQU 00000001H
  1379. PAGEOUT_SHARED EQU 00000002H
  1380. PAGEOUT_SYSTEM EQU 00000004H
  1381. PAGEOUT_REGION EQU 00000008H
  1382. PAGEOUT_ALL EQU (PAGEOUT_PRIVATE OR PAGEOUT_SHARED OR PAGEOUT_SYSTEM)
  1383. VMM_Service _Call_On_My_Not_Flat_Stack
  1384. VMM_Service _LinRegionLock
  1385. VMM_Service _LinRegionUnLock
  1386. VMM_Service _AttemptingSomethingDangerous
  1387. VMM_Service _Vsprintf
  1388. VMM_Service _Vsprintfw
  1389. VMM_Service Load_FS_Service
  1390. VMM_Service Assert_FS_Service
  1391. VMM_StdCall_Service ObsoleteRtlUnwind, 4
  1392. VMM_StdCall_Service ObsoleteRtlRaiseException, 1
  1393. VMM_StdCall_Service ObsoleteRtlRaiseStatus, 1
  1394. VMM_StdCall_Service ObsoleteKeGetCurrentIrql, 0
  1395. VMM_FastCall_Service ObsoleteKfRaiseIrql, 1
  1396. VMM_FastCall_Service ObsoleteKfLowerIrql, 1
  1397. VMM_Service _Begin_Preemptable_Code
  1398. VMM_Service _End_Preemptable_Code
  1399. VMM_FastCall_Service Set_Preemptable_Count, 1
  1400. VMM_StdCall_Service ObsoleteKeInitializeDpc, 3
  1401. VMM_StdCall_Service ObsoleteKeInsertQueueDpc, 3
  1402. VMM_StdCall_Service ObsoleteKeRemoveQueueDpc, 1
  1403. VMM_StdCall_Service HeapAllocateEx, 4
  1404. VMM_StdCall_Service HeapReAllocateEx, 5
  1405. VMM_StdCall_Service HeapGetSizeEx, 2
  1406. VMM_StdCall_Service HeapFreeEx, 2
  1407. VMM_Service _Get_CPUID_Flags
  1408. VMM_StdCall_Service KeCheckDivideByZeroTrap, 1
  1409. endif
  1410. ifdef WIN41SERVICES
  1411. VMM_Service _RegisterGARTHandler
  1412. VMM_Service _GARTReserve
  1413. VMM_Service _GARTCommit
  1414. VMM_Service _GARTUnCommit
  1415. VMM_Service _GARTFree
  1416. VMM_Service _GARTMemAttributes
  1417. VMM_StdCall_Service KfRaiseIrqlToDpcLevel, 0
  1418. VMM_Service VMMCreateThreadEx
  1419. VMM_Service _FlushCaches
  1420. PG_UNCACHED EQU 00000001H
  1421. PG_WRITECOMBINED EQU 00000002H
  1422. FLUSHCACHES_NORMAL EQU 00000000H
  1423. FLUSHCACHES_GET_CACHE_LINE_PTR EQU 00000001H
  1424. FLUSHCACHES_GET_CACHE_SIZE_PTR EQU 00000002H
  1425. FLUSHCACHES_TAKE_OVER EQU 00000003H
  1426. FLUSHCACHES_FORCE_PAGES_OUT EQU 00000004H
  1427. FLUSHCACHES_LOCK_LOCKABLE EQU 00000005H
  1428. FLUSHCACHES_UNLOCK_LOCKABLE EQU 00000006H
  1429. VMM_Service Set_Thread_Win32_Pri_NoYield
  1430. VMM_Service _FlushMappedCacheBlock
  1431. VMM_Service _ReleaseMappedCacheBlock
  1432. VMM_Service Run_Preemptable_Events
  1433. VMM_Service _MMPreSystemExit
  1434. VMM_Service _MMPageFileShutDown
  1435. VMM_Service _Set_Global_Time_Out_Ex
  1436. VMM_Service Query_Thread_Priority
  1437. endif
  1438. End_Service_Table VMM, VMM
  1439. COMNFS_FLAT EQU 0FFFFFFFFH
  1440. RS_RECLAIM EQU 00000001H
  1441. RS_RESTORE EQU 00000002H
  1442. RS_DOSARENA EQU 00000004H
  1443. ReclaimStruc STRUC
  1444. RS_Linear DD ?
  1445. RS_Bytes DD ?
  1446. RS_CallBack DD ?
  1447. RS_RefData DD ?
  1448. RS_HookTable DD ?
  1449. RS_Flags DD ?
  1450. ReclaimStruc ENDS
  1451. frmtx STRUC
  1452. frmtx_pfrmtxNext DD ?
  1453. frmtx_hmutex DD ?
  1454. frmtx_cEnterCount DD ?
  1455. frmtx_pthcbOwner DD ?
  1456. frmtx_htimeout DD ?
  1457. frmtx ENDS
  1458. vmmfrinfo STRUC
  1459. vmmfrinfo_frmtxDOS DB SIZE frmtx DUP (?)
  1460. vmmfrinfo_frmtxV86 DB SIZE frmtx DUP (?)
  1461. vmmfrinfo_frmtxOther DB SIZE frmtx DUP (?)
  1462. vmmfrinfo ENDS
  1463. DemandInfoStruc STRUC
  1464. DILin_Total_Count DD ?
  1465. DIPhys_Count DD ?
  1466. DIFree_Count DD ?
  1467. DIUnlock_Count DD ?
  1468. DILinear_Base_Addr DD ?
  1469. DILin_Total_Free DD ?
  1470. DIPage_Faults DD ?
  1471. DIPage_Ins DD ?
  1472. DIPage_Outs DD ?
  1473. DIPage_Discards DD ?
  1474. DIInstance_Faults DD ?
  1475. DIPagingFileMax DD ?
  1476. DIPagingFileInUse DD ?
  1477. DICommit_Count DD ?
  1478. DIReserved DD 2 DUP (?)
  1479. DemandInfoStruc ENDS
  1480. InstDataStruc STRUC
  1481. InstLinkF DD 0
  1482. InstLinkB DD 0
  1483. InstLinAddr DD ?
  1484. InstSize DD ?
  1485. InstType DD ?
  1486. InstDataStruc ENDS
  1487. INDOS_FIELD EQU 100H
  1488. ALWAYS_FIELD EQU 200H
  1489. OPTIONAL_FIELD EQU 400H
  1490. IPF_Data STRUC
  1491. IPF_LinAddr DD ?
  1492. IPF_MapPageNum DD ?
  1493. IPF_PTEEntry DD ?
  1494. IPF_FaultingVM DD ?
  1495. IPF_Flags DD ?
  1496. IPF_Data ENDS
  1497. Exception_Handler_Struc STRUC
  1498. EH_Reserved DD ?
  1499. EH_Start_EIP DD ?
  1500. EH_End_EIP DD ?
  1501. EH_Handler DD ?
  1502. Exception_Handler_Struc ENDS
  1503. PR_PRIVATE EQU 80000400H
  1504. PR_SHARED EQU 80060000H
  1505. PR_SYSTEM EQU 80080000H
  1506. PR_FIXED EQU 00000008H
  1507. PR_4MEG EQU 00000001H
  1508. PR_STATIC EQU 00000010H
  1509. PD_ZEROINIT EQU 00000001H
  1510. PD_NOINIT EQU 00000002H
  1511. PD_FIXEDZERO EQU 00000003H
  1512. PD_FIXED EQU 00000004H
  1513. PC_FIXED EQU 00000008H
  1514. PC_LOCKED EQU 00000080H
  1515. PC_LOCKEDIFDP EQU 00000100H
  1516. PC_WRITEABLE EQU 00020000H
  1517. PC_USER EQU 00040000H
  1518. PC_INCR EQU 40000000H
  1519. PC_PRESENT EQU 80000000H
  1520. PC_STATIC EQU 20000000H
  1521. PC_DIRTY EQU 08000000H
  1522. PC_CACHEDIS EQU 00100000H
  1523. PC_CACHEWT EQU 00080000H
  1524. PC_PAGEFLUSH EQU 00008000H
  1525. ifdef WRITE_WATCH
  1526. PC_WRITE_WATCH EQU 00200000H
  1527. endif
  1528. PCC_ZEROINIT EQU 00000001H
  1529. PCC_NOLIN EQU 10000000H
  1530. MTRR_UC EQU 0
  1531. MTRR_WC EQU 1
  1532. MTRR_WT EQU 4
  1533. MTRR_WP EQU 5
  1534. MTRR_WB EQU 6
  1535. ifndef _WINNT_
  1536. _MEMORY_BASIC_INFORMATION STRUC
  1537. mbi_BaseAddress DD ?
  1538. mbi_AllocationBase DD ?
  1539. mbi_AllocationProtect DD ?
  1540. mbi_RegionSize DD ?
  1541. mbi_State DD ?
  1542. mbi_Protect DD ?
  1543. mbi_Type DD ?
  1544. _MEMORY_BASIC_INFORMATION ENDS
  1545. PAGE_NOACCESS EQU 01H
  1546. PAGE_READONLY EQU 02H
  1547. PAGE_READWRITE EQU 04H
  1548. MEM_COMMIT EQU 1000H
  1549. MEM_RESERVE EQU 2000H
  1550. MEM_FREE EQU 10000H
  1551. MEM_PRIVATE EQU 20000H
  1552. endif
  1553. pd_s STRUC
  1554. pd_virginin DD ?
  1555. pd_taintedin DD ?
  1556. pd_cleanout DD ?
  1557. pd_dirtyout DD ?
  1558. pd_virginfree DD ?
  1559. pd_taintedfree DD ?
  1560. pd_dirty DD ?
  1561. pd_type DD ?
  1562. pd_s ENDS
  1563. PD_SWAPPER EQU 0
  1564. PD_PAGERONLY EQU 1
  1565. PD_NESTEXEC EQU 2
  1566. endif
  1567. PAGESHIFT EQU 12
  1568. PAGESIZE EQU (1 SHL PAGESHIFT)
  1569. PAGEMASK EQU (PAGESIZE-1)
  1570. MAXSYSTEMLADDR EQU (0ffbfffffH)
  1571. MINSYSTEMLADDR EQU (0c0000000H)
  1572. MAXSHAREDLADDR EQU (0bfffffffH)
  1573. MINSHAREDLADDR EQU (80000000H)
  1574. MAXPRIVATELADDR EQU (7fffffffH)
  1575. MINPRIVATELADDR EQU (00400000H)
  1576. MAXDOSLADDR EQU (003fffffH)
  1577. MINDOSLADDR EQU (00000000H)
  1578. MAXSYSTEMPAGE EQU (MAXSYSTEMLADDR SHR PAGESHIFT)
  1579. MINSYSTEMPAGE EQU (MINSYSTEMLADDR SHR PAGESHIFT)
  1580. MAXSHAREDPAGE EQU (MAXSHAREDLADDR SHR PAGESHIFT)
  1581. MINSHAREDPAGE EQU (MINSHAREDLADDR SHR PAGESHIFT)
  1582. MAXPRIVATEPAGE EQU (MAXPRIVATELADDR SHR PAGESHIFT)
  1583. MINPRIVATEPAGE EQU (MINPRIVATELADDR SHR PAGESHIFT)
  1584. MAXDOSPAGE EQU (MAXDOSLADDR SHR PAGESHIFT)
  1585. MINDOSPAGE EQU (MINDOSLADDR SHR PAGESHIFT)
  1586. CBPRIVATE EQU (1+MAXPRIVATELADDR-MINPRIVATELADDR)
  1587. CBSHARED EQU (1+MAXSHAREDLADDR-MINSHAREDLADDR)
  1588. CBSYSTEM EQU (1+MAXSYSTEMLADDR-MINSYSTEMLADDR)
  1589. CBDOS EQU (1+MAXDOSLADDR-MINDOSLADDR)
  1590. CPGPRIVATE EQU (1+MAXPRIVATEPAGE-MINPRIVATEPAGE)
  1591. CPGSHARED EQU (1+MAXSHAREDPAGE-MINSHAREDPAGE)
  1592. CPGSYSTEM EQU (1+MAXSYSTEMPAGE-MINSYSTEMPAGE)
  1593. CPGDOS EQU (1+MAXDOSPAGE-MINDOSPAGE)
  1594. IFDEF DEBUG
  1595. DebFar EQU NEAR PTR
  1596. ELSE
  1597. DebFar EQU SHORT
  1598. ENDIF
  1599. ASD_MAX_REF_DATA EQU 256
  1600. _vmmguid STRUC
  1601. Data1 DD ?
  1602. Data2 DW ?
  1603. Data3 DW ?
  1604. Data4 DB 8 DUP (?)
  1605. _vmmguid ENDS
  1606. ASD_ERROR_NONE EQU 00000000H
  1607. ASD_CHECK_FAIL EQU 00000001H
  1608. ASD_CHECK_SUCCESS EQU 00000002H
  1609. ASD_CHECK_UNKNOWN EQU 00000003H
  1610. ASD_ERROR_BAD_TIME EQU 00000004H
  1611. ASD_REGISTRY_ERROR EQU 00000005H
  1612. ASD_CLEAN_BOOT EQU 00000006H
  1613. ASD_OUT_OF_MEMORY EQU 00000007H
  1614. ASD_FILE_ERROR EQU 00000008H
  1615. ASD_ALREADY_SET EQU 00000009H
  1616. ASD_MISSING_CHECK EQU 0000000AH
  1617. ASD_BAD_PARAMETER EQU 0000000BH
  1618. ASD_OP_CHECK_AND_WRITE_FAIL_IF_UNKNOWN EQU 00000000H
  1619. ASD_OP_CHECK_AND_ALWAYS_WRITE_FAIL EQU 00000001H
  1620. ASD_OP_CHECK EQU 00000002H
  1621. ASD_OP_DONE_AND_SET_SUCCESS EQU 00000003H
  1622. ASD_OP_SET_FAIL EQU 00000004H
  1623. ASD_OP_SET_SUCCESS EQU 00000005H
  1624. ASD_OP_SET_UNKNOWN EQU 00000006H
  1625. ASD_OP_DONE EQU 00000007H
  1626. ASD_FLAG_STRING EQU 00000001H
  1627. ifndef Not_VxD
  1628. SYS_CRITICAL_INIT EQU 0000H
  1629. DEVICE_INIT EQU 0001H
  1630. INIT_COMPLETE EQU 0002H
  1631. SYS_VM_INIT EQU 0003H
  1632. SYS_VM_TERMINATE EQU 0004H
  1633. SYSTEM_EXIT EQU 0005H
  1634. SYS_CRITICAL_EXIT EQU 0006H
  1635. CREATE_VM EQU 0007H
  1636. VM_CRITICAL_INIT EQU 0008H
  1637. VM_INIT EQU 0009H
  1638. VM_TERMINATE EQU 000AH
  1639. VM_NOT_EXECUTEABLE EQU 000BH
  1640. DESTROY_VM EQU 000CH
  1641. VNE_CRASHED_BIT EQU 00H
  1642. VNE_CRASHED EQU (1 SHL VNE_CRASHED_BIT)
  1643. VNE_NUKED_BIT EQU 01H
  1644. VNE_NUKED EQU (1 SHL VNE_NUKED_BIT)
  1645. VNE_CREATEFAIL_BIT EQU 02H
  1646. VNE_CREATEFAIL EQU (1 SHL VNE_CREATEFAIL_BIT)
  1647. VNE_CRINITFAIL_BIT EQU 03H
  1648. VNE_CRINITFAIL EQU (1 SHL VNE_CRINITFAIL_BIT)
  1649. VNE_INITFAIL_BIT EQU 04H
  1650. VNE_INITFAIL EQU (1 SHL VNE_INITFAIL_BIT)
  1651. VNE_CLOSED_BIT EQU 05H
  1652. VNE_CLOSED EQU (1 SHL VNE_CLOSED_BIT)
  1653. VM_SUSPEND EQU 000DH
  1654. VM_RESUME EQU 000EH
  1655. SET_DEVICE_FOCUS EQU 000FH
  1656. BEGIN_MESSAGE_MODE EQU 0010H
  1657. END_MESSAGE_MODE EQU 0011H
  1658. REBOOT_PROCESSOR EQU 0012H
  1659. QUERY_DESTROY EQU 0013H
  1660. DEBUG_QUERY EQU 0014H
  1661. BEGIN_PM_APP EQU 0015H
  1662. BPA_32_BIT EQU 01H
  1663. BPA_32_BIT_FLAG EQU 1
  1664. END_PM_APP EQU 0016H
  1665. DEVICE_REBOOT_NOTIFY EQU 0017H
  1666. CRIT_REBOOT_NOTIFY EQU 0018H
  1667. CLOSE_VM_NOTIFY EQU 0019H
  1668. CVNF_CRIT_CLOSE_BIT EQU 0
  1669. CVNF_CRIT_CLOSE EQU (1 SHL CVNF_CRIT_CLOSE_BIT)
  1670. POWER_EVENT EQU 001AH
  1671. SYS_DYNAMIC_DEVICE_INIT EQU 001BH
  1672. SYS_DYNAMIC_DEVICE_EXIT EQU 001CH
  1673. CREATE_THREAD EQU 001DH
  1674. THREAD_INIT EQU 001EH
  1675. TERMINATE_THREAD EQU 001FH
  1676. THREAD_Not_Executeable EQU 0020H
  1677. DESTROY_THREAD EQU 0021H
  1678. PNP_NEW_DEVNODE EQU 0022H
  1679. W32_DEVICEIOCONTROL EQU 0023H
  1680. DIOC_GETVERSION EQU 0H
  1681. DIOC_OPEN EQU DIOC_GETVERSION
  1682. DIOC_CLOSEHANDLE EQU -1
  1683. SYS_VM_TERMINATE2 EQU 0024H
  1684. SYSTEM_EXIT2 EQU 0025H
  1685. SYS_CRITICAL_EXIT2 EQU 0026H
  1686. VM_TERMINATE2 EQU 0027H
  1687. VM_NOT_EXECUTEABLE2 EQU 0028H
  1688. DESTROY_VM2 EQU 0029H
  1689. VM_SUSPEND2 EQU 002AH
  1690. END_MESSAGE_MODE2 EQU 002BH
  1691. END_PM_APP2 EQU 002CH
  1692. DEVICE_REBOOT_NOTIFY2 EQU 002DH
  1693. CRIT_REBOOT_NOTIFY2 EQU 002EH
  1694. CLOSE_VM_NOTIFY2 EQU 002FH
  1695. GET_CONTENTION_HANDLER EQU 0030H
  1696. KERNEL32_INITIALIZED EQU 0031H
  1697. KERNEL32_SHUTDOWN EQU 0032H
  1698. CREATE_PROCESS EQU 0033H
  1699. DESTROY_PROCESS EQU 0034H
  1700. ifndef WIN40COMPAT
  1701. SYS_DYNAMIC_DEVICE_REINIT EQU 0035H
  1702. endif
  1703. SYS_POWER_DOWN EQU 0036H
  1704. MAX_SYSTEM_CONTROL EQU 0036H
  1705. BEGIN_RESERVED_PRIVATE_SYSTEM_CONTROL EQU 70000000H
  1706. END_RESERVED_PRIVATE_SYSTEM_CONTROL EQU 7FFFFFFFH
  1707. endif
  1708. SYSSTATE_PRESYSCRITINIT EQU 00000000H
  1709. SYSSTATE_PREDEVICEINIT EQU 10000000H
  1710. SYSSTATE_PREINITCOMPLETE EQU 20000000H
  1711. SYSSTATE_VXDINITCOMPLETED EQU 40000000H
  1712. SYSSTATE_KERNEL32INITED EQU 50000000H
  1713. SYSSTATE_KERNEL32TERMINATED EQU 0A0000000H
  1714. SYSSTATE_PRESYSVMTERMINATE EQU 0B0000000H
  1715. SYSSTATE_PRESYSTEMEXIT EQU 0E0000000H
  1716. SYSSTATE_PRESYSTEMEXIT2 EQU 0E4000000H
  1717. SYSSTATE_PRESYSCRITEXIT EQU 0F0000000H
  1718. SYSSTATE_PRESYSCRITEXIT2 EQU 0F4000000H
  1719. SYSSTATE_POSTSYSCRITEXIT2 EQU 0FFF00000H
  1720. SYSSTATE_PREDEVICEREBOOT EQU 0FFFF0000H
  1721. SYSSTATE_PRECRITREBOOT EQU 0FFFFF000H
  1722. SYSSTATE_PREREBOOTCPU EQU 0FFFFFF00H
  1723. BeginDoc
  1724. EndDoc
  1725. ??_pf_Check equ 1
  1726. ??_pf_ArgsUsed equ 2
  1727. ??_pf_Entered equ 4
  1728. ??_pf_Left equ 8
  1729. ??_pf_Returned equ 16
  1730. ??_pushed = 0
  1731. ??_align = 0
  1732. ??_ends equ <>
  1733. BeginProc macro Name, P1, P2, P3, P4, P5, P6, P7, LastArg
  1734. local Profile_Data, prelabeldata, ??_hookvar
  1735. ??_frame = 0
  1736. ??_aframe = 0
  1737. ??_taframe = 0
  1738. ??_initaframe = 0
  1739. ??_numargs = 0
  1740. ??_numlocals = 0
  1741. ??_numlocalsymbols = 0
  1742. ??_procflags = 0
  1743. ??_esp = 0
  1744. ??_pushed = 0
  1745. ??_align = 0
  1746. ??_hook = 0
  1747. ??_hookarg = 0
  1748. ??_service = 0
  1749. ??_async_service = 0
  1750. IF DEBLEVEL GT DEBLEVELNORMAL
  1751. ??_log = DFS_LOG
  1752. ??_profile = DFS_PROFILE
  1753. ??_test_cld = DFS_TEST_CLD
  1754. ELSE
  1755. ??_log = 0
  1756. IFDEF DEBUG
  1757. IFDEF profileall
  1758. IF ?_ICODE
  1759. ??_profile = DFS_PROFILE
  1760. ELSE
  1761. ??_profile = 0
  1762. ENDIF
  1763. ELSE
  1764. ??_profile = 0
  1765. ENDIF
  1766. ELSE
  1767. ??_profile = 0
  1768. ENDIF
  1769. ??_test_cld = 0
  1770. ENDIF
  1771. ??_might_block = 0
  1772. ??_test_reenter = 0
  1773. ??_never_reenter = 0
  1774. ??_not_swapping = 0
  1775. ??_prolog_disabled = 0
  1776. ??_public = 1
  1777. ??_cleanoff = 0
  1778. ??_ccall = 0
  1779. ??_pcall = 0
  1780. ??_scall = 0
  1781. ??_fastcall = 0
  1782. ??_w32svc = 0
  1783. ??_fleave = FALSE
  1784. ??_name equ <Name>
  1785. .errnb ??_ends, <Cannot nest functions with named segments>
  1786. .errnb <LastArg>, <Too many arguments to BeginProc>
  1787. irp arg, <P1, P2, P3, P4, P5, P6, P7>
  1788. if ??_hookarg
  1789. ??_hookarg = 0
  1790. ??_hookvar equ <arg>
  1791. elseifdef ?&&arg&&_BeginProc
  1792. ?&&arg&&_BeginProc
  1793. elseifdef VxD_&&arg&&_CODE_SEG
  1794. ??_ends textequ <VxD_&&arg&&_CODE_ENDS>
  1795. VxD_&&arg&&_CODE_SEG
  1796. else
  1797. .err <Bad param "&arg" to BeginProc>
  1798. endif
  1799. endm
  1800. ifndef Not_VxD
  1801. ife ??_service
  1802. ifndef profileall
  1803. ??_profile = 0
  1804. endif
  1805. ifdef VMMSYS
  1806. ??_prolog_disabled = 1
  1807. endif
  1808. else
  1809. ??_test_cld = DFS_TEST_CLD
  1810. endif
  1811. ife ?_16ICODE
  1812. ??_prolog_disabled = 1
  1813. else
  1814. ife ?_RCODE
  1815. ??_prolog_disabled = 1
  1816. else
  1817. ife ?_PCODE
  1818. ??_might_block = DFS_TEST_BLOCK
  1819. endif
  1820. if ??_service
  1821. ife ??_async_service
  1822. ??_test_reenter = DFS_TEST_REENTER
  1823. endif
  1824. endif
  1825. endif
  1826. endif
  1827. endif
  1828. if ??_esp
  1829. ??_basereg equ <esp+??_pushed>
  1830. ??_initaframe = 4
  1831. else
  1832. ??_basereg equ <ebp>
  1833. ??_initaframe = 8
  1834. endif
  1835. @Caller equ <dword ptr [??_basereg+??_initaframe-4]>
  1836. ??_cleanoff = ??_pcall or ??_scall or ??_fastcall
  1837. ??_dfs = ??_never_reenter + ??_test_reenter + ??_not_swapping + \
  1838. ??_log + ??_profile + ??_test_cld + ??_might_block
  1839. if ??_prolog_disabled
  1840. ??_dfs = 0
  1841. endif
  1842. ifndef Not_VxD
  1843. if ??_hook
  1844. if ??_align
  1845. Dword_Align
  1846. endif
  1847. prelabeldata:
  1848. ifndef ??_hookvar
  1849. .err <HOOK_PROC requires next arg to be name of dword location>
  1850. endif
  1851. jmp short Name
  1852. jmp [??_hookvar]
  1853. ifdef DEBUG
  1854. Profile_Data dd 0
  1855. endif
  1856. if ??_align
  1857. .errnz ($ - prelabeldata) mod 4
  1858. endif
  1859. endif
  1860. ifdef DEBUG
  1861. ?prolog_&Name label near
  1862. if (??_service OR ??_profile) AND (??_hook EQ 0)
  1863. jmp short Name
  1864. if ??_align
  1865. Dword_Align
  1866. endif
  1867. IF ?_ICODE
  1868. ifdef profileall
  1869. ?ProfileHeader_BeginProc Profile_Data, %@filename
  1870. else
  1871. Profile_Data dd 0
  1872. endif
  1873. ELSE
  1874. Profile_Data dd 0
  1875. ENDIF
  1876. endif
  1877. endif
  1878. if ??_align
  1879. Dword_Align
  1880. endif
  1881. endif
  1882. Name proc near
  1883. ife ??_pcall or ??_ccall or ??_scall or ??_fastcall
  1884. if ??_public
  1885. public Name
  1886. else
  1887. ifdef DEBUG
  1888. % ?merge @FileName,$,Name,:
  1889. % ?merge public,,,,,@FileName,$,Name
  1890. endif
  1891. endif
  1892. endif
  1893. if ??_ccall
  1894. if ??_public
  1895. _&Name equ Name
  1896. ifdef Not_VxD
  1897. public C Name
  1898. else
  1899. public _&Name
  1900. endif
  1901. endif
  1902. endif
  1903. if ??_pcall
  1904. if ??_public
  1905. ?toupper Name
  1906. ?merge public,,,,%?upper
  1907. endif
  1908. endif
  1909. ife ??_scall or ??_fastcall
  1910. ?_BeginProc_Debug_Prologue
  1911. endif
  1912. endm
  1913. ?_BeginProc_Debug_Prologue MACRO
  1914. ifndef Not_VxD
  1915. ifdef DEBUG
  1916. if ??_dfs EQ DFS_LOG
  1917. VMMCall Log_Proc_Call
  1918. else
  1919. if ??_dfs EQ DFS_TEST_REENTER
  1920. VMMCall Test_Reenter
  1921. else
  1922. if ??_dfs or ?_LOCKABLECODE eq 0
  1923. ifdef WIN31COMPAT
  1924. if ??_dfs AND DFS_LOG
  1925. VMMCall Log_Proc_Call
  1926. endif
  1927. if ??_dfs AND DFS_TEST_REENTER
  1928. VMMCall Test_Reenter
  1929. endif
  1930. else
  1931. ife ?_LOCKABLECODE
  1932. ifdef ??_debug_flags
  1933. push ??_debug_flags
  1934. if ??_dfs
  1935. pushfd
  1936. or dword ptr [esp+4],??_dfs
  1937. popfd
  1938. endif
  1939. VMMCall _Debug_Flags_Service
  1940. elseif ??_dfs
  1941. push ??_dfs
  1942. VMMCall _Debug_Flags_Service
  1943. endif
  1944. else
  1945. push ??_dfs
  1946. VMMCall _Debug_Flags_Service
  1947. endif
  1948. endif
  1949. else
  1950. ifdef profileall
  1951. IncProfileCount
  1952. endif
  1953. endif
  1954. endif
  1955. endif
  1956. endif
  1957. endif
  1958. ENDM
  1959. ?_BeginProc macro
  1960. endm
  1961. ?PUBLIC_BeginProc macro
  1962. ??_public = 1
  1963. endm
  1964. ?LOCAL_BeginProc macro
  1965. ??_public = 0
  1966. endm
  1967. ?HIGH_FREQ_BeginProc macro
  1968. ??_align = 1
  1969. endm
  1970. ?HOOK_PROC_BeginProc macro
  1971. ??_hook = 1
  1972. ??_hookarg = 1
  1973. endm
  1974. ?SERVICE_BeginProc macro
  1975. ??_service = 1
  1976. .erre ?_16ICODE, <SERVICEs must be in 32 bit code>
  1977. .erre ?_RCODE, <SERVICEs must be in 32 bit code>
  1978. endm
  1979. ?ASYNC_SERVICE_BeginProc macro
  1980. ??_service = 1
  1981. ??_async_service = 1
  1982. .errnz ?_LCODE, <ASYNC_SERVICE's must be in LOCKED code>
  1983. endm
  1984. ?NO_LOG_BeginProc macro
  1985. ??_log = 0
  1986. endm
  1987. ?NO_PROFILE_BeginProc macro
  1988. ??_profile = 0
  1989. endm
  1990. ?NO_TEST_CLD_BeginProc macro
  1991. ??_test_cld = 0
  1992. endm
  1993. ?TEST_BLOCK_BeginProc macro
  1994. ??_might_block = DFS_TEST_BLOCK
  1995. endm
  1996. ?TEST_REENTER_BeginProc macro
  1997. ??_test_reenter = DFS_TEST_REENTER
  1998. endm
  1999. ?NEVER_REENTER_BeginProc macro
  2000. ??_never_reenter = DFS_NEVER_REENTER
  2001. endm
  2002. ?NOT_SWAPPING_BeginProc macro
  2003. ??_not_swapping = DFS_NOT_SWAPPING
  2004. endm
  2005. ?NO_PROLOG_BeginProc macro
  2006. ??_prolog_disabled = 1
  2007. endm
  2008. ?ESP_BeginProc macro
  2009. ??_esp = VMM_TRUE
  2010. ifndef Not_VxD
  2011. .erre ?_16ICODE, <Beginproc ESP attribute invalid in 16 bit seg.>
  2012. .erre ?_RCODE, <Beginproc ESP attribute invalid in real-mode seg.>
  2013. endif
  2014. endm
  2015. ?CCALL_BeginProc macro
  2016. ??_ccall = 1
  2017. endm
  2018. ?PCALL_BeginProc macro
  2019. ??_pcall = 1
  2020. endm
  2021. ?SCALL_BeginProc macro
  2022. ??_scall = 1
  2023. endm
  2024. ?FASTCALL_BeginProc macro
  2025. ??_fastcall = 1
  2026. endm
  2027. ?ICALL_BeginProc macro
  2028. ??_scall = 1
  2029. endm
  2030. ?W32SVC_BeginProc macro
  2031. ??_scall = 1
  2032. ??_w32svc = 1
  2033. endm
  2034. ifdef DEBUG
  2035. ifdef profileall
  2036. ?ProfileHeader_BeginProc macro PL, filename
  2037. ifndef _&filename&__proc_list
  2038. _&filename&__proc_list = 0
  2039. PUBLIC _&filename&__proc_list
  2040. endif
  2041. dd OFFSET32 _&filename&__proc_list
  2042. PL dd 0
  2043. _&filename&__proc_list = PL
  2044. endm
  2045. endif
  2046. IncProfileCount macro
  2047. if ??_service OR ??_profile
  2048. inc dword ptr [??_name-4]
  2049. else
  2050. ifndef profileall
  2051. .err <IncProfileCount can be used only in services.>
  2052. endif
  2053. endif
  2054. endm
  2055. else
  2056. IncProfileCount macro
  2057. endm
  2058. endif
  2059. ArgVar macro name,length,used
  2060. ??_numargs = ??_numargs + 1
  2061. if ??_pcall
  2062. ?mkarg <name>, <length>, <used>, %??_numargs
  2063. else
  2064. ?arg <name>, <length>, <used>
  2065. endif
  2066. ??_procflags = ??_procflags OR ??_pf_Check
  2067. endm
  2068. ?mkarg macro name, length, used, num
  2069. .xcref ?MKA&num
  2070. ?deflocal <name>
  2071. ?MKA&num &macro
  2072. ?argvar <name>, <length>, <used>
  2073. &endm
  2074. ??_aframe = ??_aframe + 4
  2075. endm
  2076. .xcref ?mkarg
  2077. ?argvar macro name,length,used
  2078. local a
  2079. a = ??_taframe
  2080. ??_aframe = ??_aframe + 4
  2081. ??_taframe = ??_taframe + 4
  2082. ifidni <length>,<BYTE>
  2083. ?setname <name>, <byte ptr [??_basereg+??_initaframe+a]>, <used>
  2084. elseifidni <length>,<WORD>
  2085. ?setname <name>, <word ptr [??_basereg+??_initaframe+a]>, <used>
  2086. elseifidni <length>,<DWORD>
  2087. ?setname <name>, <dword ptr [??_basereg+??_initaframe+a]>, <used>
  2088. ?setname <name&l>,<word ptr [??_basereg+??_initaframe+a]>, <used>
  2089. ?setname <name&ll>,<byte ptr [??_basereg+??_initaframe+a]>, <used>
  2090. ?setname <name&lh>,<byte ptr [??_basereg+??_initaframe+a+1]>, <used>
  2091. ?setname <name&h>,<word ptr [??_basereg+??_initaframe+a+2]>, <used>
  2092. ?setname <name&hl>,<byte ptr [??_basereg+??_initaframe+a+2]>, <used>
  2093. ?setname <name&hh>,<byte ptr [??_basereg+??_initaframe+a+3]>, <used>
  2094. else
  2095. ??_aframe = ??_aframe - 4 + ((length + 3)/4)*4
  2096. ??_taframe = ??_taframe - 4 + ((length + 3)/4)*4
  2097. ?setname <name>, <[??_basereg+??_initaframe+a]>, <used>
  2098. endif
  2099. endm
  2100. ?arg macro name,length,used
  2101. if ??_fastcall
  2102. if ??_numargs le 2
  2103. if length gt 4
  2104. .err <First 2 parameters are dwords (ecx,edx) for fastcall functions>
  2105. endif
  2106. ??_aframe = ??_aframe + 4
  2107. if ??_numargs eq 1
  2108. ?merge ecx_,name,,,equ,ecx
  2109. else
  2110. ?merge edx_,name,,,equ,edx
  2111. endif
  2112. else
  2113. ?argvar name, length, used
  2114. endif
  2115. else
  2116. ?argvar name, length, used
  2117. endif
  2118. endm
  2119. ?setname macro name, value, used
  2120. ?deflocal <name>
  2121. ifidni <used>, <NOTUSED>
  2122. name equ _inaccessible_NOTUSED_
  2123. else
  2124. name equ value
  2125. ??_procflags = ??_procflags OR ??_pf_ArgsUsed OR ??_pf_Check
  2126. endif
  2127. endm
  2128. LocalVar macro name,length,flag
  2129. local a
  2130. ??_numlocals = ??_numlocals + 1
  2131. ??_pad = 1
  2132. ifidni <flag>, <PACK>
  2133. ??_pad = 0
  2134. endif
  2135. ifidni <length>,<BYTE>
  2136. ??_frame = ??_frame + 1 + 3 * ??_pad
  2137. a = ??_frame
  2138. ?deflocal <name>
  2139. name equ byte ptr [??_basereg-a]
  2140. elseifidni <length>,<WORD>
  2141. ??_frame = ??_frame + 2 + 2 * ??_pad
  2142. a = ??_frame
  2143. ?deflocal <name>
  2144. name equ word ptr [??_basereg-a]
  2145. elseifidni <length>,<DWORD>
  2146. ??_frame = ??_frame + 4
  2147. a = ??_frame
  2148. ?deflocal <name, name&l, name&ll, name&lh, name&h, name&hl, name&hh>
  2149. name equ dword ptr [??_basereg-a]
  2150. name&l equ word ptr [??_basereg-a]
  2151. name&ll equ byte ptr [??_basereg-a]
  2152. name&lh equ byte ptr [??_basereg-a+1]
  2153. name&h equ word ptr [??_basereg-a+2]
  2154. name&hl equ byte ptr [??_basereg-a+2]
  2155. name&hh equ byte ptr [??_basereg-a+3]
  2156. else
  2157. ??_frame = ??_frame + ((length + 3)/4)*4
  2158. a = ??_frame
  2159. ?deflocal <name>
  2160. name equ [??_basereg-a]
  2161. endif
  2162. ??_procflags = ??_procflags OR ??_pf_Check
  2163. endm
  2164. ?deflocal macro name
  2165. irp nm, <name>
  2166. ??_numlocalsymbols = ??_numlocalsymbols + 1
  2167. ?dodeflocal <nm>, %(??_numlocalsymbols)
  2168. endm
  2169. endm
  2170. .xcref ?deflocal
  2171. ?dodeflocal macro name, num
  2172. .xcref ?LOC&num
  2173. ?LOC&num &macro
  2174. name equ <__inaccessible__NOTINSCOPE__>
  2175. &endm
  2176. endm
  2177. .xcref ?dodeflocal
  2178. EnterProc macro
  2179. .errnz ??_frame and 3, <Total size of local variables not a multiple of 4.>
  2180. if ??_scall
  2181. if ??_public
  2182. ifdef Not_VxD
  2183. ?merge %??_name,@,%(??_aframe),,label,near
  2184. ?merge public,,,,C,%??_name,@,%(??_aframe)
  2185. else
  2186. ?merge _,%??_name,@,%(??_aframe),label,near
  2187. ?merge public,,,,,_,%??_name,@,%(??_aframe)
  2188. endif
  2189. endif
  2190. ?_BeginProc_Debug_Prologue
  2191. endif
  2192. if ??_fastcall
  2193. if ??_public
  2194. ifdef Not_VxD
  2195. ?merge %??_name,@,%(??_aframe),,label,near
  2196. ?merge public,,,,C,%??_name,@,%(??_aframe)
  2197. else
  2198. ?merge @,%??_name,@,%(??_aframe),label,near
  2199. ?merge public,,,,,@,%??_name,@,%(??_aframe)
  2200. endif
  2201. endif
  2202. ?_BeginProc_Debug_Prologue
  2203. endif
  2204. if ??_pcall
  2205. ??_aframe = 0
  2206. ?count = ??_numargs
  2207. rept ??_numargs
  2208. ?invprg <?MKA>,%?count
  2209. ?count = ?count - 1
  2210. endm
  2211. endif
  2212. ??_fleave = FALSE
  2213. if ??_esp
  2214. if ??_frame
  2215. sub esp, ??_frame
  2216. ??_pushed = ??_pushed + ??_frame
  2217. ??_fleave = VMM_TRUE
  2218. endif
  2219. else
  2220. if ??_frame eq 0
  2221. if (??_taframe eq 0) OR ((??_procflags AND ??_pf_ArgsUsed) EQ 0)
  2222. ifdef DEBUG
  2223. push ebp
  2224. mov ebp,esp
  2225. ??_fleave = VMM_TRUE
  2226. endif
  2227. else
  2228. push ebp
  2229. mov ebp,esp
  2230. ??_fleave = VMM_TRUE
  2231. endif
  2232. else
  2233. enter ??_frame, 0
  2234. ??_fleave = VMM_TRUE
  2235. endif
  2236. endif
  2237. ??_procflags = ??_procflags OR ??_pf_Entered
  2238. endm
  2239. LeaveProc macro flags
  2240. if ??_fleave
  2241. if ??_esp
  2242. ifidni <flags>,<PRESERVE_FLAGS>
  2243. lea esp,[esp + ??_frame]
  2244. else
  2245. add esp,??_frame
  2246. endif
  2247. else
  2248. leave
  2249. endif
  2250. endif
  2251. ??_procflags = ??_procflags OR ??_pf_Left
  2252. endm
  2253. Return macro
  2254. if ??_cleanoff OR ??_w32svc
  2255. if ??_w32svc AND (??_taframe LT 8)
  2256. ret 8
  2257. else
  2258. ret ??_taframe
  2259. endif
  2260. else
  2261. ret
  2262. endif
  2263. ??_procflags = ??_procflags OR ??_pf_Returned
  2264. endm
  2265. EndProc macro Name, Flag
  2266. Name endp
  2267. if ??_w32svc
  2268. if ??_taframe lt 8
  2269. cparm&Name equ 0
  2270. else
  2271. cparm&Name equ (??_taframe/4 - 2)
  2272. endif
  2273. endif
  2274. if ??_procflags AND ??_pf_Left
  2275. if ??_fleave
  2276. if ??_esp
  2277. ??_pushed = ??_pushed - ??_frame
  2278. endif
  2279. endif
  2280. endif
  2281. ifdifi <Flag>,<NOCHECK>
  2282. if ??_pushed ne 0
  2283. %out Warning: stack not balanced in Name
  2284. endif
  2285. if ??_procflags AND ??_pf_Check
  2286. ife ??_procflags AND ??_pf_Entered
  2287. %out Warning: ArgVar/LocalVar without EnterProc in Name
  2288. endif
  2289. ife ??_procflags AND ??_pf_Left
  2290. %out Warning: ArgVar/LocalVar without LeaveProc in Name
  2291. endif
  2292. ife ??_procflags AND ??_pf_Returned
  2293. %out Warning: ArgVar/LocalVar without Return in Name
  2294. endif
  2295. endif
  2296. endif
  2297. ifdifi <Flag>,<KEEPFRAMEVARS>
  2298. ?count = 0
  2299. rept ??_numlocalsymbols
  2300. ?count = ?count + 1
  2301. ?invprg <?LOC>,%?count
  2302. endm
  2303. endif
  2304. ??_ends
  2305. ??_ends equ <>
  2306. endm
  2307. cCall macro name, arglst, flags
  2308. ife .TYPE name
  2309. CondExtern name, near
  2310. endif
  2311. ifdef ??_nonstandardccall_&name
  2312. PushCParams <arglst>, <FAST>
  2313. else
  2314. PushCParams <arglst>, <flags>
  2315. endif
  2316. call name
  2317. ifdef ??_nonstandardccall_&name
  2318. ClearCParams PRESERVE_FLAGS
  2319. else
  2320. ClearCParams <flags>
  2321. endif
  2322. endm
  2323. .xcref cCall
  2324. pCall macro name, arglst
  2325. local ??saved
  2326. ife .TYPE name
  2327. ?toupper name
  2328. else
  2329. ?upper equ <name>
  2330. endif
  2331. CondExtern %?upper, near
  2332. ??saved = ??_pushed
  2333. irp x,<arglst>
  2334. push x
  2335. ??_pushed = ??_pushed + 4
  2336. endm
  2337. call ?upper
  2338. ??_pushed = ??saved
  2339. endm
  2340. .xcref pCall
  2341. sCall macro name, arglst
  2342. local ??saved
  2343. ??saved = ??_pushed
  2344. PushCParams <arglst>
  2345. ?scall _, name, %(??_argc * 4)
  2346. ??_pushed = ??saved
  2347. endm
  2348. .xcref sCall
  2349. fCall macro name, arglst, flags
  2350. local ??saved
  2351. ??saved = ??_pushed
  2352. ife .TYPE name
  2353. CondExtern name, near
  2354. endif
  2355. PushCParams <arglst>, <FASTCALL>
  2356. ?scall @, name, %(??_argc * 4)
  2357. ifdef ??_nonstandardccall_&name
  2358. ClearCParams PRESERVE_FLAGS
  2359. else
  2360. ClearCParams <flags>
  2361. endif
  2362. ??_pushed = ??saved
  2363. endm
  2364. .xcref fCall
  2365. iCall equ <sCall>
  2366. IFNDEF STANDARD_CCALL
  2367. NONSTANDARD_CCALL = 1
  2368. ENDIF
  2369. PushCParams macro arglst, flags
  2370. LOCAL ??_pushedargs
  2371. ??_argc = 0
  2372. IFDEF NONSTANDARD_CCALL
  2373. ??_popargs = 0
  2374. ELSE
  2375. ??_popargs = ??_align EQ 0
  2376. ENDIF
  2377. ifidni <flags>, <SMALL>
  2378. ??_popargs = 1
  2379. elseifidni <flags>, <FAST>
  2380. ??_popargs = 0
  2381. elseifidni <flags>, <FASTCALL>
  2382. ??_popargs = 0
  2383. endif
  2384. irp x,<arglst>
  2385. ??_argc = ??_argc + 1
  2386. ifidni <flags>, <FASTCALL>
  2387. if ??_argc eq 1
  2388. ifdifi <x>, <ecx>
  2389. .err <first parameter must be ECX for fastcall functions>
  2390. endif
  2391. elseif ??_argc eq 2
  2392. ifdifi <x>, <edx>
  2393. .err <first parameter must be EDX for fastcall functions>
  2394. endif
  2395. else
  2396. ?marg <x>,%??_argc
  2397. endif
  2398. else
  2399. ?marg <x>,%??_argc
  2400. endif
  2401. endm
  2402. ?count = ??_argc
  2403. ifidni <flags>, <FASTCALL>
  2404. ??_pushedargs = ??_argc-2
  2405. else
  2406. ??_pushedargs = ??_argc
  2407. endif
  2408. if ??_pushedargs GT 0
  2409. rept ??_argc
  2410. ?invprg <?AM>,%?count
  2411. ?count = ?count - 1
  2412. endm
  2413. endif
  2414. endm
  2415. ClearCParams macro fPreserveFlags
  2416. if ??_argc ne 0
  2417. if (??_popargs) AND (??_argc LE 2)
  2418. rept ??_argc
  2419. pop ecx
  2420. endm
  2421. elseifidni <fPreserveFlags>, <PRESERVE_FLAGS>
  2422. lea esp, [esp][??_argc * 4]
  2423. else
  2424. add esp,??_argc * 4
  2425. endif
  2426. endif
  2427. ??_pushed = ??_pushed - (??_argc * 4)
  2428. endm
  2429. ?marg macro name, num
  2430. .xcref
  2431. .xcref ?AM&num
  2432. .cref
  2433. ?AM&num &macro
  2434. push name
  2435. ??_pushed = ??_pushed + 4
  2436. &endm
  2437. endm
  2438. .xcref ?marg
  2439. ?invprg macro name1, name2
  2440. name1&name2
  2441. purge name1&name2
  2442. endm
  2443. .xcref ?invprg
  2444. ?scall macro prefix, name1, name2
  2445. CondExtern prefix&name1&@&name2, near
  2446. call prefix&name1&@&name2
  2447. endm
  2448. .xcref ?scall
  2449. ?merge macro l1, l2, l3, l4, op, r1, r2, r3, r4, r5, r6, r7, r8, r9
  2450. l1&l2&l3&l4 op r1&r2&r3&r4&r5&r6&r7&r8&r9
  2451. endm
  2452. ?toupper macro s
  2453. ?upper equ <>
  2454. irpc x,<s>
  2455. if '&x' GE 'a'
  2456. if '&x' LE 'z'
  2457. ?t1 substr <ABCDEFGHIJKLMNOPQRSTUVWXYZ>,'&x'-'a'+1,1
  2458. ?upper catstr ?upper,?t1
  2459. else
  2460. ?upper catstr ?upper,<&x>
  2461. endif
  2462. else
  2463. ?upper catstr ?upper,<&x>
  2464. endif
  2465. endm
  2466. endm
  2467. .xcref
  2468. CondExtern macro name,dist
  2469. ifdef MASM6
  2470. ifndef name
  2471. externdef name:dist
  2472. endif
  2473. else
  2474. if2
  2475. ifndef name
  2476. extrn name:dist
  2477. endif
  2478. endif
  2479. endif
  2480. endm
  2481. SaveReg macro reglist
  2482. irp reg,<reglist>
  2483. ifidni <reg>, <fd>
  2484. pushfd
  2485. ??_pushed = ??_pushed + 4
  2486. else
  2487. ifidni <reg>, <ad>
  2488. pushad
  2489. ??_pushed = ??_pushed + SIZE Pushad_Struc
  2490. else
  2491. push reg
  2492. ??_pushed = ??_pushed + 4
  2493. endif
  2494. endif
  2495. endm
  2496. endm
  2497. RestoreReg macro reglist
  2498. irp reg,<reglist>
  2499. ifidni <reg>, <fd>
  2500. popfd
  2501. ??_pushed = ??_pushed - 4
  2502. else
  2503. ifidni <reg>, <ad>
  2504. popad
  2505. ??_pushed = ??_pushed - SIZE Pushad_Struc
  2506. else
  2507. pop reg
  2508. ??_pushed = ??_pushed - 4
  2509. endif
  2510. endif
  2511. endm
  2512. endm
  2513. ifdef DEBUG
  2514. Begin_Profile_List macro devname
  2515. ifdef profileall
  2516. VxD_DATA_SEG
  2517. db 'PROCLIST'
  2518. PUBLIC devname&_Proc_Profile_List
  2519. devname&_Proc_Profile_List label dword
  2520. endif
  2521. endm
  2522. Profile_Link macro modname
  2523. ifdef profileall
  2524. ifdifi <modname>,@filename
  2525. EXTRN _&modname&__proc_list:near
  2526. endif
  2527. dd OFFSET32 _&modname&__proc_list
  2528. endif
  2529. endm
  2530. End_Profile_List macro
  2531. ifdef profileall
  2532. dd 0
  2533. VxD_DATA_ENDS
  2534. endif
  2535. endm
  2536. endif
  2537. ifndef Not_VxD
  2538. RESERVED_LOW_BOOST EQU 00000001H
  2539. CUR_RUN_VM_BOOST EQU 00000004H
  2540. LOW_PRI_DEVICE_BOOST EQU 00000010H
  2541. HIGH_PRI_DEVICE_BOOST EQU 00001000H
  2542. CRITICAL_SECTION_BOOST EQU 00100000H
  2543. TIME_CRITICAL_BOOST EQU 00400000H
  2544. RESERVED_HIGH_BOOST EQU 40000000H
  2545. PEF_WAIT_FOR_STI_BIT EQU 0
  2546. PEF_WAIT_FOR_STI EQU (1 SHL PEF_WAIT_FOR_STI_BIT)
  2547. PEF_WAIT_NOT_CRIT_BIT EQU 1
  2548. PEF_WAIT_NOT_CRIT EQU (1 SHL PEF_WAIT_NOT_CRIT_BIT)
  2549. PEF_DONT_UNBOOST_BIT EQU 2
  2550. PEF_DONT_UNBOOST EQU (1 SHL PEF_DONT_UNBOOST_BIT)
  2551. PEF_ALWAYS_SCHED_BIT EQU 3
  2552. PEF_ALWAYS_SCHED EQU (1 SHL PEF_ALWAYS_SCHED_BIT)
  2553. PEF_TIME_OUT_BIT EQU 4
  2554. PEF_TIME_OUT EQU (1 SHL PEF_TIME_OUT_BIT)
  2555. PEF_WAIT_NOT_HW_INT_BIT EQU 5
  2556. PEF_WAIT_NOT_HW_INT EQU (1 SHL PEF_WAIT_NOT_HW_INT_BIT)
  2557. PEF_WAIT_NOT_NESTED_EXEC_BIT EQU 6
  2558. PEF_WAIT_NOT_NESTED_EXEC EQU (1 SHL PEF_WAIT_NOT_NESTED_EXEC_BIT)
  2559. PEF_WAIT_IN_PM_BIT EQU 7
  2560. PEF_WAIT_IN_PM EQU (1 SHL PEF_WAIT_IN_PM_BIT)
  2561. PEF_THREAD_EVENT_BIT EQU 8
  2562. PEF_THREAD_EVENT EQU (1 SHL PEF_THREAD_EVENT_BIT)
  2563. PEF_WAIT_FOR_THREAD_STI_BIT EQU 9
  2564. PEF_WAIT_FOR_THREAD_STI EQU (1 SHL PEF_WAIT_FOR_THREAD_STI_BIT)
  2565. PEF_RING0_EVENT_BIT EQU 10
  2566. PEF_RING0_EVENT EQU (1 SHL PEF_RING0_EVENT_BIT)
  2567. PEF_WAIT_CRIT_BIT EQU 11
  2568. PEF_WAIT_CRIT EQU (1 SHL PEF_WAIT_CRIT_BIT)
  2569. PEF_WAIT_CRIT_VM_BIT EQU 12
  2570. PEF_WAIT_CRIT_VM EQU (1 SHL PEF_WAIT_CRIT_VM_BIT)
  2571. PEF_PROCESS_LAST_BIT EQU 13
  2572. PEF_PROCESS_LAST EQU (1 SHL PEF_PROCESS_LAST_BIT)
  2573. PEF_WAIT_PREEMPTABLE_BIT EQU 14
  2574. PEF_WAIT_PREEMPTABLE EQU (1 SHL PEF_WAIT_PREEMPTABLE_BIT)
  2575. PEF_WAIT_FOR_PASSIVE_BIT EQU 15
  2576. PEF_WAIT_FOR_PASSIVE EQU (1 SHL PEF_WAIT_FOR_PASSIVE_BIT)
  2577. PEF_WAIT_FOR_APPY_BIT EQU 16
  2578. PEF_WAIT_FOR_APPY EQU (1 SHL PEF_WAIT_FOR_APPY_BIT)
  2579. PEF_WAIT_FOR_WORKER_BIT EQU 17
  2580. PEF_WAIT_FOR_WORKER EQU (1 SHL PEF_WAIT_FOR_WORKER_BIT)
  2581. PEF_WAIT_NOT_TIME_CRIT_BIT EQU PEF_WAIT_NOT_HW_INT_BIT
  2582. PEF_WAIT_NOT_TIME_CRIT EQU PEF_WAIT_NOT_HW_INT
  2583. PEF_WAIT_NOT_PM_LOCKED_STACK_BIT EQU PEF_WAIT_NOT_NESTED_EXEC_BIT
  2584. PEF_WAIT_NOT_PM_LOCKED_STACK EQU PEF_WAIT_NOT_NESTED_EXEC
  2585. PEF_WAIT_FOR_CONFIGMG_CALLABLE EQU PEF_WAIT_FOR_WORKER
  2586. PEF_WAIT_FOR_CONFIGMG_QUICK EQU PEF_WAIT_FOR_APPY
  2587. BLOCK_SVC_INTS_BIT EQU 0
  2588. BLOCK_SVC_INTS EQU (1 SHL BLOCK_SVC_INTS_BIT)
  2589. BLOCK_SVC_IF_INTS_LOCKED_BIT EQU 1
  2590. BLOCK_SVC_IF_INTS_LOCKED EQU (1 SHL BLOCK_SVC_IF_INTS_LOCKED_BIT)
  2591. BLOCK_ENABLE_INTS_BIT EQU 2
  2592. BLOCK_ENABLE_INTS EQU (1 SHL BLOCK_ENABLE_INTS_BIT)
  2593. BLOCK_POLL_BIT EQU 3
  2594. BLOCK_POLL EQU (1 SHL BLOCK_POLL_BIT)
  2595. BLOCK_THREAD_IDLE_BIT EQU 4
  2596. BLOCK_THREAD_IDLE EQU (1 SHL BLOCK_THREAD_IDLE_BIT)
  2597. BLOCK_FORCE_SVC_INTS_BIT EQU 5
  2598. BLOCK_FORCE_SVC_INTS EQU (1 SHL BLOCK_FORCE_SVC_INTS_BIT)
  2599. Client_Reg_Struc STRUC
  2600. Client_EDI DD ?
  2601. Client_ESI DD ?
  2602. Client_EBP DD ?
  2603. Client_res0 DD ?
  2604. Client_EBX DD ?
  2605. Client_EDX DD ?
  2606. Client_ECX DD ?
  2607. Client_EAX DD ?
  2608. Client_Error DD ?
  2609. Client_EIP DD ?
  2610. Client_CS DW ?
  2611. Client_res1 DW ?
  2612. Client_EFlags DD ?
  2613. Client_ESP DD ?
  2614. Client_SS DW ?
  2615. Client_res2 DW ?
  2616. Client_ES DW ?
  2617. Client_res3 DW ?
  2618. Client_DS DW ?
  2619. Client_res4 DW ?
  2620. Client_FS DW ?
  2621. Client_res5 DW ?
  2622. Client_GS DW ?
  2623. Client_res6 DW ?
  2624. Client_Alt_EIP DD ?
  2625. Client_Alt_CS DW ?
  2626. Client_res7 DW ?
  2627. Client_Alt_EFlags DD ?
  2628. Client_Alt_ESP DD ?
  2629. Client_Alt_SS DW ?
  2630. Client_res8 DW ?
  2631. Client_Alt_ES DW ?
  2632. Client_res9 DW ?
  2633. Client_Alt_DS DW ?
  2634. Client_res10 DW ?
  2635. Client_Alt_FS DW ?
  2636. Client_res11 DW ?
  2637. Client_Alt_GS DW ?
  2638. Client_res12 DW ?
  2639. Client_Reg_Struc ENDS
  2640. Client_Word_Reg_Struc STRUC
  2641. Client_DI DW ?
  2642. Client_res13 DW ?
  2643. Client_SI DW ?
  2644. Client_res14 DW ?
  2645. Client_BP DW ?
  2646. Client_res15 DW ?
  2647. Client_res16 DD ?
  2648. Client_BX DW ?
  2649. Client_res17 DW ?
  2650. Client_DX DW ?
  2651. Client_res18 DW ?
  2652. Client_CX DW ?
  2653. Client_res19 DW ?
  2654. Client_AX DW ?
  2655. Client_res20 DW ?
  2656. Client_res21 DD ?
  2657. Client_IP DW ?
  2658. Client_res22 DW ?
  2659. Client_res23 DD ?
  2660. Client_Flags DW ?
  2661. Client_res24 DW ?
  2662. Client_SP DW ?
  2663. Client_res25 DW ?
  2664. Client_res26 DD 5 DUP (?)
  2665. Client_Alt_IP DW ?
  2666. Client_res27 DW ?
  2667. Client_res28 DD ?
  2668. Client_Alt_Flags DW ?
  2669. Client_res29 DW ?
  2670. Client_Alt_SP DW ?
  2671. Client_Word_Reg_Struc ENDS
  2672. Client_Byte_Reg_Struc STRUC
  2673. Client_res30 DD 4 DUP (?)
  2674. Client_BL DB ?
  2675. Client_BH DB ?
  2676. Client_res31 DW ?
  2677. Client_DL DB ?
  2678. Client_DH DB ?
  2679. Client_res32 DW ?
  2680. Client_CL DB ?
  2681. Client_CH DB ?
  2682. Client_res33 DW ?
  2683. Client_AL DB ?
  2684. Client_AH DB ?
  2685. Client_Byte_Reg_Struc ENDS
  2686. ?UnionSize = 0
  2687. if size Client_Reg_Struc gt ?UnionSize
  2688. ?UnionSize = size Client_Reg_Struc
  2689. endif
  2690. CRS equ <(byte ptr 0)>
  2691. if size Client_Word_Reg_Struc gt ?UnionSize
  2692. ?UnionSize = size Client_Word_Reg_Struc
  2693. endif
  2694. CWRS equ <(byte ptr 0)>
  2695. if size Client_Byte_Reg_Struc gt ?UnionSize
  2696. ?UnionSize = size Client_Byte_Reg_Struc
  2697. endif
  2698. CBRS equ <(byte ptr 0)>
  2699. tagCLIENT_STRUC STRUC
  2700. DB ?UnionSize dup(?)
  2701. tagCLIENT_STRUC ENDS
  2702. IF 0
  2703. .ERRNZ Client_SP - Client_ESP
  2704. .ERRNZ Client_AL - Client_EAX
  2705. endif
  2706. DYNA_LINK_INT EQU 20H
  2707. DeclareNonstandardCcallService macro arglst
  2708. irp x,<arglst>
  2709. ??_nonstandardccall_&&x = 1
  2710. endm
  2711. endm
  2712. DeclareNonstandardCcallService <_BlockOnID, _LocalizeSprintf>
  2713. DeclareNonstandardCcallService <_SetLastV86Page>
  2714. BeginDoc
  2715. EndDoc
  2716. BeginDoc
  2717. EndDoc
  2718. DefTable MACRO vt, vn
  2719. vt EQU <vn>
  2720. ENDM
  2721. GenDD2 MACRO vt, sn, jf
  2722. dd OFFSET32 vt[sn+jf]
  2723. ENDM
  2724. GenDD MACRO P, vid, snum, jflag
  2725. LOCAL vtable
  2726. IFDEF @@VxDName&vid
  2727. Deftable vtable, %@@VxDName&vid
  2728. EXTRN vtable:DWORD
  2729. GenDD2 %vtable, snum, jflag
  2730. ELSE
  2731. dd @@&P+jflag
  2732. ENDIF
  2733. ENDM
  2734. VxDCall MACRO P, Param, flags
  2735. ??_vxdid = (@@&P SHR 16)
  2736. ??_servicenum = (@@&P AND 0FFFFh)
  2737. ifdef ??_standardccall_&P
  2738. PushCParams <Param>, <FAST>
  2739. .errnz ??_argc ne ??_standardccall_&P, <wrong # of parameters passed to &P&>
  2740. else
  2741. ifdef ??_fastcall_&P
  2742. PushCParams <Param>, <FASTCALL>
  2743. .errnz ??_argc ne (??_fastcall_&P), <wrong # of parameters passed to fastcall function &P&>
  2744. else
  2745. ifdef ??_nonstandardccall_&P
  2746. PushCParams <Param>, <flags>
  2747. else
  2748. PushCParams <Param>, <FAST>
  2749. endif
  2750. endif
  2751. endif
  2752. int Dyna_Link_Int
  2753. GenDD P, %??_vxdid, %??_servicenum, 0
  2754. ifndef ??_standardccall_&P
  2755. ifndef ??_fastcall_&P
  2756. ifdef ??_nonstandardccall_&P
  2757. ClearCParams PRESERVE_FLAGS
  2758. else
  2759. ClearCParams
  2760. endif
  2761. else
  2762. if(??_argc gt 2)
  2763. ??_pushed = ??_pushed - ((??_argc - 2) * 4)
  2764. endif
  2765. endif
  2766. else
  2767. ??_pushed = ??_pushed - (??_argc * 4)
  2768. endif
  2769. ENDM
  2770. VxDJmp MACRO P, Param
  2771. ??_vxdid = (@@&P SHR 16)
  2772. ??_servicenum = (@@&P AND 0FFFFh)
  2773. ifdef ??_fastcall_&P
  2774. PushCParams <Param>, <FASTCALL>
  2775. .errnz ??_argc gt 2, <More than 2 parameters may not be passed to fastcall functions thru VxDJmp>
  2776. else
  2777. .errnb <Param>, <Parameters may not be passed to VxDJmp or VMMJmp>
  2778. endif
  2779. int Dyna_Link_Int
  2780. GenDD P, %??_vxdid, %??_servicenum, DL_Jmp_Mask
  2781. ENDM
  2782. DL_Jmp_Mask EQU 8000h
  2783. DL_Jmp_Bit EQU 0Fh
  2784. VMMCall MACRO P, Param
  2785. .ERRNZ (@@&P SHR 16) - VMM_DEVICE_ID
  2786. VxDCall <P>, <Param>
  2787. ENDM
  2788. VMMJmp MACRO P, Param
  2789. .ERRNZ (@@&P SHR 16) - VMM_DEVICE_ID
  2790. VxDJmp <P>, <Param>
  2791. ENDM
  2792. WDMCall MACRO P, Param, flags
  2793. ifdef ??_standardccall_&P
  2794. PushCParams <Param>, <FAST>
  2795. .errnz ??_argc ne ??_standardccall_&P, <wrong # of parameters passed to &P&>
  2796. else
  2797. ifdef ??_fastcall_&P
  2798. PushCParams <Param>, <FASTCALL>
  2799. .errnz ??_argc ne (??_fastcall_&P), <wrong # of parameters passed to fastcall function &P&>
  2800. else
  2801. ifdef ??_nonstandardccall_&P
  2802. PushCParams <Param>, <flags>
  2803. else
  2804. PushCParams <Param>, <FAST>
  2805. endif
  2806. endif
  2807. endif
  2808. mov eax,WDM@@&P
  2809. int WDM_DynaLink_Int
  2810. nop
  2811. nop
  2812. nop
  2813. ifndef ??_standardccall_&P
  2814. ifndef ??_fastcall_&P
  2815. ifdef ??_nonstandardccall_&P
  2816. ClearCParams PRESERVE_FLAGS
  2817. else
  2818. ClearCParams
  2819. endif
  2820. else
  2821. if(??_argc gt 2)
  2822. ??_pushed = ??_pushed - ((??_argc - 2) * 4)
  2823. endif
  2824. endif
  2825. else
  2826. ??_pushed = ??_pushed - (??_argc * 4)
  2827. endif
  2828. ENDM
  2829. WDMJmp MACRO P, Param
  2830. ifdef ??_fastcall_&P
  2831. PushCParams <Param>, <FASTCALL>
  2832. .errnz ??_argc gt 2, <More than 2 parameters may not be passed to fastcall functions thru VxDJmp>
  2833. else
  2834. .errnb <Param>, <Parameters may not be passed to WDMJmp>
  2835. endif
  2836. mov eax, WDM@@&P+WDM_DL_Jmp_Mask
  2837. int WDM_DynaLink_Int
  2838. nop
  2839. nop
  2840. nop
  2841. ENDM
  2842. WDM_DL_Jmp_Mask EQU 80000000h
  2843. WDM_DL_Jmp_Bit EQU 31
  2844. BeginDoc
  2845. EndDoc
  2846. VxD_CODE_SEG EQU <VxD_LOCKED_CODE_SEG>
  2847. VxD_CODE_ENDS EQU <VxD_LOCKED_CODE_ENDS>
  2848. VxD_LOCKED_CODE_SEG MACRO
  2849. _LTEXT SEGMENT
  2850. ??_CUR_CODE_SEG = ??_CUR_CODE_SEG SHL 4 + ??_LCODE
  2851. ASSUME cs:FLAT, ds:FLAT, es:FLAT, ss:FLAT
  2852. ENDM
  2853. VxD_LOCKED_CODE_ENDS MACRO
  2854. ??_CUR_CODE_SEG = ??_CUR_CODE_SEG SHR 4
  2855. _LTEXT ENDS
  2856. ENDM
  2857. VxD_PAGEABLE_CODE_SEG MACRO
  2858. _PTEXT SEGMENT
  2859. ??_CUR_CODE_SEG = ??_CUR_CODE_SEG SHL 4 + ??_PCODE
  2860. ASSUME cs:FLAT, ds:FLAT, es:FLAT, ss:FLAT
  2861. ENDM
  2862. VxD_PAGEABLE_CODE_ENDS MACRO
  2863. ??_CUR_CODE_SEG = ??_CUR_CODE_SEG SHR 4
  2864. _PTEXT ENDS
  2865. ENDM
  2866. VxD_DEBUG_ONLY_CODE_SEG MACRO
  2867. _DB1CODE SEGMENT
  2868. ??_CUR_CODE_SEG = ??_CUR_CODE_SEG SHL 4 + ??_DBOCODE
  2869. ASSUME cs:FLAT, ds:FLAT, es:FLAT, ss:FLAT
  2870. ENDM
  2871. VxD_DEBUG_ONLY_CODE_ENDS MACRO
  2872. ??_CUR_CODE_SEG = ??_CUR_CODE_SEG SHR 4
  2873. _DB1CODE ENDS
  2874. ENDM
  2875. VxD_INIT_CODE_SEG MACRO
  2876. _ITEXT SEGMENT
  2877. ??_CUR_CODE_SEG = ??_CUR_CODE_SEG SHL 4 + ??_ICODE
  2878. ASSUME cs:FLAT, ds:FLAT, es:FLAT, ss:FLAT
  2879. ENDM
  2880. VxD_INIT_CODE_ENDS MACRO
  2881. ??_CUR_CODE_SEG = ??_CUR_CODE_SEG SHR 4
  2882. _ITEXT ENDS
  2883. ENDM
  2884. VxD_ICODE_SEG equ VxD_INIT_CODE_SEG
  2885. VxD_ICODE_ENDS equ VxD_INIT_CODE_ENDS
  2886. VxD_DATA_SEG EQU <VxD_LOCKED_DATA_SEG>
  2887. VxD_DATA_ENDS EQU <VxD_LOCKED_DATA_ENDS>
  2888. VxD_LOCKED_DATA_SEG MACRO NO_ALIGN
  2889. _LDATA SEGMENT
  2890. IFB <NO_ALIGN>
  2891. ALIGN 4
  2892. ENDIF
  2893. ENDM
  2894. VxD_LOCKED_DATA_ENDS MACRO
  2895. _LDATA ENDS
  2896. ENDM
  2897. VxD_IDATA_SEG MACRO
  2898. _IDATA SEGMENT
  2899. ENDM
  2900. VxD_IDATA_ENDS MACRO
  2901. _IDATA ENDS
  2902. ENDM
  2903. VxD_PAGEABLE_DATA_SEG MACRO NO_ALIGN
  2904. _PDATA SEGMENT
  2905. IFB <NO_ALIGN>
  2906. ALIGN 4
  2907. ENDIF
  2908. ENDM
  2909. VxD_PAGEABLE_DATA_ENDS MACRO
  2910. _PDATA ENDS
  2911. ENDM
  2912. VxD_STATIC_CODE_SEG MACRO
  2913. _STEXT SEGMENT
  2914. ??_CUR_CODE_SEG = ??_CUR_CODE_SEG SHL 4 + ??_SCODE
  2915. ASSUME cs:FLAT, ds:FLAT, es:FLAT, ss:FLAT
  2916. ENDM
  2917. VxD_STATIC_CODE_ENDS MACRO
  2918. ??_CUR_CODE_SEG = ??_CUR_CODE_SEG SHR 4
  2919. _STEXT ENDS
  2920. ENDM
  2921. VxD_STATIC_DATA_SEG MACRO NO_ALIGN
  2922. _SDATA SEGMENT
  2923. IFB <NO_ALIGN>
  2924. ALIGN 4
  2925. ENDIF
  2926. ENDM
  2927. VxD_STATIC_DATA_ENDS MACRO
  2928. _SDATA ENDS
  2929. ENDM
  2930. VxD_DEBUG_ONLY_DATA_SEG MACRO NO_ALIGN
  2931. _DB2DATA SEGMENT
  2932. IFB <NO_ALIGN>
  2933. ALIGN 4
  2934. ENDIF
  2935. ENDM
  2936. VxD_DEBUG_ONLY_DATA_ENDS MACRO
  2937. _DB2DATA ENDS
  2938. ENDM
  2939. VxD_16BIT_INIT_SEG MACRO
  2940. _16ICODE SEGMENT
  2941. ASSUME CS:_16ICODE, DS:NOTHING, ES:NOTHING, SS:NOTHING
  2942. ??_CUR_CODE_SEG = ??_CUR_CODE_SEG SHL 4 + ??_16ICODE
  2943. ENDM
  2944. VxD_16BIT_INIT_ENDS MACRO
  2945. ??_CUR_CODE_SEG = ??_CUR_CODE_SEG SHR 4
  2946. _16ICODE ENDS
  2947. ENDM
  2948. VxD_REAL_INIT_SEG MACRO
  2949. _RCODE SEGMENT
  2950. ASSUME CS:_RCODE, DS:_RCODE, ES:_RCODE, SS:_RCODE
  2951. ??_CUR_CODE_SEG = ??_CUR_CODE_SEG SHL 4 + ??_RCODE
  2952. ENDM
  2953. VxD_REAL_INIT_ENDS MACRO
  2954. ??_CUR_CODE_SEG = ??_CUR_CODE_SEG SHR 4
  2955. _RCODE ENDS
  2956. ENDM
  2957. endif
  2958. ifndef DDK_VERSION
  2959. ifdef WIN31COMPAT
  2960. DDK_VERSION EQU 30AH
  2961. else
  2962. ifdef WIN40COMPAT
  2963. DDK_VERSION EQU 400H
  2964. else
  2965. DDK_VERSION EQU 40AH
  2966. endif
  2967. endif
  2968. endif
  2969. VxD_Desc_Block STRUC
  2970. DDB_Next DD ?
  2971. DDB_SDK_Version DW DDK_VERSION
  2972. DDB_Req_Device_Number DW UNDEFINED_DEVICE_ID
  2973. DDB_Dev_Major_Version DB 0
  2974. DDB_Dev_Minor_Version DB 0
  2975. DDB_Flags DW 0
  2976. DDB_Name DB " "
  2977. DDB_Init_Order DD UNDEFINED_INIT_ORDER
  2978. DDB_Control_Proc DD ?
  2979. DDB_V86_API_Proc DD 0
  2980. DDB_PM_API_Proc DD 0
  2981. DDB_V86_API_CSIP DD 0
  2982. DDB_PM_API_CSIP DD 0
  2983. DDB_Reference_Data DD ?
  2984. DDB_Service_Table_Ptr DD 0
  2985. DDB_Service_Table_Size DD 0
  2986. DDB_Win32_Service_Table DD 0
  2987. DDB_Prev DD 'Prev'
  2988. DDB_Size DD SIZE(VxD_Desc_Block)
  2989. DDB_Reserved1 DD 'Rsv1'
  2990. DDB_Reserved2 DD 'Rsv2'
  2991. DDB_Reserved3 DD 'Rsv3'
  2992. VxD_Desc_Block ENDS
  2993. ifndef Not_VxD
  2994. DDB_SYS_CRIT_INIT_DONE_BIT EQU 0
  2995. DDB_SYS_CRIT_INIT_DONE EQU (1 SHL DDB_SYS_CRIT_INIT_DONE_BIT)
  2996. DDB_DEVICE_INIT_DONE_BIT EQU 1
  2997. DDB_DEVICE_INIT_DONE EQU (1 SHL DDB_DEVICE_INIT_DONE_BIT)
  2998. DDB_HAS_WIN32_SVCS_BIT EQU 14
  2999. DDB_HAS_WIN32_SVCS EQU (1 SHL DDB_HAS_WIN32_SVCS_BIT)
  3000. DDB_DYNAMIC_VXD_BIT EQU 15
  3001. DDB_DYNAMIC_VXD EQU (1 SHL DDB_DYNAMIC_VXD_BIT)
  3002. DDB_DEVICE_DYNALINKED_BIT EQU 13
  3003. DDB_DEVICE_DYNALINKED EQU (1 SHL DDB_DEVICE_DYNALINKED_BIT)
  3004. BeginDoc
  3005. EndDoc
  3006. Declare_Virtual_Device MACRO Name, Major_Ver, Minor_Ver, Ctrl_Proc, Device_Num, Init_Order, V86_Proc, PM_Proc, Reference_Data
  3007. LOCAL V86_API_Offset, PM_API_Offset, Serv_Tab_Offset, Serv_Tab_Len, Ref_Data_Offset
  3008. dev_id_err MACRO
  3009. IFNDEF Name&_Name_Based
  3010. .err <Device ID required when providing services>
  3011. ENDIF
  3012. ENDM
  3013. IFB <V86_Proc>
  3014. V86_API_Offset EQU 0
  3015. ELSE
  3016. IFB <Device_Num>
  3017. dev_id_err
  3018. ENDIF
  3019. V86_API_Offset EQU <OFFSET32 V86_Proc>
  3020. ENDIF
  3021. IFB <PM_Proc>
  3022. PM_API_Offset EQU 0
  3023. ELSE
  3024. IFB <Device_Num>
  3025. dev_id_err
  3026. ENDIF
  3027. PM_API_Offset EQU <OFFSET32 PM_Proc>
  3028. ENDIF
  3029. IFDEF Name&_Service_Table
  3030. IFB <Device_Num>
  3031. dev_id_err
  3032. ELSE
  3033. IFE Device_Num - UNDEFINED_DEVICE_ID
  3034. dev_id_err
  3035. ENDIF
  3036. ENDIF
  3037. Serv_Tab_Offset EQU <OFFSET32 Name&_Service_Table>
  3038. Serv_Tab_Len EQU Num_&Name&_Services
  3039. ELSE
  3040. Serv_Tab_Offset EQU 0
  3041. Serv_Tab_Len EQU 0
  3042. ENDIF
  3043. IFNB <Device_Num>
  3044. .erre (Device_Num LT BASEID_FOR_NAMEBASEDVXD), <Device ID must be less than BASEID_FOR_NAMEBASEDVXD>
  3045. ENDIF
  3046. IFB <Reference_Data>
  3047. Ref_Data_Offset EQU 0
  3048. ELSE
  3049. Ref_Data_Offset EQU <OFFSET32 Reference_Data>
  3050. ENDIF
  3051. IFDEF DEBUG
  3052. VxD_IDATA_SEG
  3053. db 0dh, 0ah, 'D_E_B_U_G===>'
  3054. db "&Name", '<===', 0dh, 0ah
  3055. VxD_IDATA_ENDS
  3056. ENDIF
  3057. VxD_LOCKED_DATA_SEG
  3058. PUBLIC Name&_DDB
  3059. Name&_DDB VxD_Desc_Block <,,Device_Num,Major_Ver,Minor_Ver,,"&Name",Init_Order,\
  3060. OFFSET32 Ctrl_Proc, V86_API_Offset, PM_API_Offset, \
  3061. ,,Ref_Data_Offset,Serv_Tab_Offset, Serv_Tab_Len>
  3062. VxD_LOCKED_DATA_ENDS
  3063. ENDM
  3064. Begin_Control_Dispatch MACRO VxD_Name, p1, p2
  3065. ??_cd_low = 0FFFFFFFFh
  3066. ??_cd_high = 0
  3067. BeginProc VxD_Name&_Control, p1, p2, LOCKED
  3068. ENDM
  3069. End_Control_Dispatch MACRO VxD_Name
  3070. LOCAL ignore, table
  3071. procoff MACRO num
  3072. IFDEF ??_cd_&&num
  3073. dd OFFSET32 ??_cd_&&num
  3074. ELSE
  3075. dd OFFSET32 ignore
  3076. ENDIF
  3077. ENDM
  3078. IF ??_cd_low EQ ??_cd_high
  3079. cmp eax, ??_cd_low
  3080. ?merge <jz>,,,,,<??_cd_>, %(??_cd_low)
  3081. clc
  3082. ret
  3083. ELSE
  3084. IF ??_cd_low GT 0
  3085. sub eax, ??_cd_low
  3086. ENDIF
  3087. cmp eax, ??_cd_high - ??_cd_low + 1
  3088. jae short ignore
  3089. jmp [eax*4+table]
  3090. ignore:
  3091. clc
  3092. ret
  3093. table label dword
  3094. REPT ??_cd_high - ??_cd_low + 1
  3095. procoff %(??_cd_low)
  3096. ??_cd_low = ??_cd_low + 1
  3097. ENDM
  3098. ENDIF
  3099. EndProc VxD_Name&_Control
  3100. PURGE procoff
  3101. PURGE Begin_Control_Dispatch
  3102. PURGE Control_Dispatch
  3103. PURGE End_Control_Dispatch
  3104. ENDM
  3105. BeginDoc
  3106. EndDoc
  3107. Control_Dispatch MACRO Service, Procedure, callc, arglst
  3108. LOCAL Skip_Interseg_Jump
  3109. .errnz ?_LCODE, <Control_Dispatch must be in VxD_LOCKED_CODE_SEG.>
  3110. IFB <callc>
  3111. IFDEF ??_cd_low
  3112. Equate_Service MACRO Serv
  3113. ??_cd_&&Serv equ Procedure
  3114. ENDM
  3115. Equate_Service %(Service)
  3116. IF Service LT ??_cd_low
  3117. ??_cd_low = Service
  3118. ENDIF
  3119. IF Service GT ??_cd_high
  3120. ??_cd_high = Service
  3121. ENDIF
  3122. PURGE Equate_Service
  3123. ELSE
  3124. cmp eax, Service
  3125. jz Procedure
  3126. ENDIF
  3127. ELSE
  3128. cmp eax, Service
  3129. jne SHORT Skip_Interseg_Jump
  3130. callc Procedure, <arglst>
  3131. IF Service EQ PNP_NEW_DEVNODE
  3132. stc
  3133. ELSE
  3134. cmp eax,1
  3135. ENDIF
  3136. ret
  3137. Skip_Interseg_Jump:
  3138. ENDIF
  3139. ENDM
  3140. BYTE_INPUT EQU 000H
  3141. BYTE_OUTPUT EQU 004H
  3142. WORD_INPUT EQU 008H
  3143. WORD_OUTPUT EQU 00CH
  3144. DWORD_INPUT EQU 010H
  3145. DWORD_OUTPUT EQU 014H
  3146. OUTPUT_BIT EQU 2
  3147. OUTPUT EQU (1 SHL OUTPUT_BIT)
  3148. WORD_IO_BIT EQU 3
  3149. WORD_IO EQU (1 SHL WORD_IO_BIT)
  3150. DWORD_IO_BIT EQU 4
  3151. DWORD_IO EQU (1 SHL DWORD_IO_BIT)
  3152. STRING_IO_BIT EQU 5
  3153. STRING_IO EQU (1 SHL STRING_IO_BIT)
  3154. REP_IO_BIT EQU 6
  3155. REP_IO EQU (1 SHL REP_IO_BIT)
  3156. ADDR_32_IO_BIT EQU 7
  3157. ADDR_32_IO EQU (1 SHL ADDR_32_IO_BIT)
  3158. REVERSE_IO_BIT EQU 8
  3159. REVERSE_IO EQU (1 SHL REVERSE_IO_BIT)
  3160. IO_SEG_MASK EQU 0FFFF0000H
  3161. IO_SEG_SHIFT EQU 10H
  3162. BeginDoc
  3163. EndDoc
  3164. Dispatch_Byte_IO MACRO In_Proc, Out_Proc
  3165. LOCAL Byte_IO
  3166. cmp ecx, Byte_Output
  3167. jbe SHORT Byte_IO
  3168. VMMJmp Simulate_IO
  3169. Byte_IO:
  3170. IFIDNI <In_Proc>, <Fall_Through>
  3171. je Out_Proc
  3172. ELSE
  3173. IFIDNI <Out_Proc>, <Fall_Through>
  3174. jb In_Proc
  3175. ELSE
  3176. je Out_Proc
  3177. jmp In_Proc
  3178. ENDIF
  3179. ENDIF
  3180. ENDM
  3181. BeginDoc
  3182. EndDoc
  3183. Emulate_Non_Byte_IO MACRO
  3184. LOCAL Byte_IO
  3185. cmp ecx, Byte_Output
  3186. jbe SHORT Byte_IO
  3187. VMMJmp Simulate_IO
  3188. Byte_IO:
  3189. ENDM
  3190. BeginDoc
  3191. EndDoc
  3192. VxD_IOT_Hdr STRUC
  3193. VxD_IO_Ports DW ?
  3194. VxD_IOT_Hdr ENDS
  3195. VxD_IO_Struc STRUC
  3196. VxD_IO_Port DW ?
  3197. VxD_IO_Proc DD ?
  3198. VxD_IO_Struc ENDS
  3199. .ERRNZ SIZE VxD_IOT_Hdr - 2
  3200. Begin_VxD_IO_Table MACRO Table_Name
  3201. PUBLIC Table_Name
  3202. Table_Name LABEL WORD
  3203. ifndef MASM6
  3204. IF2
  3205. IFNDEF Table_Name&_Entries
  3206. .err <No End_VxD_IO_Table for &Table_Name>
  3207. ENDIF
  3208. dw Table_Name&_Entries
  3209. ELSE
  3210. dw ?
  3211. ENDIF
  3212. ELSE
  3213. dw Table_Name&_Entries
  3214. ENDIF
  3215. ENDM
  3216. .ERRNZ SIZE VxD_IO_Struc - 6
  3217. VxD_IO MACRO Port, Proc_Name
  3218. dw Port
  3219. dd OFFSET32 Proc_Name
  3220. ENDM
  3221. End_VxD_IO_Table MACRO Table_Name
  3222. IFNDEF Table_Name
  3223. .err <No Begin_VxD_IO_Table for &Table_Name>
  3224. ELSE
  3225. Table_Name&_Entries EQU (($-Table_Name)-2) / (SIZE VxD_IO_Struc)
  3226. IF Table_Name&_Entries LE 0
  3227. .err <Invalid number of port traps in &Table_Name>
  3228. ENDIF
  3229. ENDIF
  3230. ENDM
  3231. Push_Client_State MACRO Can_Trash_EDI
  3232. sub esp, SIZE Client_Reg_Struc
  3233. ??_pushed = ??_pushed + SIZE Client_Reg_Struc
  3234. ifidni <Can_Trash_EDI>, <USES_EDI>
  3235. mov edi, esp
  3236. VMMCall Save_Client_State
  3237. else
  3238. push edi
  3239. lea edi, [esp+4]
  3240. VMMCall Save_Client_State
  3241. pop edi
  3242. endif
  3243. ENDM
  3244. Pop_Client_State MACRO Can_Trash_ESI
  3245. ifdifi <Can_Trash_ESI>, <USES_ESI>
  3246. push esi
  3247. lea esi, [esp+4]
  3248. VMMCall Restore_Client_State
  3249. pop esi
  3250. else
  3251. mov esi, esp
  3252. VMMCall Restore_Client_State
  3253. endif
  3254. add esp, SIZE Client_Reg_Struc
  3255. ??_pushed = ??_pushed - SIZE Client_Reg_Struc
  3256. ENDM
  3257. BeginDoc
  3258. EndDoc
  3259. CallRet MACRO P1, P2
  3260. IFDEF DEBUG
  3261. IFIDNI <P1>, <SHORT>
  3262. call P2
  3263. ELSE
  3264. call P1
  3265. ENDIF
  3266. ret
  3267. ELSE
  3268. jmp P1 P2
  3269. ENDIF
  3270. ENDM
  3271. BeginDoc
  3272. EndDoc
  3273. CallJmp MACRO Function_Name, Return_Label
  3274. IFDEF DEBUG
  3275. call Function_Name
  3276. jmp Return_Label
  3277. ELSE
  3278. push Return_Label
  3279. jmp Function_Name
  3280. ENDIF
  3281. ENDM
  3282. BeginDoc
  3283. EndDoc
  3284. IFDEF DEBUG
  3285. VxDCallRet macro p:req
  3286. VxDCall p
  3287. ret
  3288. endm
  3289. VMMCallRet macro p:req
  3290. VMMCall p
  3291. ret
  3292. endm
  3293. ELSE
  3294. VxDCallRet equ <VxDJmp>
  3295. VMMCallRet equ <VMMJmp>
  3296. ENDIF
  3297. PClient_DS equ WORD PTR -4
  3298. PClient_ES equ WORD PTR -8
  3299. PClient_FS equ WORD PTR -12
  3300. PClient_GS equ WORD PTR -16
  3301. Client_Ptr_Flat MACRO Reg_32, Cli_Seg, Cli_Off, Can_Trash_EAX
  3302. IFDIFI <Reg_32>, <EAX>
  3303. IFDIFI <Can_Trash_EAX>, <USES_EAX>
  3304. xchg Reg_32, eax
  3305. ENDIF
  3306. ENDIF
  3307. IFB <Cli_Off>
  3308. mov ax, (Client_&Cli_Seg * 100h) + 0FFh
  3309. ELSE
  3310. mov ax, (Client_&Cli_Seg * 100h) + Client_&Cli_Off
  3311. ENDIF
  3312. VMMCall Map_Flat
  3313. IFDIFI <Reg_32>, <EAX>
  3314. xchg Reg_32, eax
  3315. ENDIF
  3316. ENDM
  3317. VxDint MACRO Int_Number
  3318. if (OPATTR Int_Number) AND 4
  3319. push Int_Number
  3320. else
  3321. push DWORD PTR Int_Number
  3322. endif
  3323. VMMCall Exec_VxD_Int
  3324. ENDM
  3325. VxDintMustComplete MACRO Int_Number
  3326. if (OPATTR Int_Number) AND 4
  3327. push Int_Number
  3328. else
  3329. push DWORD PTR Int_Number
  3330. endif
  3331. VMMCall _ExecVxDIntMustComplete
  3332. ENDM
  3333. Load_FS macro
  3334. VMMCall Load_FS_Service
  3335. endm
  3336. endif
  3337. DUPLICATE_DEVICE_ID_BIT EQU 0
  3338. DUPLICATE_DEVICE_ID EQU (1 SHL DUPLICATE_DEVICE_ID_BIT)
  3339. DUPLICATE_FROM_INT2F_BIT EQU 1
  3340. DUPLICATE_FROM_INT2F EQU (1 SHL DUPLICATE_FROM_INT2F_BIT)
  3341. LOADING_FROM_INT2F_BIT EQU 2
  3342. LOADING_FROM_INT2F EQU (1 SHL LOADING_FROM_INT2F_BIT)
  3343. DEVICE_LOAD_OK EQU 0
  3344. ABORT_DEVICE_LOAD EQU 1
  3345. ABORT_WIN386_LOAD EQU 2
  3346. DEVICE_NOT_NEEDED EQU 3
  3347. NO_FAIL_MESSAGE_BIT EQU 15
  3348. NO_FAIL_MESSAGE EQU (1 SHL NO_FAIL_MESSAGE_BIT)
  3349. LDRSRV_GET_PROFILE_STRING EQU 0
  3350. LDRSRV_GET_NEXT_PROFILE_STRING EQU 1
  3351. LDRSRV_RESERVED EQU 2
  3352. LDRSRV_GET_PROFILE_BOOLEAN EQU 3
  3353. LDRSRV_GET_PROFILE_DECIMAL_INT EQU 4
  3354. LDRSRV_GET_PROFILE_HEX_INT EQU 5
  3355. LDRSRV_COPY_EXTENDED_MEMORY EQU 6
  3356. LDRSRV_GET_MEMORY_INFO EQU 7
  3357. LDRSRV_RegOpenKey EQU 100H
  3358. LDRSRV_RegCreateKey EQU 101H
  3359. LDRSRV_RegCloseKey EQU 102H
  3360. LDRSRV_RegDeleteKey EQU 103H
  3361. LDRSRV_RegSetValue EQU 104H
  3362. LDRSRV_RegQueryValue EQU 105H
  3363. LDRSRV_RegEnumKey EQU 106H
  3364. LDRSRV_RegDeleteValue EQU 107H
  3365. LDRSRV_RegEnumValue EQU 108H
  3366. LDRSRV_RegQueryValueEx EQU 109H
  3367. LDRSRV_RegSetValueEx EQU 10AH
  3368. LDRSRV_RegFlushKey EQU 10BH
  3369. LDRSRV_COPY_INIT EQU 1
  3370. LDRSRV_COPY_LOCKED EQU 2
  3371. LDRSRV_COPY_PAGEABLE EQU 3
  3372. RCODE_OBJ EQU -1
  3373. LCODE_OBJ EQU 01H
  3374. LDATA_OBJ EQU 02H
  3375. PCODE_OBJ EQU 03H
  3376. PDATA_OBJ EQU 04H
  3377. SCODE_OBJ EQU 05H
  3378. SDATA_OBJ EQU 06H
  3379. CODE16_OBJ EQU 07H
  3380. LMSG_OBJ EQU 08H
  3381. PMSG_OBJ EQU 09H
  3382. DBOC_OBJ EQU 0BH
  3383. DBOD_OBJ EQU 0CH
  3384. PLCODE_OBJ EQU 0DH
  3385. PPCODE_OBJ EQU 0FH
  3386. ICODE_OBJ EQU 11H
  3387. IDATA_OBJ EQU 12H
  3388. ICODE16_OBJ EQU 13H
  3389. IMSG_OBJ EQU 14H
  3390. ObjectLocation STRUC
  3391. OL_LinearAddr DD ?
  3392. OL_Size DD ?
  3393. OL_ObjType DB ?
  3394. ObjectLocation ENDS
  3395. MAXOBJECTS EQU 25
  3396. Device_Location_List STRUC
  3397. DLL_DDB DD ?
  3398. DLL_NumObjects DB ?
  3399. DLL_ObjLocation DB SIZE ObjectLocation * 1 DUP (?)
  3400. Device_Location_List ENDS
  3401. PE_BIT EQU 0
  3402. PE_MASK EQU (1 SHL PE_BIT)
  3403. MP_BIT EQU 1
  3404. MP_MASK EQU (1 SHL MP_BIT)
  3405. EM_BIT EQU 2
  3406. EM_MASK EQU (1 SHL EM_BIT)
  3407. TS_BIT EQU 3
  3408. TS_MASK EQU (1 SHL TS_BIT)
  3409. ET_BIT EQU 4
  3410. ET_MASK EQU (1 SHL ET_BIT)
  3411. PG_BIT EQU 31
  3412. PG_MASK EQU (1 SHL PG_BIT)
  3413. CF_BIT EQU 0
  3414. CF_MASK EQU (1 SHL CF_BIT)
  3415. PF_BIT EQU 2
  3416. PF_MASK EQU (1 SHL PF_BIT)
  3417. AF_BIT EQU 4
  3418. AF_MASK EQU (1 SHL AF_BIT)
  3419. ZF_BIT EQU 6
  3420. ZF_MASK EQU (1 SHL ZF_BIT)
  3421. SF_BIT EQU 7
  3422. SF_MASK EQU (1 SHL SF_BIT)
  3423. TF_BIT EQU 8
  3424. TF_MASK EQU (1 SHL TF_BIT)
  3425. IF_BIT EQU 9
  3426. IF_MASK EQU (1 SHL IF_BIT)
  3427. DF_BIT EQU 10
  3428. DF_MASK EQU (1 SHL DF_BIT)
  3429. OF_BIT EQU 11
  3430. OF_MASK EQU (1 SHL OF_BIT)
  3431. IOPL_MASK EQU 3000H
  3432. IOPL_BIT0 EQU 12
  3433. IOPL_BIT1 EQU 13
  3434. NT_BIT EQU 14
  3435. NT_MASK EQU (1 SHL NT_BIT)
  3436. RF_BIT EQU 16
  3437. RF_MASK EQU (1 SHL RF_BIT)
  3438. VM_BIT EQU 17
  3439. VM_MASK EQU (1 SHL VM_BIT)
  3440. AC_BIT EQU 18
  3441. AC_MASK EQU (1 SHL AC_BIT)
  3442. VIF_BIT EQU 19
  3443. VIF_MASK EQU (1 SHL VIF_BIT)
  3444. VIP_BIT EQU 20
  3445. VIP_MASK EQU (1 SHL VIP_BIT)
  3446. IFDEF MASM6
  3447. loopde EQU <looped>
  3448. loopdne EQU <loopned>
  3449. loopdz EQU <loopzd>
  3450. loopdnz EQU <loopnzd>
  3451. ELSE
  3452. loopd EQU <loop>
  3453. loopde EQU <loope>
  3454. loopdne EQU <loopne>
  3455. loopdz EQU <loopz>
  3456. loopdnz EQU <loopnz>
  3457. ENDIF
  3458. P_SIZE EQU 1000H
  3459. P_PRESBIT EQU 0
  3460. P_PRES EQU (1 SHL P_PRESBIT)
  3461. P_WRITEBIT EQU 1
  3462. P_WRITE EQU (1 SHL P_WRITEBIT)
  3463. P_USERBIT EQU 2
  3464. P_USER EQU (1 SHL P_USERBIT)
  3465. P_ACCBIT EQU 5
  3466. P_ACC EQU (1 SHL P_ACCBIT)
  3467. P_DIRTYBIT EQU 6
  3468. P_DIRTY EQU (1 SHL P_DIRTYBIT)
  3469. P_AVAIL EQU (P_PRES+P_WRITE+P_USER)
  3470. PG_VM EQU 0
  3471. PG_SYS EQU 1
  3472. PG_RESERVED1 EQU 2
  3473. PG_PRIVATE EQU 3
  3474. PG_RESERVED2 EQU 4
  3475. PG_RELOCK EQU 5
  3476. PG_INSTANCE EQU 6
  3477. PG_HOOKED EQU 7
  3478. PG_IGNORE EQU 0FFFFFFFFH
  3479. D_PRES EQU 080H
  3480. D_NOTPRES EQU 0
  3481. D_DPL0 EQU 0
  3482. D_DPL1 EQU 020H
  3483. D_DPL2 EQU 040H
  3484. D_DPL3 EQU 060H
  3485. D_SEG EQU 010H
  3486. D_CTRL EQU 0
  3487. D_GRAN_BYTE EQU 000H
  3488. D_GRAN_PAGE EQU 080H
  3489. D_DEF16 EQU 000H
  3490. D_DEF32 EQU 040H
  3491. D_CODE EQU 08H
  3492. D_DATA EQU 0
  3493. D_X EQU 0
  3494. D_RX EQU 02H
  3495. D_C EQU 04H
  3496. D_R EQU 0
  3497. D_W EQU 02H
  3498. D_ED EQU 04H
  3499. D_ACCESSED EQU 1
  3500. RW_DATA_TYPE EQU (D_PRES+D_SEG+D_DATA+D_W)
  3501. R_DATA_TYPE EQU (D_PRES+D_SEG+D_DATA+D_R)
  3502. CODE_TYPE EQU (D_PRES+D_SEG+D_CODE+D_RX)
  3503. D_PAGE32 EQU (D_GRAN_PAGE+D_DEF32)
  3504. SELECTOR_MASK EQU 0FFF8H
  3505. SEL_LOW_MASK EQU 0F8H
  3506. TABLE_MASK EQU 04H
  3507. RPL_MASK EQU 03H
  3508. RPL_CLR EQU (NOT RPL_MASK)
  3509. IVT_ROM_DATA_SIZE EQU 500H
  3510. endif