16 typedef ACCESS
*LPACCESS
;
25 typedef DESCRIPTOR
*LPDESCRIPTOR
;
27 HANDLE
DPMI_GetNewSelector(WORD selcount
);
28 BOOL
DPMI_FreeSelector(HANDLE pmSel
);
29 BOOL
DPMI_SetDescriptor(HANDLE pmSel
, LPDESCRIPTOR lpDesc
);
31 /*************************************************************************/
33 int do_int31(struct sigcontext_struct
*context
)
36 printf("do_int31 // context->sc_eax=%04X\n", context
->sc_eax
);
37 switch(context
->sc_eax
)
40 context
->sc_eax
= DPMI_GetNewSelector(context
->sc_ecx
);
43 context
->sc_eax
= DPMI_FreeSelector(context
->sc_ebx
);
46 lpDesc
= MAKELONG(context
->sc_edi
, context
->sc_es
);
47 context
->sc_eax
= DPMI_SetDescriptor(context
->sc_ebx
, lpDesc
);
50 IntBarf(0x31, context
);
56 /*************************************************************************/
59 HANDLE
DPMI_GetNewSelector(WORD selcount
)
63 printf("DPMI_GetNewSelector(%d); !\n", selcount
);
64 pmSel
= GlobalAlloc(GMEM_FIXED
, 4096);
65 ptr
= GlobalLock(pmSel
);
66 printf("DPMI_GetNewSelector() return %04X !\n", pmSel
);
71 BOOL
DPMI_FreeSelector(HANDLE pmSel
)
73 printf("DPMI_FreeSelector(%04X); !\n", pmSel
);
78 BOOL
DPMI_SetDescriptor(HANDLE pmSel
, LPDESCRIPTOR lpDesc
)
80 printf("DPMI_SetDescriptor(%04X, %08X); !\n", pmSel
, lpDesc
);
81 printf("DPMI lpDesc->Limit=%u \n", lpDesc
->Limit
);
82 printf("DPMI lpDesc->addr_lo=%04X \n", lpDesc
->addr_lo
);
83 printf("DPMI lpDesc->addr_hi=%02X \n", lpDesc
->addr_hi
);
84 printf("DPMI lpDesc->access.accessed=%u \n", lpDesc
->access
.accessed
);
85 printf("DPMI lpDesc->access.read_write=%u \n", lpDesc
->access
.read_write
);
86 printf("DPMI lpDesc->access.conf_exp=%u \n", lpDesc
->access
.conf_exp
);
87 printf("DPMI lpDesc->access.code=%u \n", lpDesc
->access
.code
);
88 printf("DPMI lpDesc->access.xsystem=%u \n", lpDesc
->access
.xsystem
);
89 printf("DPMI lpDesc->access.dpl=%u \n", lpDesc
->access
.dpl
);
90 printf("DPMI lpDesc->access.present=%u \n", lpDesc
->access
.present
);
91 printf("DPMI lpDesc->reserved=%04X \n", lpDesc
->reserved
);