Removed hModule parameter from MZ_AllocDPMITask(), and renamed

MZ_KillModule() to MZ_KillTask().
This commit is contained in:
Ove Kaaven 2000-07-30 13:41:13 +00:00 committed by Alexandre Julliard
parent d1d090516c
commit e3b353e220
3 changed files with 9 additions and 18 deletions

View File

@ -55,8 +55,8 @@ typedef struct _DOSEVENT {
#define MZ_SUPPORTED #define MZ_SUPPORTED
extern BOOL MZ_InitTask( LPDOSTASK lpDosTask ); extern BOOL MZ_InitTask( LPDOSTASK lpDosTask );
extern void MZ_KillModule( LPDOSTASK lpDosTask ); extern void MZ_KillTask( LPDOSTASK lpDosTask );
extern LPDOSTASK MZ_AllocDPMITask( HMODULE16 hModule ); extern LPDOSTASK MZ_AllocDPMITask( void );
#endif /* linux-i386 */ #endif /* linux-i386 */

View File

@ -182,7 +182,7 @@ static WORD MZ_InitEnvironment( LPDOSTASK lpDosTask, LPCSTR env, LPCSTR name )
return seg; return seg;
} }
static BOOL MZ_InitMemory( LPDOSTASK lpDosTask, NE_MODULE *pModule ) static BOOL MZ_InitMemory( LPDOSTASK lpDosTask )
{ {
int x; int x;
@ -210,7 +210,6 @@ static BOOL MZ_InitMemory( LPDOSTASK lpDosTask, NE_MODULE *pModule )
return FALSE; return FALSE;
} }
TRACE("DOS VM86 image mapped at %08lx\n",(DWORD)lpDosTask->img); TRACE("DOS VM86 image mapped at %08lx\n",(DWORD)lpDosTask->img);
pModule->dos_image=lpDosTask->img;
/* initialize the memory */ /* initialize the memory */
TRACE("Initializing DOS memory structures\n"); TRACE("Initializing DOS memory structures\n");
@ -253,7 +252,7 @@ static BOOL MZ_LoadImage( HANDLE hFile, LPCSTR filename, LPCSTR cmdline,
max_size=image_size+((DWORD)mz_header.e_maxalloc<<4)+(PSP_SIZE<<4); max_size=image_size+((DWORD)mz_header.e_maxalloc<<4)+(PSP_SIZE<<4);
} }
MZ_InitMemory(lpDosTask,pModule); MZ_InitMemory(lpDosTask);
/* allocate environment block */ /* allocate environment block */
env_seg=MZ_InitEnvironment(lpDosTask,env,filename); env_seg=MZ_InitEnvironment(lpDosTask,env,filename);
@ -308,22 +307,14 @@ static BOOL MZ_LoadImage( HANDLE hFile, LPCSTR filename, LPCSTR cmdline,
return TRUE; return TRUE;
} }
LPDOSTASK MZ_AllocDPMITask( HMODULE16 hModule ) LPDOSTASK MZ_AllocDPMITask( void )
{ {
LPDOSTASK lpDosTask = calloc(1, sizeof(DOSTASK)); LPDOSTASK lpDosTask = calloc(1, sizeof(DOSTASK));
NE_MODULE *pModule;
if (lpDosTask) { if (lpDosTask) {
lpDosTask->hModule = hModule;
pModule = (NE_MODULE *)GlobalLock16(hModule);
pModule->lpDosTask = lpDosTask;
lpDosTask->img=NULL; lpDosTask->mm_name[0]=0; lpDosTask->mm_fd=-1; lpDosTask->img=NULL; lpDosTask->mm_name[0]=0; lpDosTask->mm_fd=-1;
MZ_InitMemory(lpDosTask, pModule); MZ_InitMemory(lpDosTask);
GlobalUnlock16(hModule);
} }
return lpDosTask; return lpDosTask;
} }
@ -497,7 +488,7 @@ BOOL MZ_CreateProcess( HANDLE hFile, LPCSTR filename, LPCSTR cmdline, LPCSTR env
if (alloc) { if (alloc) {
pModule->dos_image = lpDosTask->img; pModule->dos_image = lpDosTask->img;
if (!MZ_InitTask( lpDosTask )) { if (!MZ_InitTask( lpDosTask )) {
MZ_KillModule( lpDosTask ); MZ_KillTask( lpDosTask );
/* FIXME: cleanup hModule */ /* FIXME: cleanup hModule */
SetLastError(ERROR_GEN_FAILURE); SetLastError(ERROR_GEN_FAILURE);
return FALSE; return FALSE;
@ -511,7 +502,7 @@ BOOL MZ_CreateProcess( HANDLE hFile, LPCSTR filename, LPCSTR cmdline, LPCSTR env
} }
#endif #endif
void MZ_KillModule( LPDOSTASK lpDosTask ) void MZ_KillTask( LPDOSTASK lpDosTask )
{ {
DOSEVENT *event,*p_event; DOSEVENT *event,*p_event;
DOSSYSTEM *sys,*p_sys; DOSSYSTEM *sys,*p_sys;

View File

@ -357,7 +357,7 @@ callrmproc_again:
#ifdef MZ_SUPPORTED #ifdef MZ_SUPPORTED
FIXME("DPMI real-mode call using DOS VM task system, not fully tested!\n"); FIXME("DPMI real-mode call using DOS VM task system, not fully tested!\n");
TRACE("creating VM86 task\n"); TRACE("creating VM86 task\n");
if (!MZ_InitTask( MZ_AllocDPMITask( pModule->self ) )) { if (!MZ_InitTask( MZ_AllocDPMITask() )) {
ERR("could not setup VM86 task\n"); ERR("could not setup VM86 task\n");
return 1; return 1;
} }