mirror of
https://github.com/reactos/reactos.git
synced 2024-10-02 07:26:47 +00:00
[SYSSETUP]
- Use a writable buffer for lpCommandLine in CreateProcessW. Simplify starting of control panel applets. Patch by Hermès Bélusca. - CORE-6570 #resolve #comment We need FishEye ;) svn path=/trunk/; revision=57277
This commit is contained in:
parent
9d3aee7b91
commit
c378d0a138
|
@ -786,33 +786,45 @@ SetKeyboardLayoutName(HWND hwnd)
|
|||
|
||||
|
||||
static BOOL
|
||||
RunControlPanelApplet(HWND hwnd, WCHAR *lpCommandLine)
|
||||
RunControlPanelApplet(HWND hwnd, PCWSTR pwszCPLParameters)
|
||||
{
|
||||
STARTUPINFOW StartupInfo;
|
||||
PROCESS_INFORMATION ProcessInformation;
|
||||
|
||||
ZeroMemory(&StartupInfo, sizeof(STARTUPINFOW));
|
||||
StartupInfo.cb = sizeof(STARTUPINFOW);
|
||||
|
||||
if (!CreateProcessW(NULL,
|
||||
lpCommandLine,
|
||||
NULL,
|
||||
NULL,
|
||||
FALSE,
|
||||
0,
|
||||
NULL,
|
||||
NULL,
|
||||
&StartupInfo,
|
||||
&ProcessInformation))
|
||||
if (pwszCPLParameters)
|
||||
{
|
||||
MessageBoxW(hwnd, L"Error: failed to launch rundll32", NULL, MB_ICONERROR);
|
||||
STARTUPINFOW StartupInfo;
|
||||
PROCESS_INFORMATION ProcessInformation;
|
||||
WCHAR CmdLine[MAX_PATH] = L"rundll32.exe shell32.dll,Control_RunDLL ";
|
||||
|
||||
ZeroMemory(&StartupInfo, sizeof(STARTUPINFOW));
|
||||
StartupInfo.cb = sizeof(STARTUPINFOW);
|
||||
|
||||
ASSERT(_countof(CmdLine) > wcslen(CmdLine) + wcslen(pwszCPLParameters));
|
||||
wcscat(CmdLine, pwszCPLParameters);
|
||||
|
||||
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 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 @@ LocalePageDlgProc(HWND hwndDlg,
|
|||
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 @@ LocalePageDlgProc(HWND hwndDlg,
|
|||
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;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue