home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / tolkit45.zip / os2tk45 / inc / vdmm.inc < prev    next >
Text File  |  1999-04-30  |  30KB  |  1,038 lines

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