home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / header45.zip / vpmxport.h < prev    next >
C/C++ Source or Header  |  1999-03-15  |  8KB  |  231 lines

  1. /***    VPMXPORT.H
  2.  *
  3.  *
  4.  *
  5.  *      Copyright (c) IBM Corporation 1993
  6.  *
  7.  *      All Rights Reserved
  8.  *
  9.  *      Title:
  10.  *
  11.  *      DPMI host per task data
  12.  *
  13.  *      Description:
  14.  *
  15.  *      Contains the vpm definitions
  16.  *
  17.  *      MODIFICATION HISTORY
  18.  *      --------------------
  19.  *      05/07/91 RCW  Changed all occurences of the single line comment
  20.  *                    notation to the standard notation to allow users to
  21.  *                    maintain ANSI compatibility.  This is in response to
  22.  *                    PTR B718526.  All future updates to this and all other
  23.  *                    header files should use the standard commenting format.
  24.  *
  25.  *      Gordon Kuo         02/24/96     149007
  26.  *      Add LDHD and PLDHD to link the list of DHD to enhance Extended
  27.  *      Exception Handle (DPMI 1.0 Subset)
  28.  *      Add VPMXCPT definitions
  29.  *
  30.  *     03-27-96 Gordon Kuo -- Fix Defect 149895
  31.  *        Add dhd_ppDosX address to switch VDPX puxtd when switch DPMI client
  32.  *
  33.  *
  34.  */
  35.  
  36. /* NOINC */
  37. #if __IBMC__ || __IBMCPP__
  38.    #pragma info( none )
  39.       #ifndef __CHKHDR__
  40.          #pragma info( none )
  41.       #endif
  42.    #pragma info( restore )
  43. #endif
  44. /* INC */
  45.  
  46. #ifndef __VPMXPORT__
  47. #define __VPMXPORT__
  48.  
  49.  
  50. #include <vpmx2.h>
  51.  
  52. /***ET+ DHD - DPMI host data block
  53.  *
  54.  *      This is the DPMI host data for a task.  The V86 mode
  55.  *      host data block allocated (in the V86 mode address space)
  56.  *      before the start protected mode execution call is used only
  57.  *      for the client V86 mode stack.  All other per dpmi task
  58.  *      data is kept in this structure as per dpmi program instance
  59.  *      data.  Note: there is one structure per dpmi start call in a VDM.
  60.  */
  61. typedef struct dhd_s {
  62.     struct dhd_s *dhd_pdhdParent;   /* pointer to parent program's DHD    */
  63.     USHORT dhd_segStack;            /* V86 stack segment (host data area) */
  64.     USHORT dhd_segEnviron;          /* V86 environment segment            */
  65.     USHORT dhd_segPDB;              /* V86 pdb segment                    */
  66.     SEL    dhd_selSS;               /* protect mode stack selector        */
  67.     SEL    dhd_selDS;               /* protect mode ds  selector          */
  68.     SEL    dhd_selCS;               /* protect mode cs  selector          */
  69.     SEL    dhd_selPDB;              /* protect mode pdb selector          */
  70.     SEL    dhd_selEnviron;          /* protect mode env selector          */
  71.     PVOID  dhd_pdpmData;            /* DPMI API layer per DPMI task data  */
  72.     PVOID  dhd_pvpmData;            /* em86 per DPMI task data            */
  73.     PVOID  dhd_pDosX;               /* DOS API extension area             */
  74.     PVOID  dhd_laddrLDT;            /* LDT linear address                 */
  75.     SEL    dhd_selvpmbp;            /* protect mode vpm breakpoint sel    */
  76.     ULONG  DHD_sig;                 /* assertion checking                 */
  77.     PVOID  dhd_ppDosX;              /* pointer of puxtd (DOS API extension area) */
  78.                                /* 149895   */
  79. } DHD;
  80.  
  81. #define DHD_SIGNATURE                   0x20444844      /* "DHD " */
  82.  
  83. typedef DHD *PDHD;  /* pdhd */
  84.  
  85.  
  86. typedef struct l_dhd {         /* GK : List structure for DHD 149007 */
  87.    struct l_dhd *pNextLDHD;
  88.    PDHD   pDHD;
  89. } LDHD;
  90.  
  91. typedef LDHD *PLDHD;           /* GK : List structure for DHD 149007 */
  92. /*end*/
  93.  
  94. /*c-begin*/
  95. /* common external references */
  96. extern PDHD    pdhdHostData;            /* instance data in em86vpm.c */
  97. extern ULONG   flVpmIRQHooks;           /* instance data in em86vpm.c */
  98. /*c-end*/
  99.  
  100. /* Definitions for get/set dpmi exception handler calls */
  101. /* 32 bit or 16 bit APP flag                   149007   */
  102. #define VPMXCPT32                 0x0001
  103. /* 1.0 extended handler. Need to provide Expanded Stack */
  104. #define VPMXCPT10                 0x0002
  105. #define VPMXCPT_REFLECT     0x0004
  106. /* 0.9 handler. old stack frame                         */
  107. /* #define VPMXCPT09              0x0008                   */
  108. /* V86 Mode Exception Handler or Protect mode handler   */
  109. #define VPMXCPTV86          0x0010
  110. /* Already set 1.0 extended handler at least once       */
  111. /*                       Need to provide Expanded Stack */
  112. #define VPMXCPT10SET        0x8000
  113.  
  114. /***ET+ PFNDPMRTE - DPMI router hook
  115.  *
  116.  *  ENTRY
  117.  *      pcrf   - pointer to client register frame
  118.  *
  119.  *  EXIT
  120.  *      NONE
  121.  *
  122.  *  CALLING CONVENTIONS
  123.  *      32-bit small-model PASCAL calling conventions.  More specifically:
  124.  *
  125.  *      Parameters are pushed on the stack from left to right, and are
  126.  *      removed by the callee.  The callee will preserve EBX, ESI, EDI, EBP,
  127.  *      DS and ES.  DS is assumed to contain the callee's DGROUP selector
  128.  *      on entry.  EAX must be set to the return code on exit.
  129.  */
  130. typedef VOID (PASCAL *PFNDPMRTE)(PCRF);           /* pdpmr */
  131. /*end*/
  132.  
  133. /***ET+ PFNDPMSTART - DPMI task entry hook
  134.  *
  135.  *  ENTRY
  136.  *      pcrf   - pointer to client register frame
  137.  *
  138.  *  EXIT
  139.  *      SUCCESS == TRUE
  140.  *
  141.  *  CALLING CONVENTIONS
  142.  *      32-bit small-model PASCAL calling conventions.  More specifically:
  143.  *
  144.  *      Parameters are pushed on the stack from left to right, and are
  145.  *      removed by the callee.  The callee will preserve EBX, ESI, EDI, EBP,
  146.  *      DS and ES.  DS is assumed to contain the callee's DGROUP selector
  147.  *      on entry.  EAX must be set to the return code on exit.
  148.  */
  149. typedef BOOL (PASCAL *PFNDPMSTART)(PCRF);          /* pdpms */
  150. /*end*/
  151.  
  152. /***ET+ PFNDPMEND - DPMI task end hook
  153.  *
  154.  *  ENTRY
  155.  *      NONE
  156.  *
  157.  *  EXIT
  158.  *      SUCCESS == TRUE
  159.  *
  160.  *  CALLING CONVENTIONS
  161.  *      32-bit small-model PASCAL calling conventions.  More specifically:
  162.  *
  163.  *      Parameters are pushed on the stack from left to right, and are
  164.  *      removed by the callee.  The callee will preserve EBX, ESI, EDI, EBP,
  165.  *      DS and ES.  DS is assumed to contain the callee's DGROUP selector
  166.  *      on entry.  EAX must be set to the return code on exit.
  167.  */
  168. typedef BOOL (PASCAL *PFNDPMEND)(VOID);          /* pdpme */
  169. /*end*/
  170.  
  171. /***ET+ PFNDPMQUERY - Query DPMI function
  172.  *     Designed for furture use
  173.  *  ENTRY
  174.  * ulQueryItem - The item ID that EM86 queries at
  175.  * pulResult   - the result return
  176.  *
  177.  *  EXIT
  178.  *      TRUE  -- The query successes
  179.  *      FALSE -- The query fail
  180.  *
  181.  *  CALLING CONVENTIONS
  182.  *      32-bit small-model PASCAL calling conventions.  More specifically:
  183.  *
  184.  *      Parameters are pushed on the stack from left to right, and are
  185.  *      removed by the callee.  The callee will preserve EBX, ESI, EDI, EBP,
  186.  *      DS and ES.  DS is assumed to contain the callee's DGROUP selector
  187.  *      on entry.  EAX must be set to the return code on exit.
  188.  */
  189. typedef ULONG (PASCAL *PFNDPMQUERY)(ULONG,PULONG);       /* dpmQuery */
  190. /*end*/
  191.  
  192.  
  193. /***ET+ DPMX - DPMI VDD exports to kernel for VDHRegisterDPMI
  194.  *
  195.  *      These entry points are passed to the kernel during the
  196.  *      exchange of entry points in VDHRegisterDPMI.
  197.  */
  198. typedef struct dpmx_s {
  199.     PFNDPMRTE   dpmx_pfnINT31Rte;
  200.     PFNDPMSTART dpmx_pfnCreateTask;
  201.     PFNDPMEND   dpmx_pfnEndTask;
  202.     PFNDPMQUERY dpmx_pfnQuery;
  203. } DPMX;        /* dpmx */
  204.  
  205. typedef DPMX *PDPMX;  /* pdpmx */
  206.  
  207. #define DPM_QUERY_WP_SET 0
  208.  
  209. /*end*/
  210.  
  211. /* VDH service for registering DPMI VDD */
  212. /*c-begin*/
  213. BOOL VDHENTRY VDHRegisterDPMI (ULONG, PDPMX, PVPMX);
  214. /*c-end*/
  215. /*masm-begin*/
  216. /* VDHENTRY VDHRegisterDPMI <ULONG, ULONG, ULONG> */
  217. /*masm-end*/
  218.  
  219. #endif /* __VPMXPORT__ */
  220.  
  221.  
  222. /* NOINC */
  223. #if __IBMC__ || __IBMCPP__
  224.    #pragma info( none )
  225.       #ifndef __CHKHDR__
  226.          #pragma info( restore )
  227.       #endif
  228.    #pragma info( restore )
  229. #endif
  230. /* INC */
  231.