home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / warphead.zip / H / VPMXPORT.H < prev    next >
C/C++ Source or Header  |  1997-04-10  |  5KB  |  161 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.  */
  18.  
  19. #pragma checkout( suspend )
  20.    #ifndef __CHKHDR__
  21.       #pragma checkout( suspend )
  22.    #endif
  23. #pragma checkout( resume )
  24.  
  25. #ifndef __VPMXPORT__
  26. #define __VPMXPORT__
  27.  
  28.  
  29. #include <vpmx2.h>
  30.  
  31. /***ET+ DHD - DPMI host data block
  32.  *
  33.  *      This is the DPMI host data for a task.  The V86 mode
  34.  *      host data block allocated (in the V86 mode address space)
  35.  *      before the start protected mode execution call is used only
  36.  *      for the client V86 mode stack.  All other per dpmi task
  37.  *      data is kept in this structure as per dpmi program instance
  38.  *      data.  Note: there is one structure per dpmi start call in a VDM.
  39.  */
  40. typedef struct dhd_s {
  41.     struct dhd_s *dhd_pdhdParent;   /* pointer to parent program's DHD    */
  42.     USHORT dhd_segStack;            /* V86 stack segment (host data area) */
  43.     USHORT dhd_segEnviron;          /* V86 environment segment            */
  44.     USHORT dhd_segPDB;              /* V86 pdb segment                    */
  45.     SEL    dhd_selSS;               /* protect mode stack selector        */
  46.     SEL    dhd_selDS;               /* protect mode ds  selector          */
  47.     SEL    dhd_selCS;               /* protect mode cs  selector          */
  48.     SEL    dhd_selPDB;              /* protect mode pdb selector          */
  49.     SEL    dhd_selEnviron;          /* protect mode env selector          */
  50.     PVOID  dhd_pdpmData;            /* DPMI API layer per DPMI task data  */
  51.     PVOID  dhd_pvpmData;            /* em86 per DPMI task data            */
  52.     PVOID  dhd_pDosX;               /* DOS API extension area             */
  53.     PVOID  dhd_laddrLDT;            /* LDT linear address                 */
  54.     SEL    dhd_selvpmbp;            /* protect mode vpm breakpoint sel    */
  55.     ULONG  DHD_sig;                 /* assertion checking                 */
  56. } DHD;
  57.  
  58. #define DHD_SIGNATURE                   0x20444844      /* "DHD " */
  59.  
  60. typedef DHD *PDHD;  /* pdhd */
  61. /*end*/
  62.  
  63. /*c-begin*/
  64. /* common external references */
  65. extern PDHD    pdhdHostData;            /* instance data in em86vpm.c */
  66. extern ULONG   flVpmIRQHooks;           /* instance data in em86vpm.c */
  67. /*c-end*/
  68.  
  69. /* Definitions for get/set dpmi exception handler calls */
  70. #define VPMXCPT32           1
  71. #define VPMXCPT10           2
  72. #define VPMXCPT_REFLECT     4
  73.  
  74. /***ET+ PFNDPMRTE - DPMI router hook
  75.  *
  76.  *  ENTRY
  77.  *      pcrf   - pointer to client register frame
  78.  *
  79.  *  EXIT
  80.  *      NONE
  81.  *
  82.  *  CALLING CONVENTIONS
  83.  *      32-bit small-model PASCAL calling conventions.  More specifically:
  84.  *
  85.  *      Parameters are pushed on the stack from left to right, and are
  86.  *      removed by the callee.  The callee will preserve EBX, ESI, EDI, EBP,
  87.  *      DS and ES.  DS is assumed to contain the callee's DGROUP selector
  88.  *      on entry.  EAX must be set to the return code on exit.
  89.  */
  90. typedef VOID (PASCAL *PFNDPMRTE)(PCRF);           /* pdpmr */
  91. /*end*/
  92.  
  93. /***ET+ PFNDPMSTART - DPMI task entry hook
  94.  *
  95.  *  ENTRY
  96.  *      pcrf   - pointer to client register frame
  97.  *
  98.  *  EXIT
  99.  *      SUCCESS == TRUE
  100.  *
  101.  *  CALLING CONVENTIONS
  102.  *      32-bit small-model PASCAL calling conventions.  More specifically:
  103.  *
  104.  *      Parameters are pushed on the stack from left to right, and are
  105.  *      removed by the callee.  The callee will preserve EBX, ESI, EDI, EBP,
  106.  *      DS and ES.  DS is assumed to contain the callee's DGROUP selector
  107.  *      on entry.  EAX must be set to the return code on exit.
  108.  */
  109. typedef BOOL (PASCAL *PFNDPMSTART)(PCRF);          /* pdpms */
  110. /*end*/
  111.  
  112. /***ET+ PFNDPMEND - DPMI task end hook
  113.  *
  114.  *  ENTRY
  115.  *      NONE
  116.  *
  117.  *  EXIT
  118.  *      SUCCESS == TRUE
  119.  *
  120.  *  CALLING CONVENTIONS
  121.  *      32-bit small-model PASCAL calling conventions.  More specifically:
  122.  *
  123.  *      Parameters are pushed on the stack from left to right, and are
  124.  *      removed by the callee.  The callee will preserve EBX, ESI, EDI, EBP,
  125.  *      DS and ES.  DS is assumed to contain the callee's DGROUP selector
  126.  *      on entry.  EAX must be set to the return code on exit.
  127.  */
  128. typedef BOOL (PASCAL *PFNDPMEND)(VOID);          /* pdpme */
  129. /*end*/
  130.  
  131.  
  132. /***ET+ DPMX - DPMI VDD exports to kernel for VDHRegisterDPMI
  133.  *
  134.  *      These entry points are passed to the kernel during the
  135.  *      exchange of entry points in VDHRegisterDPMI.
  136.  */
  137. typedef struct dpmx_s {
  138.     PFNDPMRTE   dpmx_pfnINT31Rte;
  139.     PFNDPMSTART dpmx_pfnCreateTask;
  140.     PFNDPMEND   dpmx_pfnEndTask;
  141. } DPMX;        /* dpmx */
  142.  
  143. typedef DPMX *PDPMX;  /* pdpmx */
  144. /*end*/
  145.  
  146. /* VDH service for registering DPMI VDD */
  147. /*c-begin*/
  148. BOOL VDHENTRY VDHRegisterDPMI (ULONG, PDPMX, PVPMX);
  149. /*c-end*/
  150. /*masm-begin*/
  151. /* VDHENTRY VDHRegisterDPMI <ULONG, ULONG, ULONG> */
  152. /*masm-end*/
  153.  
  154. #endif /* __VPMXPORT__ */
  155.  
  156. #pragma checkout( suspend )
  157.    #ifndef __CHKHDR__
  158.       #pragma checkout( resume )
  159.    #endif
  160. #pragma checkout( resume )
  161.