Subversion Repositories Kolibri OS

Rev

Go to most recent revision | Details | Last modification | View Log | RSS feed

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

,

3488
    ENDM
3489
 
3490
VMMJmp MACRO P, Param
3491
    .ERRNZ (@@&P SHR 16) - VMM_DEVICE_ID
3492
    VxDJmp 

,

3493
    ENDM
3494
 
3495
WDMCall MACRO P, Param, flags
3496
    ifdef ??_standardccall_&P
3497
      PushCParams , 
3498
      .errnz ??_argc ne ??_standardccall_&P, 
3499
    else
3500
      ifdef ??_fastcall_&P
3501
	PushCParams , 
3502
	.errnz ??_argc ne (??_fastcall_&P), 
3503
      else
3504
	ifdef ??_nonstandardccall_&P
3505
	  PushCParams , 
3506
	else
3507
	  PushCParams , 
3508
	endif
3509
      endif
3510
    endif
3511
    mov	eax,WDM@@&P
3512
    int WDM_DynaLink_Int
3513
    nop
3514
    nop
3515
    nop
3516
    ifndef ??_standardccall_&P
3517
      ifndef ??_fastcall_&P
3518
	ifdef ??_nonstandardccall_&P
3519
	ClearCParams PRESERVE_FLAGS
3520
	else
3521
	ClearCParams
3522
	endif
3523
      else
3524
	if(??_argc gt 2)
3525
	    ??_pushed = ??_pushed - ((??_argc - 2) * 4)
3526
	endif
3527
      endif
3528
    else
3529
      ??_pushed = ??_pushed - (??_argc * 4)
3530
    endif
3531
    ENDM
3532
 
3533
WDMJmp	MACRO P, Param
3534
    ifdef ??_fastcall_&P
3535
      PushCParams , 
3536
      .errnz ??_argc gt 2, 
3537
    else
3538
      .errnb , 
3539
    endif
3540
    mov	eax, WDM@@&P+WDM_DL_Jmp_Mask
3541
    int WDM_DynaLink_Int
3542
    nop
3543
    nop
3544
    nop
3545
    ENDM
3546
 
3547
WDM_DL_Jmp_Mask	EQU	80000000h
3548
WDM_DL_Jmp_Bit	EQU	31
3549
 
3550
BeginDoc
3551
 
3552
 
3553
 
3554
 
3555
 
3556
 
3557
 
3558
 
3559
 
3560
 
3561
 
3562
 
3563
 
3564
 
3565
 
3566
 
3567
 
3568
 
3569
 
3570
 
3571
 
3572
 
3573
 
3574
 
3575
 
3576
 
3577
 
3578
 
3579
EndDoc
3580
 
3581
 
3582
 
3583
 
3584
VxD_CODE_SEG	EQU 
3585
VxD_CODE_ENDS	EQU 
3586
 
3587
 
3588
VxD_LOCKED_CODE_SEG MACRO
3589
_LTEXT	 SEGMENT
3590
??_CUR_CODE_SEG = ??_CUR_CODE_SEG SHL 4 + ??_LCODE
3591
   ASSUME   cs:FLAT, ds:FLAT, es:FLAT, ss:FLAT
3592
 
3593
	ENDM
3594
 
3595
VxD_LOCKED_CODE_ENDS MACRO
3596
??_CUR_CODE_SEG = ??_CUR_CODE_SEG SHR 4
3597
_LTEXT	 ENDS
3598
	ENDM
3599
 
3600
 
3601
 
3602
 
3603
VxD_PAGEABLE_CODE_SEG MACRO
3604
_PTEXT	 SEGMENT
3605
??_CUR_CODE_SEG = ??_CUR_CODE_SEG SHL 4 + ??_PCODE
3606
   ASSUME   cs:FLAT, ds:FLAT, es:FLAT, ss:FLAT
3607
 
3608
	ENDM
3609
 
3610
VxD_PAGEABLE_CODE_ENDS MACRO
3611
??_CUR_CODE_SEG = ??_CUR_CODE_SEG SHR 4
3612
_PTEXT	 ENDS
3613
	ENDM
3614
 
3615
 
3616
 
3617
 
3618
VxD_DEBUG_ONLY_CODE_SEG MACRO
3619
_DB1CODE    SEGMENT
3620
??_CUR_CODE_SEG = ??_CUR_CODE_SEG SHL 4 + ??_DBOCODE
3621
   ASSUME   cs:FLAT, ds:FLAT, es:FLAT, ss:FLAT
3622
	ENDM
3623
 
3624
VxD_DEBUG_ONLY_CODE_ENDS MACRO
3625
??_CUR_CODE_SEG = ??_CUR_CODE_SEG SHR 4
3626
_DB1CODE    ENDS
3627
	ENDM
3628
 
3629
 
3630
 
3631
 
3632
VxD_INIT_CODE_SEG   MACRO
3633
_ITEXT	SEGMENT
3634
??_CUR_CODE_SEG = ??_CUR_CODE_SEG SHL 4 + ??_ICODE
3635
    ASSUME  cs:FLAT, ds:FLAT, es:FLAT, ss:FLAT
3636
    ENDM
3637
 
3638
VxD_INIT_CODE_ENDS  MACRO
3639
??_CUR_CODE_SEG = ??_CUR_CODE_SEG SHR 4
3640
_ITEXT	ENDS
3641
	ENDM
3642
 
3643
VxD_ICODE_SEG equ VxD_INIT_CODE_SEG
3644
VxD_ICODE_ENDS equ VxD_INIT_CODE_ENDS
3645
 
3646
 
3647
 
3648
 
3649
VxD_DATA_SEG	EQU 
3650
VxD_DATA_ENDS	EQU 
3651
 
3652
VxD_LOCKED_DATA_SEG MACRO NO_ALIGN
3653
_LDATA	 SEGMENT
3654
IFB 
3655
    ALIGN 4
3656
ENDIF
3657
	ENDM
3658
 
3659
VxD_LOCKED_DATA_ENDS MACRO
3660
_LDATA	 ENDS
3661
	ENDM
3662
 
3663
 
3664
 
3665
 
3666
VxD_IDATA_SEG	MACRO
3667
_IDATA	SEGMENT
3668
	ENDM
3669
VxD_IDATA_ENDS	MACRO
3670
_IDATA	ENDS
3671
	ENDM
3672
 
3673
 
3674
 
3675
 
3676
VxD_PAGEABLE_DATA_SEG MACRO NO_ALIGN
3677
_PDATA	 SEGMENT
3678
IFB 
3679
    ALIGN 4
3680
ENDIF
3681
	ENDM
3682
 
3683
VxD_PAGEABLE_DATA_ENDS MACRO
3684
_PDATA	 ENDS
3685
	ENDM
3686
 
3687
 
3688
 
3689
 
3690
VxD_STATIC_CODE_SEG MACRO
3691
_STEXT	 SEGMENT
3692
??_CUR_CODE_SEG = ??_CUR_CODE_SEG SHL 4 + ??_SCODE
3693
   ASSUME   cs:FLAT, ds:FLAT, es:FLAT, ss:FLAT
3694
 
3695
	ENDM
3696
 
3697
VxD_STATIC_CODE_ENDS MACRO
3698
??_CUR_CODE_SEG = ??_CUR_CODE_SEG SHR 4
3699
_STEXT	 ENDS
3700
	ENDM
3701
 
3702
 
3703
 
3704
 
3705
VxD_STATIC_DATA_SEG MACRO NO_ALIGN
3706
_SDATA	 SEGMENT
3707
IFB 
3708
    ALIGN 4
3709
ENDIF
3710
	ENDM
3711
 
3712
VxD_STATIC_DATA_ENDS MACRO
3713
_SDATA	 ENDS
3714
	ENDM
3715
 
3716
 
3717
 
3718
VxD_DEBUG_ONLY_DATA_SEG MACRO NO_ALIGN
3719
_DB2DATA    SEGMENT
3720
IFB 
3721
    ALIGN 4
3722
ENDIF
3723
	ENDM
3724
 
3725
VxD_DEBUG_ONLY_DATA_ENDS MACRO
3726
_DB2DATA    ENDS
3727
	ENDM
3728
 
3729
 
3730
 
3731
 
3732
VxD_16BIT_INIT_SEG  MACRO
3733
_16ICODE SEGMENT
3734
ASSUME CS:_16ICODE, DS:NOTHING, ES:NOTHING, SS:NOTHING
3735
??_CUR_CODE_SEG = ??_CUR_CODE_SEG SHL 4 + ??_16ICODE
3736
	  ENDM
3737
 
3738
VxD_16BIT_INIT_ENDS MACRO
3739
??_CUR_CODE_SEG = ??_CUR_CODE_SEG SHR 4
3740
_16ICODE ENDS
3741
	   ENDM
3742
 
3743
 
3744
 
3745
VxD_REAL_INIT_SEG  MACRO
3746
_RCODE SEGMENT
3747
ASSUME CS:_RCODE, DS:_RCODE, ES:_RCODE, SS:_RCODE
3748
??_CUR_CODE_SEG = ??_CUR_CODE_SEG SHL 4 + ??_RCODE
3749
	  ENDM
3750
 
3751
VxD_REAL_INIT_ENDS MACRO
3752
??_CUR_CODE_SEG = ??_CUR_CODE_SEG SHR 4
3753
_RCODE ENDS
3754
	   ENDM
3755
 
3756
endif
3757
ifndef DDK_VERSION
3758
ifdef WIN31COMPAT
3759
DDK_VERSION	EQU	30AH
3760
else
3761
ifdef WIN40COMPAT
3762
DDK_VERSION	EQU	400H
3763
else
3764
DDK_VERSION	EQU	40AH
3765
endif
3766
endif
3767
endif
3768
 
3769
VxD_Desc_Block	STRUC
3770
DDB_Next	DD	?
3771
DDB_SDK_Version	DW	DDK_VERSION
3772
DDB_Req_Device_Number	DW	UNDEFINED_DEVICE_ID
3773
DDB_Dev_Major_Version	DB	0
3774
DDB_Dev_Minor_Version	DB	0
3775
DDB_Flags	DW	0
3776
DDB_Name	DB	"        "
3777
DDB_Init_Order	DD	UNDEFINED_INIT_ORDER
3778
DDB_Control_Proc	DD	?
3779
DDB_V86_API_Proc	DD	0
3780
DDB_PM_API_Proc	DD	0
3781
DDB_V86_API_CSIP	DD	0
3782
DDB_PM_API_CSIP	DD	0
3783
DDB_Reference_Data	DD	?
3784
DDB_Service_Table_Ptr	DD	0
3785
DDB_Service_Table_Size	DD	0
3786
DDB_Win32_Service_Table	DD	0
3787
DDB_Prev	DD	'Prev'
3788
DDB_Size	DD	SIZE(VxD_Desc_Block)
3789
DDB_Reserved1	DD	'Rsv1'
3790
DDB_Reserved2	DD	'Rsv2'
3791
DDB_Reserved3	DD	'Rsv3'
3792
VxD_Desc_Block	ENDS
3793
ifndef Not_VxD
3794
DDB_SYS_CRIT_INIT_DONE_BIT	EQU	0
3795
DDB_SYS_CRIT_INIT_DONE	EQU	(1 SHL DDB_SYS_CRIT_INIT_DONE_BIT)
3796
DDB_DEVICE_INIT_DONE_BIT	EQU	1
3797
DDB_DEVICE_INIT_DONE	EQU	(1 SHL DDB_DEVICE_INIT_DONE_BIT)
3798
DDB_HAS_WIN32_SVCS_BIT	EQU	14
3799
DDB_HAS_WIN32_SVCS	EQU	(1 SHL DDB_HAS_WIN32_SVCS_BIT)
3800
DDB_DYNAMIC_VXD_BIT	EQU	15
3801
DDB_DYNAMIC_VXD	EQU	(1 SHL DDB_DYNAMIC_VXD_BIT)
3802
DDB_DEVICE_DYNALINKED_BIT	EQU	13
3803
DDB_DEVICE_DYNALINKED	EQU	(1 SHL DDB_DEVICE_DYNALINKED_BIT)
3804
BeginDoc
3805
 
3806
 
3807
 
3808
 
3809
 
3810
 
3811
 
3812
EndDoc
3813
Declare_Virtual_Device MACRO Name, Major_Ver, Minor_Ver, Ctrl_Proc, Device_Num, Init_Order, V86_Proc, PM_Proc, Reference_Data
3814
    LOCAL   V86_API_Offset, PM_API_Offset, Serv_Tab_Offset, Serv_Tab_Len, Ref_Data_Offset
3815
 
3816
dev_id_err MACRO
3817
 
3818
IFNDEF Name&_Name_Based
3819
.err 
3820
ENDIF
3821
    ENDM
3822
 
3823
IFB 
3824
    V86_API_Offset EQU 0
3825
ELSE
3826
 IFB 
3827
    dev_id_err
3828
 ENDIF
3829
    V86_API_Offset EQU 
3830
ENDIF
3831
 
3832
IFB 
3833
    PM_API_Offset EQU 0
3834
ELSE
3835
 IFB 
3836
    dev_id_err
3837
 ENDIF
3838
    PM_API_Offset EQU 
3839
ENDIF
3840
 
3841
IFDEF Name&_Service_Table
3842
 IFB 
3843
    dev_id_err
3844
 ELSE
3845
  IFE Device_Num - UNDEFINED_DEVICE_ID
3846
    dev_id_err
3847
  ENDIF
3848
 ENDIF
3849
    Serv_Tab_Offset EQU 
3850
    Serv_Tab_Len    EQU Num_&Name&_Services
3851
ELSE
3852
    Serv_Tab_Offset EQU 0
3853
    Serv_Tab_Len    EQU 0
3854
ENDIF
3855
 
3856
IFNB	
3857
  .erre (Device_Num LT BASEID_FOR_NAMEBASEDVXD), 
3858
ENDIF
3859
 
3860
IFB 
3861
	Ref_Data_Offset EQU 0
3862
ELSE
3863
	Ref_Data_Offset EQU   
3864
ENDIF
3865
 
3866
IFDEF DEBUG
3867
VxD_IDATA_SEG
3868
    db	0dh, 0ah, 'D_E_B_U_G===>'
3869
	db	"&Name", '<===', 0dh, 0ah
3870
VxD_IDATA_ENDS
3871
ENDIF
3872
 
3873
VxD_LOCKED_DATA_SEG
3874
 
3875
PUBLIC Name&_DDB
3876
Name&_DDB VxD_Desc_Block <,,Device_Num,Major_Ver,Minor_Ver,,"&Name",Init_Order,\
3877
	     OFFSET32 Ctrl_Proc, V86_API_Offset, PM_API_Offset, \
3878
	     ,,Ref_Data_Offset,Serv_Tab_Offset, Serv_Tab_Len>
3879
 
3880
VxD_LOCKED_DATA_ENDS
3881
 
3882
    ENDM
3883
 
3884
 
3885
 
3886
 
3887
 
3888
 
3889
 
3890
 
3891
 
3892
 
3893
 
3894
 
3895
 
3896
 
3897
 
3898
 
3899
 
3900
 
3901
 
3902
 
3903
 
3904
 
3905
 
3906
 
3907
 
3908
 
3909
 
3910
 
3911
 
3912
Begin_Control_Dispatch MACRO VxD_Name, p1, p2
3913
??_cd_low = 0FFFFFFFFh
3914
??_cd_high = 0
3915
 
3916
BeginProc VxD_Name&_Control, p1, p2, LOCKED
3917
ENDM
3918
 
3919
End_Control_Dispatch   MACRO VxD_Name
3920
    LOCAL ignore, table
3921
 
3922
procoff MACRO num
3923
IFDEF ??_cd_&&num
3924
    dd	OFFSET32 ??_cd_&&num
3925
ELSE
3926
    dd	OFFSET32 ignore
3927
ENDIF
3928
ENDM
3929
 
3930
IF ??_cd_low EQ ??_cd_high
3931
    cmp eax, ??_cd_low
3932
    ?merge  ,,,,,, %(??_cd_low)
3933
    clc
3934
    ret
3935
ELSE
3936
IF ??_cd_low GT 0
3937
    sub eax, ??_cd_low
3938
ENDIF
3939
    cmp eax, ??_cd_high - ??_cd_low + 1
3940
    jae short ignore
3941
    jmp [eax*4+table]
3942
ignore:
3943
    clc
3944
    ret
3945
 
3946
table label dword
3947
    REPT   ??_cd_high - ??_cd_low + 1
3948
    procoff %(??_cd_low)
3949
    ??_cd_low = ??_cd_low + 1
3950
    ENDM
3951
ENDIF
3952
 
3953
EndProc VxD_Name&_Control
3954
 
3955
PURGE procoff
3956
PURGE Begin_Control_Dispatch
3957
PURGE Control_Dispatch
3958
PURGE End_Control_Dispatch
3959
ENDM
3960
 
3961
BeginDoc
3962
 
3963
 
3964
 
3965
 
3966
 
3967
 
3968
 
3969
 
3970
 
3971
 
3972
 
3973
 
3974
 
3975
 
3976
 
3977
 
3978
 
3979
 
3980
 
3981
 
3982
EndDoc
3983
Control_Dispatch MACRO Service, Procedure, callc, arglst
3984
    LOCAL Skip_Interseg_Jump
3985
 
3986
.errnz ?_LCODE, 
3987
 
3988
IFB 
3989
 
3990
IFDEF ??_cd_low
3991
Equate_Service MACRO Serv
3992
??_cd_&&Serv equ Procedure
3993
ENDM
3994
 
3995
Equate_Service %(Service)
3996
 
3997
IF Service LT ??_cd_low
3998
??_cd_low = Service
3999
ENDIF
4000
IF Service GT ??_cd_high
4001
??_cd_high = Service
4002
ENDIF
4003
 
4004
PURGE Equate_Service
4005
 
4006
ELSE
4007
    cmp eax, Service
4008
    jz	Procedure
4009
ENDIF
4010
 
4011
ELSE
4012
 
4013
    cmp eax, Service
4014
    jne SHORT Skip_Interseg_Jump
4015
    callc   Procedure, 
4016
IF Service EQ PNP_NEW_DEVNODE
4017
    stc
4018
ELSE
4019
    cmp eax,1
4020
ENDIF
4021
    ret
4022
Skip_Interseg_Jump:
4023
 
4024
ENDIF
4025
 
4026
    ENDM
4027
 
4028
BYTE_INPUT	EQU	000H
4029
BYTE_OUTPUT	EQU	004H
4030
WORD_INPUT	EQU	008H
4031
WORD_OUTPUT	EQU	00CH
4032
DWORD_INPUT	EQU	010H
4033
DWORD_OUTPUT	EQU	014H
4034
OUTPUT_BIT	EQU	2
4035
OUTPUT	EQU	(1 SHL OUTPUT_BIT)
4036
WORD_IO_BIT	EQU	3
4037
WORD_IO	EQU	(1 SHL WORD_IO_BIT)
4038
DWORD_IO_BIT	EQU	4
4039
DWORD_IO	EQU	(1 SHL DWORD_IO_BIT)
4040
STRING_IO_BIT	EQU	5
4041
STRING_IO	EQU	(1 SHL STRING_IO_BIT)
4042
REP_IO_BIT	EQU	6
4043
REP_IO	EQU	(1 SHL REP_IO_BIT)
4044
ADDR_32_IO_BIT	EQU	7
4045
ADDR_32_IO	EQU	(1 SHL ADDR_32_IO_BIT)
4046
REVERSE_IO_BIT	EQU	8
4047
REVERSE_IO	EQU	(1 SHL REVERSE_IO_BIT)
4048
IO_SEG_MASK	EQU	0FFFF0000H
4049
IO_SEG_SHIFT	EQU	10H
4050
BeginDoc
4051
 
4052
 
4053
 
4054
 
4055
 
4056
 
4057
EndDoc
4058
Dispatch_Byte_IO MACRO In_Proc, Out_Proc
4059
    LOCAL   Byte_IO
4060
    cmp ecx, Byte_Output
4061
    jbe SHORT Byte_IO
4062
    VMMJmp  Simulate_IO
4063
Byte_IO:
4064
IFIDNI , 
4065
    je	Out_Proc
4066
ELSE
4067
IFIDNI , 
4068
    jb	In_Proc
4069
ELSE
4070
    je	Out_Proc
4071
    jmp In_Proc
4072
ENDIF
4073
ENDIF
4074
    ENDM
4075
 
4076
BeginDoc
4077
 
4078
 
4079
 
4080
 
4081
 
4082
 
4083
 
4084
EndDoc
4085
Emulate_Non_Byte_IO MACRO
4086
    LOCAL   Byte_IO
4087
    cmp ecx, Byte_Output
4088
    jbe SHORT Byte_IO
4089
    VMMJmp  Simulate_IO
4090
Byte_IO:
4091
    ENDM
4092
 
4093
BeginDoc
4094
 
4095
 
4096
 
4097
 
4098
 
4099
 
4100
 
4101
 
4102
EndDoc
4103
 
4104
 
4105
VxD_IOT_Hdr	STRUC
4106
VxD_IO_Ports	DW	?
4107
VxD_IOT_Hdr	ENDS
4108
 
4109
VxD_IO_Struc	STRUC
4110
VxD_IO_Port	DW	?
4111
VxD_IO_Proc	DD	?
4112
VxD_IO_Struc	ENDS
4113
.ERRNZ SIZE VxD_IOT_Hdr - 2
4114
Begin_VxD_IO_Table MACRO Table_Name
4115
PUBLIC Table_Name
4116
Table_Name LABEL WORD
4117
 
4118
ifndef MASM6
4119
IF2
4120
IFNDEF Table_Name&_Entries
4121
.err 
4122
ENDIF
4123
    dw	Table_Name&_Entries
4124
ELSE
4125
    dw	?
4126
ENDIF
4127
ELSE
4128
    dw	Table_Name&_Entries
4129
ENDIF
4130
 
4131
    ENDM
4132
 
4133
.ERRNZ SIZE VxD_IO_Struc - 6
4134
VxD_IO MACRO Port, Proc_Name
4135
    dw	Port
4136
    dd	OFFSET32 Proc_Name
4137
    ENDM
4138
 
4139
End_VxD_IO_Table MACRO Table_Name
4140
 
4141
IFNDEF Table_Name
4142
.err 
4143
ELSE
4144
    Table_Name&_Entries EQU (($-Table_Name)-2) / (SIZE VxD_IO_Struc)
4145
IF Table_Name&_Entries LE 0
4146
.err 
4147
ENDIF
4148
ENDIF
4149
	ENDM
4150
 
4151
 
4152
 
4153
 
4154
 
4155
 
4156
 
4157
 
4158
 
4159
 
4160
 
4161
 
4162
 
4163
Push_Client_State MACRO Can_Trash_EDI
4164
    sub esp, SIZE Client_Reg_Struc
4165
    ??_pushed = ??_pushed + SIZE Client_Reg_Struc
4166
    ifidni , 
4167
    mov edi, esp
4168
    VMMCall Save_Client_State
4169
    else
4170
    push    edi
4171
    lea edi, [esp+4]
4172
    VMMCall Save_Client_State
4173
    pop edi
4174
    endif
4175
    ENDM
4176
 
4177
Pop_Client_State MACRO Can_Trash_ESI
4178
    ifdifi , 
4179
    push    esi
4180
    lea esi, [esp+4]
4181
    VMMCall Restore_Client_State
4182
    pop esi
4183
    else
4184
    mov esi, esp
4185
    VMMCall Restore_Client_State
4186
    endif
4187
    add esp, SIZE Client_Reg_Struc
4188
    ??_pushed = ??_pushed - SIZE Client_Reg_Struc
4189
    ENDM
4190
 
4191
BeginDoc
4192
 
4193
 
4194
 
4195
 
4196
 
4197
 
4198
 
4199
 
4200
 
4201
 
4202
 
4203
 
4204
 
4205
 
4206
EndDoc
4207
 
4208
CallRet MACRO P1, P2
4209
IFDEF DEBUG
4210
IFIDNI , 
4211
    call    P2
4212
ELSE
4213
    call    P1
4214
ENDIF
4215
    ret
4216
ELSE
4217
    jmp P1 P2
4218
ENDIF
4219
    ENDM
4220
 
4221
BeginDoc
4222
 
4223
 
4224
 
4225
 
4226
 
4227
 
4228
 
4229
 
4230
 
4231
 
4232
 
4233
 
4234
 
4235
 
4236
 
4237
EndDoc
4238
 
4239
CallJmp MACRO Function_Name, Return_Label
4240
IFDEF DEBUG
4241
    call    Function_Name
4242
    jmp     Return_Label
4243
ELSE
4244
    push    Return_Label
4245
    jmp     Function_Name
4246
ENDIF
4247
    ENDM
4248
 
4249
 
4250
BeginDoc
4251
 
4252
 
4253
 
4254
 
4255
 
4256
 
4257
EndDoc
4258
 
4259
IFDEF	DEBUG
4260
 
4261
VxDCallRet macro p:req
4262
    VxDCall p
4263
    ret
4264
endm
4265
 
4266
VMMCallRet macro p:req
4267
    VMMCall p
4268
    ret
4269
endm
4270
 
4271
ELSE
4272
 
4273
VxDCallRet equ 
4274
VMMCallRet equ 
4275
 
4276
ENDIF
4277
 
4278
 
4279
 
4280
PClient_DS equ WORD PTR -4
4281
PClient_ES equ WORD PTR -8
4282
PClient_FS equ WORD PTR -12
4283
PClient_GS equ WORD PTR -16
4284
 
4285
 
4286
 
4287
 
4288
 
4289
 
4290
 
4291
 
4292
 
4293
 
4294
 
4295
Client_Ptr_Flat MACRO Reg_32, Cli_Seg, Cli_Off, Can_Trash_EAX
4296
 
4297
IFDIFI , 
4298
    IFDIFI , 
4299
    xchg    Reg_32, eax
4300
    ENDIF
4301
ENDIF
4302
IFB 
4303
    mov ax, (Client_&Cli_Seg * 100h) + 0FFh
4304
ELSE
4305
    mov ax, (Client_&Cli_Seg * 100h) + Client_&Cli_Off
4306
ENDIF
4307
    VMMCall Map_Flat
4308
 
4309
IFDIFI , 
4310
    xchg    Reg_32, eax
4311
ENDIF
4312
 
4313
    ENDM
4314
 
4315
 
4316
 
4317
VxDint	MACRO	Int_Number
4318
    if	(OPATTR Int_Number) AND 4
4319
    push    Int_Number
4320
    else
4321
    push    DWORD PTR Int_Number
4322
    endif
4323
    VMMCall Exec_VxD_Int
4324
    ENDM
4325
 
4326
VxDintMustComplete MACRO   Int_Number
4327
    if	(OPATTR Int_Number) AND 4
4328
    push    Int_Number
4329
    else
4330
    push    DWORD PTR Int_Number
4331
    endif
4332
	VMMCall _ExecVxDIntMustComplete
4333
    ENDM
4334
 
4335
Load_FS 	macro
4336
	VMMCall Load_FS_Service
4337
endm
4338
 
4339
endif
4340
DUPLICATE_DEVICE_ID_BIT	EQU	0
4341
DUPLICATE_DEVICE_ID	EQU	(1 SHL DUPLICATE_DEVICE_ID_BIT)
4342
DUPLICATE_FROM_INT2F_BIT	EQU	1
4343
DUPLICATE_FROM_INT2F	EQU	(1 SHL DUPLICATE_FROM_INT2F_BIT)
4344
LOADING_FROM_INT2F_BIT	EQU	2
4345
LOADING_FROM_INT2F	EQU	(1 SHL LOADING_FROM_INT2F_BIT)
4346
DEVICE_LOAD_OK	EQU	0
4347
ABORT_DEVICE_LOAD	EQU	1
4348
ABORT_WIN386_LOAD	EQU	2
4349
DEVICE_NOT_NEEDED	EQU	3
4350
NO_FAIL_MESSAGE_BIT	EQU	15
4351
NO_FAIL_MESSAGE	EQU	(1 SHL NO_FAIL_MESSAGE_BIT)
4352
LDRSRV_GET_PROFILE_STRING	EQU	0
4353
LDRSRV_GET_NEXT_PROFILE_STRING	EQU	1
4354
LDRSRV_RESERVED	EQU	2
4355
LDRSRV_GET_PROFILE_BOOLEAN	EQU	3
4356
LDRSRV_GET_PROFILE_DECIMAL_INT	EQU	4
4357
LDRSRV_GET_PROFILE_HEX_INT	EQU	5
4358
LDRSRV_COPY_EXTENDED_MEMORY	EQU	6
4359
LDRSRV_GET_MEMORY_INFO	EQU	7
4360
LDRSRV_RegOpenKey	EQU	100H
4361
LDRSRV_RegCreateKey	EQU	101H
4362
LDRSRV_RegCloseKey	EQU	102H
4363
LDRSRV_RegDeleteKey	EQU	103H
4364
LDRSRV_RegSetValue	EQU	104H
4365
LDRSRV_RegQueryValue	EQU	105H
4366
LDRSRV_RegEnumKey	EQU	106H
4367
LDRSRV_RegDeleteValue	EQU	107H
4368
LDRSRV_RegEnumValue	EQU	108H
4369
LDRSRV_RegQueryValueEx	EQU	109H
4370
LDRSRV_RegSetValueEx	EQU	10AH
4371
LDRSRV_RegFlushKey	EQU	10BH
4372
LDRSRV_COPY_INIT	EQU	1
4373
LDRSRV_COPY_LOCKED	EQU	2
4374
LDRSRV_COPY_PAGEABLE	EQU	3
4375
RCODE_OBJ	EQU	-1
4376
LCODE_OBJ	EQU	01H
4377
LDATA_OBJ	EQU	02H
4378
PCODE_OBJ	EQU	03H
4379
PDATA_OBJ	EQU	04H
4380
SCODE_OBJ	EQU	05H
4381
SDATA_OBJ	EQU	06H
4382
CODE16_OBJ	EQU	07H
4383
LMSG_OBJ	EQU	08H
4384
PMSG_OBJ	EQU	09H
4385
DBOC_OBJ	EQU	0BH
4386
DBOD_OBJ	EQU	0CH
4387
PLCODE_OBJ	EQU	0DH
4388
PPCODE_OBJ	EQU	0FH
4389
ICODE_OBJ	EQU	11H
4390
IDATA_OBJ	EQU	12H
4391
ICODE16_OBJ	EQU	13H
4392
IMSG_OBJ	EQU	14H
4393
 
4394
ObjectLocation	STRUC
4395
OL_LinearAddr	DD	?
4396
OL_Size	DD	?
4397
OL_ObjType	DB	?
4398
ObjectLocation	ENDS
4399
MAXOBJECTS	EQU	25
4400
 
4401
Device_Location_List	STRUC
4402
DLL_DDB	DD	?
4403
DLL_NumObjects	DB	?
4404
DLL_ObjLocation	DB	SIZE ObjectLocation * 1 DUP (?)
4405
Device_Location_List	ENDS
4406
PE_BIT	EQU	0
4407
PE_MASK	EQU	(1 SHL PE_BIT)
4408
MP_BIT	EQU	1
4409
MP_MASK	EQU	(1 SHL MP_BIT)
4410
EM_BIT	EQU	2
4411
EM_MASK	EQU	(1 SHL EM_BIT)
4412
TS_BIT	EQU	3
4413
TS_MASK	EQU	(1 SHL TS_BIT)
4414
ET_BIT	EQU	4
4415
ET_MASK	EQU	(1 SHL ET_BIT)
4416
PG_BIT	EQU	31
4417
PG_MASK	EQU	(1 SHL PG_BIT)
4418
CF_BIT	EQU	0
4419
CF_MASK	EQU	(1 SHL CF_BIT)
4420
PF_BIT	EQU	2
4421
PF_MASK	EQU	(1 SHL PF_BIT)
4422
AF_BIT	EQU	4
4423
AF_MASK	EQU	(1 SHL AF_BIT)
4424
ZF_BIT	EQU	6
4425
ZF_MASK	EQU	(1 SHL ZF_BIT)
4426
SF_BIT	EQU	7
4427
SF_MASK	EQU	(1 SHL SF_BIT)
4428
TF_BIT	EQU	8
4429
TF_MASK	EQU	(1 SHL TF_BIT)
4430
IF_BIT	EQU	9
4431
IF_MASK	EQU	(1 SHL IF_BIT)
4432
DF_BIT	EQU	10
4433
DF_MASK	EQU	(1 SHL DF_BIT)
4434
OF_BIT	EQU	11
4435
OF_MASK	EQU	(1 SHL OF_BIT)
4436
IOPL_MASK	EQU	3000H
4437
IOPL_BIT0	EQU	12
4438
IOPL_BIT1	EQU	13
4439
NT_BIT	EQU	14
4440
NT_MASK	EQU	(1 SHL NT_BIT)
4441
RF_BIT	EQU	16
4442
RF_MASK	EQU	(1 SHL RF_BIT)
4443
VM_BIT	EQU	17
4444
VM_MASK	EQU	(1 SHL VM_BIT)
4445
AC_BIT	EQU	18
4446
AC_MASK	EQU	(1 SHL AC_BIT)
4447
VIF_BIT	EQU	19
4448
VIF_MASK	EQU	(1 SHL VIF_BIT)
4449
VIP_BIT	EQU	20
4450
VIP_MASK	EQU	(1 SHL VIP_BIT)
4451
 
4452
 
4453
 
4454
 
4455
 
4456
 
4457
IFDEF MASM6
4458
loopde EQU 
4459
loopdne EQU 
4460
loopdz EQU 
4461
loopdnz EQU 
4462
ELSE
4463
loopd EQU 
4464
loopde EQU 
4465
loopdne EQU 
4466
loopdz EQU 
4467
loopdnz EQU 
4468
ENDIF
4469
 
4470
P_SIZE	EQU	1000H
4471
P_PRESBIT	EQU	0
4472
P_PRES	EQU	(1 SHL P_PRESBIT)
4473
P_WRITEBIT	EQU	1
4474
P_WRITE	EQU	(1 SHL P_WRITEBIT)
4475
P_USERBIT	EQU	2
4476
P_USER	EQU	(1 SHL P_USERBIT)
4477
P_ACCBIT	EQU	5
4478
P_ACC	EQU	(1 SHL P_ACCBIT)
4479
P_DIRTYBIT	EQU	6
4480
P_DIRTY	EQU	(1 SHL P_DIRTYBIT)
4481
P_AVAIL	EQU	(P_PRES+P_WRITE+P_USER)
4482
PG_VM	EQU	0
4483
PG_SYS	EQU	1
4484
PG_RESERVED1	EQU	2
4485
PG_PRIVATE	EQU	3
4486
PG_RESERVED2	EQU	4
4487
PG_RELOCK	EQU	5
4488
PG_INSTANCE	EQU	6
4489
PG_HOOKED	EQU	7
4490
PG_IGNORE	EQU	0FFFFFFFFH
4491
D_PRES	EQU	080H
4492
D_NOTPRES	EQU	0
4493
D_DPL0	EQU	0
4494
D_DPL1	EQU	020H
4495
D_DPL2	EQU	040H
4496
D_DPL3	EQU	060H
4497
D_SEG	EQU	010H
4498
D_CTRL	EQU	0
4499
D_GRAN_BYTE	EQU	000H
4500
D_GRAN_PAGE	EQU	080H
4501
D_DEF16	EQU	000H
4502
D_DEF32	EQU	040H
4503
D_CODE	EQU	08H
4504
D_DATA	EQU	0
4505
D_X	EQU	0
4506
D_RX	EQU	02H
4507
D_C	EQU	04H
4508
D_R	EQU	0
4509
D_W	EQU	02H
4510
D_ED	EQU	04H
4511
D_ACCESSED	EQU	1
4512
RW_DATA_TYPE	EQU	(D_PRES+D_SEG+D_DATA+D_W)
4513
R_DATA_TYPE	EQU	(D_PRES+D_SEG+D_DATA+D_R)
4514
CODE_TYPE	EQU	(D_PRES+D_SEG+D_CODE+D_RX)
4515
D_PAGE32	EQU	(D_GRAN_PAGE+D_DEF32)
4516
SELECTOR_MASK	EQU	0FFF8H
4517
SEL_LOW_MASK	EQU	0F8H
4518
TABLE_MASK	EQU	04H
4519
RPL_MASK	EQU	03H
4520
RPL_CLR	EQU	(NOT RPL_MASK)
4521
IVT_ROM_DATA_SIZE	EQU	500H
4522
endif