mirror of
git://source.winehq.org/git/wine.git
synced 2024-09-01 09:03:37 +00:00
kernel32: Add the new image path to the dll path for a new process.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
9551cb0b84
commit
c258b5ef11
|
@ -1885,9 +1885,9 @@ static RTL_USER_PROCESS_PARAMETERS *create_process_params( LPCWSTR filename, LPC
|
||||||
const STARTUPINFOW *startup )
|
const STARTUPINFOW *startup )
|
||||||
{
|
{
|
||||||
RTL_USER_PROCESS_PARAMETERS *params;
|
RTL_USER_PROCESS_PARAMETERS *params;
|
||||||
UNICODE_STRING imageW, curdirW, cmdlineW, titleW, desktopW, runtimeW, newdirW;
|
UNICODE_STRING imageW, dllpathW, curdirW, cmdlineW, titleW, desktopW, runtimeW, newdirW;
|
||||||
WCHAR imagepath[MAX_PATH];
|
WCHAR imagepath[MAX_PATH];
|
||||||
WCHAR *envW = env;
|
WCHAR *load_path, *dummy, *envW = env;
|
||||||
|
|
||||||
if(!GetLongPathNameW( filename, imagepath, MAX_PATH ))
|
if(!GetLongPathNameW( filename, imagepath, MAX_PATH ))
|
||||||
lstrcpynW( imagepath, filename, MAX_PATH );
|
lstrcpynW( imagepath, filename, MAX_PATH );
|
||||||
|
@ -1914,20 +1914,24 @@ static RTL_USER_PROCESS_PARAMETERS *create_process_params( LPCWSTR filename, LPC
|
||||||
else
|
else
|
||||||
cur_dir = NULL;
|
cur_dir = NULL;
|
||||||
}
|
}
|
||||||
|
LdrGetDllPath( imagepath, LOAD_WITH_ALTERED_SEARCH_PATH, &load_path, &dummy );
|
||||||
RtlInitUnicodeString( &imageW, imagepath );
|
RtlInitUnicodeString( &imageW, imagepath );
|
||||||
|
RtlInitUnicodeString( &dllpathW, load_path );
|
||||||
RtlInitUnicodeString( &curdirW, cur_dir );
|
RtlInitUnicodeString( &curdirW, cur_dir );
|
||||||
RtlInitUnicodeString( &cmdlineW, cmdline );
|
RtlInitUnicodeString( &cmdlineW, cmdline );
|
||||||
RtlInitUnicodeString( &titleW, startup->lpTitle ? startup->lpTitle : imagepath );
|
RtlInitUnicodeString( &titleW, startup->lpTitle ? startup->lpTitle : imagepath );
|
||||||
RtlInitUnicodeString( &desktopW, startup->lpDesktop );
|
RtlInitUnicodeString( &desktopW, startup->lpDesktop );
|
||||||
runtimeW.Buffer = (WCHAR *)startup->lpReserved2;
|
runtimeW.Buffer = (WCHAR *)startup->lpReserved2;
|
||||||
runtimeW.Length = runtimeW.MaximumLength = startup->cbReserved2;
|
runtimeW.Length = runtimeW.MaximumLength = startup->cbReserved2;
|
||||||
if (RtlCreateProcessParametersEx( ¶ms, &imageW, NULL, cur_dir ? &curdirW : NULL,
|
if (RtlCreateProcessParametersEx( ¶ms, &imageW, &dllpathW, cur_dir ? &curdirW : NULL,
|
||||||
&cmdlineW, envW, &titleW, &desktopW,
|
&cmdlineW, envW, &titleW, &desktopW,
|
||||||
NULL, &runtimeW, PROCESS_PARAMS_FLAG_NORMALIZED ))
|
NULL, &runtimeW, PROCESS_PARAMS_FLAG_NORMALIZED ))
|
||||||
{
|
{
|
||||||
|
RtlReleasePath( load_path );
|
||||||
if (envW != env) HeapFree( GetProcessHeap(), 0, envW );
|
if (envW != env) HeapFree( GetProcessHeap(), 0, envW );
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
RtlReleasePath( load_path );
|
||||||
|
|
||||||
if (flags & CREATE_NEW_PROCESS_GROUP) params->ConsoleFlags = 1;
|
if (flags & CREATE_NEW_PROCESS_GROUP) params->ConsoleFlags = 1;
|
||||||
if (flags & CREATE_NEW_CONSOLE) params->ConsoleHandle = KERNEL32_CONSOLE_ALLOC;
|
if (flags & CREATE_NEW_CONSOLE) params->ConsoleHandle = KERNEL32_CONSOLE_ALLOC;
|
||||||
|
|
Loading…
Reference in a new issue