Fixed DOS environment passing.
This commit is contained in:
parent
4659741056
commit
72b279236e
|
@ -131,7 +131,7 @@ static WORD MZ_InitEnvironment( LPDOSTASK lpDosTask, LPCSTR env, LPCSTR name )
|
||||||
|
|
||||||
if (env) {
|
if (env) {
|
||||||
/* get size of environment block */
|
/* get size of environment block */
|
||||||
while (env[sz++]) sz+=strlen(env+sz);
|
while (env[sz++]) sz+=strlen(env+sz)+1;
|
||||||
} else sz++;
|
} else sz++;
|
||||||
/* allocate it */
|
/* allocate it */
|
||||||
envblk=DOSMEM_GetBlock(lpDosTask->hModule,sz+sizeof(WORD)+strlen(name)+1,&seg);
|
envblk=DOSMEM_GetBlock(lpDosTask->hModule,sz+sizeof(WORD)+strlen(name)+1,&seg);
|
||||||
|
@ -364,6 +364,7 @@ HINSTANCE16 MZ_CreateProcess( LPCSTR name, LPCSTR cmdline, LPCSTR env,
|
||||||
LPDOSTASK lpDosTask = NULL; /* keep gcc from complaining */
|
LPDOSTASK lpDosTask = NULL; /* keep gcc from complaining */
|
||||||
HMODULE16 hModule;
|
HMODULE16 hModule;
|
||||||
HINSTANCE16 hInstance;
|
HINSTANCE16 hInstance;
|
||||||
|
PDB32 *pdb = PROCESS_Current();
|
||||||
TDB *pTask = (TDB*)GlobalLock16( GetCurrentTask() );
|
TDB *pTask = (TDB*)GlobalLock16( GetCurrentTask() );
|
||||||
NE_MODULE *pModule = pTask ? NE_GetPtr( pTask->hModule ) : NULL;
|
NE_MODULE *pModule = pTask ? NE_GetPtr( pTask->hModule ) : NULL;
|
||||||
HFILE16 hFile;
|
HFILE16 hFile;
|
||||||
|
@ -378,6 +379,7 @@ HINSTANCE16 MZ_CreateProcess( LPCSTR name, LPCSTR cmdline, LPCSTR env,
|
||||||
if ((hFile = OpenFile16( name, &ofs, OF_READ )) == HFILE_ERROR16)
|
if ((hFile = OpenFile16( name, &ofs, OF_READ )) == HFILE_ERROR16)
|
||||||
return 2; /* File not found */
|
return 2; /* File not found */
|
||||||
|
|
||||||
|
if ((!env)&&pdb) env = pdb->env_db->environ;
|
||||||
if (alloc) {
|
if (alloc) {
|
||||||
if ((hModule = MODULE_CreateDummyModule(&ofs)) < 32)
|
if ((hModule = MODULE_CreateDummyModule(&ofs)) < 32)
|
||||||
return hModule;
|
return hModule;
|
||||||
|
|
Loading…
Reference in New Issue