ReactOS 0.4.15-dev-7834-g00c4b3d
startrec.c
Go to the documentation of this file.
1/*
2 * PROJECT: ReactOS System Control Panel Applet
3 * LICENSE: GPL - See COPYING in the top level directory
4 * FILE: dll/cpl/sysdm/startrec.c
5 * PURPOSE: Computer settings for startup and recovery
6 * COPYRIGHT: Copyright 2006 Ged Murphy <gedmurphy@gmail.com>
7 * Copyright 2006 Christoph von Wittich <Christoph@ApiViewer.de>
8 * Copyright 2007 Johannes Anderwald <johannes.anderwald@reactos.org>
9 */
10
11#include "precomp.h"
12
13#include <shlwapi.h>
14
15typedef struct _BOOTRECORD
16{
22
23typedef struct _STARTINFO
24{
31
33
34static VOID
36{
37 if (Timeout == 0)
38 {
41 }
42 else
43 {
46 }
49}
50
51static VOID
53{
54 if (Timeout == 0)
55 {
58 }
59 else
60 {
63 }
66}
67
68
69static DWORD
70GetSystemDrive(WCHAR **szSystemDrive)
71{
72 DWORD dwBufSize;
73
74 /* Get Path to freeldr.ini or boot.ini */
75 *szSystemDrive = HeapAlloc(GetProcessHeap(), 0, MAX_PATH * sizeof(WCHAR));
76 if (*szSystemDrive != NULL)
77 {
78 dwBufSize = GetEnvironmentVariableW(L"SystemDrive", *szSystemDrive, MAX_PATH);
79 if (dwBufSize > MAX_PATH)
80 {
81 WCHAR *szTmp;
82 DWORD dwBufSize2;
83
84 szTmp = HeapReAlloc(GetProcessHeap(), 0, *szSystemDrive, dwBufSize * sizeof(WCHAR));
85 if (szTmp == NULL)
86 goto FailGetSysDrive;
87
88 *szSystemDrive = szTmp;
89
90 dwBufSize2 = GetEnvironmentVariableW(L"SystemDrive", *szSystemDrive, dwBufSize);
91 if (dwBufSize2 > dwBufSize || dwBufSize2 == 0)
92 goto FailGetSysDrive;
93 }
94 else if (dwBufSize == 0)
95 {
96FailGetSysDrive:
97 HeapFree(GetProcessHeap(), 0, *szSystemDrive);
98 *szSystemDrive = NULL;
99 return 0;
100 }
101
102 return dwBufSize;
103 }
104
105 return 0;
106}
107
108static PBOOTRECORD
109ReadFreeldrSection(HINF hInf, WCHAR *szSectionName)
110{
111 PBOOTRECORD pRecord;
112 INFCONTEXT InfContext;
114 WCHAR szValue[MAX_PATH];
115 DWORD LineLength;
116
117 if (!SetupFindFirstLineW(hInf,
118 szSectionName,
119 NULL,
120 &InfContext))
121 {
122 /* Failed to find section */
123 return NULL;
124 }
125
127 if (pRecord == NULL)
128 {
129 return NULL;
130 }
131
132 wcscpy(pRecord->szSectionName, szSectionName);
133
134 do
135 {
136 if (!SetupGetStringFieldW(&InfContext,
137 0,
138 szName,
139 sizeof(szName) / sizeof(WCHAR),
140 &LineLength))
141 {
142 break;
143 }
144
145 if (!SetupGetStringFieldW(&InfContext,
146 1,
147 szValue,
148 sizeof(szValue) / sizeof(WCHAR),
149 &LineLength))
150 {
151 break;
152 }
153
154 if (!_wcsnicmp(szName, L"BootType", 8))
155 {
156 if (!_wcsnicmp(szValue, L"ReactOS", 7))
157 {
158 // FIXME: Store as enum
159 pRecord->BootType = 1;
160 }
161 else
162 {
163 pRecord->BootType = 0;
164 }
165 }
166 else if (!_wcsnicmp(szName, L"SystemPath", 10))
167 {
168 wcscpy(pRecord->szBootPath, szValue);
169 }
170 else if (!_wcsnicmp(szName, L"Options", 7))
171 {
172 // FIXME: Store flags as values
173 wcscpy(pRecord->szOptions, szValue);
174 }
175
176 }
177 while (SetupFindNextLine(&InfContext, &InfContext));
178
179 return pRecord;
180}
181
182
183static INT
185{
186 INFCONTEXT InfContext;
187 PBOOTRECORD pRecord;
188 WCHAR szDefaultOs[MAX_PATH];
190 WCHAR szValue[MAX_PATH];
191 DWORD LineLength;
192 DWORD TimeOut;
193 LRESULT lResult;
194
195 if (!SetupFindFirstLineW(hInf,
196 L"FREELOADER",
197 L"DefaultOS",
198 &InfContext))
199 {
200 /* Failed to find default os */
201 return FALSE;
202 }
203
204 if (!SetupGetStringFieldW(&InfContext,
205 1,
206 szDefaultOs,
207 sizeof(szDefaultOs) / sizeof(WCHAR),
208 &LineLength))
209 {
210 /* No key */
211 return FALSE;
212 }
213
214 if (!SetupFindFirstLineW(hInf,
215 L"FREELOADER",
216 L"TimeOut",
217 &InfContext))
218 {
219 /* Expected to find timeout value */
220 return FALSE;
221 }
222
223
224 if (!SetupGetIntField(&InfContext,
225 1,
226 (PINT)&TimeOut))
227 {
228 /* Failed to retrieve timeout */
229 return FALSE;
230 }
231
232 if (!SetupFindFirstLineW(hInf,
233 L"Operating Systems",
234 NULL,
235 &InfContext))
236 {
237 /* Expected list of operating systems */
238 return FALSE;
239 }
240
241 do
242 {
243 if (!SetupGetStringFieldW(&InfContext,
244 0,
245 szName,
246 sizeof(szName) / sizeof(WCHAR),
247 &LineLength))
248 {
249 /* The ini file is messed up */
250 return FALSE;
251 }
252
253 if (!SetupGetStringFieldW(&InfContext,
254 1,
255 szValue,
256 sizeof(szValue) / sizeof(WCHAR),
257 &LineLength))
258 {
259 /* The ini file is messed up */
260 return FALSE;
261 }
262
263 pRecord = ReadFreeldrSection(hInf, szName);
264 if (pRecord)
265 {
266 lResult = SendDlgItemMessageW(hwndDlg, IDC_STRECOSCOMBO, CB_ADDSTRING, (WPARAM)0, (LPARAM)szValue);
267 if (lResult != CB_ERR)
268 {
269 SendDlgItemMessageW(hwndDlg, IDC_STRECOSCOMBO, CB_SETITEMDATA, (WPARAM)lResult, (LPARAM)pRecord);
270 if (!wcscmp(szDefaultOs, szName))
271 {
272 /* We store the friendly name as key */
273 wcscpy(szDefaultOs, szValue);
274 }
275 }
276 else
277 {
278 HeapFree(GetProcessHeap(), 0, pRecord);
279 }
280 }
281 }
282 while (SetupFindNextLine(&InfContext, &InfContext));
283
284 /* Find default os in list */
285 lResult = SendDlgItemMessageW(hwndDlg, IDC_STRECOSCOMBO, CB_FINDSTRING, (WPARAM)-1, (LPARAM)szDefaultOs);
286 if (lResult != CB_ERR)
287 {
288 /* Set cur sel */
290 }
291
292 if(TimeOut)
293 {
295 }
296
297 SetTimeout(hwndDlg, TimeOut);
298
299 return TRUE;
300}
301
302static INT
304{
305 INFCONTEXT InfContext;
307 WCHAR szValue[MAX_PATH];
308 DWORD LineLength;
309 DWORD TimeOut = 0;
310 WCHAR szDefaultOS[MAX_PATH];
311 WCHAR szOptions[MAX_PATH];
312 PBOOTRECORD pRecord;
313 LRESULT lResult;
314
315 if(!SetupFindFirstLineW(hInf,
316 L"boot loader",
317 NULL,
318 &InfContext))
319 {
320 return FALSE;
321 }
322
323 do
324 {
325 if (!SetupGetStringFieldW(&InfContext,
326 0,
327 szName,
328 sizeof(szName) / sizeof(WCHAR),
329 &LineLength))
330 {
331 return FALSE;
332 }
333
334 if (!SetupGetStringFieldW(&InfContext,
335 1,
336 szValue,
337 sizeof(szValue) / sizeof(WCHAR),
338 &LineLength))
339 {
340 return FALSE;
341 }
342
343 if (!_wcsnicmp(szName, L"timeout", 7))
344 {
345 TimeOut = _wtoi(szValue);
346 }
347
348 if (!_wcsnicmp(szName, L"default", 7))
349 {
350 wcscpy(szDefaultOS, szValue);
351 }
352
353 }
354 while (SetupFindNextLine(&InfContext, &InfContext));
355
356 if (!SetupFindFirstLineW(hInf,
357 L"operating systems",
358 NULL,
359 &InfContext))
360 {
361 /* Failed to find operating systems section */
362 return FALSE;
363 }
364
365 do
366 {
367 if (!SetupGetStringFieldW(&InfContext,
368 0,
369 szName,
370 sizeof(szName) / sizeof(WCHAR),
371 &LineLength))
372 {
373 return FALSE;
374 }
375
376 if (!SetupGetStringFieldW(&InfContext,
377 1,
378 szValue,
379 sizeof(szValue) / sizeof(WCHAR),
380 &LineLength))
381 {
382 return FALSE;
383 }
384
385 SetupGetStringFieldW(&InfContext,
386 2,
387 szOptions,
388 sizeof(szOptions) / sizeof(WCHAR),
389 &LineLength);
390
392 if (pRecord)
393 {
394 pRecord->BootType = 0;
395 wcscpy(pRecord->szBootPath, szName);
396 wcscpy(pRecord->szSectionName, szValue);
397 wcscpy(pRecord->szOptions, szOptions);
398
399 if (!wcscmp(szName, szDefaultOS))
400 {
401 /* ms boot ini stores the path not the friendly name */
402 wcscpy(szDefaultOS, szValue);
403 }
404
405 lResult = SendDlgItemMessageW(hwndDlg, IDC_STRECOSCOMBO, CB_ADDSTRING, (WPARAM)0, (LPARAM)szValue);
406 if (lResult != CB_ERR)
407 {
408 SendDlgItemMessageW(hwndDlg, IDC_STRECOSCOMBO, CB_SETITEMDATA, (WPARAM)lResult, (LPARAM)pRecord);
409 }
410 else
411 {
412 HeapFree(GetProcessHeap(), 0, pRecord);
413 }
414 }
415
416 }
417 while (SetupFindNextLine(&InfContext, &InfContext));
418
419 /* Find default os in list */
420 lResult = SendDlgItemMessageW(hwndDlg, IDC_STRECOSCOMBO, CB_FINDSTRING, (WPARAM)0, (LPARAM)szDefaultOS);
421 if (lResult != CB_ERR)
422 {
423 /* Set cur sel */
425 }
426
427 if(TimeOut)
428 {
430 }
431
432 SetTimeout(hwndDlg, TimeOut);
433
434 return TRUE;
435}
436
437static VOID
439{
440 LRESULT lIndex;
441 LONG index;
442 PBOOTRECORD pRecord;
443
445 if (lIndex == CB_ERR)
446 return;
447
448 for (index = 0; index <lIndex; index++)
449 {
451 if ((INT_PTR)pRecord != CB_ERR)
452 {
453 HeapFree(GetProcessHeap(), 0, pRecord);
454 }
455 }
456
458}
459
460static LRESULT
461LoadOSList(HWND hwndDlg, PSTARTINFO pStartInfo)
462{
463 DWORD dwBufSize;
464 WCHAR *szSystemDrive;
465 HINF hInf;
466
467 dwBufSize = GetSystemDrive(&szSystemDrive);
468 if (dwBufSize == 0)
469 return FALSE;
470
471 wcscpy(pStartInfo->szFreeldrIni, szSystemDrive);
472 wcscat(pStartInfo->szFreeldrIni, L"\\freeldr.ini");
473
474 if (PathFileExistsW(pStartInfo->szFreeldrIni))
475 {
476 /* Free resource previously allocated by GetSystemDrive() */
477 HeapFree(GetProcessHeap(), 0, szSystemDrive);
478 /* freeldr.ini exists */
479 hInf = SetupOpenInfFileW(pStartInfo->szFreeldrIni,
480 NULL,
482 NULL);
483
484 if (hInf != INVALID_HANDLE_VALUE)
485 {
486 LoadFreeldrSettings(hInf, hwndDlg);
487 SetupCloseInfFile(hInf);
488 pStartInfo->iFreeLdrIni = 1;
489 return TRUE;
490 }
491 return FALSE;
492 }
493
494 /* Try loading boot.ini settings */
495 wcscpy(pStartInfo->szFreeldrIni, szSystemDrive);
496 wcscat(pStartInfo->szFreeldrIni, L"\\boot.ini");
497
498 /* Free resource previously allocated by GetSystemDrive() */
499 HeapFree(GetProcessHeap(), 0, szSystemDrive);
500
501 if (PathFileExistsW(pStartInfo->szFreeldrIni))
502 {
503 /* Load boot.ini settings */
504 hInf = SetupOpenInfFileW(pStartInfo->szFreeldrIni,
505 NULL,
507 NULL);
508
509 if (hInf != INVALID_HANDLE_VALUE)
510 {
511 LoadBootSettings(hInf, hwndDlg);
512 SetupCloseInfFile(hInf);
513 pStartInfo->iFreeLdrIni = 2;
514 return TRUE;
515 }
516
517 return FALSE;
518 }
519
520 return FALSE;
521}
522
523static VOID
525{
526 if (pStartInfo->dwCrashDumpEnabled == 0)
527 {
528 /* No crash information required */
531 }
532 else if (pStartInfo->dwCrashDumpEnabled == 3)
533 {
534 /* Minidump type */
538 }
539 else if (pStartInfo->dwCrashDumpEnabled == 1 || pStartInfo->dwCrashDumpEnabled == 2)
540 {
541 /* Kernel or complete dump */
545 }
547}
548
549static VOID
551{
552 HKEY hKey;
553 DWORD lResult;
554
556 L"System\\CurrentControlSet\\Control\\CrashControl",
557 0,
558 NULL,
560 KEY_WRITE,
561 NULL,
562 &hKey,
563 NULL);
564 if (lResult != ERROR_SUCCESS)
565 {
566 /* Failed to open key */
567 SetLastError(lResult);
568 ShowLastWin32Error(hwndDlg);
569
570 return;
571 }
572
574 RegSetValueExW(hKey, L"LogEvent", 0, REG_DWORD, (LPBYTE)&lResult, sizeof(lResult));
575
577 RegSetValueExW(hKey, L"SendAlert", 0, REG_DWORD, (LPBYTE)&lResult, sizeof(lResult));
578
579 lResult = (DWORD) SendDlgItemMessage(hwndDlg, IDC_STRRECRESTART, BM_GETCHECK, (WPARAM)0, (LPARAM)0);
580 RegSetValueExW(hKey, L"AutoReboot", 0, REG_DWORD, (LPBYTE)&lResult, sizeof(lResult));
581
583 RegSetValueExW(hKey, L"Overwrite", 0, REG_DWORD, (LPBYTE)&lResult, sizeof(lResult));
584
585
586 if (pStartInfo->dwCrashDumpEnabled == 1 || pStartInfo->dwCrashDumpEnabled == 2)
587 {
588 SendDlgItemMessage(hwndDlg, IDC_STRRECDUMPFILE, WM_GETTEXT, (WPARAM)sizeof(pStartInfo->szDumpFile) / sizeof(WCHAR), (LPARAM)pStartInfo->szDumpFile);
589 RegSetValueExW(hKey, L"DumpFile", 0, REG_EXPAND_SZ, (LPBYTE)pStartInfo->szDumpFile, (wcslen(pStartInfo->szDumpFile) + 1) * sizeof(WCHAR));
590 }
591 else if (pStartInfo->dwCrashDumpEnabled == 3)
592 {
593 SendDlgItemMessage(hwndDlg, IDC_STRRECDUMPFILE, WM_GETTEXT, (WPARAM)sizeof(pStartInfo->szDumpFile) / sizeof(WCHAR), (LPARAM)pStartInfo->szDumpFile);
594 RegSetValueExW(hKey, L"MinidumpDir", 0, REG_EXPAND_SZ, (LPBYTE)pStartInfo->szDumpFile, (wcslen(pStartInfo->szDumpFile) + 1) * sizeof(WCHAR));
595 }
596
597 RegSetValueExW(hKey, L"CrashDumpEnabled", 0, REG_DWORD, (LPBYTE)&pStartInfo->dwCrashDumpEnabled, sizeof(pStartInfo->dwCrashDumpEnabled));
599}
600
601static VOID
603{
604 HKEY hKey;
606 DWORD dwValue, dwValueLength, dwType, dwResult;
607
609 L"System\\CurrentControlSet\\Control\\CrashControl",
610 0,
611 NULL,
613 KEY_READ,
614 NULL,
615 &hKey,
616 NULL);
617 if (dwResult != ERROR_SUCCESS)
618 {
619 /* Failed to open key */
620 SetLastError(dwResult);
621 ShowLastWin32Error(hwndDlg);
622
629
631 return;
632 }
633
634 dwValueLength = sizeof(DWORD);
635 if (RegQueryValueExW(hKey, L"LogEvent", NULL, &dwType, (LPBYTE)&dwValue, &dwValueLength) == ERROR_SUCCESS && dwType == REG_DWORD && dwValue)
637
638 dwValueLength = sizeof(DWORD);
639 if (RegQueryValueExW(hKey, L"SendAlert", NULL, &dwType, (LPBYTE)&dwValue, &dwValueLength) == ERROR_SUCCESS && dwType == REG_DWORD && dwValue)
641
642 dwValueLength = sizeof(DWORD);
643 if (RegQueryValueExW(hKey, L"AutoReboot", NULL, &dwType, (LPBYTE)&dwValue, &dwValueLength) == ERROR_SUCCESS && dwType == REG_DWORD && dwValue)
645
646 dwValueLength = sizeof(DWORD);
647 if (RegQueryValueExW(hKey, L"Overwrite", NULL, &dwType, (LPBYTE)&dwValue, &dwValueLength) == ERROR_SUCCESS && dwType == REG_DWORD && dwValue)
649
650 dwValueLength = sizeof(DWORD);
651 if (RegQueryValueExW(hKey, L"CrashDumpEnabled", NULL, &dwType, (LPBYTE)&dwValue, &dwValueLength) == ERROR_SUCCESS && dwType == REG_DWORD && dwValue)
652 pStartInfo->dwCrashDumpEnabled = dwValue;
653
654 dwValueLength = sizeof(pStartInfo->szDumpFile);
655 if (RegQueryValueExW(hKey, L"DumpFile", NULL, &dwType, (LPBYTE)pStartInfo->szDumpFile, &dwValueLength) != ERROR_SUCCESS)
656 pStartInfo->szDumpFile[0] = L'\0';
657
658 dwValueLength = sizeof(pStartInfo->szMinidumpDir);
659 if (RegQueryValueExW(hKey, L"MinidumpDir", NULL, &dwType, (LPBYTE)pStartInfo->szMinidumpDir, &dwValueLength) != ERROR_SUCCESS)
660 pStartInfo->szMinidumpDir[0] = L'\0';
661
662 if (LoadStringW(hApplet, IDS_NO_DUMP, szName, sizeof(szName) / sizeof(WCHAR)))
663 {
664 szName[(sizeof(szName)/sizeof(WCHAR))-1] = L'\0';
666 }
667
668 if (LoadStringW(hApplet, IDS_FULL_DUMP, szName, sizeof(szName) / sizeof(WCHAR)))
669 {
670 szName[(sizeof(szName)/sizeof(WCHAR))-1] = L'\0';
672 }
673
674 if (LoadStringW(hApplet, IDS_KERNEL_DUMP, szName, sizeof(szName) / sizeof(WCHAR)))
675 {
676 szName[(sizeof(szName)/sizeof(WCHAR))-1] = L'\0';
678 }
679
680 if (LoadStringW(hApplet, IDS_MINI_DUMP, szName, sizeof(szName) / sizeof(WCHAR)))
681 {
682 szName[(sizeof(szName)/sizeof(WCHAR))-1] = L'\0';
684 }
685
686 SetCrashDlgItems(hwndDlg, pStartInfo);
688
690}
691
692
693/* Property page dialog callback */
696 UINT uMsg,
699{
700 PSTARTINFO pStartInfo;
701 PBOOTRECORD pRecord;
702 int iTimeout;
703 LRESULT lResult;
704 WCHAR szTimeout[10];
705
707
708 pStartInfo = (PSTARTINFO)GetWindowLongPtr(hwndDlg, DWLP_USER);
709
710 switch(uMsg)
711 {
712 case WM_INITDIALOG:
713 pStartInfo = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(STARTINFO));
714 SetWindowLongPtr(hwndDlg, DWLP_USER, (LONG_PTR)pStartInfo);
715
716 LoadRecoveryOptions(hwndDlg, pStartInfo);
717 SetRecoveryTimeout(hwndDlg, 0);
718 return LoadOSList(hwndDlg, pStartInfo);
719
720 case WM_DESTROY:
721 DeleteBootRecords(hwndDlg);
722 HeapFree(GetProcessHeap(), 0, pStartInfo);
723 break;
724
725 case WM_COMMAND:
726 switch(LOWORD(wParam))
727 {
728 case IDC_STRRECEDIT:
729 ShellExecuteW(0, L"open", L"notepad", pStartInfo->szFreeldrIni, NULL, SW_SHOWNORMAL);
730 // FIXME: Use CreateProcess and wait untill finished
731 // DeleteBootRecords(hwndDlg);
732 // LoadOSList(hwndDlg);
733 break;
734
735 case IDOK:
736 /* Save timeout */
738 iTimeout = SendDlgItemMessage(hwndDlg, IDC_STRRECLISTUPDWN, UDM_GETPOS, (WPARAM)0, (LPARAM)0);
739 else
740 iTimeout = 0;
741 swprintf(szTimeout, L"%i", iTimeout);
742
744 if (lResult == CB_ERR)
745 {
746 /* ? */
747 DeleteBootRecords(hwndDlg);
748 return TRUE;
749 }
750
751 pRecord = (PBOOTRECORD) SendDlgItemMessage(hwndDlg, IDC_STRECOSCOMBO, CB_GETITEMDATA, (WPARAM)lResult, (LPARAM)0);
752
753 if ((INT_PTR)pRecord != CB_ERR)
754 {
755 if (pStartInfo->iFreeLdrIni == 1) // FreeLdrIni style
756 {
757 /* Set default timeout */
758 WritePrivateProfileStringW(L"FREELOADER",
759 L"TimeOut",
760 szTimeout,
761 pStartInfo->szFreeldrIni);
762 /* Set default OS */
763 WritePrivateProfileStringW(L"FREELOADER",
764 L"DefaultOS",
765 pRecord->szSectionName,
766 pStartInfo->szFreeldrIni);
767
768 }
769 else if (pStartInfo->iFreeLdrIni == 2) // BootIni style
770 {
771 /* Set default timeout */
772 WritePrivateProfileStringW(L"boot loader",
773 L"timeout",
774 szTimeout,
775 pStartInfo->szFreeldrIni);
776 /* Set default OS */
777 WritePrivateProfileStringW(L"boot loader",
778 L"default",
779 pRecord->szBootPath,
780 pStartInfo->szFreeldrIni);
781
782 }
783 }
784
786 {
787 WriteStartupRecoveryOptions(hwndDlg, pStartInfo);
788 }
789
790 EndDialog(hwndDlg,
791 LOWORD(wParam));
792 return TRUE;
793
794 case IDCANCEL:
795 EndDialog(hwndDlg,
796 LOWORD(wParam));
797 return TRUE;
798
799 case IDC_STRECLIST:
801 SetTimeout(hwndDlg, 30);
802 else
803 SetTimeout(hwndDlg, 0);
804 break;
805
806 case IDC_STRRECREC:
808 SetRecoveryTimeout(hwndDlg, 30);
809 else
810 SetRecoveryTimeout(hwndDlg, 0);
811 break;
812
815 {
816 LRESULT lResult;
817
819 if (lResult != CB_ERR && lResult != (LRESULT)pStartInfo->dwCrashDumpEnabled)
820 {
821 if (pStartInfo->dwCrashDumpEnabled == 1 || pStartInfo->dwCrashDumpEnabled == 2)
822 {
823 SendDlgItemMessageW(hwndDlg, IDC_STRRECDUMPFILE, WM_GETTEXT, (WPARAM)sizeof(pStartInfo->szDumpFile) / sizeof(WCHAR), (LPARAM)pStartInfo->szDumpFile);
824 }
825 else if (pStartInfo->dwCrashDumpEnabled == 3)
826 {
827 SendDlgItemMessageW(hwndDlg, IDC_STRRECDUMPFILE, WM_GETTEXT, (WPARAM)sizeof(pStartInfo->szMinidumpDir) / sizeof(WCHAR), (LPARAM)pStartInfo->szMinidumpDir);
828 }
829
830 pStartInfo->dwCrashDumpEnabled = (DWORD)lResult;
831 SetCrashDlgItems(hwndDlg, pStartInfo);
832 }
833 }
834 break;
835 }
836 break;
837 }
838
839 return FALSE;
840}
char szTmp[518]
#define index(s, c)
Definition: various.h:29
#define RegCloseKey(hKey)
Definition: registry.h:49
WPARAM wParam
Definition: combotst.c:138
LPARAM lParam
Definition: combotst.c:139
#define ERROR_SUCCESS
Definition: deptool.c:10
#define NULL
Definition: types.h:112
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
HINSTANCE hApplet
Definition: access.c:17
#define IDS_NO_DUMP
Definition: resource.h:27
#define IDS_FULL_DUMP
Definition: resource.h:30
#define IDC_STRRECREC
Definition: resource.h:178
#define IDC_STRRECRECUPDWN
Definition: resource.h:180
#define IDC_STRRECDEBUGCOMBO
Definition: resource.h:185
#define IDC_STRRECOVERWRITE
Definition: resource.h:187
#define IDC_STRRECRESTART
Definition: resource.h:184
#define IDC_STRRECSENDALERT
Definition: resource.h:183
#define IDC_STRRECEDIT
Definition: resource.h:181
#define IDC_STRRECLISTUPDWN
Definition: resource.h:177
#define IDC_STRRECWRITEEVENT
Definition: resource.h:182
#define IDS_KERNEL_DUMP
Definition: resource.h:29
#define IDC_STRECLIST
Definition: resource.h:175
#define IDC_STRRECRECEDIT
Definition: resource.h:179
#define IDC_STRECOSCOMBO
Definition: resource.h:174
#define IDS_MINI_DUMP
Definition: resource.h:28
#define IDC_STRRECDUMPFILE
Definition: resource.h:186
#define IDC_STRRECLISTEDIT
Definition: resource.h:176
LONG WINAPI RegCreateKeyExW(_In_ HKEY hKey, _In_ LPCWSTR lpSubKey, _In_ DWORD Reserved, _In_opt_ LPWSTR lpClass, _In_ DWORD dwOptions, _In_ REGSAM samDesired, _In_opt_ LPSECURITY_ATTRIBUTES lpSecurityAttributes, _Out_ PHKEY phkResult, _Out_opt_ LPDWORD lpdwDisposition)
Definition: reg.c:1096
LONG WINAPI RegSetValueExW(_In_ HKEY hKey, _In_ LPCWSTR lpValueName, _In_ DWORD Reserved, _In_ DWORD dwType, _In_ CONST BYTE *lpData, _In_ DWORD cbData)
Definition: reg.c:4882
LONG WINAPI RegQueryValueExW(_In_ HKEY hkeyorg, _In_ LPCWSTR name, _In_ LPDWORD reserved, _In_ LPDWORD type, _In_ LPBYTE data, _In_ LPDWORD count)
Definition: reg.c:4103
#define GetProcessHeap()
Definition: compat.h:736
#define GetEnvironmentVariableW(x, y, z)
Definition: compat.h:755
#define SetLastError(x)
Definition: compat.h:752
#define INVALID_HANDLE_VALUE
Definition: compat.h:731
#define HeapAlloc
Definition: compat.h:733
#define HeapReAlloc
Definition: compat.h:734
#define MAX_PATH
Definition: compat.h:34
#define HeapFree(x, y, z)
Definition: compat.h:735
#define CALLBACK
Definition: compat.h:35
#define HEAP_ZERO_MEMORY
Definition: compat.h:134
BOOL WINAPI WritePrivateProfileStringW(LPCWSTR section, LPCWSTR entry, LPCWSTR string, LPCWSTR filename)
Definition: profile.c:1453
HINF WINAPI SetupOpenInfFileW(PCWSTR name, PCWSTR class, DWORD style, UINT *error)
Definition: parser.c:1229
BOOL WINAPI PathFileExistsW(LPCWSTR lpszPath)
Definition: path.c:1777
#define swprintf
Definition: precomp.h:40
unsigned int BOOL
Definition: ntddk_ex.h:94
unsigned long DWORD
Definition: ntddk_ex.h:95
FxAutoRegKey hKey
GLuint index
Definition: glext.h:6031
_Check_return_ _CRTIMP int __cdecl _wtoi(_In_z_ const wchar_t *_Str)
_CRTIMP size_t __cdecl wcslen(_In_z_ const wchar_t *_Str)
#define INF_STYLE_OLDNT
Definition: infsupp.h:37
if(dx< 0)
Definition: linetemp.h:194
__int3264 LONG_PTR
Definition: mstsclib_h.h:276
unsigned int UINT
Definition: ndis.h:50
#define KEY_READ
Definition: nt_native.h:1023
#define REG_OPTION_NON_VOLATILE
Definition: nt_native.h:1057
#define KEY_WRITE
Definition: nt_native.h:1031
#define DWORD
Definition: nt_native.h:44
#define REG_EXPAND_SZ
Definition: nt_native.h:1494
#define UNREFERENCED_PARAMETER(P)
Definition: ntbasedef.h:317
#define L(x)
Definition: ntvdm.h:50
#define LOWORD(l)
Definition: pedump.c:82
long LONG
Definition: pedump.c:60
static ULONG Timeout
Definition: ping.c:61
static const WCHAR szName[]
Definition: powrprof.c:45
#define UDM_SETPOS
Definition: commctrl.h:2143
#define UDM_SETRANGE
Definition: commctrl.h:2141
#define UDM_GETPOS
Definition: commctrl.h:2144
#define REG_DWORD
Definition: sdbapi.c:596
_CRTIMP wchar_t *__cdecl wcscpy(_Out_writes_z_(_String_length_(_Source)+1) wchar_t *_Dest, _In_z_ const wchar_t *_Source)
_Check_return_ _CRTIMP int __cdecl wcscmp(_In_z_ const wchar_t *_Str1, _In_z_ const wchar_t *_Str2)
_CRTIMP wchar_t *__cdecl wcscat(_Inout_updates_z_(_String_length_(_Dest)+_String_length_(_Source)+1) wchar_t *_Dest, _In_z_ const wchar_t *_Source)
_Check_return_ _CRTIMP int __cdecl _wcsnicmp(_In_reads_or_z_(_MaxCount) const wchar_t *_Str1, _In_reads_or_z_(_MaxCount) const wchar_t *_Str2, _In_ size_t _MaxCount)
HINSTANCE WINAPI ShellExecuteW(HWND hwnd, LPCWSTR lpVerb, LPCWSTR lpFile, LPCWSTR lpParameters, LPCWSTR lpDirectory, INT nShowCmd)
Definition: shlexec.cpp:2379
struct _BOOTRECORD BOOTRECORD
struct _BOOTRECORD * PBOOTRECORD
static VOID SetRecoveryTimeout(HWND hwndDlg, INT Timeout)
Definition: startrec.c:52
static LRESULT LoadOSList(HWND hwndDlg, PSTARTINFO pStartInfo)
Definition: startrec.c:461
static VOID SetTimeout(HWND hwndDlg, INT Timeout)
Definition: startrec.c:35
static VOID SetCrashDlgItems(HWND hwnd, PSTARTINFO pStartInfo)
Definition: startrec.c:524
struct _STARTINFO * PSTARTINFO
struct _STARTINFO STARTINFO
static DWORD GetSystemDrive(WCHAR **szSystemDrive)
Definition: startrec.c:70
static VOID WriteStartupRecoveryOptions(HWND hwndDlg, PSTARTINFO pStartInfo)
Definition: startrec.c:550
static INT LoadBootSettings(HINF hInf, HWND hwndDlg)
Definition: startrec.c:303
BOOL SaveRecoveryOptions
Definition: startrec.c:32
static INT LoadFreeldrSettings(HINF hInf, HWND hwndDlg)
Definition: startrec.c:184
INT_PTR CALLBACK StartRecDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
Definition: startrec.c:695
static VOID LoadRecoveryOptions(HWND hwndDlg, PSTARTINFO pStartInfo)
Definition: startrec.c:602
static PBOOTRECORD ReadFreeldrSection(HINF hInf, WCHAR *szSectionName)
Definition: startrec.c:109
static VOID DeleteBootRecords(HWND hwndDlg)
Definition: startrec.c:438
WCHAR szBootPath[MAX_PATH]
Definition: startrec.c:19
WCHAR szSectionName[128]
Definition: startrec.c:18
WCHAR szOptions[512]
Definition: startrec.c:20
DWORD BootType
Definition: startrec.c:17
INT iFreeLdrIni
Definition: startrec.c:29
DWORD dwCrashDumpEnabled
Definition: startrec.c:28
WCHAR szMinidumpDir[MAX_PATH]
Definition: startrec.c:27
WCHAR szDumpFile[MAX_PATH]
Definition: startrec.c:26
WCHAR szFreeldrIni[MAX_PATH+15]
Definition: startrec.c:25
#define GetWindowLongPtr
Definition: treelist.c:73
#define SetWindowLongPtr
Definition: treelist.c:70
int32_t INT_PTR
Definition: typedefs.h:64
unsigned char * LPBYTE
Definition: typedefs.h:53
int32_t INT
Definition: typedefs.h:58
#define MAKELONG(a, b)
Definition: typedefs.h:249
#define HIWORD(l)
Definition: typedefs.h:247
BOOL WINAPI SetupGetStringFieldW(IN PINFCONTEXT Context, IN ULONG FieldIndex, OUT PWSTR ReturnBuffer, IN ULONG ReturnBufferSize, OUT PULONG RequiredSize)
Definition: infsupp.c:186
BOOL WINAPI SetupFindFirstLineW(IN HINF InfHandle, IN PCWSTR Section, IN PCWSTR Key, IN OUT PINFCONTEXT Context)
Definition: infsupp.c:56
BOOL WINAPI SetupGetIntField(IN PINFCONTEXT Context, IN ULONG FieldIndex, OUT INT *IntegerValue)
Definition: infsupp.c:148
BOOL WINAPI SetupFindNextLine(IN PINFCONTEXT ContextIn, OUT PINFCONTEXT ContextOut)
Definition: infsupp.c:82
VOID WINAPI SetupCloseInfFile(IN HINF InfHandle)
Definition: infsupp.c:45
_In_ LONG _In_ HWND hwnd
Definition: winddi.h:4023
LONG_PTR LPARAM
Definition: windef.h:208
LONG_PTR LRESULT
Definition: windef.h:209
UINT_PTR WPARAM
Definition: windef.h:207
int * PINT
Definition: windef.h:177
#define HKEY_LOCAL_MACHINE
Definition: winreg.h:12
#define SW_SHOWNORMAL
Definition: winuser.h:770
#define CB_SETITEMDATA
Definition: winuser.h:1966
#define DWLP_USER
Definition: winuser.h:872
#define IDCANCEL
Definition: winuser.h:831
int WINAPI LoadStringW(_In_opt_ HINSTANCE hInstance, _In_ UINT uID, _Out_writes_to_(cchBufferMax, return+1) LPWSTR lpBuffer, _In_ int cchBufferMax)
#define WM_COMMAND
Definition: winuser.h:1740
#define CB_ERR
Definition: winuser.h:2435
#define CB_SETCURSEL
Definition: winuser.h:1961
#define WM_GETTEXT
Definition: winuser.h:1618
#define CB_RESETCONTENT
Definition: winuser.h:1959
#define WM_INITDIALOG
Definition: winuser.h:1739
#define CB_GETCOUNT
Definition: winuser.h:1942
HWND WINAPI GetDlgItem(_In_opt_ HWND, _In_ int)
#define IDOK
Definition: winuser.h:830
#define CBN_SELCHANGE
Definition: winuser.h:1979
#define BM_SETCHECK
Definition: winuser.h:1921
LRESULT WINAPI SendDlgItemMessageW(_In_ HWND, _In_ int, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
#define WM_SETTEXT
Definition: winuser.h:1617
#define CB_ADDSTRING
Definition: winuser.h:1936
#define CB_GETITEMDATA
Definition: winuser.h:1950
BOOL WINAPI EnableWindow(_In_ HWND, _In_ BOOL)
#define WM_DESTROY
Definition: winuser.h:1609
#define CB_FINDSTRING
Definition: winuser.h:1939
#define CB_GETCURSEL
Definition: winuser.h:1943
#define SendDlgItemMessage
Definition: winuser.h:5842
LRESULT WINAPI SendMessageW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
#define BST_CHECKED
Definition: winuser.h:197
#define BM_GETCHECK
Definition: winuser.h:1918
BOOL WINAPI EndDialog(_In_ HWND, _In_ INT_PTR)
void ShowLastWin32Error(HWND hwndParent)
Definition: winutils.c:11
__wchar_t WCHAR
Definition: xmlstorage.h:180