Index: dll/win32/syssetup/wizard.c =================================================================== --- dll/win32/syssetup/wizard.c (révision 57214) +++ dll/win32/syssetup/wizard.c (copie de travail) @@ -786,33 +786,45 @@ static BOOL -RunControlPanelApplet(HWND hwnd, WCHAR *lpCommandLine) +RunControlPanelApplet(HWND hwnd, WCHAR* lpszCPLParameters) { - STARTUPINFOW StartupInfo; - PROCESS_INFORMATION ProcessInformation; + if (lpszCPLParameters) + { + STARTUPINFOW StartupInfo; + PROCESS_INFORMATION ProcessInformation; + WCHAR CmdLine[MAX_PATH] = L"rundll32.exe shell32.dll,Control_RunDLL "; - ZeroMemory(&StartupInfo, sizeof(STARTUPINFOW)); - StartupInfo.cb = sizeof(STARTUPINFOW); + ZeroMemory(&StartupInfo, sizeof(STARTUPINFOW)); + StartupInfo.cb = sizeof(STARTUPINFOW); - if (!CreateProcessW(NULL, - lpCommandLine, - NULL, - NULL, - FALSE, - 0, - NULL, - NULL, - &StartupInfo, - &ProcessInformation)) + // wcscat_s(CmdLine, MAX_PATH, lpszCPLParameters); + wcscat(CmdLine, lpszCPLParameters); + + if (!CreateProcessW(NULL, + CmdLine, + NULL, + NULL, + FALSE, + 0, + NULL, + NULL, + &StartupInfo, + &ProcessInformation)) + { + MessageBoxW(hwnd, L"Error: Failed to launch the Control Panel Applet.", NULL, MB_ICONERROR); + return FALSE; + } + + WaitForSingleObject(ProcessInformation.hProcess, INFINITE); + CloseHandle(ProcessInformation.hThread); + CloseHandle(ProcessInformation.hProcess); + return TRUE; + } + else { - MessageBoxW(hwnd, L"Error: failed to launch rundll32", NULL, MB_ICONERROR); + MessageBoxW(hwnd, L"Error: Failed to launch the Control Panel Applet.", NULL, MB_ICONERROR); return FALSE; } - - WaitForSingleObject(ProcessInformation.hProcess, INFINITE); - CloseHandle(ProcessInformation.hThread); - CloseHandle(ProcessInformation.hProcess); - return TRUE; } static VOID @@ -866,12 +878,12 @@ switch (LOWORD(wParam)) { case IDC_CUSTOMLOCALE: - RunControlPanelApplet(hwndDlg, L"rundll32.exe shell32.dll,Control_RunDLL intl.cpl,,5"); + RunControlPanelApplet(hwndDlg, L"intl.cpl,,5"); /* FIXME: Update input locale name */ break; case IDC_CUSTOMLAYOUT: - RunControlPanelApplet(hwndDlg, L"rundll32.exe shell32.dll,Control_RunDLL input.dll,@1"); + RunControlPanelApplet(hwndDlg, L"input.dll,@1"); break; } } @@ -888,13 +900,18 @@ PropSheet_SetWizButtons(GetParent(hwndDlg), PSWIZB_BACK | PSWIZB_NEXT); if (SetupData->UnattendSetup) { - WCHAR wszPath[MAX_PATH], wszBuf[1024]; + WCHAR wszPath[MAX_PATH]; if (GetRosInstallCD(wszPath, _countof(wszPath))) - swprintf(wszBuf, L"rundll32.exe shell32.dll,Control_RunDLL intl.cpl,,/f:\"%sreactos\\unattend.inf\"", wszPath); + { + WCHAR wszParams[1024]; + swprintf(wszParams, L"intl.cpl,,/f:\"%sreactos\\unattend.inf\"", wszPath); + RunControlPanelApplet(hwndDlg, wszParams); + } else - wcscpy(wszBuf, L"rundll32.exe shell32.dll,Control_RunDLL intl.cpl,,/f:\"unattend.inf\""); + { + RunControlPanelApplet(hwndDlg, L"intl.cpl,,/f:\"unattend.inf\""); + } - RunControlPanelApplet(hwndDlg, wszBuf); SetWindowLongPtr(hwndDlg, DWL_MSGRESULT, IDD_DATETIMEPAGE); return TRUE; }