7 /* #define DEBUG_INT */
20 typedef ACCESS
*LPACCESS
;
29 typedef DESCRIPTOR
*LPDESCRIPTOR
;
31 HANDLE
DPMI_GetNewSelector(WORD selcount
);
32 BOOL
DPMI_FreeSelector(HANDLE pmSel
);
33 BOOL
DPMI_SetDescriptor(HANDLE pmSel
, LPDESCRIPTOR lpDesc
);
35 /*************************************************************************/
37 int do_int31(struct sigcontext_struct
*context
)
40 dprintf_int(stddeb
,"do_int31 // context->sc_eax=%08lX\n",
42 switch(context
->sc_eax
)
45 context
->sc_eax
= DPMI_GetNewSelector(context
->sc_ecx
);
48 context
->sc_eax
= DPMI_FreeSelector(context
->sc_ebx
);
51 lpDesc
= (LPDESCRIPTOR
) MAKELONG(context
->sc_edi
,
53 context
->sc_eax
= DPMI_SetDescriptor(context
->sc_ebx
, lpDesc
);
56 IntBarf(0x31, context
);
62 /*************************************************************************/
65 HANDLE
DPMI_GetNewSelector(WORD selcount
)
69 dprintf_int(stddeb
,"DPMI_GetNewSelector(%d); !\n", selcount
);
70 pmSel
= GlobalAlloc(GMEM_FIXED
, 4096);
71 ptr
= GlobalLock(pmSel
);
72 dprintf_int(stddeb
,"DPMI_GetNewSelector() return %04X !\n", pmSel
);
77 BOOL
DPMI_FreeSelector(HANDLE pmSel
)
79 dprintf_int(stddeb
,"DPMI_FreeSelector(%04X); !\n", pmSel
);
84 BOOL
DPMI_SetDescriptor(HANDLE pmSel
, LPDESCRIPTOR lpDesc
)
86 dprintf_int(stdnimp
,"DPMI_SetDescriptor(%04X, %p); !\n",
88 dprintf_int(stdnimp
,"DPMI lpDesc->Limit=%u \n", lpDesc
->Limit
);
89 dprintf_int(stdnimp
,"DPMI lpDesc->addr_lo=%04X \n", lpDesc
->addr_lo
);
90 dprintf_int(stdnimp
,"DPMI lpDesc->addr_hi=%02X \n", lpDesc
->addr_hi
);
91 dprintf_int(stdnimp
,"DPMI lpDesc->access.accessed=%u \n",
92 lpDesc
->access
.accessed
);
93 dprintf_int(stdnimp
,"DPMI lpDesc->access.read_write=%u \n",
94 lpDesc
->access
.read_write
);
95 dprintf_int(stdnimp
,"DPMI lpDesc->access.conf_exp=%u \n",
96 lpDesc
->access
.conf_exp
);
97 dprintf_int(stdnimp
,"DPMI lpDesc->access.code=%u \n",
99 dprintf_int(stdnimp
,"DPMI lpDesc->access.xsystem=%u \n",
100 lpDesc
->access
.xsystem
);
101 dprintf_int(stdnimp
,"DPMI lpDesc->access.dpl=%u \n",
103 dprintf_int(stdnimp
,"DPMI lpDesc->access.present=%u \n",
104 lpDesc
->access
.present
);
105 dprintf_int(stdnimp
,"DPMI lpDesc->reserved=%04X \n", lpDesc
->reserved
);