Commit 5950c6af authored by Alexandre Julliard's avatar Alexandre Julliard

user32: Specify the full application path when starting builtin apps.

parent 0856f774
......@@ -354,12 +354,14 @@ BOOL WINAPI ExitWindowsEx( UINT flags, DWORD reason )
static const WCHAR forceW[] = { ' ','-','-','f','o','r','c','e',0 };
static const WCHAR shutdownW[] = { ' ','-','-','s','h','u','t','d','o','w','n',0 };
WCHAR app[MAX_PATH];
WCHAR cmdline[MAX_PATH + 64];
PROCESS_INFORMATION pi;
STARTUPINFOW si;
GetSystemDirectoryW( cmdline, MAX_PATH );
lstrcatW( cmdline, winebootW );
GetSystemDirectoryW( app, MAX_PATH - sizeof(winebootW)/sizeof(WCHAR) );
strcatW( app, winebootW );
strcpyW( cmdline, app );
if (flags & EWX_FORCE) lstrcatW( cmdline, killW );
else
......@@ -371,7 +373,7 @@ BOOL WINAPI ExitWindowsEx( UINT flags, DWORD reason )
memset( &si, 0, sizeof si );
si.cb = sizeof si;
if (!CreateProcessW( NULL, cmdline, NULL, NULL, FALSE, DETACHED_PROCESS, NULL, NULL, &si, &pi ))
if (!CreateProcessW( app, cmdline, NULL, NULL, FALSE, DETACHED_PROCESS, NULL, NULL, &si, &pi ))
{
ERR( "Failed to run %s\n", debugstr_w(cmdline) );
return FALSE;
......
......@@ -1852,11 +1852,13 @@ HWND WINAPI GetDesktopWindow(void)
if (!GetUserObjectInformationW( GetProcessWindowStation(), UOI_FLAGS, &flags,
sizeof(flags), NULL ) || (flags.dwFlags & WSF_VISIBLE))
{
static const WCHAR command_line[] = {'\\','e','x','p','l','o','r','e','r','.','e','x','e',' ','/','d','e','s','k','t','o','p',0};
static const WCHAR explorer[] = {'\\','e','x','p','l','o','r','e','r','.','e','x','e',0};
static const WCHAR args[] = {' ','/','d','e','s','k','t','o','p',0};
STARTUPINFOW si;
PROCESS_INFORMATION pi;
WCHAR systemdir[MAX_PATH];
WCHAR cmdline[MAX_PATH + sizeof(command_line)/sizeof(WCHAR)];
WCHAR windir[MAX_PATH];
WCHAR app[MAX_PATH + sizeof(explorer)/sizeof(WCHAR)];
WCHAR cmdline[MAX_PATH + (sizeof(explorer) + sizeof(args))/sizeof(WCHAR)];
memset( &si, 0, sizeof(si) );
si.cb = sizeof(si);
......@@ -1865,11 +1867,13 @@ HWND WINAPI GetDesktopWindow(void)
si.hStdOutput = 0;
si.hStdError = GetStdHandle( STD_ERROR_HANDLE );
GetSystemDirectoryW( systemdir, MAX_PATH );
lstrcpyW( cmdline, systemdir );
lstrcatW( cmdline, command_line );
if (CreateProcessW( NULL, cmdline, NULL, NULL, FALSE, DETACHED_PROCESS,
NULL, systemdir, &si, &pi ))
GetWindowsDirectoryW( windir, MAX_PATH );
strcpyW( app, windir );
strcatW( app, explorer );
strcpyW( cmdline, app );
strcatW( cmdline, args );
if (CreateProcessW( app, cmdline, NULL, NULL, FALSE, DETACHED_PROCESS,
NULL, windir, &si, &pi ))
{
TRACE( "started explorer pid %04x tid %04x\n", pi.dwProcessId, pi.dwThreadId );
WaitForInputIdle( pi.hProcess, 10000 );
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment