Just get DOS task structure from MZ_Current(), instead of (clumsily)

trying to find and read from the current task's module structures.
This commit is contained in:
Ove Kaaven 2000-07-28 20:18:49 +00:00 committed by Alexandre Julliard
parent 3939b6d9dd
commit 0a116b8b8a
2 changed files with 11 additions and 38 deletions

View File

@ -947,29 +947,19 @@ INT21_networkfunc (CONTEXT86 *context)
static void INT21_SetCurrentPSP(WORD psp)
{
#ifdef MZ_SUPPORTED
TDB *pTask = (TDB *)GlobalLock16( GetCurrentTask() );
NE_MODULE *pModule = pTask ? NE_GetPtr( pTask->hModule ) : NULL;
GlobalUnlock16( GetCurrentTask() );
if (pModule->lpDosTask)
pModule->lpDosTask->psp_seg = psp;
LPDOSTASK lpDosTask = MZ_Current();
if (lpDosTask)
lpDosTask->psp_seg = psp;
else
#endif
ERR("Cannot change PSP for non-DOS task!\n");
}
static WORD INT21_GetCurrentPSP()
{
#ifdef MZ_SUPPORTED
TDB *pTask = (TDB *)GlobalLock16( GetCurrentTask() );
NE_MODULE *pModule = pTask ? NE_GetPtr( pTask->hModule ) : NULL;
GlobalUnlock16( GetCurrentTask() );
if (pModule->lpDosTask)
return pModule->lpDosTask->psp_seg;
LPDOSTASK lpDosTask = MZ_Current();
if (lpDosTask)
return lpDosTask->psp_seg;
else
#endif
return GetCurrentPDB16();
}

View File

@ -114,16 +114,9 @@ void WINAPI INT_Int2fHandler( CONTEXT86 *context )
break;
case 0x10: /* XMS v2+ get driver address */
{
#ifdef MZ_SUPPORTED
TDB *pTask = (TDB *)GlobalLock16( GetCurrentTask() );
NE_MODULE *pModule = pTask ? NE_GetPtr( pTask->hModule ) : NULL;
GlobalUnlock16( GetCurrentTask() );
LPDOSTASK lpDosTask = MZ_Current();
if (pModule && pModule->lpDosTask)
ES_reg(context) = pModule->lpDosTask->xms_seg;
else
#endif
ES_reg(context) = 0;
ES_reg(context) = lpDosTask ? lpDosTask->xms_seg : 0;
BX_reg(context) = 0;
break;
}
@ -355,12 +348,7 @@ static void do_int2f_16( CONTEXT86 *context )
#endif
{
SYSTEM_INFO si;
#ifdef MZ_SUPPORTED
TDB *pTask = (TDB *)GlobalLock16( GetCurrentTask() );
NE_MODULE *pModule = pTask ? NE_GetPtr( pTask->hModule ) : NULL;
GlobalUnlock16( GetCurrentTask() );
#endif
LPDOSTASK lpDosTask = MZ_Current();
GetSystemInfo(&si);
AX_reg(context) = 0x0000; /* DPMI Installed */
@ -368,13 +356,8 @@ static void do_int2f_16( CONTEXT86 *context )
CL_reg(context) = si.wProcessorLevel;
DX_reg(context) = 0x005a; /* DPMI major/minor 0.90 */
SI_reg(context) = 0; /* # of para. of DOS extended private data */
#ifdef MZ_SUPPORTED /* ES:DI is DPMI switch entry point */
if (pModule && pModule->lpDosTask)
ES_reg(context) = pModule->lpDosTask->dpmi_seg;
else
#endif
ES_reg(context) = 0;
DI_reg(context) = 0;
ES_reg(context) = lpDosTask ? lpDosTask->dpmi_seg : 0;
DI_reg(context) = 0; /* ES:DI is DPMI switch entry point */
break;
}
case 0x8a: /* DPMI get vendor-specific API entry point. */