From 892627b12bfb9fa725f487bca341f35a3462da0c Mon Sep 17 00:00:00 2001 From: Ulrich Weigand Date: Tue, 16 Mar 1999 16:29:26 +0000 Subject: [PATCH] Pass CreateProcess() SECURITY_ATTRIBUTES through to PROCESS_Create(). --- include/dosexe.h | 5 +++-- include/module.h | 5 +++-- include/pe_image.h | 5 +++-- loader/dos/module.c | 13 ++++++++----- loader/module.c | 8 ++++---- loader/ne/module.c | 11 +++++++---- loader/pe_image.c | 7 ++++--- 7 files changed, 32 insertions(+), 22 deletions(-) diff --git a/include/dosexe.h b/include/dosexe.h index 351d83970cf..2b317a07356 100644 --- a/include/dosexe.h +++ b/include/dosexe.h @@ -40,8 +40,9 @@ extern LPDOSTASK MZ_AllocDPMITask( HMODULE16 hModule ); extern void MZ_Tick( WORD handle ); -extern BOOL MZ_CreateProcess( HFILE hFile, OFSTRUCT *ofs, LPCSTR cmdline, - LPCSTR env, BOOL inherit, LPSTARTUPINFOA startup, +extern BOOL MZ_CreateProcess( HFILE hFile, OFSTRUCT *ofs, LPCSTR cmdline, LPCSTR env, + LPSECURITY_ATTRIBUTES psa, LPSECURITY_ATTRIBUTES tsa, + BOOL inherit, LPSTARTUPINFOA startup, LPPROCESS_INFORMATION info ); extern int DOSVM_Enter( PCONTEXT context ); extern void DOSVM_SetTimer( unsigned ticks ); diff --git a/include/module.h b/include/module.h index f730cd7c559..cbed0219026 100644 --- a/include/module.h +++ b/include/module.h @@ -167,8 +167,9 @@ extern FARPROC16 NE_GetEntryPointEx( HMODULE16 hModule, WORD ordinal, BOOL16 sno extern BOOL16 NE_SetEntryPoint( HMODULE16 hModule, WORD ordinal, WORD offset ); extern HANDLE NE_OpenFile( NE_MODULE *pModule ); extern HINSTANCE16 NE_LoadModule( LPCSTR name, BOOL implicit ); -extern BOOL NE_CreateProcess( HFILE hFile, OFSTRUCT *ofs, LPCSTR cmd_line, - LPCSTR env, BOOL inherit, LPSTARTUPINFOA startup, +extern BOOL NE_CreateProcess( HFILE hFile, OFSTRUCT *ofs, LPCSTR cmd_line, LPCSTR env, + LPSECURITY_ATTRIBUTES psa, LPSECURITY_ATTRIBUTES tsa, + BOOL inherit, LPSTARTUPINFOA startup, LPPROCESS_INFORMATION info ); /* loader/ne/resource.c */ diff --git a/include/pe_image.h b/include/pe_image.h index 2362792d7b9..7ba71f5f4a0 100644 --- a/include/pe_image.h +++ b/include/pe_image.h @@ -36,8 +36,9 @@ extern HGLOBAL PE_LoadResource(struct _wine_modref *wm,HRSRC); extern HMODULE PE_LoadImage( HFILE hFile, OFSTRUCT *ofs, LPCSTR *modName ); extern struct _wine_modref *PE_CreateModule( HMODULE hModule, OFSTRUCT *ofs, DWORD flags, BOOL builtin ); -extern BOOL PE_CreateProcess( HFILE hFile, OFSTRUCT *ofs, LPCSTR cmd_line, - LPCSTR env, BOOL inherit, LPSTARTUPINFOA startup, +extern BOOL PE_CreateProcess( HFILE hFile, OFSTRUCT *ofs, LPCSTR cmd_line, LPCSTR env, + LPSECURITY_ATTRIBUTES psa, LPSECURITY_ATTRIBUTES tsa, + BOOL inherit, LPSTARTUPINFOA startup, LPPROCESS_INFORMATION info ); struct _THDB; /* forward definition */ diff --git a/loader/dos/module.c b/loader/dos/module.c index 00e46552db9..9a8b301d0b2 100644 --- a/loader/dos/module.c +++ b/loader/dos/module.c @@ -415,8 +415,9 @@ BOOL MZ_InitTask( LPDOSTASK lpDosTask ) return TRUE; } -BOOL MZ_CreateProcess( HFILE hFile, OFSTRUCT *ofs, LPCSTR cmdline, - LPCSTR env, BOOL inherit, LPSTARTUPINFOA startup, +BOOL MZ_CreateProcess( HFILE hFile, OFSTRUCT *ofs, LPCSTR cmdline, LPCSTR env, + LPSECURITY_ATTRIBUTES psa, LPSECURITY_ATTRIBUTES tsa, + BOOL inherit, LPSTARTUPINFOA startup, LPPROCESS_INFORMATION info ) { LPDOSTASK lpDosTask = NULL; /* keep gcc from complaining */ @@ -463,7 +464,8 @@ BOOL MZ_CreateProcess( HFILE hFile, OFSTRUCT *ofs, LPCSTR cmdline, SetLastError(ERROR_GEN_FAILURE); return FALSE; } - if (!PROCESS_Create( pModule, cmdline, env, 0, 0, inherit, startup, info )) + if (!PROCESS_Create( pModule, cmdline, env, 0, 0, + psa, tsa, inherit, startup, info )) return FALSE; } return TRUE; @@ -491,8 +493,9 @@ void MZ_KillModule( LPDOSTASK lpDosTask ) #else /* !MZ_SUPPORTED */ -BOOL MZ_CreateProcess( HFILE hFile, OFSTRUCT *ofs, LPCSTR cmdline, - LPCSTR env, BOOL inherit, LPSTARTUPINFOA startup, +BOOL MZ_CreateProcess( HFILE hFile, OFSTRUCT *ofs, LPCSTR cmdline, LPCSTR env, + LPSECURITY_ATTRIBUTES psa, LPSECURITY_ATTRIBUTES tsa, + BOOL inherit, LPSTARTUPINFOA startup, LPPROCESS_INFORMATION info ) { WARN(module,"DOS executables not supported on this architecture\n"); diff --git a/loader/module.c b/loader/module.c index 666d3c06a91..c9137b8ed2e 100644 --- a/loader/module.c +++ b/loader/module.c @@ -847,10 +847,6 @@ BOOL WINAPI CreateProcessA( LPCSTR lpApplicationName, LPSTR lpCommandLine, /* Warn if unsupported features are used */ - if (lpProcessAttributes) - FIXME(module, "(%s,...): lpProcessAttributes ignored\n", name); - if (lpThreadAttributes) - FIXME(module, "(%s,...): lpThreadAttributes ignored\n", name); if (dwCreationFlags & DEBUG_PROCESS) FIXME(module, "(%s,...): DEBUG_PROCESS ignored\n", name); if (dwCreationFlags & DEBUG_ONLY_THIS_PROCESS) @@ -922,6 +918,7 @@ BOOL WINAPI CreateProcessA( LPCSTR lpApplicationName, LPSTR lpCommandLine, lstrcpynA( ofs.szPathName, name, sizeof( ofs.szPathName ) ); retv = NE_CreateProcess( HFILE_ERROR, &ofs, cmdline, lpEnvironment, + lpProcessAttributes, lpThreadAttributes, bInheritHandles, lpStartupInfo, lpProcessInfo ); /* Load file and create process */ @@ -956,16 +953,19 @@ BOOL WINAPI CreateProcessA( LPCSTR lpApplicationName, LPSTR lpCommandLine, { case SCS_32BIT_BINARY: retv = PE_CreateProcess( hFile, &ofs, cmdline, lpEnvironment, + lpProcessAttributes, lpThreadAttributes, bInheritHandles, lpStartupInfo, lpProcessInfo ); break; case SCS_DOS_BINARY: retv = MZ_CreateProcess( hFile, &ofs, cmdline, lpEnvironment, + lpProcessAttributes, lpThreadAttributes, bInheritHandles, lpStartupInfo, lpProcessInfo ); break; case SCS_WOW_BINARY: retv = NE_CreateProcess( hFile, &ofs, cmdline, lpEnvironment, + lpProcessAttributes, lpThreadAttributes, bInheritHandles, lpStartupInfo, lpProcessInfo ); break; diff --git a/loader/ne/module.c b/loader/ne/module.c index 59edc9e5364..bf607663703 100644 --- a/loader/ne/module.c +++ b/loader/ne/module.c @@ -914,7 +914,8 @@ HINSTANCE16 WINAPI LoadModule16( LPCSTR name, LPVOID paramBlock ) } pdb = PROCESS_Create( pModule, new_cmd_line, env, - hInstance, hPrevInstance, TRUE, &startup, &info ); + hInstance, hPrevInstance, + NULL, NULL, TRUE, &startup, &info ); CloseHandle( info.hThread ); CloseHandle( info.hProcess ); @@ -932,8 +933,9 @@ HINSTANCE16 WINAPI LoadModule16( LPCSTR name, LPVOID paramBlock ) /********************************************************************** * NE_CreateProcess */ -BOOL NE_CreateProcess( HFILE hFile, OFSTRUCT *ofs, LPCSTR cmd_line, - LPCSTR env, BOOL inherit, LPSTARTUPINFOA startup, +BOOL NE_CreateProcess( HFILE hFile, OFSTRUCT *ofs, LPCSTR cmd_line, LPCSTR env, + LPSECURITY_ATTRIBUTES psa, LPSECURITY_ATTRIBUTES tsa, + BOOL inherit, LPSTARTUPINFOA startup, LPPROCESS_INFORMATION info ) { HINSTANCE16 hInstance, hPrevInstance = 0; @@ -1004,7 +1006,8 @@ BOOL NE_CreateProcess( HFILE hFile, OFSTRUCT *ofs, LPCSTR cmd_line, pModule->flags |= NE_FFLAGS_GUI; /* FIXME: is this necessary? */ if ( !PROCESS_Create( pModule, cmd_line, env, - hInstance, hPrevInstance, inherit, startup, info ) ) + hInstance, hPrevInstance, + psa, tsa, inherit, startup, info ) ) return FALSE; return TRUE; diff --git a/loader/pe_image.c b/loader/pe_image.c index eb86f119f0d..f05301dcd40 100644 --- a/loader/pe_image.c +++ b/loader/pe_image.c @@ -879,8 +879,9 @@ HMODULE PE_LoadLibraryExA (LPCSTR name, * FIXME: this function should use PE_LoadLibraryExA, but currently can't * due to the PROCESS_Create stuff. */ -BOOL PE_CreateProcess( HFILE hFile, OFSTRUCT *ofs, LPCSTR cmd_line, - LPCSTR env, BOOL inherit, LPSTARTUPINFOA startup, +BOOL PE_CreateProcess( HFILE hFile, OFSTRUCT *ofs, LPCSTR cmd_line, LPCSTR env, + LPSECURITY_ATTRIBUTES psa, LPSECURITY_ATTRIBUTES tsa, + BOOL inherit, LPSTARTUPINFOA startup, LPPROCESS_INFORMATION info ) { LPCSTR modName = NULL; @@ -914,7 +915,7 @@ BOOL PE_CreateProcess( HFILE hFile, OFSTRUCT *ofs, LPCSTR cmd_line, /* Create new process */ if ( !PROCESS_Create( pModule, cmd_line, env, - 0, 0, inherit, startup, info ) ) + 0, 0, psa, tsa, inherit, startup, info ) ) return FALSE; /* Note: PE_CreateModule and the remaining process initialization will