Author: ekohl
Date: Fri Dec 26 13:11:57 2014
New Revision: 65836
URL:
http://svn.reactos.org/svn/reactos?rev=65836&view=rev
Log:
[SYSDM]
Fix startup and recovery option dialog issues.
Patch by Ricardo Hanke.
Thanks a lot!
CORE-8952 #resolve
Modified:
trunk/reactos/dll/cpl/sysdm/startrec.c
Modified: trunk/reactos/dll/cpl/sysdm/startrec.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/sysdm/startrec.c?r…
==============================================================================
--- trunk/reactos/dll/cpl/sysdm/startrec.c [iso-8859-1] (original)
+++ trunk/reactos/dll/cpl/sysdm/startrec.c [iso-8859-1] Fri Dec 26 13:11:57 2014
@@ -22,6 +22,7 @@
INT iFreeLdrIni;
} STARTINFO, *PSTARTINFO;
+BOOL SaveRecoveryOptions;
static VOID
SetTimeout(HWND hwndDlg, INT Timeout)
@@ -544,13 +545,21 @@
HKEY hKey;
DWORD lResult;
- if (RegOpenKeyExW(HKEY_LOCAL_MACHINE,
- L"System\\CurrentControlSet\\Control\\CrashControl",
- 0,
- KEY_WRITE,
- &hKey) != ERROR_SUCCESS)
- {
- /* Failed to open key */
+ lResult = (DWORD)RegCreateKeyExW(HKEY_LOCAL_MACHINE,
+
L"System\\CurrentControlSet\\Control\\CrashControl",
+ 0,
+ NULL,
+ REG_OPTION_NON_VOLATILE,
+ KEY_WRITE,
+ NULL,
+ &hKey,
+ NULL);
+ if (lResult != ERROR_SUCCESS)
+ {
+ /* Failed to open key */
+ SetLastError(lResult);
+ ShowLastWin32Error(hwndDlg);
+
return;
}
@@ -587,15 +596,31 @@
{
HKEY hKey;
WCHAR szName[MAX_PATH];
- DWORD dwValue, dwValueLength, dwType;
-
- if (RegOpenKeyEx(HKEY_LOCAL_MACHINE,
- L"System\\CurrentControlSet\\Control\\CrashControl",
- 0,
- KEY_READ,
- &hKey) != ERROR_SUCCESS)
+ DWORD dwValue, dwValueLength, dwType, dwResult;
+
+ dwResult = (DWORD)RegCreateKeyExW(HKEY_LOCAL_MACHINE,
+
L"System\\CurrentControlSet\\Control\\CrashControl",
+ 0,
+ NULL,
+ REG_OPTION_NON_VOLATILE,
+ KEY_READ,
+ NULL,
+ &hKey,
+ NULL);
+ if (dwResult != ERROR_SUCCESS)
{
/* 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;
}
@@ -633,7 +658,7 @@
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';
SendDlgItemMessageW(hwndDlg, IDC_STRRECDEBUGCOMBO, CB_ADDSTRING, (WPARAM)0,
(LPARAM) szName);
@@ -653,6 +678,8 @@
SetCrashDlgItems(hwndDlg, pStartInfo);
RegCloseKey(hKey);
+
+ SaveRecoveryOptions = TRUE;
}
@@ -748,7 +775,11 @@
}
}
- WriteStartupRecoveryOptions(hwndDlg, pStartInfo);
+ if (SaveRecoveryOptions)
+ {
+ WriteStartupRecoveryOptions(hwndDlg, pStartInfo);
+ }
+
EndDialog(hwndDlg,
LOWORD(wParam));
return TRUE;