home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / warphead.zip / H / VDMM.H < prev    next >
Text File  |  1997-04-10  |  41KB  |  1,082 lines

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