home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / audiopdd.zip / wdevhelp.h < prev    next >
C/C++ Source or Header  |  1999-02-24  |  32KB  |  1,105 lines

  1. /* DEVHELP.H - DevHelp header file for Watcom-based device drivers
  2. */
  3.  
  4. // 24-Feb-99: added this
  5. // #define VMDHA_SELMAP            0x0400   /* me, see dude 09_95, 04_95 (align to 4K page) */
  6.  
  7. // 4-Feb-99: added return
  8. // ax=1 if already owned
  9. // for: USHORT DevHelp_SetIRQ(NPFN IRQHandler, USHORT IRQLevel, USHORT SharedFlag);
  10.  
  11. // 4-Feb-99: added return
  12. // ax=1 if not owner (based on ds)
  13. // for: USHORT DevHelp_UnSetIRQ(USHORT IRQLevel);
  14.  
  15. // seems that Watcom will use [ax bx] as ax=low word always, disregarding the order within []
  16. // so if I used [ax dx] is would still put high word in dx and low in ax (accounted for already
  17. // within here)
  18.  
  19. #ifndef DEVHELP_INCLUDED
  20. #define DEVHELP_INCLUDED
  21.  
  22. #ifdef __WATCOMC__ 
  23.  
  24. #ifndef OS2_INCLUDED
  25. #define INCL_NOPMAPI
  26. #include <os2.h>
  27. #endif
  28.  
  29. #ifdef __cplusplus
  30. extern "C" {
  31. #endif
  32.  
  33. typedef ULONG   LIN;               // 32-Bit Linear Addess
  34. typedef ULONG   __far *PLIN;       // 16:16 Ptr to a 32-Bit Linear Addess
  35.  
  36. typedef struct _PAGELIST {
  37.   ULONG    PhysAddr;
  38.   ULONG    Size;
  39. } PAGELIST, __near *NPPAGELIST, __far *PPAGELIST;
  40.  
  41. extern PFN Device_Help;
  42.  
  43. #define DEVHELP_CALL \
  44.    "call far [Device_Help]" \
  45.    "jc   error" \
  46.    "sub  ax,ax" \
  47.    "error:" \
  48.    value [ax]
  49.  
  50. USHORT DevHelp_ABIOSCall(USHORT Lid, NPBYTE ReqBlk, USHORT Entry_Type);
  51. #pragma aux DevHelp_ABIOSCall = \
  52.    "mov  dl,36h" \
  53.    DEVHELP_CALL \
  54.    parm caller [ax] [si] [dh] \
  55.    modify exact [ax dl];
  56.  
  57. USHORT DevHelp_ABIOSCommonEntry(NPBYTE ReqBlk, USHORT Entry_Type);
  58. #pragma aux DevHelp_ABIOSCommonEntry = \
  59.    "mov  dl,37h" \
  60.    DEVHELP_CALL \
  61.    parm caller [si] [dh] \
  62.    modify exact [ax dl];
  63.  
  64. USHORT DevHelp_AllocateCtxHook(NPFN HookHandler, PULONG HookHandle);
  65. #pragma aux DevHelp_AllocateCtxHook = \
  66.    "push bx" \
  67.    "movzx   eax,ax" \
  68.    "mov  ebx,-1" \
  69.    "mov  dl,63h" \
  70.    "call far [Device_Help]" \
  71.    "pop  bx" \
  72.    "jc   error" \
  73.    "mov  es:[bx],eax" \
  74.    "sub  ax,ax" \
  75.    "error:" \
  76.    value [ax] \
  77.    parm caller nomemory [ax] [es bx] \
  78.    modify exact [ax bx dl es];
  79.  
  80. // PSEL?  Isn't that just a near pointer?
  81. USHORT DevHelp_AllocGDTSelector(PSEL Selectors, USHORT Count);
  82. #pragma aux DevHelp_AllocGDTSelector = \
  83.    "mov  dl,2Dh" \
  84.    DEVHELP_CALL \
  85.    parm caller [es di] [cx] \
  86.    modify nomemory exact [ax dl];
  87.  
  88. #define MEMTYPE_ABOVE_1M   0
  89. #define MEMTYPE_BELOW_1M   1
  90.  
  91. USHORT DevHelp_AllocPhys(ULONG lSize, USHORT MemType, PULONG PhysAddr);
  92. #pragma aux DevHelp_AllocPhys = \
  93.    "xchg ax,bx" \
  94.    "mov  dl,18h" \
  95.    "call far [Device_Help]" \
  96.    "jc   error" \
  97.    "mov  es:[di],bx" \
  98.    "mov  es:[di+2],ax" \
  99.    "sub  ax,ax" \
  100.    "error:" \
  101.    value [ax] \
  102.    parm caller nomemory [ax bx] [dh] [es di] \
  103.    modify exact [ax bx dx];
  104.  
  105. #define WAIT_NOT_ALLOWED 0
  106. #define WAIT_IS_ALLOWED  1
  107.  
  108. USHORT DevHelp_AllocReqPacket(USHORT WaitFlag, PBYTE __far *ReqPktAddr);
  109. #pragma aux DevHelp_AllocReqPacket = \
  110.    "mov  dl,0Dh", \
  111.    "call far [Device_Help]" \
  112.    "jc   error" \
  113.    "push es" \
  114.    "push bx" \
  115.    "mov  bx,sp" \
  116.    "les  bx,ss:[bx]" \
  117.    "pop  es:[bx]" \
  118.    "pop  es:[bx+2]" \
  119.    "error:" \
  120.    "mov  ax,0" \
  121.    "sbb  ax,0" \
  122.    value [ax] \
  123.    parm caller [dh] [] \
  124.    modify exact [ax bx dl es];
  125.  
  126. USHORT DevHelp_ArmCtxHook(ULONG HookData, ULONG HookHandle);
  127. #pragma aux DevHelp_ArmCtxHook = \
  128.    "mov  bx,sp" \
  129.    "mov  dl,65h", \
  130.    "mov  eax,ss:[bx]" \
  131.    "mov  ecx,-1" \
  132.    "mov  ebx,ss:[bx+4]" \
  133.    DEVHELP_CALL \
  134.    parm caller nomemory [] \
  135.    modify nomemory exact [ax bx cx dl];
  136.  
  137. typedef struct _IDCTABLE {
  138.   USHORT   Reserved[3];
  139.   VOID     (__far *ProtIDCEntry) (VOID);
  140.   USHORT   ProtIDC_DS;
  141. } IDCTABLE, __near *NPIDCTABLE;
  142.  
  143. USHORT DevHelp_AttachDD(NPSZ DDName, NPBYTE DDTable);
  144. #pragma aux DevHelp_AttachDD = \
  145.    "mov  dl,2Ah" \
  146.    "call far [Device_Help]" \
  147.    "mov  ax,0" \
  148.    "sbb  ax,0" \
  149.    value [ax] \
  150.    parm caller [bx] [di] \
  151.    modify exact [ax dl];
  152.  
  153. USHORT DevHelp_Beep(USHORT Frequency, USHORT DurationMS);
  154. #pragma aux DevHelp_Beep = \
  155.    "mov  dl,52h" \
  156.    DEVHELP_CALL \
  157.    parm caller nomemory [bx] [cx] \
  158.    modify nomemory exact [ax dx];
  159.  
  160. USHORT DevHelp_CloseEventSem(ULONG hEvent);
  161. #pragma aux DevHelp_CloseEventSem = \
  162.    "movzx   esp,sp" \
  163.    "mov  dl,68h" \
  164.    "mov  eax,[esp]" \
  165.    DEVHELP_CALL \
  166.    parm caller nomemory [] \
  167.    modify nomemory exact [ax dl];
  168.  
  169. USHORT DevHelp_DeRegister(USHORT MonitorPID, USHORT MonitorHandle, PUSHORT MonitorsLeft);
  170. #pragma aux DevHelp_DeRegister = \
  171.    "mov  dl,21h" \
  172.    "call far [Device_Help]" \
  173.    "jc   error" \
  174.    "mov  es:[di],ax" \
  175.    "sub  ax,ax" \
  176.    "error:" \
  177.    value [ax] \
  178.    parm caller nomemory [bx] [ax] [es di] \
  179.    modify exact [ax dl];
  180.  
  181. USHORT DevHelp_DevDone(PBYTE ReqPktAddr);
  182. #pragma aux DevHelp_DevDone = \
  183.    "mov  dl,1" \
  184.    DEVHELP_CALL \
  185.    parm caller [es bx] \
  186.    modify exact [ax dl];
  187.  
  188. #define DYNAPI_CALLGATE16       0x0001   /* 16:16 CallGate     */
  189. #define DYNAPI_CALLGATE32       0x0000   /*  0:32 CallGate     */
  190.  
  191. #define DYNAPI_ROUTINE16        0x0002   /* 16:16 Routine Addr */
  192. #define DYNAPI_ROUTINE32        0x0000   /*  0:32 Routine Addr */
  193.  
  194. USHORT DevHelp_DynamicAPI(PVOID  RoutineAddress, USHORT ParmCount, USHORT Flags, PSEL CallGateSel);
  195. #pragma aux DevHelp_DynamicAPI = \
  196.    "mov  dl,6Ch" \
  197.    "xchg ax,bx" \
  198.    "call far [Device_Help]" \
  199.    "jc   error" \
  200.    "mov  es:[si],di" \
  201.    "sub  ax,ax" \
  202.    "error:" \
  203.    value [ax] \
  204.    parm caller [ax bx] [cx] [dh] [es si] \
  205.    modify exact [ax bx di dl];
  206.  
  207. USHORT DevHelp_EOI(USHORT IRQLevel);
  208. #pragma aux DevHelp_EOI = \
  209.    "mov  dl,31h" \
  210.    "call far [Device_Help]" \
  211.    "sub  ax,ax" \
  212.    value [ax] \
  213.    parm caller nomemory [al] \
  214.    modify nomemory exact [ax dl];
  215.  
  216. USHORT DevHelp_FreeCtxHook(ULONG HookHandle);
  217. #pragma aux DevHelp_FreeCtxHook = \
  218.    "movzx   esp,sp" \
  219.    "mov  dl,64h", \
  220.    "mov  eax,[esp]" \
  221.    DEVHELP_CALL \
  222.    parm caller nomemory [] \
  223.    modify nomemory exact [ax dl];
  224.  
  225. USHORT DevHelp_FreeGDTSelector(SEL Selector);
  226. #pragma aux DevHelp_FreeGDTSelector = \
  227.    "mov  dl,53h" \
  228.    DEVHELP_CALL \
  229.    parm caller nomemory [ax] \
  230.    modify nomemory exact [ax dl];
  231.  
  232. USHORT DevHelp_FreeLIDEntry(USHORT LIDNumber);
  233. #pragma aux DevHelp_FreeLIDEntry = \
  234.    "mov  dl,35h" \
  235.    DEVHELP_CALL \
  236.    parm caller nomemory [ax] \
  237.    modify nomemory exact [ax dl];
  238.  
  239. USHORT DevHelp_FreePhys(ULONG PhysAddr);
  240. #pragma aux DevHelp_FreePhys = \
  241.    "xchg ax,bx" \
  242.    "mov  dl,19h" \
  243.    "call far [Device_Help]" \
  244.    "mov  ax,0" \
  245.    "sbb  ax,0" \
  246.    value [ax] \
  247.    parm caller nomemory [ax bx] \
  248.    modify exact [ax bx dl];
  249.  
  250. USHORT DevHelp_FreeReqPacket(PBYTE ReqPktAddr);
  251. #pragma aux DevHelp_FreeReqPacket = \
  252.    "mov  dl,0Eh", \
  253.    "call far [Device_Help]" \
  254.    "sub  ax,ax" \
  255.    value [ax] \
  256.    parm caller [es bx] \
  257.    modify exact [ax dl];
  258.  
  259. typedef struct _SELDESCINFO {
  260.   UCHAR    Type;                        
  261.   UCHAR    Granularity;                 
  262.   LIN      BaseAddr;                    
  263.   ULONG    Limit;                       
  264. } SELDESCINFO, __far *PSELDESCINFO;  
  265.                                         
  266. typedef struct _GATEDESCINFO {         
  267.   UCHAR    Type;                        
  268.   UCHAR    ParmCount;                   
  269.   SEL      Selector;                    
  270.   USHORT   Reserved_1;                  
  271.   ULONG    Offset;                      
  272. } GATEDESCINFO, __far *PGATEDESCINFO;
  273.  
  274. USHORT DevHelp_GetDescInfo(SEL Selector, PBYTE SelInfo);
  275. #pragma aux DevHelp_GetDescInfo = \
  276.    "mov  dl,5Dh" \
  277.    "call far [Device_Help]" \
  278.    "jc   error" \
  279.    "mov  es:[bx],ax" \
  280.    "mov  es:[bx+2],ecx" \
  281.    "mov  es:[bx+6],edx" \
  282.    "sub  ax,ax" \
  283.    "error:" \
  284.    value [ax] \
  285.    parm caller nomemory [ax] [es bx] \
  286.    modify exact [ax cx dx];
  287.  
  288. USHORT DevHelp_GetDeviceBlock(USHORT Lid, PPVOID DeviceBlockPtr);
  289. #pragma aux DevHelp_GetDeviceBlock = \
  290.    "mov  dl,38h" \
  291.    "call far [Device_Help]" \
  292.    "jc   error" \
  293.    "mov  es:[si],dx" \
  294.    "mov  es:[si+2],cx" \
  295.    "sub  ax,ax" \
  296.    "error:" \
  297.    value [ax] \
  298.    parm caller nomemory [ax] [es si] \
  299.    modify exact [ax bx cx dx];
  300.  
  301. #define DHGETDOSV_SYSINFOSEG            1
  302. #define DHGETDOSV_LOCINFOSEG            2
  303. #define DHGETDOSV_VECTORSDF             4
  304. #define DHGETDOSV_VECTORREBOOT          5
  305. #define DHGETDOSV_YIELDFLAG             7                            /*@V76282*/
  306. #define DHGETDOSV_TCYIELDFLAG           8                            /*@V76282*/
  307. #define DHGETDOSV_DOSCODEPAGE           11                           /*@V76282*/
  308. #define DHGETDOSV_INTERRUPTLEV          13
  309. #define DHGETDOSV_DEVICECLASSTABLE      14                           /*@V76282*/
  310. #define DHGETDOSV_DMQSSELECTOR          15                           /*@V76282*/
  311. #define DHGETDOSV_APMINFO               16                           /*@V76282*/
  312.  
  313. USHORT DevHelp_GetDOSVar(USHORT VarNumber, USHORT VarMember, PPVOID KernalVar);
  314. #pragma aux DevHelp_GetDOSVar = \
  315.    "mov  dl,24h" \
  316.    "call far [Device_Help]" \
  317.    "mov  es:[di],bx" \
  318.    "mov  es:[di+2],ax" \
  319.    "sub  ax,ax" \
  320.    value [ax] \
  321.    parm caller nomemory [al] [cx] [es di] \
  322.    modify exact [ax bx dl];
  323.  
  324. USHORT DevHelp_GetLIDEntry(USHORT DeviceType, SHORT LIDIndex, USHORT Type, PUSHORT LID);
  325. #pragma aux DevHelp_GetLIDEntry = \
  326.    "mov  dl,34h" \
  327.    "call far [Device_Help]" \
  328.    "jc   error" \
  329.    "mov  es:[di],ax" \
  330.    "sub  ax,ax" \
  331.    "error:" \
  332.    value [ax] \
  333.    parm caller nomemory [al] [bl] [dh] [es di] \
  334.    modify exact [ax dl];
  335.  
  336. USHORT DevHelp_InternalError(PSZ MsgText, USHORT MsgLength );
  337. #pragma aux DevHelp_InternalError aborts = \
  338.    "push ds" \
  339.    "push es" \
  340.    "pop  ds" \
  341.    "pop  es" \
  342.    "mov  dl,2Bh" \
  343.    "jmp far es:[Device_Help]" \
  344.    parm [es si] [di] \
  345.    modify nomemory exact [];
  346.  
  347. USHORT DevHelp_LinToGDTSelector(SEL Selector, LIN LinearAddr, ULONG Size);
  348. #pragma aux DevHelp_LinToGDTSelector = \
  349.    "mov  bx,sp" \
  350.    "mov  dl,5Ch" \
  351.    "mov  ecx,ss:[bx+4]" \
  352.    "mov  ebx,ss:[bx]" \
  353.    "call far [Device_Help]" \
  354.    "jc   error" \
  355.    "sub  ax,ax" \
  356.    "error:" \
  357.    value [ax] \
  358.    parm caller nomemory [ax] [] \
  359.    modify nomemory exact [ax bx cx dl];
  360.  
  361. #define LOCKTYPE_SHORT_ANYMEM    0x00
  362. #define LOCKTYPE_LONG_ANYMEM     0x01
  363. #define LOCKTYPE_LONG_HIGHMEM    0x03
  364. #define LOCKTYPE_SHORT_VERIFY    0x04
  365.  
  366. USHORT DevHelp_Lock(SEL Segment, USHORT LockType, USHORT WaitFlag, PULONG LockHandle);
  367. #pragma aux DevHelp_Lock = \
  368.    "mov  dl,13h" \
  369.    "call far [Device_Help]" \
  370.    "jc   error" \
  371.    "mov  es:[di],bx" \
  372.    "mov  es:[di+2],ax" \
  373.    "sub  ax,ax" \
  374.    "error:" \
  375.    value [ax] \
  376.    parm caller [ax] [bh] [bl] [es di] \
  377.    modify exact [ax dl];
  378.  
  379. USHORT DevHelp_MonFlush(USHORT MonitorHandle);
  380. #pragma aux DevHelp_MonFlush = \
  381.    "mov  dl,23h" \
  382.    DEVHELP_CALL \
  383.    parm caller [ax] \
  384.    modify exact [ax dl];
  385.  
  386. USHORT DevHelp_MonitorCreate(USHORT MonitorHandle, PBYTE FinalBuffer, NPFN NotifyRtn, PUSHORT MonitorChainHandle);
  387. #pragma aux DevHelp_MonitorCreate = \
  388.    "mov  dl,1Fh" \
  389.    "call far [Device_Help]" \
  390.    "jc   error" \
  391.    "mov  si,[esp]" \
  392.    "mov  es,[esp+2]" \
  393.    "mov  es:[si],ax" \
  394.    "sub  ax,ax" \
  395.    "error:" \
  396.    value [ax] \
  397.    parm caller [ax] [es si] [di] [] \
  398.    modify exact [ax dl es si];
  399.  
  400. /* DevHelp_MonWrite has one change compared to the original specification.
  401.    The DataRecord parameter was originally a far (16:16) pointer.  It has 
  402.    been changed to a near pointer because DS must point to the default data
  403.    segment and therefore the DataRecord parameter must be near.  This 
  404.    allows the compiler to catch the error.
  405. */
  406.  
  407. USHORT DevHelp_MonWrite(USHORT MonitorHandle, NPBYTE DataRecord, USHORT Count, ULONG TimeStampMS, USHORT WaitFlag);
  408. #pragma aux DevHelp_MonWrite = \
  409.    "mov  dl,22h" \
  410.    DEVHELP_CALL \
  411.    parm caller [ax] [si] [cx] [di bx] [dh] \
  412.    modify exact [ax dl];
  413.  
  414. USHORT DevHelp_OpenEventSem(ULONG hEvent);
  415. #pragma aux DevHelp_OpenEventSem = \
  416.    "mov  eax,[esp]" \
  417.    "mov  dl,67h" \
  418.    DEVHELP_CALL \
  419.    parm caller nomemory [] \
  420.    modify nomemory exact [ax dl];
  421.  
  422. #define GDTSEL_R3CODE           0x0000                               /*@V76282*/
  423. #define GDTSEL_R3DATA           0x0001                               /*@V76282*/
  424. #define GDTSEL_R2CODE           0x0003                               /*@V76282*/
  425. #define GDTSEL_R2DATA           0x0004                               /*@V76282*/
  426. #define GDTSEL_R0CODE           0x0005                               /*@V76282*/
  427. #define GDTSEL_R0DATA           0x0006                               /*@V76282*/
  428.  
  429. /* GDTSEL_ADDR32 may be OR'd with above defines */                   /*@V76282*/
  430. #define GDTSEL_ADDR32           0x0080                               /*@V76282*/
  431.  
  432. USHORT DevHelp_PageListToGDTSelector(SEL Selector, ULONG Size, USHORT Access, LIN pPageList);
  433. #pragma aux DevHelp_PageListToGDTSelector = \
  434.    "mov  ecx,[esp]" \
  435.    "mov  dh,[esp+4]" \
  436.    "mov  edi,[esp+6]" \
  437.    "mov  dl,60h" \
  438.    "call far [Device_Help]" \
  439.    "jc   error" \
  440.    "sub  ax,ax" \
  441.    "error:" \
  442.    value [ax] \
  443.    parm caller [] \
  444.    modify nomemory exact [ax cx dx di];
  445.  
  446. USHORT DevHelp_PageListToLin(ULONG Size, LIN pPageList, PLIN LinearAddr);
  447. #pragma aux DevHelp_PageListToLin = \
  448.    "mov  ecx,[esp]" \
  449.    "mov  edi,[esp+4]" \
  450.    "mov  dl,5Fh" \
  451.    "call far [Device_Help]" \
  452.    "jc   error" \
  453.    "les  di,[esp+8]" \
  454.    "mov  es:[di],eax" \
  455.    "sub  ax,ax" \
  456.    "error:" \
  457.    value [ax] \
  458.    parm caller [] \
  459.    modify exact [ax cx dx di];
  460.  
  461. /* NOTE: After the DevHelp call, SI contains the modified selector. However, 
  462.    the C interface has no provisions for returning this value to the caller.
  463.    You can, however, use the _SI() inline function defined in include.h.
  464. */
  465.  
  466. USHORT DevHelp_PhysToGDTSel(ULONG PhysAddr, ULONG Count, SEL Selector, UCHAR Access);
  467. #pragma aux DevHelp_PhysToGDTSel = \
  468.    "push bp" \
  469.    "mov  dl,54h" \
  470.    "mov  bp,sp" \
  471.    "mov  eax,[bp+2]" \
  472.    "mov  ecx,[bp+6]" \
  473.    "mov  si,[bp+10]" \
  474.    "mov  dh,[bp+12]" \
  475.    "call far [Device_Help]" \
  476.    "jc   error" \
  477.    "sub  ax,ax" \
  478.    "error:" \
  479.    "pop  bp" \
  480.    value [ax] \
  481.    parm caller nomemory [] \
  482.    modify nomemory exact [ax cx dx si];
  483.  
  484. USHORT DevHelp_PhysToGDTSelector(ULONG PhysAddr, USHORT Count, SEL Selector);
  485. #pragma aux DevHelp_PhysToGDTSelector = \
  486.    "xchg ax,bx" \
  487.    "mov  dl,2Eh" \
  488.    DEVHELP_CALL \
  489.    parm nomemory [ax bx] [cx] [si] \
  490.    modify nomemory exact [ax bx dl];
  491.  
  492.  
  493. #define SELTYPE_R3CODE  0
  494. #define SELTYPE_R3DATA  1
  495. #define SELTYPE_FREE    2
  496. #define SELTYPE_R2CODE  3
  497. #define SELTYPE_R2DATA  4
  498. #define SELTYPE_R3VIDEO 5
  499.  
  500. USHORT DevHelp_PhysToUVirt(ULONG PhysAddr, USHORT Length, USHORT flags, USHORT TagType, PVOID SelOffset);
  501. #pragma aux DevHelp_PhysToUVirt = \
  502.    "xchg ax,bx" \
  503.    "mov  dl,17h" \
  504.    "call far [Device_Help]" \
  505.    "jc   error" \
  506.    "push es" \
  507.    "push bx" \
  508.    "mov  bx,sp" \
  509.    "les  bx,ss:[bx+4]" \
  510.    "pop  es:[bx]" \
  511.    "pop  es:[bx+2]" \
  512.    "sub  ax,ax" \
  513.    "error:" \
  514.    value [ax] \
  515.    parm caller nomemory [bx ax] [cx] [dh] [si] [] \
  516.    modify exact [ax bx dl es];
  517.  
  518. USHORT DevHelp_PhysToVirt(ULONG PhysAddr, USHORT usLength, PVOID SelOffset, PUSHORT ModeFlag);
  519. #pragma aux DevHelp_PhysToVirt = \
  520.    "xchg ax,bx" \
  521.    "mov  dx,15h" \
  522.    "push ds" \
  523.    "call far [Device_Help]" \
  524.    "jc   error" \
  525.    "sub  ax,ax" \
  526.    "mov  es:[di],si" \
  527.    "mov  es:[di+2],ds" \
  528.    "error:" \
  529.    "pop  ds" \
  530.    value [ax] \
  531.    parm caller nomemory [bx ax] [cx] [es di] [] \
  532.    modify exact [ax bx dx si];
  533.  
  534. USHORT DevHelp_PostEventSem(ULONG hEvent);
  535. #pragma aux DevHelp_PostEventSem = \
  536.    "mov  eax,[esp]" \
  537.    "mov  dl,69h" \
  538.    DEVHELP_CALL \
  539.    parm caller nomemory [] \
  540.    modify nomemory exact [ax dl];
  541.  
  542. #define WAIT_IS_INTERRUPTABLE      0
  543. #define WAIT_IS_NOT_INTERRUPTABLE  1
  544.  
  545. #define WAIT_INTERRUPTED           0x8003
  546. #define WAIT_TIMED_OUT             0x8001
  547.  
  548. USHORT DevHelp_ProcBlock(ULONG EventId, ULONG WaitTime, USHORT IntWaitFlag);
  549. #pragma aux DevHelp_ProcBlock = \
  550.    "mov  dl,4" \
  551.    "xchg ax,bx" \
  552.    "xchg cx,di" \
  553.    "call far [Device_Help]" \
  554.    "jc   error" \
  555.    "mov  ax,0"       /* doesn't affect zero flag like sub ax,ax does */ \
  556.    "error:" \
  557.    value [ax] \
  558.    parm caller nomemory [ax bx] [di cx] [dh] \
  559.    modify nomemory exact [ax bx cx dl di];
  560.  
  561. USHORT DevHelp_ProcRun(ULONG EventId, PUSHORT AwakeCount);
  562. #pragma aux DevHelp_ProcRun = \
  563.    "mov  dl,5" \
  564.    "xchg ax,bx" \
  565.    "call far [Device_Help]" \
  566.    "mov  es:[si],ax" \
  567.    "sub  ax,ax" \
  568.    value [ax] \
  569.    parm caller nomemory [ax bx] [es si] \
  570.    modify exact [ax bx dl];
  571.  
  572. USHORT DevHelp_PullParticular(NPBYTE Queue, PBYTE ReqPktAddr);
  573. #pragma aux DevHelp_PullParticular= \
  574.    "mov  dl,0Bh" \
  575.    DEVHELP_CALL \
  576.    parm [si] [es bx] \
  577.    modify exact [ax dl];
  578.  
  579. USHORT DevHelp_PullRequest(NPBYTE Queue, PBYTE __far *ReqPktAddr);
  580. #pragma aux DevHelp_PullRequest = \
  581.    "push es" \
  582.    "mov  dl,0Ah" \
  583.    "call far [Device_Help]" \
  584.    "jc   error" \
  585.    "movzx   esp,sp" \
  586.    "push es" \
  587.    "push bx" \
  588.    "mov  bx,sp" \
  589.    "les  bx,[esp]" \
  590.    "pop  es:[bx]" \
  591.    "pop  es:[bx+2]" \
  592.    "sub  ax,ax" \
  593.    "error:" \
  594.    value [ax] \
  595.    parm [si] [] \
  596.    modify exact [ax bx dl es];
  597.  
  598. USHORT DevHelp_PushRequest(NPBYTE Queue, PBYTE ReqPktddr);
  599. #pragma aux DevHelp_PushRequest = \
  600.    "mov  dl,09h" \
  601.    "call far [Device_Help]" \
  602.    "sub  ax,ax" \
  603.    value [ax] \
  604.    parm [si] [es bx] \
  605.    modify exact [ax dl];
  606.  
  607. USHORT DevHelp_QueueFlush(NPBYTE Queue);
  608. #pragma aux DevHelp_QueueFlush = \
  609.    "mov  dl,10h" \
  610.    "call far [Device_Help]" \
  611.    "sub  ax,ax" \
  612.    value [ax] \
  613.    parm [bx] \
  614.    modify exact [ax dl];
  615.  
  616. typedef struct _QUEUEHDR  {
  617.   USHORT   QSize;
  618.   USHORT   QChrOut;
  619.   USHORT   QCount;
  620.   BYTE     Queue[1];
  621. } QUEUEHDR, __far *PQUEUEHDR;
  622.  
  623. USHORT DevHelp_QueueInit(NPBYTE Queue);
  624. #pragma aux DevHelp_QueueInit = \
  625.    "mov  dl,0Fh" \
  626.    "call far [Device_Help]" \
  627.    "sub  ax,ax" \
  628.    value [ax] \
  629.    parm [bx] \
  630.    modify exact [ax dl];
  631.  
  632. USHORT DevHelp_QueueRead(NPBYTE Queue, PBYTE Char);
  633. #pragma aux DevHelp_QueueRead = \
  634.    "mov  dl,12h" \
  635.    "call far [Device_Help]" \
  636.    "jc   error" \
  637.    "mov  es:[di],al" \
  638.    "sub  ax,ax" \
  639.    "error:" \
  640.    value [ax] \
  641.    parm [bx] [es di] \
  642.    modify exact [ax dl];
  643.  
  644. USHORT DevHelp_QueueWrite(NPBYTE Queue, UCHAR Char);
  645. #pragma aux DevHelp_QueueWrite = \
  646.    "mov  dl,11h" \
  647.    DEVHELP_CALL \
  648.    parm [bx] [al] \
  649.    modify exact [ax dl];
  650.  
  651. USHORT DevHelp_RAS(USHORT Major, USHORT Minor, USHORT Size, PBYTE Data);
  652. #pragma aux DevHelp_RAS = \
  653.    "push ds" \
  654.    "push es" \
  655.    "pop  ds" \
  656.    "pop  es" \
  657.    "mov  dl,28h" \
  658.    "call far es:[Device_Help]" \
  659.    "push es" \
  660.    "pop  ds" \
  661.    "mov  ax,0" \
  662.    "sbb  ax,0" \
  663.    value [ax] \
  664.    parm [ax] [cx] [bx] [es si] \
  665.    modify nomemory exact [ax dl es];
  666.  
  667. #define CHAIN_AT_TOP    0
  668. #define CHAIN_AT_BOTTOM 1
  669.  
  670. USHORT DevHelp_Register(USHORT MonitorHandle, USHORT MonitorPID, PBYTE InputBuffer, NPBYTE OutputBuffer, USHORT ChainFlag);
  671. #pragma aux DevHelp_Register = \
  672.    "mov  dl,20h" \
  673.    DEVHELP_CALL \
  674.    parm caller nomemory [ax] [cx] [es si] [di] [dh] \
  675.    modify nomemory exact [ax dl];
  676.  
  677. USHORT DevHelp_RegisterBeep(PFN BeepHandler);
  678. #pragma aux DevHelp_RegisterBeep = \
  679.    "mov  dl,51h" \
  680.    "call far [Device_Help]" \
  681.    "sub  ax,ax" \
  682.    value [ax] \
  683.    parm caller nomemory [cx di] \
  684.    modify nomemory exact [ax dl];
  685.  
  686. #define DEVICECLASS_ADDDM       1                                    /*@V74979*/
  687. #define DEVICECLASS_MOUSE       2                                    /*@V74979*/
  688.  
  689. USHORT DevHelp_RegisterDeviceClass(NPSZ DeviceString, PFN DriverEP, USHORT DeviceFlags, USHORT DeviceClass, PUSHORT DeviceHandle);
  690. #pragma aux DevHelp_RegisterDeviceClass = \
  691.    "mov  dl,43h" \
  692.    "xchg ax,bx" \
  693.    "call far [Device_Help]" \
  694.    "jc   error" \
  695.    "les  bx,[esp]" \
  696.    "mov  es:[bx],ax" \
  697.    "sub  ax,ax" \
  698.    "error:" \
  699.    value [ax] \
  700.    parm [si] [ax bx] [di] [cx] [] \
  701.    modify exact [ax bx dl es];
  702.  
  703. USHORT DevHelp_RegisterPDD(NPSZ PhysDevName, PFN HandlerRoutine);
  704. #pragma aux DevHelp_RegisterPDD = \
  705.    "mov  dl,50h" \
  706.    DEVHELP_CALL \
  707.    parm caller [si] [es di] \
  708.    modify nomemory exact [ax dl];
  709.  
  710. typedef struct _STACKUSAGEDATA {
  711.    USHORT Size;
  712.    USHORT Flags;
  713.    USHORT IRQLevel;
  714.    USHORT CLIStack;
  715.    USHORT STIStack;
  716.    USHORT EOIStack;
  717.    USHORT NestingLevel;
  718. } STACKUSAGEDATA;
  719.  
  720. USHORT DevHelp_RegisterStackUsage(PVOID StackUsageData);
  721. #pragma aux DevHelp_RegisterStackUsage = \
  722.    "mov  dl,3Ah" \
  723.    "call far [Device_Help]" \
  724.    "mov  ax,0" \
  725.    "sbb  ax,0" \
  726.    value [ax] \
  727.    parm caller [bx] \
  728.    modify nomemory exact [ax dl];
  729.  
  730. USHORT DevHelp_RegisterTmrDD(NPFN TimerEntry, PULONG TmrRollover, PULONG Tmr);
  731. #pragma aux DevHelp_RegisterTmrDD = \
  732.    "mov  dl,61h" \
  733.    "call far [Device_Help]" \
  734.    "mov  ax,bx" \
  735.    "les  bx,[esp]" \
  736.    "mov  es:[bx],ax" \
  737.    "mov  es:[bx+2],di" \
  738.    "les  bx,[esp+4]" \
  739.    "mov  es:[bx],cx" \
  740.    "mov  es:[bx+2],di" \
  741.    "sub  ax,ax" \
  742.    value [ax] \
  743.    parm caller nomemory [di] [] \
  744.    modify exact [ax bx cx di dl es];
  745.  
  746. USHORT DevHlp_ResetEventSem(ULONG hEvent, PULONG pNumPosts);
  747. #pragma aux DevHelp_ResetEventSem = \
  748.    "mov  eax,[esp]" \
  749.    "mov  edi,[esp+4]" \
  750.    "mov  dl,6Ah" \
  751.    DEVHELP_CALL \
  752.    parm caller nomemory [] \
  753.    modify exact [ax di dl];
  754.  
  755. USHORT DevHelp_ResetTimer(NPFN TimerHandler);
  756. #pragma aux DevHelp_ResetTimer = \
  757.    "mov  dl,1Eh" \
  758.    DEVHELP_CALL \
  759.    parm caller nomemory [ax] \
  760.    modify nomemory exact [ax dl];
  761.  
  762. typedef struct _MSGTABLE {
  763.   USHORT   MsgId;                       /* Message Id #                  */
  764.   USHORT   cMsgStrings;                 /* # of (%) substitution strings */
  765.   PSZ      MsgStrings[1];               /* Substitution string pointers  */
  766. } MSGTABLE, __near *NPMSGTABLE;
  767.  
  768. USHORT DevHelp_Save_Message(NPBYTE MsgTable);
  769. #pragma aux DevHelp_Save_Message = \
  770.    "sub  bx,bx" \
  771.    "mov  dl,3Dh" \
  772.    DEVHELP_CALL \
  773.    parm caller [si] \
  774.    modify nomemory exact [ax bx dl];
  775.  
  776. USHORT DevHelp_SchedClock(PFN NEAR *SchedRoutineAddr);
  777. #pragma aux DevHelp_SchedClock = \
  778.    "mov  dl,0h" \
  779.    "call far [Device_Help]" \
  780.    "sub  ax,ax" \
  781.    value [ax] \
  782.    parm caller [ax] \
  783.    modify nomemory exact [ax dl];
  784.  
  785. USHORT DevHelp_SemClear(ULONG SemHandle);
  786. #pragma aux DevHelp_SemClear = \
  787.    "xchg ax,bx" \
  788.    "mov  dl,7h" \
  789.    DEVHELP_CALL \
  790.    parm nomemory [ax bx] \
  791.    modify nomemory exact [ax bx dl];
  792.  
  793. #define SEMUSEFLAG_IN_USE       0
  794. #define SEMUSEFLAG_NOT_IN_USE   1
  795.  
  796. USHORT DevHelp_SemHandle(ULONG SemKey, USHORT SemUseFlag, PULONG SemHandle);
  797. #pragma aux DevHelp_SemHandle = \
  798.    "xchg ax,bx" \
  799.    "mov  dl,8h" \
  800.    "call far [Device_Help]" \
  801.    "jc   error" \
  802.    "mov  es:[si],bx" \
  803.    "mov  es:[si+2],ax" \
  804.    "sub  ax,ax" \
  805.    "error:" \
  806.    value [ax] \
  807.    parm nomemory [ax bx] [dh] [es si] \
  808.    modify exact [ax bx dl];
  809.  
  810. USHORT DevHelp_SemRequest(ULONG SemHandle, ULONG SemTimeout);
  811. #pragma aux DevHelp_SemRequest = \
  812.    "xchg ax,bx" \
  813.    "xchg di,cx" \
  814.    "mov  dl,06h" \
  815.    DEVHELP_CALL \
  816.    parm nomemory [ax bx] [cx di] \
  817.    modify nomemory exact [ax bx cx di dl];
  818.  
  819. #define EVENT_MOUSEHOTKEY   0
  820. #define EVENT_CTRLBREAK     1
  821. #define EVENT_CTRLC         2
  822. #define EVENT_CTRLNUMLOCK   3
  823. #define EVENT_CTRLPRTSC     4
  824. #define EVENT_SHIFTPRTSC    5
  825. #define EVENT_KBDHOTKEY     6
  826. #define EVENT_KBDREBOOT     7
  827.  
  828. USHORT DevHelp_SendEvent(USHORT EventType, USHORT Parm);
  829. #pragma aux DevHelp_SendEvent = \
  830.    "mov  dl,25h" \
  831.    "call far [Device_Help]" \
  832.    "mov  ax,0" \
  833.    "sbb  ax,0" \
  834.    value [ax] \
  835.    parm nomemory [ah] [bx] \
  836.    modify nomemory exact [ax dl];
  837.  
  838. // 4-Feb-99: added return
  839. // ax=1 if already owned
  840. USHORT DevHelp_SetIRQ(NPFN IRQHandler, USHORT IRQLevel, USHORT SharedFlag);
  841. #pragma aux DevHelp_SetIRQ = \
  842.    "mov  dl,1Bh" \
  843.    DEVHELP_CALL \
  844.    parm caller nomemory [ax] [bx] [dh] \
  845.    modify nomemory exact [ax dl];
  846.  
  847. USHORT DevHelp_SetTimer(NPFN TimerHandler);
  848. #pragma aux DevHelp_SetTimer = \
  849.    "mov  dl,1Dh" \
  850.    DEVHELP_CALL \
  851.    parm caller nomemory [ax] \
  852.    modify nomemory exact [ax dl];
  853.  
  854. USHORT DevHelp_SortRequest(NPBYTE Queue, PBYTE ReqPktAddr);
  855. #pragma aux DevHelp_SortRequest = \
  856.    "mov  dl,0Ch" \
  857.    "call far [Device_Help]" \
  858.    "sub  ax,ax" \
  859.    value [ax] \
  860.    parm [si] [es bx] \
  861.    modify exact [ax dl];
  862.  
  863. USHORT DevHelp_TCYield(void);
  864. #pragma aux DevHelp_TCYield = \
  865.    "mov  dl,3" \
  866.    "call far [Device_Help]" \
  867.    "sub  ax,ax" \
  868.    value [ax] \
  869.    parm caller nomemory [] \
  870.    modify nomemory exact [ax dl];
  871.  
  872. USHORT DevHelp_TickCount(NPFN TimerHandler, USHORT TickCount);
  873. #pragma aux DevHelp_TickCount = \
  874.    "mov  dl,33h" \
  875.    DEVHELP_CALL \
  876.    parm caller nomemory [ax] [bx] \
  877.    modify nomemory exact [ax dl];
  878.  
  879. USHORT DevHelp_UnLock(ULONG LockHandle);
  880. #pragma aux DevHelp_UnLock = \
  881.    "xchg ax,bx" \
  882.    "mov  dl,14h" \
  883.    DEVHELP_CALL \
  884.    parm nomemory [ax bx] \
  885.    modify nomemory exact [ax bx dl];
  886.  
  887. // 4-Feb-99: added return
  888. // ax=1 if not owner (based on ds)
  889. USHORT DevHelp_UnSetIRQ(USHORT IRQLevel);
  890. #pragma aux DevHelp_UnSetIRQ = \
  891.    "mov  dl,1Ch" \
  892.    DEVHELP_CALL \
  893.    parm caller nomemory [bx] \
  894.    modify nomemory exact [ax dl];
  895.  
  896. #define VERIFY_READONLY    0
  897. #define VERIFY_READWRITE   1
  898.  
  899. USHORT DevHelp_VerifyAccess(SEL MemSelector, USHORT Length, USHORT MemOffset, UCHAR AccessFlag);
  900. #pragma aux DevHelp_VerifyAccess = \
  901.    "mov  dl,27h" \
  902.    DEVHELP_CALL \
  903.    parm caller nomemory [ax] [cx] [di] [dh] \
  904.    modify nomemory exact [ax dl];
  905.  
  906. #define VIDEO_PAUSE_OFF            0
  907. #define VIDEO_PAUSE_ON             1
  908.  
  909. USHORT DevHelp_VideoPause(USHORT OnOff);
  910. #pragma aux DevHelp_VideoPause = \
  911.    "mov  dl,3Ch" \
  912.    "call far [Device_Help]" \
  913.    "mov  ax,0" \
  914.    "sbb  ax,0" \
  915.    value [ax] \
  916.    parm nomemory [al] \
  917.    modify nomemory exact [ax dl];
  918.  
  919. USHORT DevHelp_VirtToLin(SEL Selector, ULONG Offset, PLIN LinearAddr);
  920. #pragma aux DevHelp_VirtToLin = \
  921.    "movzx   esp,sp" \
  922.    "mov  esi,[esp]" \
  923.    "mov  dl,5bh" \
  924.    "call far [Device_Help]" \
  925.    "jc   error" \
  926.    "les  bx,[esp+4]" \
  927.    "mov  es:[bx],eax" \
  928.    "sub  ax,ax" \
  929.    "error:" \
  930.    value [ax] \
  931.    parm caller nomemory [ax] [] \
  932.    modify exact [ax si es bx dl];
  933.  
  934. USHORT DevHelp_VirtToPhys(PVOID SelOffset, PULONG PhysAddr);
  935. #pragma aux DevHelp_VirtToPhys = \
  936.    "push ds" \
  937.    "mov  dl,16h" \
  938.    "push es" \
  939.    "mov  si,ds" \
  940.    "mov  es,si" \
  941.    "mov  ds,bx" \
  942.    "mov  si,ax" \
  943.    "call far es:[Device_Help]" \
  944.    "pop  es" \
  945.    "mov  es:[di],bx" \
  946.    "mov  es:[di+2],ax" \
  947.    "pop  ds" \
  948.    "sub  ax,ax" \
  949.    value [ax] \
  950.    parm caller nomemory [ax bx] [es di] \
  951.    modify exact [ax bx dl es si];
  952.  
  953. #define VMDHA_16M               0x0001                               /*@V76282*/
  954. #define VMDHA_FIXED             0x0002                               /*@V76282*/
  955. #define VMDHA_SWAP              0x0004                               /*@V76282*/
  956. #define VMDHA_CONTIG            0x0008                               /*@V76282*/
  957. #define VMDHA_PHYS              0x0010                               /*@V76282*/
  958. #define VMDHA_PROCESS           0x0020                               /*@V76282*/
  959. #define VMDHA_SGSCONT           0x0040                               /*@V76282*/
  960. #define VMDHA_RESERVE           0x0100 /* if used, must be @ INIT */ /*@V76282*/
  961. #define VMDHA_SELMAP            0x0400 /* see above */
  962. #define VMDHA_USEHIGHMEM        0x0800                               /*@V76282*/
  963.  
  964. USHORT DevHelp_VMAlloc(ULONG Flags, ULONG Size, ULONG PhysAddr, PLIN LinearAddr, PPVOID SelOffset);
  965. #pragma aux DevHelp_VMAlloc = \
  966.    "movzx   esp,sp" \
  967.    "mov  eax,[esp]" \
  968.    "mov  ecx,[esp+4]" \
  969.    "mov  edi,[esp+8]" \
  970.    "mov  dl,57h" \
  971.    "call far [Device_Help]" \
  972.    "jc   error" \
  973.    "les  di,[esp+12]" \
  974.    "mov  es:[di],eax" \
  975.    "les  di,[esp+16]" \
  976.    "mov  es:[di],ecx" \
  977.    "sub  ax,ax" \
  978.    "error:" \
  979.    value [ax] \
  980.    parm caller nomemory [] \
  981.    modify exact [ax cx di dl es];
  982.  
  983. USHORT DevHelp_VMFree(LIN LinearAddr);
  984. #pragma aux DevHelp_VMFree = \
  985.    "movzx   esp,sp" \
  986.    "mov  dl,58h" \
  987.    "mov  eax,[esp]" \
  988.    DEVHELP_CALL \
  989.    parm caller nomemory [] \
  990.    modify nomemory exact [ax dl];
  991.  
  992. #define VMDHGP_WRITE            0x0001                               /*@V76282*/
  993. #define VMDHGP_SELMAP           0x0002                               /*@V76282*/
  994. #define VMDHGP_SGSCONTROL       0x0004                               /*@V76282*/
  995. #define VMDHGP_4MEG             0x0008                               /*@V76282*/
  996.  
  997. USHORT DevHelp_VMGlobalToProcess(ULONG Flags, LIN LinearAddr, ULONG Length, PLIN ProcessLinearAddr);
  998. #pragma aux DevHelp_VMGlobalToProcess = \
  999.    "mov  dl,5Ah" \
  1000.    "mov  eax,[esp]" \
  1001.    "mov  ebx,[esp+4]" \
  1002.    "mov  ecx,[esp+8]" \
  1003.    "call far [Device_Help]" \
  1004.    "jc   error" \
  1005.    "les  bx,[esp+12]" \
  1006.    "mov  es:[bx],eax" \
  1007.    "sub  ax,ax" \
  1008.    "error:" \
  1009.    value [ax] \
  1010.    parm caller nomemory [] \
  1011.    modify exact [ax bx cx dl es];
  1012.  
  1013. #define VMDHL_NOBLOCK           0x0001
  1014. #define VMDHL_CONTIGUOUS        0x0002
  1015. #define VMDHL_16M               0x0004
  1016. #define VMDHL_WRITE             0x0008
  1017. #define VMDHL_LONG              0x0010
  1018. #define VMDHL_VERIFY            0x0020
  1019.  
  1020. USHORT DevHelp_VMLock(ULONG Flags, LIN LinearAddr, ULONG Length, LIN pPagelist, LIN pLockHandle, PULONG PageListCount);
  1021. #pragma aux DevHelp_VMLock = \
  1022.    "mov  dl,55h" \
  1023.    "mov  eax,[esp]" \
  1024.    "mov  ebx,[esp+4]" \
  1025.    "mov  ecx,[esp+8]" \
  1026.    "mov  edi,[esp+12]" \
  1027.    "mov  esi,[esp+16]" \
  1028.    "call far [Device_Help]" \
  1029.    "jc   error" \
  1030.    "les  bx,[esp+20]" \
  1031.    "mov  es:[bx],eax" \
  1032.    "sub  ax,ax" \
  1033.    "error:" \
  1034.    value [ax] \
  1035.    parm caller nomemory [] \
  1036.    modify exact [ax bx cx dl si di es];
  1037.  
  1038. #define VMDHPG_READONLY         0x0000                               /*@V76282*/
  1039. #define VMDHPG_WRITE            0x0001                               /*@V76282*/
  1040.  
  1041. USHORT DevHelp_VMProcessToGlobal(ULONG Flags, LIN LinearAddr, ULONG Length, PLIN GlobalLinearAddr);
  1042. #pragma aux DevHelp_ProcessToGlobal = \
  1043.    "mov  dl,59h" \
  1044.    "mov  eax,[esp]" \
  1045.    "mov  ebx,[esp+4]" \
  1046.    "mov  ecx,[esp+8]" \
  1047.    "call far [Device_Help]" \
  1048.    "jc   error" \
  1049.    "les  bx,[esp+12]" \
  1050.    "mov  es:[bx],eax" \
  1051.    "sub  ax,ax" \
  1052.    "error:" \
  1053.    value [ax] \
  1054.    parm caller nomemory [] \
  1055.    modify exact [ax bx cx dl es];
  1056.  
  1057. #define VMDHS_DECOMMIT          0x0001                               /*@V76282*/
  1058. #define VMDHS_RESIDENT          0x0002                               /*@V76282*/
  1059. #define VMDHS_SWAP              0x0004                               /*@V76282*/
  1060.  
  1061. USHORT DevHelp_VMSetMem(LIN LinearAddr, ULONG Size, ULONG Flags);
  1062. #pragma aux DevHelp_VMSetMem = \
  1063.    "mov  dl,66h" \
  1064.    "mov  ebx,[esp]" \
  1065.    "mov  ecx,[esp+4]" \
  1066.    "mov  eax,[esp+8]" \
  1067.    DEVHELP_CALL \
  1068.    parm caller nomemory [] \
  1069.    modify nomemory exact [ax bx cx dl];
  1070.  
  1071. USHORT DevHelp_VMUnLock(LIN pLockHandle);
  1072. #pragma aux DevHelp_VMUnLock = \
  1073.    "mov  dl,56h" \
  1074.    "mov  esi,[esp]" \
  1075.    DEVHELP_CALL \
  1076.    parm caller [] \
  1077.    modify exact [ax si dl];
  1078.  
  1079. USHORT DevHelp_Yield(void);
  1080. #pragma aux DevHelp_Yield = \
  1081.    "mov  dl,2" \
  1082.    "call far [Device_Help]" \
  1083.    "sub  ax,ax" \
  1084.    value [ax] \
  1085.    parm caller nomemory [] \
  1086.    modify nomemory exact [ax dl];
  1087.  
  1088. /*
  1089. ** DevHlp Error Codes  (from ABERROR.INC)
  1090. */
  1091.  
  1092. #define MSG_MEMORY_ALLOCATION_FAILED    0x00
  1093. #define ERROR_LID_ALREADY_OWNED         0x01
  1094. #define ERROR_LID_DOES_NOT_EXIST        0x02
  1095. #define ERROR_ABIOS_NOT_PRESENT         0x03
  1096. #define ERROR_NOT_YOUR_LID              0x04
  1097. #define ERROR_INVALID_ENTRY_POINT       0x05
  1098.  
  1099. #ifdef __cplusplus
  1100. }
  1101. #endif
  1102.  
  1103. #endif
  1104. #endif
  1105.