home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / ddkx86v2.zip / DDKX86 / DBCSDD / INC / VDMM.INC < prev    next >
Text File  |  1995-04-14  |  30KB  |  1,036 lines

  1. ;*DDK*************************************************************************/
  2. ;
  3. ; COPYRIGHT    Copyright (C) 1995 IBM Corporation
  4. ;
  5. ;    The following IBM OS/2 WARP source code is provided to you solely for
  6. ;    the purpose of assisting you in your development of OS/2 WARP device
  7. ;    drivers. You may use this code in accordance with the IBM License
  8. ;    Agreement provided in the IBM Device Driver Source Kit for OS/2. This
  9. ;    Copyright statement may not be removed.;
  10. ;*****************************************************************************/
  11. ;***    VDMM.INC
  12. ;
  13. ;
  14. ;
  15. ;    For include file hierarchy, see MVDM.INC
  16. ;
  17. ;    Title:
  18. ;        VDMM exports
  19. ;
  20. ;    Description:
  21. ;        VDM Manager Exported Definitions
  22. ;
  23. ;
  24.  
  25.  
  26. ;***************************************
  27. ;         VDMM Defines
  28. ;***************************************
  29.  
  30.  
  31. CURRENT_VDM    EQU    (0)
  32.  
  33. ;***    VDHAllocMem: flOptions
  34.  
  35. VDHAM_FIXED    EQU    00000h
  36. VDHAM_SWAPPABLE        EQU    00001h
  37.  
  38.  
  39.  
  40. ;***    VDHAllocPage: flOptions values
  41.  
  42. VDHAP_SPECIFIC    EQU    00001h
  43. VDHAP_SYSTEM    EQU    00002h
  44. VDHAP_FIXED    EQU    00004h
  45. VDHAP_SWAPPABLE        EQU    00000h
  46. VDHAP_PHYSICAL    EQU    00008h
  47.  
  48.  
  49.  
  50. ;***    VDHMapPages: flOptions values
  51.  
  52. VDHMT_INVALID    EQU    00001h
  53. VDHMT_LINEAR    EQU    00002h
  54. VDHMT_PHYSICAL    EQU    00003h
  55. VDHMT_BLACK_HOLE    EQU    00004h
  56.  
  57.  
  58. ;***    VDHInstallFaultHook: flOptions values
  59.  
  60. VDHIFH_ADDR    EQU    00001h
  61.  
  62.  
  63. ;***    VDHAllocMem Flags: flOptions Value
  64.  
  65. VDHCBP_SWAPPABLE    EQU    00001h
  66.  
  67.  
  68. ;***    VDHSetPriority: flClass values
  69.  
  70. VDHSP_NO_CHANGE        EQU    000000000h
  71. VDHSP_IDLE    EQU    000000001h
  72. VDHSP_REGULAR    EQU    000000002h
  73. VDHSP_TIME_CRITICAL    EQU    000000003h
  74. VDHSP_SERVER    EQU    000000004h
  75. VDHSP_SIMULATED_INTERRUPT    EQU    000000005h
  76.  
  77. VDHSP_CLASS_MASK    EQU    00000ffffh
  78. VDHSP_NUM_CLASSES    EQU    5
  79.  
  80. VDHSP_DEFAULT_ACTION    EQU    000000000h
  81. VDHSP_START_USE        EQU    000010000h
  82. VDHSP_CONTINUE_USE    EQU    000020000h
  83. VDHSP_END_USE    EQU    000030000h
  84.  
  85. VDHSP_ACTION_MASK    EQU    0ffff0000h
  86.  
  87.  
  88. ;***    VDHYield - flags
  89.  
  90. VDH_YIELD_TIME_CRITICAL        EQU    1
  91.  
  92.  
  93. ;***    VDHLockMem flags - flOptions
  94.  
  95. VDHLM_RESIDENT    EQU    00000h
  96. VDHLM_READ    EQU    00001h
  97. VDHLM_WRITE    EQU    00002h
  98. VDHLM_CONTIGUOUS    EQU    00004h
  99. VDHLM_NOBLOCK    EQU    00008h
  100. VDHLM_16M    EQU    00010h
  101. VDHLM_ALIGN    EQU    00020h
  102.  
  103. VDHLM_NO_ADDR    EQU    -1
  104.  
  105.  
  106. VDH_FAILURE    EQU    0
  107. VDH_SUCCESS    EQU    1
  108.  
  109. ;***    VDM States and VDD Exit defines
  110. ;
  111. ;   These are VDM states for which VDDs get notification. Few of them
  112. ;   like PDB_* are not truely VDM state changes but they are useful
  113. ;   events for which few VDDs may be intereseted. For arguments passed
  114. ;   and callable contexts see VDHInstallUserHook.
  115. ;
  116.  
  117. VDM_CREATE    EQU    0   ;A VDM is being created
  118. VDM_TERMINATE    EQU    1   ;A VDM is being terminated
  119. VDM_FOREGROUND    EQU    2   ;A VDM coming to foreground
  120. VDM_BACKGROUND    EQU    3   ;A VDM going to background
  121. VDD_EXIT    EQU    4   ;MVDM shutting down
  122. VDM_VDD_CREATE_DONE    EQU    5   ;Called Soon after VDM_CREATE
  123. VDM_PDB_DESTROY        EQU    6   ;A PDB destroyed in a VDM
  124. VDM_PDB_CHANGE    EQU    7   ;A new PDB is switched to
  125. VDM_CODEPAGE_CHANGE    EQU    8   ;A new code page is activated
  126. VDM_TITLE_CHANGE    EQU    9   ;VDM Title change event
  127. VDM_MEMORY_MAPPED_IN    EQU    10  ;Memory mapped in
  128. VDM_MEMORY_UN_MAPPED    EQU    11  ;Memory unmapped
  129. VDM_CREATE_DONE        EQU    12  ;VDM created successfully
  130. VDM_BEGIN_VPM_TASK    EQU    13  ;VPM task initially started
  131. VDM_END_VPM_TASK    EQU    14  ;VPM task terminated
  132.  
  133.  
  134. ;***    VDHPopup Flags
  135.  
  136. VDHP_FAIL    EQU    00001h
  137. VDHP_TERMINATE_SESSION    EQU    00002h
  138. VDHP_RETRY    EQU    00004h
  139. VDHP_IGNORE    EQU    00008h
  140.  
  141.  
  142. ;***    VDHOpen: ActionTaken Flags
  143.  
  144. VDHOPEN_FILE_EXISTED    EQU    00001h
  145. VDHOPEN_FILE_CREATED    EQU    00002h
  146. VDHOPEN_FILE_TRUNCATED    EQU    00003h
  147.  
  148.  
  149. ;***    VDHOpen: FileAttribute Flags
  150.  
  151. VDHOPEN_FILE_NORMAL    EQU    00000h
  152. VDHOPEN_FILE_READONLY    EQU    00001h
  153. VDHOPEN_FILE_HIDDEN    EQU    00002h
  154. VDHOPEN_FILE_SYSTEM    EQU    00004h
  155. VDHOPEN_FILE_DIRECTORY    EQU    00010h
  156. VDHOPEN_FILE_ARCHIVED    EQU    00020h
  157.  
  158.  
  159. ;***    VDHOpen: OpenFlag Flags
  160.  
  161. VDHOPEN_FILE_OPEN    EQU    00001h
  162. VDHOPEN_FILE_REPLACE    EQU    00002h
  163. VDHOPEN_FILE_CREATE    EQU    00010h
  164.  
  165. ;     this nibble applies if file already exists              xxxx
  166.  
  167. VDHOPEN_ACTION_FAIL_IF_EXISTS    EQU    00000h       ;---- ---- ---- 0000
  168. VDHOPEN_ACTION_OPEN_IF_EXISTS    EQU    00001h       ;---- ---- ---- 0001
  169. VDHOPEN_ACTION_REPLACE_IF_EXISTS    EQU    00002h       ;---- ---- ---- 0010
  170.  
  171. ;     this nibble applies if file does not exist         xxxx
  172.  
  173. VDHOPEN_ACTION_FAIL_IF_NEW    EQU    00000h       ;---- ---- 0000 ----
  174. VDHOPEN_ACTION_CREATE_IF_NEW    EQU    00010h       ;---- ---- 0001 ----
  175.  
  176.  
  177. ;***    VDHOpen: OpenMode Flags
  178.  
  179. VDHOPEN_ACCESS_READONLY        EQU    00000h       ;---- ---- ---- -000
  180. VDHOPEN_ACCESS_WRITEONLY    EQU    00001h       ;---- ---- ---- -001
  181. VDHOPEN_ACCESS_READWRITE    EQU    00002h       ;---- ---- ---- -010
  182. VDHOPEN_SHARE_DENYREADWRITE    EQU    00010h       ;---- ---- -001 ----
  183. VDHOPEN_SHARE_DENYWRITE        EQU    00020h       ;---- ---- -010 ----
  184. VDHOPEN_SHARE_DENYREAD    EQU    00030h       ;---- ---- -011 ----
  185. VDHOPEN_SHARE_DENYNONE    EQU    00040h       ;---- ---- -100 ----
  186. VDHOPEN_FLAGS_NOINHERIT        EQU    00080h       ;---- ---- 1--- ----
  187. VDHOPEN_FLAGS_NO_LOCALITY    EQU    00000h       ;---- -000 ---- ----
  188. VDHOPEN_FLAGS_SEQUENTIAL    EQU    00100h       ;---- -001 ---- ----
  189. VDHOPEN_FLAGS_RANDOM    EQU    00200h       ;---- -010 ---- ----
  190. VDHOPEN_FLAGS_RANDOMSEQUENTIAL    EQU    00300h       ;---- -011 ---- ----
  191. VDHOPEN_FLAGS_NO_CACHE    EQU    01000h       ;---1 ---- ---- ----
  192. VDHOPEN_FLAGS_FAIL_ON_ERROR    EQU    02000h       ;--1- ---- ---- ----
  193. VDHOPEN_FLAGS_WRITE_THROUGH    EQU    04000h       ;-1-- ---- ---- ----
  194. VDHOPEN_FLAGS_DASD    EQU    08000h       ;1--- ---- ---- ----
  195. VDHOPEN_FLAGS_NONSPOOLED    EQU    000040000h
  196.  
  197.  
  198. ;***    VDHSeek: ultype options
  199.  
  200. VDHSK_ABSOLUTE    EQU    0
  201. VDHSK_CURRENT_POSITION    EQU    1
  202. VDHSK_END_OF_FILE    EQU    2
  203.  
  204.  
  205. ;***    VDHPhysicalDisk: functions
  206.  
  207. VDHPHYD_GET_DISKS    EQU    1
  208. VDHPHYD_GET_HANDLE    EQU    2
  209. VDHPHYD_RELEASE_HANDLE    EQU    3
  210.  
  211.  
  212. ;***    VDHCreateSem Flags
  213.  
  214. VDH_EVENTSEM    EQU    00000h
  215. VDH_MUTEXSEM    EQU    00001h
  216.  
  217.  
  218. ;***    VDHArmTimerHook Flags
  219.  
  220. VDH_TIMER_INTERRUPT_HOOK    EQU    (1)
  221. VDH_TIMER_GLOBAL_CONTEXT    EQU    (-1)
  222.  
  223. ;***    VDHQuerySysValue ordinals
  224.  
  225. ; Global Values         Ordinal      Type   Units    Range
  226.  
  227. VDHGSV_DAY    EQU    0   ;ULONG  days       1 <= x <= 31
  228. VDHGSV_MONTH    EQU    1   ;ULONG  months     1 <= x <= 12
  229. VDHGSV_YEAR    EQU    2   ;ULONG  years   1980 <= x <= MAXULONG
  230. VDHGSV_DAYOFWEEK    EQU    3   ;ULONG  days       0 <= x <= 6
  231. VDHGSV_HOUR    EQU    4   ;ULONG  hours      0 <= x <     24
  232. VDHGSV_MINUTE    EQU    5   ;ULONG  minutes    0 <= x <     60
  233. VDHGSV_SECOND    EQU    6   ;ULONG  secs       0 <= x <     60
  234. VDHGSV_HUNDREDTH    EQU    7   ;ULONG  1/100s     0 <= x <     100
  235. VDHGSV_SECONDS1970    EQU    8   ;ULONG  secs       0 <= x <= MAXULONG
  236. VDHGSV_TIMEZONE        EQU    9   ;ULONG  minutes    0 <= x <= MAXULONG
  237. VDHGSV_MSECSBOOT    EQU    10   ;ULONG  ms        0 <= x <= MAXULONG
  238. VDHGSV_TIMERINTERVAL    EQU    11   ;ULONG  ms        0 <= x <= 1000
  239. VDHGSV_DYNVARIATION    EQU    12   ;BOOL        TRUE/FALSE
  240. VDHGSV_MAXWAIT    EQU    13   ;ULONG  secs    0 <= x <= MAXULONG
  241. VDHGSV_MINTIMESLICE    EQU    14   ;ULONG  ms        0 <= x <= MAXULONG
  242. VDHGSV_MAXTIMESLICE    EQU    15   ;ULONG  ms        0 <= x <= MAXULONG
  243. VDHGSV_YIELD    EQU    16   ;BOOL        TRUE/FALSE
  244. VDHGSV_TCYIELD    EQU    17   ;BOOL        TRUE/FALSE
  245. VDHGSV_VERMAJOR        EQU    18   ;ULONG        0 <= x <= MAXULONG
  246. VDHGSV_VERMINOR        EQU    19   ;ULONG        0 <= x <= MAXULONG
  247. VDHGSV_VERREVISION    EQU    20   ;CHAR        A <= x <= Z
  248. VDHGSV_MACHINETYPE    EQU    21   ;ULONG        MACHINE_TYPE_*
  249. VDHGSV_BLACKHOLEADDR    EQU    22   ;PVOID  bytes    0 <= x <= MAXULONG
  250. VDHGSV_BLACKHOLESIZE    EQU    23   ;ULONG  bytes    0 <= x <= MAXULONG
  251. VDHGSV_FGNDSESSIONID    EQU    24   ;ULONG        0 <= x <  MAXSESSIONS
  252. VDHGSV_MAXFPSESSIONS    EQU    25   ;ULONG           ;TO BE DELETED
  253. VDHGSV_MAXWPSESSIONS    EQU    26   ;ULONG           ;TO BE DELETED
  254. VDHGSV_MAXPMSESSIONS    EQU    27   ;ULONG           ;TO BE DELETED
  255. VDHGSV_RESERVESESSIONS    EQU    28   ;Reserved           ;TO BE DELETED
  256. VDHGSV_ARPLADDR        EQU    29   ;ULONG
  257. VDHGSV_MACHINEINFO    EQU    30   ;ULONG ptr to System Configuration Table
  258. VDHGSV_PPOSREGS        EQU    31   ;ULONG pointer to POS Regs structure
  259. VDHGSV_PICMASK    EQU    32   ;ULONG original PIC mask values   6.13
  260. VDHGSV_IRETADDR        EQU    33   ;ULONG address of IRET in ROM
  261. VDHGSV_BOOTDRV    EQU    34   ;ULONG           1=A:,2=B:,3=C:,etc.
  262. VDHGSV_MMIOADDR        EQU    35   ;ULONG mmio address
  263. VDHGSV_MECADDR    EQU    36   ;ULONG mec table address
  264. ; if you add a new entry, please update GSVMAX in src\dos\mvdm\vdmvdh.inc
  265.  
  266. ; Local Values         Ordinal      Type   Units    Range
  267.  
  268. VDHLSV_HVDM    EQU    4096   ;HVDM
  269. VDHLSV_PID    EQU    4097   ;PID
  270. VDHLSV_PCRF    EQU    4098   ;PCRF
  271. VDHLSV_SESSIONID    EQU    4099   ;ULONG          N <= x <  MAXSESSIONS
  272. VDHLSV_FOREGROUND    EQU    4100   ;BOOL          TRUE/FALSE
  273. VDHLSV_RMSIZE    EQU    4101   ;ULONG  kbytes      0 <  x <= 640
  274. VDHLSV_CODEPAGEID    EQU    4102   ;ULONG          See DosGetCP
  275. VDHLSV_PRIORITYCLASS    EQU    4103   ;ULONG          See VDHSetPriority
  276. VDHLSV_PRIORITYLEVEL    EQU    4104   ;ULONG          See VDHSetPriority
  277. VDHLSV_VPICBASE        EQU    4105   ;UCHAR[4]
  278.  
  279.  
  280. ;  Locations of base vectors in PIC base vector array returned from
  281. ;     VDHQuerySysValue
  282. ;
  283.  
  284. VPMMASTER_PORT_INDEX    EQU    0
  285. VPMSLAVE_PORT_INDEX    EQU    1
  286.  
  287.  
  288.  
  289. ;***    Return values for VDHGSV_MACHINETYPE
  290.  
  291. MACHINE_TYPE_AT        EQU    1
  292. MACHINE_TYPE_PS2    EQU    2
  293. MACHINE_TYPE_PARKCITY    EQU    3
  294.  
  295.  
  296. ;***    Timeout values for semaphore services
  297.  
  298. SEM_INDEFINITE_WAIT    EQU    -1
  299. SEM_IMMEDIATE_RETURN    EQU    0
  300.  
  301.  
  302. ;***    VDD-to_PDD commands (used internally during VDHOpenPDD)
  303.  
  304. PDDCMD_REGISTER        EQU    0   ;to register VDD entry point with PDD
  305. PDDCMD_DEREGISTER    EQU    1   ;To deregister a VDD at MVDM shutdown
  306.  
  307.  
  308. ;*** VDHDecodeProperty defines **
  309. VDH_DP_DECIMAL    EQU    10
  310. VDH_DP_HEX    EQU    16
  311.  
  312.  
  313. ;***************************************
  314. ;       VDMM Data Types
  315. ;***************************************
  316.  
  317.  
  318. ;***    MISC VDMM data types
  319. ;
  320. DefType HVDM,HANDLE
  321. DefType PHVDM,dd
  322. DefType HBLOCK,HANDLE            ;Block pool handle
  323. DefType HLOCK,ULONG            ;Memory lock handle
  324. DefType HVDD,ULONG            ;VDD Handle
  325. DefType PPSZ,dd            ;Pointer to PSZ
  326. DefType PHVDD,dd            ;VDD Handle Pointer
  327. DefType VDHSEM,ULONG            ;It should be VOID
  328. DefType HVDHSEM,dd            ;but vddvdh.inc has
  329. DefType PHVDHSEM,dd            ;problems with it
  330. DefType PFAULTHOOK,dd
  331. DefType PTIMERHOOK,dd
  332.  
  333.  
  334. ;***    HHOOK - hook handle
  335. ;
  336. ;    This is the handle return from the VDHAllocHook and used with
  337. ;    the VDHArm functions.
  338. ;
  339.  
  340. DefType HHOOK,PVOID            ;hook handle
  341. DefType PHHOOK,dd            ;pointer to hook handle
  342.  
  343.  
  344.  
  345. ;***    Pointer types for VDD-PDD communication and V86 address manipulation
  346. ;
  347.  
  348. FAR16    EQU    <NEAR>        ;(pseudo 16:16 modifier)
  349. DefType F16PVOID,dd            ;f16p (pseudo 16:16 pointer)
  350.  
  351. FARV86    EQU    <NEAR>        ;(pseudo-V86 modifier)
  352. DefType VPVOID,dd            ;vp (pseudo-V86 pointer)
  353. DefType PVPVOID,dd            ;pvp
  354.  
  355.  
  356.  
  357.  
  358. ;***    FNPDD - PDD function for "standard" VDD-to-PDD communication
  359. ;
  360. ;   ENTRY
  361. ;    ulFun - function code
  362. ;
  363. ;    ul1   - function-specific
  364. ;        if a pointer, it will generally be 16:16, and
  365. ;        will generally be an input buffer, the first
  366. ;        word of which is the length of the entire buffer
  367. ;
  368. ;    ul2   - function-specific
  369. ;        if a pointer, it will generally be 16:16, and
  370. ;        will generally be an output buffer, the first
  371. ;        word of which is the length of the entire buffer
  372. ;
  373. ;    if uFunc == PDDCMD_REGISTER (from VDM Manager during VDHOpenPDD)
  374. ;        ul1.off == VDD's CS
  375. ;        ul1.sel == zero
  376. ;        ul2.off == low 16-bits of EIP for VDD entry point
  377. ;        ul2.sel == high 16-bits of EIP for VDD entry point
  378. ;
  379. ;   EXIT
  380. ;    SUCCESS
  381. ;        !0
  382. ;    FAILURE
  383. ;         0 (the nature of the failure, such as an error code,
  384. ;        if needed, should be returned in the ul2 output buffer)
  385. ;
  386. ;   CALLING CONVENTIONS
  387. ;    32-bit PASCAL calling conventions.  More specifically:
  388. ;
  389. ;    Parameters are pushed on the stack from left to right, and are
  390. ;    removed by the callee.  The callee preserves EBX, ESI, EDI, EBP,
  391. ;    DS and ES.  Assuming the PDD function is completely 16-bit
  392. ;    (with the exception of any 16:32 calls back to the VDD, and the
  393. ;    16:32 RETFD to return to the VDD), the high words of all the
  394. ;    extended registers are preserved by virtue of being unused by the
  395. ;    PDD.  Therefore, only BX, SI, DI, BP, DS and ES need to be explicitly
  396. ;    preserved.
  397. ;
  398. ;    Furthermore, the PDD is responsible for loading its own DS.  To
  399. ;    do this, it must have a word in its code segment fixed-up to contain
  400. ;    its data segment selector.
  401. ;
  402. ;    The return code from the PDD must be in AX  0 implies failure,
  403. ;    whereas a non-zero (generally meaningful) value implies success.
  404. ;
  405.  
  406. DefType FPFNPDD,dq            ;fpfnpdd
  407.  
  408.  
  409. ;***    FNVDD - VDD function for "standard" PDD-to-VDD communication
  410. ;
  411. ;   ENTRY
  412. ;    ulFun - function code
  413. ;
  414. ;    ul1   - function-specific
  415. ;        if a pointer, it will generally be 16:16, and
  416. ;        will generally be an input buffer, the first
  417. ;        word of which is the length of the entire buffer
  418. ;
  419. ;    ul2   - function-specific
  420. ;        if a pointer, it will generally be 16:16, and
  421. ;        will generally be an output buffer, the first
  422. ;        word of which is the length of the entire buffer
  423. ;
  424. ;   EXIT
  425. ;    SUCCESS
  426. ;        !0
  427. ;    FAILURE
  428. ;         0 (the nature of the failure, such as an error code,
  429. ;        if needed, should be returned in the ul2 output buffer)
  430. ;
  431. ;   CALLING CONVENTIONS
  432. ;    32-bit PASCAL calling conventions.  More specifically:
  433. ;
  434. ;    Parameters are pushed on the stack from left to right, and are
  435. ;    removed by the callee.  The callee must preserve EBX, ESI, EDI, EBP,
  436. ;    DS and ES.
  437. ;
  438. ;    Furthermore, the VDD is responsible for loading its own DS and ES.
  439. ;    In C, this would be a "_loadds" function (or any function in a module
  440. ;    compiled with the Au rather than Aw option).
  441. ;
  442. ;    The return code from the VDD must be in AX  0 implies failure,
  443. ;    whereas a non-zero (generally meaningful) value implies success.
  444. ;
  445.  
  446. DefType FPFNVDD,dq            ;fpfnvdd
  447.  
  448.  
  449.  
  450. VDDREQ_PASS    EQU    -1
  451.  
  452. ;***    FNSYSREQ - DOS32RequestVDD VDD function-type
  453. ;
  454. ;   ENTRY
  455. ;    sgid  - screen group
  456. ;    ulFun - function code
  457. ;    nbIn  - Input buffer size, in bytes (0 if no input buffer)
  458. ;    pIn   - Input buffer
  459. ;    nbOut - Output buffer size, in bytes (0 if no output buffer)
  460. ;    pOut  - Output buffer
  461. ;   EXIT
  462. ;    SUCCESS
  463. ;        Zero
  464. ;    FAILURE
  465. ;        Error code, or -1 to pass control to next VDD
  466. ;
  467. ;   CALLING CONVENTIONS
  468. ;    32-bit small-model PASCAL calling conventions.  More specifically:
  469. ;
  470. ;    Parameters are pushed on the stack from left to right, and are
  471. ;    removed by the callee.  The callee will preserve EBX, ESI, EDI, EBP,
  472. ;    DS and ES.  DS is assumed to contain the callee's DGROUP selector
  473. ;    on entry.  EAX must be set to the return code on exit.
  474. ;
  475.  
  476. DefType PFNSYSREQ,dd
  477.  
  478.  
  479. ;***    FNDEVREQ - VDHRequestVDD VDD function-type
  480. ;
  481. ;   ENTRY
  482. ;    hvdm  - handle to vdm
  483. ;    ulFun - function code
  484. ;    ul1   - function-specific
  485. ;        if a pointer, it will generally be 0:32, and
  486. ;        will generally be an input buffer  if the size of the
  487. ;        buffer is not implied, the first dword of the buffer should
  488. ;        contain a total size
  489. ;    ul2   - function-specific
  490. ;        if a pointer, it will generally be 0:32, and
  491. ;        will generally be an output buffer  if the size of the
  492. ;        buffer is not implied, the first dword of the buffer should
  493. ;        contain a total size
  494. ;   EXIT
  495. ;    SUCCESS
  496. ;        Non-zero value (other than -1)
  497. ;    FAILURE
  498. ;        FALSE, or -1 to pass control to next VDD (in the first case,
  499. ;        the VDD should use VDHSetError to describe the error condition)
  500. ;
  501. ;   CALLING CONVENTIONS
  502. ;    32-bit small-model PASCAL calling conventions.  More specifically:
  503. ;
  504. ;    Parameters are pushed on the stack from left to right, and are
  505. ;    removed by the callee.  The callee will preserve EBX, ESI, EDI, EBP,
  506. ;    DS and ES.  DS is assumed to contain the callee's DGROUP selector
  507. ;    on entry.  EAX must be set to the return code on exit.
  508. ;
  509.  
  510. DefType PFNDEVREQ,dd
  511.  
  512.  
  513.  
  514. ;***    PFNVDHRP - VDD property function
  515. ;
  516. ;    This function performs property setting and validation.
  517. ;
  518. ;    The set operation may be requested at any time after a VDM is created.
  519. ;
  520. ;    The Validation operation may be requested at any time (even before
  521. ;    the a VDM is created.  Validation will be requested only for
  522. ;    VDMP_STRING and VDMP_MLSTR types, since all other types can be
  523. ;    validated using the information supplied by VDHRegisterProperty.
  524. ;
  525. ;    ENTRY op   = Operation to perform (enumeration)
  526. ;             VDHPROP_VALIDATE
  527. ;             Validate property for any process.  Only called
  528. ;             for VDMP_STRING and VDMP_MLSTR properties.
  529. ;             VDHPROP_SET
  530. ;             Set an already validated property for specified
  531. ;             HVDM.  The return code is ignored.
  532. ;          hvdm = Handle of VDM.  Undefined if op = VDHPROP_VALIDATE.
  533. ;          cb   = Count of bytes pointed to by pch.
  534. ;             Value depends upon proptype:
  535. ;               VDMPROP_BOOL
  536. ;              Undefined.
  537. ;               VDMPROP_INT
  538. ;              Undefined.
  539. ;               VDMPROP_ENUM
  540. ;              Length of ASCIIZ string, including NULL terminator.
  541. ;               VDMPROP_STRING
  542. ;              Length of ASCIIZ string, including NULL terminator.
  543. ;               VDMPROP_MLSTR
  544. ;              Length of ASCIIZ string, including NULL terminator.
  545. ;
  546. ;          pch  = Value to set/validate.
  547. ;             The format depends on the proptype:
  548. ;               VDMPROP_BOOL
  549. ;              pch is interpreted as a BOOL.
  550. ;              Value 0 is FALSE !0 is TRUE.
  551. ;               VDMPROP_INT
  552. ;              pch is interpreted as a ULONG. It is guaranteed
  553. ;              to meet the registered bounds.
  554. ;               VDMPROP_ENUM
  555. ;              pch points to an ASCIIZ string. It is guaranteed
  556. ;              to be one of the registered enumeration strings.
  557. ;               VDMPROP_STRING
  558. ;              pch points to an ASCIIZ string.  It is guaranteed
  559. ;              to be less than or equal to the registered maximum
  560. ;              string length.
  561. ;               VDMPROP_MLSTR
  562. ;              pch points to an ASCIIZ string.  Multiple lines
  563. ;              are separated by a line feed (00Ah).  It is
  564. ;              guaranteed to be less than or equal to the
  565. ;              registered maximum string length.
  566. ;
  567. ;
  568. ;    EXIT-SUCCESS
  569. ;        returns 0
  570. ;
  571. ;    EXIT-FAILURE
  572. ;        returns non-zero error code
  573. ;        ERROR_INVALID_DATA
  574. ;            This should be returned if the value is not valid.
  575. ;
  576. ;    CONTEXT
  577. ;        Task
  578. ;
  579.  
  580. DefType PFNVDHRP,dd
  581.  
  582.  
  583.  
  584. ;***    PENUMHOOK - VDD hooks for VDHEnumerateVDMs
  585. ;
  586. ;   ENTRY
  587. ;    hvdm  - VDM handle
  588. ;    ulData - Handler data
  589. ;
  590. ;   EXIT
  591. ;    SUCCESS
  592. ;        TRUE
  593. ;    FAILURE
  594. ;         FALSE
  595. ;
  596. ;   CALLING CONVENTIONS
  597. ;    32-bit small-model PASCAL calling conventions.  More specifically:
  598. ;
  599. ;    Parameters are pushed on the stack from left to right, and are
  600. ;    removed by the callee.  The callee will preserve EBX, ESI, EDI, EBP,
  601. ;    DS and ES.  DS is assumed to contain the callee's DGROUP selector
  602. ;    on entry.  EAX must be set to the return code on exit.
  603. ;
  604.  
  605. DefType PENUMHOOK,dd            ;penumh
  606.  
  607.  
  608.  
  609. ;***    USERHOOK - VDD user-event-hook function
  610. ;
  611. ;   ENTRY
  612. ;    hvdm  - VDM handle
  613. ;
  614. ;   EXIT
  615. ;    SUCCESS
  616. ;        !0
  617. ;    FAILURE
  618. ;         0 (failure is only support for the VDM_CREATE hook, and
  619. ;        implies that the VDD cannot support/sustain another VDM).
  620. ;
  621. ;   CALLING CONVENTIONS
  622. ;    32-bit small-model PASCAL calling conventions.  More specifically:
  623. ;
  624. ;    Parameters are pushed on the stack from left to right, and are
  625. ;    removed by the callee.  The callee will preserve EBX, ESI, EDI, EBP,
  626. ;    DS and ES.  DS is assumed to contain the callee's DGROUP selector
  627. ;    on entry.  EAX must be set to the return code on exit.
  628. ;
  629.  
  630. DefType PUSERHOOK,dd            ;puserh
  631.  
  632.  
  633. ; Definition for thread routine
  634. ;
  635. DefType PVDDTHREAD,dd
  636. DefType PVDDTID,PULONG
  637.  
  638.  
  639. ;***    VDHPAGELIST - structure to describe dis-contiguous physical ranges
  640. ;              for VDHLockMem
  641. ;
  642. ;    vdhpl_paddr - base physical address of one range
  643. ;    vdhpl_cb    - bytes contiguously mapped from vdhpl_paddr
  644. ;
  645. DefStruc ,VDHPageList_s            ;vdhpl
  646.     ULONG     vdhpl_paddr
  647.     ULONG     vdhpl_cb
  648. EndStruc VDHPAGELIST
  649. DefType PVDHPAGELIST,dd            ;pvdhpl
  650.  
  651.  
  652. ;***    VDHMAPTARGET - target area definition for VDHMapPages
  653. ;
  654. ;    vdhmt_laddr - Target address in V86-space (0 <= vdhmt_laddr < 1M+64K)
  655. ;              to be mapped.
  656. ;    vdhmt_cpg   - Count of pages to map
  657. ;    vdhmt_hmap  - Mapping handle
  658. ;
  659. DefStruc ,VDHMapTarget_s            ;vdhmt
  660.     ULONG     vdhmt_laddr  ;address in v86-space for mapping
  661.     ULONG     vdhmt_cpg       ;count of pages to map
  662.     ULONG     vdhmt_hmap   ;handle of mapping.  Must be zero on first call
  663.                 ;to VDHMapPages for region.
  664. EndStruc VDHMAPTARGET
  665. DefType PVDHMAPTARGET,dd            ;pvdhmt
  666.  
  667.  
  668.  
  669. ;***    VDHMAPSOURCE - source area definition for VDHMapPages
  670. ;
  671. ;    vdhms_laddr - Source address to be mapped.
  672. ;    vdhms_hobj  - Object handle.
  673. ;
  674. DefStruc ,VDHMapSource_s            ;vdhms
  675.     ULONG   vdhms_laddr       ;linear address of source memory object
  676.     ULONG   vdhms_hobj       ;memory object handle
  677. EndStruc VDHMAPSOURCE
  678. DefType PVDHMAPSOURCE,dd            ;pvdhms
  679.  
  680.  
  681.  
  682. ;***    VDHQuerySem: SemState structure
  683.  
  684. DefStruc ,VDHSemState_s
  685.     UCHAR    vss_SemType        ;VDH_EVENTSEM/VDH_MUTEXSEM
  686.     UCHAR    vss_fOwned        ;0 -> Not Owned; 1 -> Owned
  687.     USHORT    vss_fWaiter        ;0 -> No one waiting; 1 -> Waiting
  688.     USHORT    vss_cRequest        ;request count in mutex case
  689.     TID    vss_tid            ;tid of the owner if owned
  690. EndStruc VDHSEMSTATE
  691.  
  692. DefType PVDHSEMSTATE,dd
  693.  
  694.  
  695. ; Defines for POS Registers
  696. POS_MAX_SIZE    EQU    8     ;Count of POS registers
  697. POS_MAX_SLOT    EQU    8     ;Maximum number of slots in machine
  698. POS_CEN_ARB_REG        EQU    090h     ;Central Arbitration register
  699. POS_SEL_FDBK_REG    EQU    091h     ;Card Selected Feedback
  700. POS_SYS_CTRLA_REG    EQU    092h     ;System Control Port A
  701. POS_SYS_SETUP_REG    EQU    094h     ;System setup/enable register
  702. POS_ADP_SETUP_REG    EQU    096h     ;Adapter setup/enable register
  703. POS_BASE_REG    EQU    0100h      ;Base POS register
  704. POS_TOP_REG    EQU    0107h      ;Highest POS Register
  705. POS_NULLPORT    EQU    0FFh     ;null value for ports not active
  706. POS_CARDFEEDBACK    EQU    0FEh     ;pretend to send back card selected
  707. POS_PLANAR_SELECT    EQU    080h     ;port 94 bit value to select planar
  708. POS_VIDEO_SELECT    EQU    020h     ;port 94 bit value to select video
  709. POS_OPTION_SELECT    EQU    008h     ;port 96 bit value to select card
  710.  
  711. ; Structure for POS Registers
  712.  
  713. DefStruc ,_POS_s
  714.   _BYTE       aPOSReg,,POS_MAX_SIZE
  715. EndStruc POS_s
  716. DefType PPOS,dd
  717.  
  718. DefStruc ,_POSREGS
  719.   POS_s      VideoPOS               ;Video POS data
  720.   POS_s      PlanarPOS               ;Planar POS data
  721.   POS_s      SlotPOS,,POS_MAX_SLOT           ;Adapter POS data
  722.   _BYTE       Port90            ;Central Arbiter
  723.   _BYTE       Port92            ;System Control Port A
  724.   _BYTE       Port94            ;System setup/enable reg
  725.   _BYTE       Port96            ;Adapter setup/enable reg
  726. EndStruc POSREGS
  727. DefType PPOSREGS,dd
  728.  
  729. DefStruc ,_SYS_CONFIG_TABLE
  730.   USHORT  Reserve               ;Reserved
  731.   _BYTE       Model            ;Model byte
  732.   _BYTE       Submodel            ;Submodel byte
  733.   _BYTE       BIOS_revision        ;BIOS revision level
  734.   _BYTE       Reserve1            ;Reserved
  735.   _BYTE       Reserve2            ;Reserved
  736.   _BYTE       Reserve3            ;Reserved
  737.   _BYTE       Reserve4            ;Reserved
  738.   _BYTE       Reserve5            ;Reserved
  739. EndStruc SYS_CONFIG_TABLE
  740. DefType PSYS_CONFIG_TABLE,dd
  741.  
  742. ; VDD initialization routine prototype
  743.  
  744. EXPENTRY VDDInit        <PSZ>
  745.  
  746.  
  747. ;***************************************
  748. ;         VDMM Macros
  749. ;***************************************
  750.  
  751.  
  752. ;  Accessing VDM data:
  753. ;
  754. ;   If the context is the desired VDM, then the following works for
  755. ;   ROM BIOS data area access, using the dynamically-fixed-up-to-zero
  756. ;   VDMBase data structure:
  757. ;
  758. ;    VDMBase.rb_field = 0
  759. ;
  760. ;   For instance data, if you put all of it inside a structure, the instance
  761. ;   of which is VDMData, and create a type, PVDMDATA, that points to such a
  762. ;   structure, you can reference instance data like so:
  763. ;
  764. ;    VDMData.fFgnd = TRUE
  765. ;
  766. ;   And if you have a PVOID (p) created with PFROMVP or PFROMVADDR, use:
  767. ;
  768. ;    *(PBYTE)p = 0
  769. ;
  770. ;
  771. ;   If the context is NOT the desired VDM, then you have to use the
  772. ;   VDM's handle (hvdm).  For ROM BIOS data area access, use the "pVDMBase"
  773. ;   macro:
  774. ;
  775. ;    pVDMBase(hvdm)->rb_field = 0
  776. ;
  777. ;   For instance data, reference similarly with the "pVDMData" macro:
  778. ;
  779. ;    pVDMData(hvdm)->fFgnd = TRUE
  780. ;
  781. ;   And if you have a PVOID (p) created with PFROMVP or PFROMVADDR, you can
  782. ;   use the "pVDM" macro to convert the pointer to one that is valid for the
  783. ;   given VDM and of the given type:
  784. ;
  785. ;    *pVDM(hvdm,PBYTE,p) = 0
  786. ;
  787. ;   An alternative to "pVDMData" (but not preferred, because it is less
  788. ;   maintainable and overrides type-checking) if you don't want to put all
  789. ;   your instance data in a structure, is:
  790. ;
  791. ;    REFHVDM(hvdm,BOOL,VDMData.fFgnd) = TRUE
  792. ;
  793. ;   Note that for any *resident* instance data, the same guidelines apply
  794. ;   simply substitute VDMRESDATA for VDMDATA.
  795. ;
  796.  
  797.  
  798. ifdef VDHSTRICT
  799.       ASSERTTASK    macro
  800.           PCall VDHAssertTask
  801.           endm
  802.       ASSERTVDMTASK    macro
  803.           PCall VDHAssertVDMTask
  804.           endm
  805.       ASSERTTASKONLY    macro
  806.           PCall VDHAssertTaskOnly
  807.           endm
  808.       ASSERTVDMTASKONLY macro
  809.           PCall VDHAssertVDMTaskOnly
  810.           endm
  811.       ASSERTINITONLY    macro
  812.           PCall VDHAssertInitOnly
  813.           endm
  814.       CHECKHVDM        macro hvdm
  815.           PCall VDHCheckHVDM, hvdm
  816.           endm
  817. else
  818.       ASSERTTASK    macro
  819.             endm
  820.       ASSERTVDMTASK    macro
  821.             endm
  822.       ASSERTTASKONLY    macro
  823.             endm
  824.       ASSERTVDMTASKONLY macro
  825.             endm
  826.       ASSERTINITONLY    macro
  827.             endm
  828.       CHECKHVDM        macro hvdm
  829.             endm
  830. endif
  831.  
  832.  
  833. ;***************************************
  834. ;      VDMM Function Prototype
  835. ;***************************************
  836.  
  837.  
  838. ;     Memory Management Function Prototypes
  839.  
  840. VDHENTRY VDHAllocMem        <ULONG cb, ULONG flOptions>
  841. VDHENTRY VDHFreeMem        <PVOID>
  842. VDHENTRY VDHAllocDosMem        <ULONG cb>
  843. VDHENTRY VDHCreateBlockPool        <ULONG cbBlock, ULONG flOptions>
  844. VDHENTRY VDHAllocBlock        <HBLOCK>
  845. VDHENTRY VDHFreeBlock        <HBLOCK,PVOID>
  846. VDHENTRY VDHDestroyBlockPool        <HBLOCK>
  847. VDHENTRY VDHCopyMem        <PVOID,PVOID,ULONG>
  848. VDHENTRY VDHExchangeMem        <PVOID,PVOID,ULONG>
  849. VDHENTRY VDHLockMem        <PVOID,ULONG,ULONG,PVOID,PVOID>
  850. VDHENTRY VDHUnlockMem        <HLOCK>
  851. VDHENTRY VDHQuerySel        <PVOID>
  852. VDHENTRY VDHQueryLin        <F16PVOID>
  853. VDHENTRY VDHCreateSel        <PVOID,ULONG>
  854. VDHENTRY VDHDestroySel        <SEL>
  855. VDHENTRY VDHGetCodePageFont        <ULONG,ULONG,PPVOID>
  856. VDHENTRY VDHReleaseCodePageFont        <PVOID>
  857.  
  858. ;     Page Management Function Prototypes
  859.  
  860. VDHENTRY VDHAllocPages        <PVOID,ULONG,ULONG>
  861. VDHENTRY VDHReallocPages        <PVOID,ULONG,ULONG>
  862. VDHENTRY VDHFreePages        <PVOID>
  863. VDHENTRY VDHFindFreePages        <PVOID,PULONG>
  864. VDHENTRY VDHGetDirtyPageInfo        <HVDM,PVOID,ULONG>
  865. VDHENTRY VDHQueryFreePages        <VOID>
  866. VDHENTRY VDHReservePages        <PVOID,ULONG>
  867. VDHENTRY VDHUnreservePages        <PVOID,ULONG>
  868. VDHENTRY VDHMapPages        <PVDHMAPSOURCE,PVDHMAPTARGET,ULONG>
  869. VDHENTRY VDHInstallFaultHook        <HVDM,PVOID,ULONG,PFAULTHOOK,BOOL>
  870. VDHENTRY VDHRemoveFaultHook        <HVDM,PVOID,ULONG,PFAULTHOOK>
  871. VDHENTRY VDHAllocDMABuffer        <ULONG,BOOL,PULONG>
  872. VDHENTRY VDHFreeDMABuffer        <PVOID>
  873.  
  874.  
  875. ;     Inter-DD Communication Function Prototypes
  876.  
  877. VDHENTRY VDHOpenPDD        <PSZ,FPFNVDD>
  878. VDHENTRY VDHRegisterVDD        <PSZ,PFNSYSREQ,PFNDEVREQ>
  879. VDHENTRY VDHOpenVDD        <PSZ>
  880. VDHENTRY VDHCloseVDD        <HVDD>
  881. VDHENTRY VDHRequestVDD        <HVDD,HVDM,ULONG,PVOID,PVOID>
  882. VDHENTRY VDHGetError        <VOID>
  883. VDHENTRY VDHSetError        <ULONG>
  884. VDHENTRY VDHInstallUserHook        <ULONG,PUSERHOOK>
  885. VDHENTRY VDHEnumerateVDMs        <PENUMHOOK,ULONG>
  886. VDHENTRY VDHHandleFromSGID        <SGID>
  887. VDHENTRY VDHHandleFromPID        <PID>              ;TO BE DELETED
  888. VDHENTRY VDHQuerySysValue        <HVDM,ULONG>
  889. VDHENTRY VDHPutSysValue        <ULONG,ULONG>
  890. VDHENTRY VDHOpen        <PSZ,PHFILE,PULONG,ULONG,ULONG,ULONG,ULONG,PVOID>
  891. VDHENTRY VDHClose        <HFILE>
  892. VDHENTRY VDHRead        <HFILE,PVOID,ULONG>
  893. VDHENTRY VDHWrite        <HFILE,PVOID,ULONG>
  894. VDHENTRY VDHSeek        <HFILE,ULONG,ULONG>
  895. VDHENTRY VDHDevIOCtl        <HFILE,ULONG,ULONG,PVOID,ULONG,PULONG,PVOID,ULONG,PULONG>
  896. VDHENTRY VDHFSCtl        <PVOID,ULONG,PULONG,PVOID,ULONG,PULONG,ULONG,PSZ,HFILE,ULONG>
  897. VDHENTRY VDHPhysicalDisk        <ULONG,PULONG,ULONG,PULONG,ULONG>
  898.  
  899. ;     Semaphore Function Prototypes
  900.  
  901. VDHENTRY VDHCreateSem        <PHVDHSEM, ULONG>
  902. VDHENTRY VDHDestroySem        <HVDHSEM>
  903. VDHENTRY VDHQuerySem        <HVDHSEM,PVDHSEMSTATE>
  904. VDHENTRY VDHResetEventSem        <HVDHSEM>
  905. VDHENTRY VDHPostEventSem        <HVDHSEM>
  906. VDHENTRY VDHWaitEventSem        <HVDHSEM,ULONG>
  907. VDHENTRY VDHRequestMutexSem        <HVDHSEM,ULONG>
  908. VDHENTRY VDHReleaseMutexSem        <HVDHSEM>
  909.  
  910. ;     Timer Function Prototypes
  911.  
  912. VDHENTRY VDHArmTimerHook        <HHOOK,ULONG,HVDM>
  913. VDHENTRY VDHDisarmTimerHook        <HHOOK>
  914.  
  915. ;     Sound Function Prototypes
  916.  
  917. VDHENTRY VDHDevBeep        <ULONG, ULONG>
  918.  
  919. ;     Property Function Prototypes
  920.  
  921. VDHENTRY VDHRegisterProperty        <PSZ,PSZ,ULONG,VPTYPE,VPORD,ULONG,PVOID,PVOID,PFNVDHRP>
  922. VDHENTRY VDHQueryProperty        <PSZ>
  923. VDHENTRY VDHDecodeProperty        <PPSZ,PULONG,PULONG,ULONG>
  924.  
  925. ;     Process Control Function Prototypes
  926.  
  927. VDHENTRY VDHPopup        <PSZZ,ULONG,ULONG,PULONG,ULONG,PSZ>
  928. VDHENTRY VDHKillVDM        <HVDM>
  929. VDHENTRY VDHHaltSystem        <VOID>
  930. VDHENTRY VDHSetPriority        <HVDM,ULONG,LONG>        ;TO BE "FIXED"
  931. VDHENTRY VDHFreezeVDM        <HVDM>
  932. VDHENTRY VDHThawVDM        <HVDM>
  933. VDHENTRY VDHIsVDMFrozen        <HVDM>
  934. VDHENTRY VDHYield        <BOOL>
  935. VDHENTRY VDHCreateThread        <PVDDTID, PVDDTHREAD>
  936. VDHENTRY VDHExitThread        <ULONG>
  937.  
  938. ;     Perfview Prototypes
  939.  
  940. VDHENTRY VDHRegisterPerfCtrs        <PBYTE,PBYTE,ULONG>
  941.  
  942. ;     Miscellaneous Function Prototypes (for kernel debugging only)
  943.  
  944. VDHENTRY VDHAssertTask        <VOID>
  945. VDHENTRY VDHAssertVDMTask        <VOID>
  946. VDHENTRY VDHAssertTaskOnly        <VOID>
  947. VDHENTRY VDHAssertVDMTaskOnly        <VOID>
  948. VDHENTRY VDHAssertInitOnly        <VOID>
  949. VDHENTRY VDHCheckHVDM        <HVDM>
  950. CENTRY VDHPanic        <PCHAR, ...>
  951. VDHENTRY VDHSetTimer0        <ULONG>
  952.  
  953.  
  954. ;*** PANICXX - Issue a panic if condition XX is set
  955.  
  956. ;   ENTRY
  957. ;    msg    quoted error message
  958.  
  959. ;   EXAMPLES
  960. ;    PANIC  <"VPICSetVIRR: invalid handle %u">,<h>
  961.  
  962. ;     or
  963.  
  964. ;    IFDEF  VDDSTRICT
  965. ;    or     ebx,ebx
  966. ;    PANICZ <"em86ReflectInt: null pointer">
  967. ;    ENDIF
  968.  
  969.  
  970. ?PANIC    macro    cond,msg,args
  971.     local    l1,szMsg
  972.     ifndef    VDHPanic
  973.     DefCode IMPORT,GLOBAL,C
  974.     DefFn    VDHPanic
  975.     EndCode
  976.     endif
  977.     ifnb    <cond>
  978.     j&cond    short l1
  979.     endif
  980.     ?a substr <msg>,1,1
  981.     % ifidn <?a>,<">
  982.     DefData LOCAL,CONST,C
  983.     SZ    szMsg,<msg,0>
  984.     EndData
  985.     CallFn    VDHPanic,<FLAToffset szMsg>,args
  986.     else
  987.     CallFn    VDHPanic,<FLAToffset msg>,args
  988.     endif
  989.     ifnb    <cond>
  990. l1:
  991.     endif
  992.     endm
  993.  
  994. PANIC    equ    <?PANIC ,>
  995. PANICC    equ    <?PANIC nc,>
  996. PANICNC equ    <?PANIC c,>
  997. PANICZ    equ    <?PANIC nz,>
  998. PANICNZ equ    <?PANIC z,>
  999. PANICE    equ    <?PANIC ne,>
  1000. PANICNE equ    <?PANIC e,>
  1001. PANICB    equ    <?PANIC ae,>
  1002. PANICBE equ    <?PANIC a,>
  1003. PANICA    equ    <?PANIC be,>
  1004. PANICAE equ    <?PANIC b,>
  1005.  
  1006. ifdef  VDDDEBUG
  1007.  
  1008. CENTRY printf        <PCHAR, ...>
  1009.  
  1010.  
  1011. PRINTDEBUG macro msg,args
  1012.     local    szMsg
  1013.     ifndef    printf
  1014.     DefCode IMPORT,GLOBAL,C
  1015.     DefFn    printf
  1016.     EndCode
  1017.     endif
  1018.     ?a substr <msg>,1,1
  1019.     % ifidn <?a>,<">
  1020.     DefData LOCAL,CONST,C
  1021.     SZ    szMsg,<msg,0>
  1022.     EndData
  1023.     CallFn    printf,< <FLAToffset szMsg>,<args> >
  1024.     else
  1025.     CallFn    printf,< <FLAToffset msg>,<args> >
  1026.     endif
  1027.     endm
  1028.  
  1029. else
  1030.  
  1031.  
  1032. PRINTDEBUG macro msg
  1033.       endm
  1034.  
  1035. endif
  1036.