home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / ddkx86v1.zip / DDKX86 / H / DHCALLS.H < prev    next >
Text File  |  1995-04-14  |  26KB  |  675 lines

  1. /*DDK*************************************************************************/
  2. /*                                                                           */
  3. /* COPYRIGHT    Copyright (C) 1995 IBM Corporation                           */
  4. /*                                                                           */
  5. /*    The following IBM OS/2 WARP source code is provided to you solely for  */
  6. /*    the purpose of assisting you in your development of OS/2 WARP device   */
  7. /*    drivers. You may use this code in accordance with the IBM License      */
  8. /*    Agreement provided in the IBM Device Driver Source Kit for OS/2. This  */
  9. /*    Copyright statement may not be removed.                                */
  10. /*                                                                           */
  11. /*****************************************************************************/
  12. /* SCCSID = %w% %e% */
  13. /**************************************************************************
  14.  *
  15.  * SOURCE FILE NAME =  DHCALLS.H
  16.  *
  17.  * DESCRIPTIVE NAME =  ADD/DM include file
  18.  *                     C Function Prototypes services in DHCALLS.LIB
  19.  *
  20.  *
  21.  * VERSION = V2.0
  22.  *
  23.  * DATE
  24.  *
  25.  * DESCRIPTION :
  26.  *
  27.  * Purpose:    DHCALLS.LIB provides a C-Callable interface to OS/2
  28.  *             Device Help (DevHelp) services.
  29.  *
  30.  *             DevHelp services provide memory/interrupt/semaphore
  31.  *             management services for ADDs and Device Managers.
  32.  *
  33.  *
  34.  * FUNCTIONS  :
  35.  *
  36.  *
  37.  *
  38.  * NOTES
  39.  *
  40.  *
  41.  * STRUCTURES
  42.  *
  43.  * EXTERNAL REFERENCES
  44.  *
  45.  *
  46.  *
  47.  * EXTERNAL FUNCTIONS
  48.  *
  49. */
  50.  
  51. /*
  52. ** DevHelp Library Calls
  53. */
  54.  
  55. typedef USHORT NEAR *NPUSHORT;
  56. typedef VOID   NEAR *NPVOID;
  57.  
  58.  
  59. /*
  60. ** ABIOS Related
  61. */
  62.  
  63. USHORT APIENTRY DevHelp_GetLIDEntry ( USHORT  DeviceType,
  64.                                       USHORT  LIDIndex,
  65.                                       USHORT  LIDType,
  66.                                       PUSHORT LID);
  67.  
  68. USHORT APIENTRY DevHelp_FreeLIDEntry( USHORT LIDNumber );
  69.  
  70. USHORT APIENTRY DevHelp_ABIOSCall( USHORT Lid,
  71.                                    NPBYTE ReqBlk,
  72.                                    USHORT Entry_Type );
  73.  
  74. USHORT APIENTRY DevHelp_ABIOSCommonEntry( NPBYTE ReqBlk,
  75.                                           USHORT Entry_Type );
  76.  
  77. USHORT APIENTRY DevHelp_ABIOSGetParms( USHORT Lid,
  78.                                        NPBYTE ParmsBlk);
  79.  
  80. USHORT APIENTRY DevHelp_GetDeviceBlock( USHORT Lid,
  81.                                         PPVOID DeviceBlockPtr );
  82.  
  83.  
  84. /*
  85. ** Memory Management
  86. */
  87.  
  88. USHORT APIENTRY DevHelp_AllocGDTSelector( PSEL   Selectors,
  89.                                           USHORT Count );
  90.  
  91. USHORT APIENTRY DevHelp_PhysToGDTSelector( ULONG  PhysAddr,
  92.                                            USHORT Count,
  93.                                            SEL    Selector );
  94.  
  95. USHORT APIENTRY DevHelp_PhysToGDTSel( ULONG PhysAddr,
  96.                                       ULONG Count,
  97.                                       SEL   Selector,
  98.                                       UCHAR Access );
  99.  
  100. USHORT APIENTRY DevHelp_AllocPhys( ULONG  lSize,
  101.                                    USHORT MemType,
  102.                                    PULONG PhysAddr);
  103.  
  104. USHORT APIENTRY DevHelp_PhysToUVirt( ULONG  PhysAddr,
  105.                                      USHORT Length,
  106.                                      USHORT Flags,
  107.                                      USHORT TagType,
  108.                                      PVOID  SelOffset);
  109.  
  110. USHORT APIENTRY DevHelp_PhysToVirt( ULONG   PhysAddr,
  111.                                     USHORT  usLength,
  112.                                     PVOID   SelOffset,
  113.                                     PUSHORT ModeFlag );
  114.  
  115. USHORT APIENTRY DevHelp_UnPhysToVirt( PUSHORT ModeFlag );
  116.  
  117. USHORT APIENTRY DevHelp_FreePhys( ULONG PhysAddr );
  118.  
  119. USHORT APIENTRY DevHelp_VirtToPhys( PVOID  SelOffset,
  120.                                     PULONG PhysAddr );
  121.  
  122. USHORT APIENTRY DevHelp_Lock( SEL    Segment,
  123.                               USHORT LockType,
  124.                               USHORT WaitFlag,
  125.                               PULONG LockHandle );
  126.  
  127. USHORT APIENTRY DevHelp_UnLock( ULONG LockHandle );
  128.  
  129. USHORT APIENTRY DevHelp_VerifyAccess( SEL    MemSelector,
  130.                                       USHORT Length,
  131.                                       USHORT MemOffset,
  132.                                       UCHAR  AccessFlag);
  133.  
  134. /* DevHelp_AllocPhys */
  135. #define MEMTYPE_ABOVE_1M 0
  136. #define MEMTYPE_BELOW_1M 1
  137.  
  138. /* DevHelp_Lock */
  139.  
  140. #define LOCKTYPE_SHORT_ANYMEM 0x00
  141. #define LOCKTYPE_LONG_ANYMEM  0x01
  142. #define LOCKTYPE_LONG_HIGHMEM 0x03
  143. #define LOCKTYPE_SHORT_VERIFY 0x04
  144.  
  145. /* DevHelp_PhysToUVirt */
  146.  
  147. #define SELTYPE_R3CODE  0
  148. #define SELTYPE_R3DATA  1
  149. #define SELTYPE_FREE    2
  150. #define SELTYPE_R2CODE  3
  151. #define SELTYPE_R2DATA  4
  152. #define SELTYPE_R3VIDEO 5
  153.  
  154.  
  155. /* DevHelp_VerifyAccess */
  156.  
  157. #define VERIFY_READONLY    0
  158. #define VERIFY_READWRITE   1
  159.  
  160. /*
  161. ** Request Packet Management
  162. */
  163.  
  164. USHORT APIENTRY DevHelp_AllocReqPacket( USHORT    WaitFlag,
  165.                                         PBYTE FAR *ReqPktAddr );
  166.  
  167. USHORT APIENTRY DevHelp_FreeReqPacket( PBYTE ReqPktAddr );
  168.  
  169. USHORT APIENTRY DevHelp_PullParticular( NPBYTE Queue,
  170.                                         PBYTE  ReqPktAddr );
  171.  
  172. USHORT APIENTRY DevHelp_PullRequest( NPBYTE    Queue,
  173.                                      PBYTE FAR *ReqPktAddr );
  174.  
  175. USHORT APIENTRY DevHelp_PushRequest( NPBYTE Queue,
  176.                                      PBYTE  ReqPktAddr );
  177.  
  178. USHORT APIENTRY DevHelp_SortRequest( NPBYTE Queue,
  179.                                      PBYTE  ReqPktAddr );
  180.  
  181.  
  182. /* DevHelp_AllocRequestPacket */
  183.  
  184. #define WAIT_NOT_ALLOWED 0
  185. #define WAIT_IS_ALLOWED  1
  186.  
  187. /*
  188. ** Character Queue Management
  189. */
  190.  
  191. USHORT APIENTRY DevHelp_QueueInit( NPBYTE Queue );
  192.  
  193. USHORT APIENTRY DevHelp_QueueRead( NPBYTE Queue,
  194.                                    PBYTE  Char );
  195.  
  196. USHORT APIENTRY DevHelp_QueueWrite( NPBYTE Queue,
  197.                                     UCHAR  Char );
  198.  
  199. USHORT APIENTRY DevHelp_QueueFlush( NPBYTE Queue );
  200.  
  201.  
  202. /* DevHelp_QueueInit */
  203.  
  204. typedef struct _QUEUEHDR  {             /* DHQH */
  205.  
  206.   USHORT   QSize;
  207.   USHORT   QChrOut;
  208.   USHORT   QCount;
  209.   BYTE     Queue[1];
  210. } QUEUEHDR;
  211.  
  212. typedef QUEUEHDR FAR *PQUEUEHDR;                                     /*@V76282*/
  213.  
  214.  
  215.  
  216. /*
  217. ** Inter-Device Driver Communications & Kernel Functions
  218. */
  219.  
  220. USHORT APIENTRY DevHelp_ProtToReal();
  221.  
  222. USHORT APIENTRY DevHelp_RealToProt();
  223.  
  224. USHORT APIENTRY DevHelp_InternalError( PSZ    MsgText,
  225.                                        USHORT MsgLength );
  226.  
  227. USHORT APIENTRY DevHelp_RAS( USHORT Major,
  228.                              USHORT Minor,
  229.                              USHORT Size,
  230.                              PBYTE Data);
  231.  
  232. USHORT APIENTRY DevHelp_RegisterPerfCtrs( NPBYTE pDataBlock,
  233.                                           NPBYTE pTextBlock,
  234.                                           USHORT Flags);
  235.  
  236. USHORT APIENTRY DevHelp_AttachDD( NPSZ   DDName,
  237.                                   NPBYTE IDCTable );
  238.  
  239. typedef struct _IDCTABLE {               /* DHID */                  /*@V85056*/
  240.                                                                      /*@V85056*/
  241.   USHORT        Reserved[3];                                         /*@V85056*/
  242.   VOID          (FAR *ProtIDCEntry)(VOID);                           /*@V85056*/
  243.   USHORT        ProtIDC_DS;                                          /*@V85056*/
  244.                                                                      /*@V85056*/
  245. } IDCTABLE;                                                          /*@V85056*/
  246.                                                                      /*@V85056*/
  247. typedef IDCTABLE NEAR *NPIDCTABLE;                                   /*@V85056*/
  248.  
  249.  
  250. USHORT APIENTRY DevHelp_GetDOSVar( USHORT VarNumber,
  251.                                    USHORT VarMember,
  252.                                    PPVOID KernelVar );
  253.  
  254. #define DHGETDOSV_SYSINFOSEG            1
  255. #define DHGETDOSV_LOCINFOSEG            2
  256. #define DHGETDOSV_VECTORSDF             4
  257. #define DHGETDOSV_VECTORREBOOT          5
  258. #define DHGETDOSV_YIELDFLAG             7                            /*@V76282*/
  259. #define DHGETDOSV_TCYIELDFLAG           8                            /*@V76282*/
  260. #define DHGETDOSV_DOSCODEPAGE           11                           /*@V76282*/
  261. #define DHGETDOSV_INTERRUPTLEV          13
  262. #define DHGETDOSV_DEVICECLASSTABLE      14                           /*@V76282*/
  263. #define DHGETDOSV_DMQSSELECTOR          15                           /*@V76282*/
  264. #define DHGETDOSV_APMINFO               16                           /*@V76282*/
  265.  
  266. USHORT APIENTRY DevHelp_Save_Message( NPBYTE MsgTable );
  267.  
  268. typedef struct _MSGTABLE {              /* DHMT */
  269.  
  270.   USHORT   MsgId;                       /* Message Id #                  */
  271.   USHORT   cMsgStrings;                 /* # of (%) substitution strings */
  272.   PSZ      MsgStrings[1];               /* Substitution string pointers  */
  273. } MSGTABLE;
  274.  
  275. typedef MSGTABLE NEAR *NPMSGTABLE;                                   /*@V76282*/
  276.  
  277. /*
  278. ** Interrupt/Thread Management
  279. */
  280.  
  281. USHORT APIENTRY DevHelp_RegisterStackUsage( PVOID StackUsageData );
  282.  
  283. USHORT APIENTRY DevHelp_SetIRQ( NPFN   IRQHandler,
  284.                                 USHORT IRQLevel,
  285.                                 USHORT SharedFlag );
  286.  
  287. USHORT APIENTRY DevHelp_UnSetIRQ( USHORT IRQLevel );
  288.  
  289. USHORT APIENTRY DevHelp_EOI( USHORT IRQLevel );
  290.  
  291. USHORT APIENTRY DevHelp_ProcBlock( ULONG  EventId,
  292.                                    ULONG  WaitTime,
  293.                                    USHORT IntWaitFlag );
  294.  
  295. USHORT APIENTRY DevHelp_ProcRun( ULONG   EventId,
  296.                                  PUSHORT AwakeCount);
  297.  
  298. USHORT APIENTRY DevHelp_DevDone( PBYTE ReqPktAddr );
  299.  
  300. USHORT APIENTRY DevHelp_TCYield();
  301.  
  302. USHORT APIENTRY DevHelp_Yield();
  303.  
  304. USHORT APIENTRY DevHelp_VideoPause( USHORT OnOff );
  305.  
  306. /* DevHelp_RegisterStackUsage */
  307.  
  308. typedef struct _STACKUSAGEDATA  {       /* DHRS */
  309.  
  310.   USHORT  Size;
  311.   USHORT  Flags;
  312.   USHORT  IRQLevel;
  313.   USHORT  CLIStack;
  314.   USHORT  STIStack;
  315.   USHORT  EOIStack;
  316.   USHORT  NestingLevel;
  317. } STACKUSAGEDATA;
  318.  
  319. /* DevHelp_Block */
  320.  
  321. #define WAIT_IS_INTERRUPTABLE      0
  322. #define WAIT_IS_NOT_INTERRUPTABLE  1
  323.  
  324. #define WAIT_INTERRUPTED           0x8003
  325. #define WAIT_TIMED_OUT             0x8001
  326.  
  327. /* DevHelp_VideoPause */
  328.  
  329. #define VIDEO_PAUSE_OFF            0
  330. #define VIDEO_PAUSE_ON             1
  331.  
  332.  
  333. /*
  334. ** Semaphore Management
  335. */
  336.  
  337. USHORT APIENTRY DevHelp_SemHandle( ULONG  SemKey,
  338.                                    USHORT SemUseFlag,
  339.                                    PULONG SemHandle );
  340.  
  341. USHORT APIENTRY DevHelp_SemClear( ULONG SemHandle );
  342.  
  343. USHORT APIENTRY DevHelp_SemRequest( ULONG SemHandle,
  344.                                     ULONG SemTimeout );
  345.  
  346. USHORT APIENTRY DevHelp_SendEvent( USHORT EventType,
  347.                                    USHORT Parm );
  348.  
  349. USHORT APIENTRY DevHelp_OpenEventSem( ULONG hEvent );
  350.  
  351. USHORT APIENTRY DevHelp_CloseEventSem( ULONG hEvent );
  352.  
  353. USHORT APIENTRY DevHelp_PostEventSem( ULONG hEvent );
  354.  
  355. USHORT APIENTRY DevHlp_ResetEventSem( ULONG hEvent,
  356.                                       PULONG pNumPosts );
  357.  
  358. /* DevHelp_SemHandle */
  359.  
  360. #define SEMUSEFLAG_IN_USE       0
  361. #define SEMUSEFLAG_NOT_IN_USE   1
  362.  
  363. /* DevHelp_SemHandle */
  364.  
  365. #define EVENT_MOUSEHOTKEY   0
  366. #define EVENT_CTRLBREAK     1
  367. #define EVENT_CTRLC         2
  368. #define EVENT_CTRLNUMLOCK   3
  369. #define EVENT_CTRLPRTSC     4
  370. #define EVENT_SHIFTPRTSC    5
  371. #define EVENT_KBDHOTKEY     6
  372. #define EVENT_KBDREBOOT     7
  373.  
  374. /*
  375. ** Timer Management
  376. */
  377.  
  378. USHORT APIENTRY DevHelp_ResetTimer( NPFN TimerHandler );
  379.  
  380. USHORT APIENTRY DevHelp_SchedClock( PFN NEAR *SchedRoutineAddr );    /*@V76282*/
  381.  
  382. USHORT APIENTRY DevHelp_SetTimer( NPFN TimerHandler );
  383.  
  384. USHORT APIENTRY DevHelp_TickCount( NPFN   TimerHandler,
  385.                                    USHORT TickCount );
  386.  
  387. USHORT APIENTRY DevHelp_RegisterTmrDD( NPFN   TimerEntry,            /*@V76282*/
  388.                                        PULONG TmrRollover,           /*@V76282*/
  389.                                        PULONG Tmr          );        /*@V76282*/
  390.  
  391.  
  392.  
  393. /*
  394. ** Real Mode Helpers
  395. */
  396.  
  397. USHORT APIENTRY DevHelp_ProtToReal();
  398.  
  399. USHORT APIENTRY DevHelp_RealToProt();
  400.  
  401. USHORT APIENTRY DevHelp_ROMCritSection( USHORT EnterExit);
  402.  
  403. USHORT APIENTRY DevHelp_SetROMVector( NPFN   IntHandler,
  404.                                       USHORT INTNum,
  405.                                       USHORT SaveDSLoc,
  406.                                       PULONG LastHeader );
  407.  
  408.  
  409.  
  410. /*
  411. ** Monitors
  412. */
  413.  
  414. USHORT APIENTRY DevHelp_MonFlush( USHORT MonitorHandle );
  415.  
  416. USHORT APIENTRY DevHelp_Register( USHORT MonitorHandle,
  417.                                   USHORT MonitorPID,
  418.                                   PBYTE  InputBuffer,
  419.                                   NPBYTE OutputBuffer,
  420.                                   USHORT ChainFlag );
  421.  
  422. USHORT APIENTRY DevHelp_MonitorCreate( USHORT  MonitorHandle,
  423.                                        PBYTE   FinalBuffer,
  424.                                        NPFN    NotifyRtn,
  425.                                        PUSHORT MonitorChainHandle);
  426.  
  427. USHORT APIENTRY DevHelp_DeRegister( USHORT  MonitorPID,              /*@V74979*/
  428.                                     USHORT  MonitorHandle,           /*@V74979*/
  429.                                     PUSHORT MonitorsLeft);
  430.  
  431. USHORT APIENTRY DevHelp_MonWrite( USHORT MonitorHandle,
  432.                                   PBYTE  DataRecord,
  433.                                   USHORT Count,
  434.                                   ULONG  TimeStampMS,                /*@V76282*/
  435.                                   USHORT WaitFlag );
  436.  
  437. /* DevHelp_Register */
  438.  
  439. #define CHAIN_AT_TOP    0
  440. #define CHAIN_AT_BOTTOM 1
  441.  
  442.  
  443.  
  444. /*
  445. ** OS/2 2.x Only
  446. **
  447. ** Note: These DeviceHelps are not available on OS/2 1.x systems
  448. **
  449. */
  450.  
  451. /*
  452. ** 32-Bit Memory Management
  453. */
  454.  
  455. typedef ULONG   LIN;                /* 32-Bit Linear Addess              */
  456. typedef ULONG   _far *PLIN;         /* 16:16 Ptr to 32-Bit Linear Addess */
  457.  
  458. USHORT APIENTRY DevHelp_VMLock( ULONG  Flags,
  459.                                 LIN    LinearAddr,
  460.                                 ULONG  Length,
  461.                                 LIN    pPagelist,
  462.                                 LIN    pLockHandle,
  463.                                 PULONG PageListCount );
  464.  
  465. USHORT APIENTRY DevHelp_VMUnLock( LIN pLockHandle );
  466.  
  467. USHORT APIENTRY DevHelp_VMAlloc( ULONG  Flags,
  468.                                  ULONG  Size,
  469.                                  ULONG  PhysAddr,
  470.                                  PLIN   LinearAddr,
  471.                                  PPVOID SelOffset );
  472.  
  473. USHORT APIENTRY DevHelp_VMFree( LIN LinearAddr );
  474.  
  475. USHORT APIENTRY DevHelp_VMProcessToGlobal( ULONG Flags,
  476.                                            LIN   LinearAddr,
  477.                                            ULONG Length,
  478.                                            PLIN  GlobalLinearAddr );
  479.  
  480. USHORT APIENTRY DevHelp_VMGlobalToProcess( ULONG Flags,
  481.                                            LIN   LinearAddr,
  482.                                            ULONG Length,
  483.                                            PLIN  ProcessLinearAddr );
  484.  
  485. USHORT APIENTRY DevHelp_VirtToLin( SEL   Selector,
  486.                                    ULONG Offset,
  487.                                    PLIN  LinearAddr );
  488.  
  489. USHORT APIENTRY DevHelp_LinToGDTSelector( SEL   Selector,
  490.                                           LIN   LinearAddr,
  491.                                           ULONG Size );
  492.  
  493. USHORT APIENTRY DevHelp_GetDescInfo( SEL Selector,
  494.                                      PBYTE SelInfo );
  495.  
  496. USHORT APIENTRY DevHelp_PageListToLin( ULONG Size,
  497.                                        LIN   pPageList,
  498.                                        PLIN  LinearAddr );
  499.  
  500. USHORT APIENTRY DevHelp_LinToPageList( LIN    LinearAddr,
  501.                                        ULONG  Size,
  502.                                        LIN    pPageList,
  503.                                        PULONG PageListCount );
  504.  
  505. USHORT APIENTRY DevHelp_PageListToGDTSelector( SEL    Selector,
  506.                                                ULONG  Size,
  507.                                                USHORT Access,
  508.                                                LIN    pPageList );
  509.  
  510. USHORT APIENTRY DevHelp_VMSetMem( LIN LinearAddr,                    /*@V74979*/
  511.                                   ULONG Size,                        /*@V74979*/
  512.                                   ULONG Flags );                     /*@V74979*/
  513.  
  514. USHORT APIENTRY DevHelp_FreeGDTSelector( SEL Selector );
  515.  
  516.  
  517. /* DevHelp_VMLock */
  518.  
  519. #define VMDHL_NOBLOCK           0x0001
  520. #define VMDHL_CONTIGUOUS        0x0002
  521. #define VMDHL_16M               0x0004
  522. #define VMDHL_WRITE             0x0008
  523. #define VMDHL_LONG              0x0010
  524. #define VMDHL_VERIFY            0x0020
  525.  
  526. /* DevHelp_VMAlloc */                                                /*@V76282*/
  527.                                                                      /*@V76282*/
  528. #define VMDHA_16M               0x0001                               /*@V76282*/
  529. #define VMDHA_FIXED             0x0002                               /*@V76282*/
  530. #define VMDHA_SWAP              0x0004                               /*@V76282*/
  531. #define VMDHA_CONTIG            0x0008                               /*@V76282*/
  532. #define VMDHA_PHYS              0x0010                               /*@V76282*/
  533. #define VMDHA_PROCESS           0x0020                               /*@V76282*/
  534. #define VMDHA_SGSCONT           0x0040                               /*@V76282*/
  535. #define VMDHA_RESERVE           0x0100                               /*@V76282*/
  536. #define VMDHA_USEHIGHMEM        0x0800                               /*@V76282*/
  537.  
  538. /* DevHelp_VMGlobalToProcess */                                      /*@V76282*/
  539.                                                                      /*@V76282*/
  540. #define VMDHGP_WRITE            0x0001                               /*@V76282*/
  541. #define VMDHGP_SELMAP           0x0002                               /*@V76282*/
  542. #define VMDHGP_SGSCONTROL       0x0004                               /*@V76282*/
  543. #define VMDHGP_4MEG             0x0008                               /*@V76282*/
  544.  
  545. /* DevHelp_VMProcessToGlobal */                                      /*@V76282*/
  546.                                                                      /*@V76282*/
  547. #define VMDHPG_READONLY         0x0000                               /*@V76282*/
  548. #define VMDHPG_WRITE            0x0001                               /*@V76282*/
  549.  
  550. /* DevHelp_GetDescInfo */                                            /*@V76282*/
  551.                                                                      /*@V76282*/
  552. typedef struct _SELDESCINFO {           /* DHSI */                   /*@V76282*/
  553.                                                                      /*@V76282*/
  554.   UCHAR    Type;                                                     /*@V76282*/
  555.   UCHAR    Granularity;                                              /*@V76282*/
  556.   LIN      BaseAddr;                                                 /*@V76282*/
  557.   ULONG    Limit;                                                    /*@V76282*/
  558.                                                                      /*@V76282*/
  559. } SELDESCINFO;                                                       /*@V76282*/
  560.                                                                      /*@V76282*/
  561. typedef SELDESCINFO FAR *PSELDESCINFO;                               /*@V76282*/
  562.                                                                      /*@V76282*/
  563. typedef struct _GATEDESCINFO {          /* DHGI */                   /*@V76282*/
  564.                                                                      /*@V76282*/
  565.   UCHAR    Type;                                                     /*@V76282*/
  566.   UCHAR    ParmCount;                                                /*@V76282*/
  567.   SEL      Selector;                                                 /*@V76282*/
  568.   USHORT   Reserved_1;                                               /*@V76282*/
  569.   ULONG    Offset;                                                   /*@V76282*/
  570.                                                                      /*@V76282*/
  571. } GATEDESCINFO;                                                      /*@V76282*/
  572.                                                                      /*@V76282*/
  573. typedef GATEDESCINFO FAR *PGATEDESCINFO;                             /*@V76282*/
  574.  
  575. /* DevHelp_PageListToGDTSelector */                                  /*@V76282*/
  576. /* DevHelp_PageListToGDTSel      */                                  /*@V76282*/
  577.                                                                      /*@V76282*/
  578. #define GDTSEL_R3CODE           0x0000                               /*@V76282*/
  579. #define GDTSEL_R3DATA           0x0001                               /*@V76282*/
  580. #define GDTSEL_R2CODE           0x0003                               /*@V76282*/
  581. #define GDTSEL_R2DATA           0x0004                               /*@V76282*/
  582. #define GDTSEL_R0CODE           0x0005                               /*@V76282*/
  583. #define GDTSEL_R0DATA           0x0006                               /*@V76282*/
  584.  
  585. /* GDTSEL_ADDR32 may be OR'd with above defines */                   /*@V76282*/
  586. #define GDTSEL_ADDR32           0x0080                               /*@V76282*/
  587.  
  588. /* DevHelp_VMSetMem */                                               /*@V76282*/
  589.                                                                      /*@V76282*/
  590. #define VMDHS_DECOMMIT          0x0001                               /*@V76282*/
  591. #define VMDHS_RESIDENT          0x0002                               /*@V76282*/
  592. #define VMDHS_SWAP              0x0004                               /*@V76282*/
  593.  
  594. /* PageList structure */                                             /*@V76282*/
  595.                                                                      /*@V76282*/
  596. typedef struct _PAGELIST {      /* DHPL */                           /*@V76282*/
  597.                                                                      /*@V76282*/
  598.   ULONG    PhysAddr;                                                 /*@V76282*/
  599.   ULONG    Size;                                                     /*@V76282*/
  600.                                                                      /*@V76282*/
  601. } PAGELIST;                                                          /*@V76282*/
  602.                                                                      /*@V76282*/
  603. typedef PAGELIST NEAR *NPPAGELIST;                                   /*@V76282*/
  604. typedef PAGELIST FAR  *PPAGELIST;                                    /*@V76282*/
  605.  
  606.  
  607. /*
  608. ** 32-Bit Context Hooks
  609. */
  610.  
  611. USHORT APIENTRY DevHelp_AllocateCtxHook( NPFN   HookHandler,
  612.                                          PULONG HookHandle );
  613.  
  614. USHORT APIENTRY DevHelp_FreeCtxHook( ULONG HookHandle );
  615.  
  616. USHORT APIENTRY DevHelp_ArmCtxHook( ULONG HookData,
  617.                                     ULONG HookHandle );
  618.  
  619.  
  620. /*
  621. ** Adapter Device Drivers / Device Managers
  622. */
  623.  
  624. USHORT APIENTRY DevHelp_RegisterDeviceClass( NPSZ    DeviceString,
  625.                                              PFN     DriverEP,
  626.                                              USHORT  DeviceFlags,
  627.                                              USHORT  DeviceClass,
  628.                                              PUSHORT DeviceHandle);
  629.  
  630. USHORT APIENTRY DevHelp_CreateInt13VDM( PBYTE VDMInt13CtrlBlk );
  631.  
  632. /* DevHelp_RegisterDeviceClass */                                    /*@V74979*/
  633.                                                                      /*@V74979*/
  634. #define DEVICECLASS_ADDDM       1                                    /*@V74979*/
  635. #define DEVICECLASS_MOUSE       2                                    /*@V74979*/
  636.  
  637. /*
  638. ** Miscellaneous
  639. */
  640.  
  641. USHORT APIENTRY DevHelp_RegisterBeep( PFN BeepHandler );             /*@V74979*/
  642.  
  643. USHORT APIENTRY DevHelp_Beep( USHORT Frequency,                      /*@V74979*/
  644.                               USHORT DurationMS );                   /*@V74979*/
  645.  
  646. USHORT APIENTRY DevHelp_RegisterPDD( NPSZ PhysDevName,
  647.                                      PFN  HandlerRoutine );
  648.  
  649. USHORT APIENTRY DevHelp_DynamicAPI( PVOID  RoutineAddress,           /*@V76282*/
  650.                                     USHORT ParmCount,                /*@V76282*/
  651.                                     USHORT Flags,                    /*@V76282*/
  652.                                     PSEL   CallGateSel );            /*@V76282*/
  653.                                                                      /*@V76282*/
  654.                                                                      /*@V76282*/
  655. /* DevHelp_DynamicAPI */                                             /*@V76282*/
  656. #define DYNAPI_CALLGATE16       0x0001   /* 16:16 CallGate     */    /*@V76282*/
  657. #define DYNAPI_CALLGATE32       0x0000   /*  0:32 CallGate     */    /*@V76282*/
  658.                                                                      /*@V76282*/
  659. #define DYNAPI_ROUTINE16        0x0002   /* 16:16 Routine Addr */    /*@V76282*/
  660. #define DYNAPI_ROUTINE32        0x0000   /*  0:32 Routine Addr */    /*@V76282*/
  661.  
  662.  
  663. /*
  664. ** DevHlp Error Codes  (from ABERROR.INC)
  665. */
  666.  
  667. #define MSG_MEMORY_ALLOCATION_FAILED    0x00
  668. #define ERROR_LID_ALREADY_OWNED         0x01
  669. #define ERROR_LID_DOES_NOT_EXIST        0x02
  670. #define ERROR_ABIOS_NOT_PRESENT         0x03
  671. #define ERROR_NOT_YOUR_LID              0x04
  672. #define ERROR_INVALID_ENTRY_POINT       0x05
  673.  
  674.  
  675.