mirror of
https://github.com/reactos/reactos.git
synced 2024-09-08 19:59:49 +00:00
[SYSDM]
Fix startup and recovery option dialog issues. Patch by Ricardo Hanke. Thanks a lot! CORE-8952 #resolve svn path=/trunk/; revision=65836
This commit is contained in:
parent
bf2b5fda05
commit
df82e81f89
|
@ -22,6 +22,7 @@ typedef struct _STARTINFO
|
||||||
INT iFreeLdrIni;
|
INT iFreeLdrIni;
|
||||||
} STARTINFO, *PSTARTINFO;
|
} STARTINFO, *PSTARTINFO;
|
||||||
|
|
||||||
|
BOOL SaveRecoveryOptions;
|
||||||
|
|
||||||
static VOID
|
static VOID
|
||||||
SetTimeout(HWND hwndDlg, INT Timeout)
|
SetTimeout(HWND hwndDlg, INT Timeout)
|
||||||
|
@ -544,13 +545,21 @@ WriteStartupRecoveryOptions(HWND hwndDlg, PSTARTINFO pStartInfo)
|
||||||
HKEY hKey;
|
HKEY hKey;
|
||||||
DWORD lResult;
|
DWORD lResult;
|
||||||
|
|
||||||
if (RegOpenKeyExW(HKEY_LOCAL_MACHINE,
|
lResult = (DWORD)RegCreateKeyExW(HKEY_LOCAL_MACHINE,
|
||||||
L"System\\CurrentControlSet\\Control\\CrashControl",
|
L"System\\CurrentControlSet\\Control\\CrashControl",
|
||||||
0,
|
0,
|
||||||
|
NULL,
|
||||||
|
REG_OPTION_NON_VOLATILE,
|
||||||
KEY_WRITE,
|
KEY_WRITE,
|
||||||
&hKey) != ERROR_SUCCESS)
|
NULL,
|
||||||
|
&hKey,
|
||||||
|
NULL);
|
||||||
|
if (lResult != ERROR_SUCCESS)
|
||||||
{
|
{
|
||||||
/* Failed to open key */
|
/* Failed to open key */
|
||||||
|
SetLastError(lResult);
|
||||||
|
ShowLastWin32Error(hwndDlg);
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -587,15 +596,31 @@ LoadRecoveryOptions(HWND hwndDlg, PSTARTINFO pStartInfo)
|
||||||
{
|
{
|
||||||
HKEY hKey;
|
HKEY hKey;
|
||||||
WCHAR szName[MAX_PATH];
|
WCHAR szName[MAX_PATH];
|
||||||
DWORD dwValue, dwValueLength, dwType;
|
DWORD dwValue, dwValueLength, dwType, dwResult;
|
||||||
|
|
||||||
if (RegOpenKeyEx(HKEY_LOCAL_MACHINE,
|
dwResult = (DWORD)RegCreateKeyExW(HKEY_LOCAL_MACHINE,
|
||||||
L"System\\CurrentControlSet\\Control\\CrashControl",
|
L"System\\CurrentControlSet\\Control\\CrashControl",
|
||||||
0,
|
0,
|
||||||
|
NULL,
|
||||||
|
REG_OPTION_NON_VOLATILE,
|
||||||
KEY_READ,
|
KEY_READ,
|
||||||
&hKey) != ERROR_SUCCESS)
|
NULL,
|
||||||
|
&hKey,
|
||||||
|
NULL);
|
||||||
|
if (dwResult != ERROR_SUCCESS)
|
||||||
{
|
{
|
||||||
/* Failed to open key */
|
/* Failed to open key */
|
||||||
|
SetLastError(dwResult);
|
||||||
|
ShowLastWin32Error(hwndDlg);
|
||||||
|
|
||||||
|
EnableWindow(GetDlgItem(hwndDlg, IDC_STRRECWRITEEVENT), FALSE);
|
||||||
|
EnableWindow(GetDlgItem(hwndDlg, IDC_STRRECSENDALERT), FALSE);
|
||||||
|
EnableWindow(GetDlgItem(hwndDlg, IDC_STRRECRESTART), FALSE);
|
||||||
|
EnableWindow(GetDlgItem(hwndDlg, IDC_STRRECDEBUGCOMBO), FALSE);
|
||||||
|
EnableWindow(GetDlgItem(hwndDlg, IDC_STRRECDUMPFILE), FALSE);
|
||||||
|
EnableWindow(GetDlgItem(hwndDlg, IDC_STRRECOVERWRITE), FALSE);
|
||||||
|
|
||||||
|
SaveRecoveryOptions = FALSE;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -633,7 +658,7 @@ LoadRecoveryOptions(HWND hwndDlg, PSTARTINFO pStartInfo)
|
||||||
SendDlgItemMessageW(hwndDlg, IDC_STRRECDEBUGCOMBO, CB_ADDSTRING, (WPARAM)0, (LPARAM) szName);
|
SendDlgItemMessageW(hwndDlg, IDC_STRRECDEBUGCOMBO, CB_ADDSTRING, (WPARAM)0, (LPARAM) szName);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (LoadString(hApplet, IDS_FULL_DUMP, szName, sizeof(szName) / sizeof(WCHAR)))
|
if (LoadStringW(hApplet, IDS_FULL_DUMP, szName, sizeof(szName) / sizeof(WCHAR)))
|
||||||
{
|
{
|
||||||
szName[(sizeof(szName)/sizeof(WCHAR))-1] = L'\0';
|
szName[(sizeof(szName)/sizeof(WCHAR))-1] = L'\0';
|
||||||
SendDlgItemMessageW(hwndDlg, IDC_STRRECDEBUGCOMBO, CB_ADDSTRING, (WPARAM)0, (LPARAM) szName);
|
SendDlgItemMessageW(hwndDlg, IDC_STRRECDEBUGCOMBO, CB_ADDSTRING, (WPARAM)0, (LPARAM) szName);
|
||||||
|
@ -653,6 +678,8 @@ LoadRecoveryOptions(HWND hwndDlg, PSTARTINFO pStartInfo)
|
||||||
|
|
||||||
SetCrashDlgItems(hwndDlg, pStartInfo);
|
SetCrashDlgItems(hwndDlg, pStartInfo);
|
||||||
RegCloseKey(hKey);
|
RegCloseKey(hKey);
|
||||||
|
|
||||||
|
SaveRecoveryOptions = TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -748,7 +775,11 @@ StartRecDlgProc(HWND hwndDlg,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (SaveRecoveryOptions)
|
||||||
|
{
|
||||||
WriteStartupRecoveryOptions(hwndDlg, pStartInfo);
|
WriteStartupRecoveryOptions(hwndDlg, pStartInfo);
|
||||||
|
}
|
||||||
|
|
||||||
EndDialog(hwndDlg,
|
EndDialog(hwndDlg,
|
||||||
LOWORD(wParam));
|
LOWORD(wParam));
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
|
Loading…
Reference in a new issue