ReactOS 0.4.17-dev-683-g0dafdc5
livecd.c
Go to the documentation of this file.
1/*
2 * COPYRIGHT: See COPYING in the top level directory
3 * PROJECT: ReactOS Userinit Logon Application
4 * FILE: base/system/userinit/livecd.c
5 * PROGRAMMERS: Eric Kohl
6 */
7
8#include "userinit.h"
9
13
15
16typedef struct _LIVECD_UNATTEND
17{
21
22
23/*
24 * Taken and adapted from dll/cpl/sysdm/general.c
25 */
26static VOID
28{
29 BITMAP logoBitmap;
30 BITMAP maskBitmap;
32 HDC hDC, hDCLogo, hDCMask;
33 HBITMAP hMask = NULL, hLogo = NULL;
34 HBITMAP hAlphaLogo = NULL;
35 COLORREF *pBits;
37
38 hDC = GetDC(hwndDlg);
39 hDCLogo = CreateCompatibleDC(NULL);
40 hDCMask = CreateCompatibleDC(NULL);
41
42 if (hDC == NULL || hDCLogo == NULL || hDCMask == NULL)
43 goto Cleanup;
44
45 ZeroMemory(pImgInfo, sizeof(*pImgInfo));
46 ZeroMemory(&bmpi, sizeof(bmpi));
47
50
51 if (hLogo == NULL || hMask == NULL)
52 goto Cleanup;
53
54 GetObject(hLogo, sizeof(logoBitmap), &logoBitmap);
55 GetObject(hMask, sizeof(maskBitmap), &maskBitmap);
56
57 if (logoBitmap.bmHeight != maskBitmap.bmHeight || logoBitmap.bmWidth != maskBitmap.bmWidth)
58 goto Cleanup;
59
61 bmpi.bmiHeader.biWidth = logoBitmap.bmWidth;
62 bmpi.bmiHeader.biHeight = logoBitmap.bmHeight;
66 bmpi.bmiHeader.biSizeImage = 4 * logoBitmap.bmWidth * logoBitmap.bmHeight;
67
68 /* Create a premultiplied bitmap */
69 hAlphaLogo = CreateDIBSection(hDC, &bmpi, DIB_RGB_COLORS, (PVOID*)&pBits, 0, 0);
70 if (!hAlphaLogo)
71 goto Cleanup;
72
73 SelectObject(hDCLogo, hLogo);
74 SelectObject(hDCMask, hMask);
75
76 for (line = logoBitmap.bmHeight - 1; line >= 0; line--)
77 {
78 for (column = 0; column < logoBitmap.bmWidth; column++)
79 {
80 COLORREF alpha = GetPixel(hDCMask, column, line) & 0xFF;
81 COLORREF Color = GetPixel(hDCLogo, column, line);
82 DWORD r, g, b;
83
84 r = GetRValue(Color) * alpha / 255;
85 g = GetGValue(Color) * alpha / 255;
86 b = GetBValue(Color) * alpha / 255;
87
88 *pBits++ = b | (g << 8) | (r << 16) | (alpha << 24);
89 }
90 }
91
92 pImgInfo->hBitmap = hAlphaLogo;
93 pImgInfo->cxSource = logoBitmap.bmWidth;
94 pImgInfo->cySource = logoBitmap.bmHeight;
95 pImgInfo->iBits = logoBitmap.bmBitsPixel;
96 pImgInfo->iPlanes = logoBitmap.bmPlanes;
97
99 if (hMask != NULL) DeleteObject(hMask);
100 if (hLogo != NULL) DeleteObject(hLogo);
101 if (hDCMask != NULL) DeleteDC(hDCMask);
102 if (hDCLogo != NULL) DeleteDC(hDCLogo);
103 if (hDC != NULL) ReleaseDC(hwndDlg, hDC);
104}
105
109BOOL
111{
112 HKEY hKey;
113 LONG rc;
114
115 /* Check for the presence of the "MiniNT" registry key */
117 L"SYSTEM\\CurrentControlSet\\Control\\MiniNT",
118 0,
120 &hKey);
121 if (rc == ERROR_SUCCESS)
123
124 return (rc == ERROR_SUCCESS);
125}
126
127
128static BOOL CALLBACK
130{
131 LCID lcid;
132 WCHAR lang[255];
133 INT index;
134 BOOL bNoShow = FALSE;
135
136 lcid = wcstoul(lpLocale, NULL, 16);
137
138 /* Display only languages with installed support */
140 return TRUE;
141
142 // See http://archives.miloush.net/michkap/archive/2006/09/23/768178.html for why we handle spain differently
145 {
146 if (bSpain == FALSE)
147 {
149 bSpain = TRUE;
150 }
151 else
152 {
153 bNoShow = TRUE;
154 }
155 }
156 else
157 {
159 }
160
161 if (bNoShow == FALSE)
162 {
165 0,
166 (LPARAM)lang);
167
170 index,
171 (LPARAM)lcid);
172 }
173
174 return TRUE;
175}
176
177
178static VOID
180{
181 WCHAR langSel[255];
182 LCID Locale = 0;
183
184 hList = hwnd;
185 bSpain = FALSE;
187
188 if (pState->Unattend->bEnabled)
189 Locale = pState->Unattend->LocaleID;
190
191 if (!Locale)
192 {
193 /* Select current locale */
194 /* or should it be System and not user? */
195 Locale = GetUserDefaultLCID();
196 }
198
201 -1,
202 (LPARAM)langSel);
203}
204
205static
206BOOL
208 LPCWSTR szLCID,
210{
211 HKEY hKey;
212 DWORD dwBufLen;
213 WCHAR szBuf[MAX_PATH], szDispName[MAX_PATH], szIndex[MAX_PATH], szPath[MAX_PATH];
214 HANDLE hLib;
215 UINT i, j, k;
216
217 wsprintf(szBuf, L"SYSTEM\\CurrentControlSet\\Control\\Keyboard Layouts\\%s", szLCID);
218
220 {
221 dwBufLen = sizeof(szDispName);
222
223 if (RegQueryValueExW(hKey, L"Layout Display Name", NULL, NULL, (LPBYTE)szDispName, &dwBufLen) == ERROR_SUCCESS)
224 {
225 if (szDispName[0] == '@')
226 {
227 for (i = 0; i < wcslen(szDispName); i++)
228 {
229 if ((szDispName[i] == ',') && (szDispName[i + 1] == '-'))
230 {
231 for (j = i + 2, k = 0; j < wcslen(szDispName)+1; j++, k++)
232 {
233 szIndex[k] = szDispName[j];
234 }
235 szDispName[i - 1] = '\0';
236 break;
237 }
238 else
239 szDispName[i] = szDispName[i + 1];
240 }
241
243 {
244 hLib = LoadLibraryW(szPath);
245 if (hLib)
246 {
247 if (LoadStringW(hLib, _wtoi(szIndex), szPath, ARRAYSIZE(szPath)) != 0)
248 {
251 return TRUE;
252 }
253 FreeLibrary(hLib);
254 }
255 }
256 }
257 }
258
259 dwBufLen = sizeof(szBuf);
260
261 if (RegQueryValueExW(hKey, L"Layout Text", NULL, NULL, (LPBYTE)szName, &dwBufLen) == ERROR_SUCCESS)
262 {
264 return TRUE;
265 }
266 }
267
268 return FALSE;
269}
270
271static
272VOID
274 HWND hwnd)
275{
276 INT iCurSel;
277 ULONG ulLayoutId;
278 HKL hKl;
279 WCHAR szLayoutId[9];
280
281 iCurSel = SendMessageW(hwnd, CB_GETCURSEL, 0, 0);
282 if (iCurSel == CB_ERR)
283 return;
284
285 ulLayoutId = (ULONG)SendMessageW(hwnd, CB_GETITEMDATA, iCurSel, 0);
286 if (ulLayoutId == (ULONG)CB_ERR)
287 return;
288
289 _swprintf(szLayoutId, L"%08lx", ulLayoutId);
290
292 SystemParametersInfoW(SPI_SETDEFAULTINPUTLANG, 0, &hKl, SPIF_SENDCHANGE);
293}
294
295static
296VOID
298 HWND hwnd,
299 LCID lcid)
300{
301 INT i, nCount;
302 LCID LayoutId;
303
304 TRACE("LCID: %08lx\n", lcid);
305 TRACE("LangID: %04lx\n", LANGIDFROMLCID(lcid));
306
307 nCount = SendMessageW(hwnd, CB_GETCOUNT, 0, 0);
308
309 for (i = 0; i < nCount; i++)
310 {
311 LayoutId = (LCID)SendMessageW(hwnd, CB_GETITEMDATA, i, 0);
312 TRACE("Layout: %08lx\n", LayoutId);
313
314 if (LANGIDFROMLCID(LayoutId) == LANGIDFROMLCID(lcid))
315 {
316 TRACE("Found 1: %08lx --> %08lx\n", LayoutId, lcid);
318 return;
319 }
320 }
321
322 for (i = 0; i < nCount; i++)
323 {
324 LayoutId = (LCID)SendMessageW(hwnd, CB_GETITEMDATA, i, 0);
325 TRACE("Layout: %08lx\n", LayoutId);
326
327 if (PRIMARYLANGID(LayoutId) == PRIMARYLANGID(lcid))
328 {
329 TRACE("Found 2: %08lx --> %08lx\n", LayoutId, lcid);
331 return;
332 }
333 }
334
335 TRACE("No match found!\n");
336}
337
338static
339VOID
341 HWND hItemsList)
342{
343 HKEY hKey;
344 WCHAR szLayoutId[9], szCurrentLayoutId[9];
346 DWORD dwIndex = 0;
348 INT iIndex;
349 LONG lError;
350 ULONG ulLayoutId;
351
352 if (!GetKeyboardLayoutNameW(szCurrentLayoutId))
353 wcscpy(szCurrentLayoutId, L"00000409");
354
356 L"System\\CurrentControlSet\\Control\\Keyboard Layouts",
357 0,
359 &hKey);
360 if (lError != ERROR_SUCCESS)
361 return;
362
363 while (TRUE)
364 {
365 dwSize = ARRAYSIZE(szLayoutId);
366
367 lError = RegEnumKeyExW(hKey,
368 dwIndex,
369 szLayoutId,
370 &dwSize,
371 NULL,
372 NULL,
373 NULL,
374 NULL);
375 if (lError != ERROR_SUCCESS)
376 break;
377
378 GetLayoutName(szLayoutId, KeyName);
379
380 iIndex = (INT)SendMessageW(hItemsList, CB_ADDSTRING, 0, (LPARAM)KeyName);
381
382 ulLayoutId = wcstoul(szLayoutId, NULL, 16);
383 SendMessageW(hItemsList, CB_SETITEMDATA, iIndex, (LPARAM)ulLayoutId);
384
385 if (wcscmp(szLayoutId, szCurrentLayoutId) == 0)
386 {
387 SendMessageW(hItemsList, CB_SETCURSEL, (WPARAM)iIndex, (LPARAM)0);
388 }
389
390 dwIndex++;
391 }
392
394}
395
396static
397VOID
399 PLCID pNewLcid)
400{
401 WCHAR szBuffer[80];
402 PWSTR ptr;
403 HKEY hLocaleKey;
404 DWORD ret;
406 LCID lcid;
407 INT i;
408
409 struct {LCTYPE LCType; PWSTR pValue;} LocaleData[] = {
410 /* Number */
411 {LOCALE_SDECIMAL, L"sDecimal"},
412 {LOCALE_STHOUSAND, L"sThousand"},
413 {LOCALE_SNEGATIVESIGN, L"sNegativeSign"},
414 {LOCALE_SPOSITIVESIGN, L"sPositiveSign"},
415 {LOCALE_SGROUPING, L"sGrouping"},
416 {LOCALE_SLIST, L"sList"},
417 {LOCALE_SNATIVEDIGITS, L"sNativeDigits"},
418 {LOCALE_INEGNUMBER, L"iNegNumber"},
419 {LOCALE_IDIGITS, L"iDigits"},
420 {LOCALE_ILZERO, L"iLZero"},
421 {LOCALE_IMEASURE, L"iMeasure"},
422 {LOCALE_IDIGITSUBSTITUTION, L"NumShape"},
423
424 /* Currency */
425 {LOCALE_SCURRENCY, L"sCurrency"},
426 {LOCALE_SMONDECIMALSEP, L"sMonDecimalSep"},
427 {LOCALE_SMONTHOUSANDSEP, L"sMonThousandSep"},
428 {LOCALE_SMONGROUPING, L"sMonGrouping"},
429 {LOCALE_ICURRENCY, L"iCurrency"},
430 {LOCALE_INEGCURR, L"iNegCurr"},
431 {LOCALE_ICURRDIGITS, L"iCurrDigits"},
432
433 /* Time */
434 {LOCALE_STIMEFORMAT, L"sTimeFormat"},
435 {LOCALE_STIME, L"sTime"},
436 {LOCALE_S1159, L"s1159"},
437 {LOCALE_S2359, L"s2359"},
438 {LOCALE_ITIME, L"iTime"},
439 {LOCALE_ITIMEMARKPOSN, L"iTimePrefix"},
440 {LOCALE_ITLZERO, L"iTLZero"},
441
442 /* Date */
443 {LOCALE_SLONGDATE, L"sLongDate"},
444 {LOCALE_SSHORTDATE, L"sShortDate"},
445 {LOCALE_SDATE, L"sDate"},
446 {LOCALE_IFIRSTDAYOFWEEK, L"iFirstDayOfWeek"},
447 {LOCALE_IFIRSTWEEKOFYEAR, L"iFirstWeekOfYear"},
448 {LOCALE_IDATE, L"iDate"},
449 {LOCALE_ICALENDARTYPE, L"iCalendarType"},
450
451 /* Misc */
452 {LOCALE_SCOUNTRY, L"sCountry"},
453 {LOCALE_SABBREVLANGNAME, L"sLanguage"},
454 {LOCALE_ICOUNTRY, L"iCountry"},
455 {0, NULL}};
456
458 L".DEFAULT\\Control Panel\\International",
459 0,
461 &hLocaleKey);
462 if (ret != ERROR_SUCCESS)
463 {
464 return;
465 }
466
467 if (pNewLcid == NULL)
468 {
469 dwSize = 9 * sizeof(WCHAR);
470 ret = RegQueryValueExW(hLocaleKey,
471 L"Locale",
472 NULL,
473 NULL,
474 (PBYTE)szBuffer,
475 &dwSize);
476 if (ret != ERROR_SUCCESS)
477 goto done;
478
479 lcid = (LCID)wcstoul(szBuffer, &ptr, 16);
480 if (lcid == 0)
481 goto done;
482 }
483 else
484 {
485 lcid = *pNewLcid;
486
487 _swprintf(szBuffer, L"%08lx", lcid);
488 RegSetValueExW(hLocaleKey,
489 L"Locale",
490 0,
491 REG_SZ,
492 (PBYTE)szBuffer,
493 (wcslen(szBuffer) + 1) * sizeof(WCHAR));
494 }
495
496 i = 0;
497 while (LocaleData[i].pValue != NULL)
498 {
500 LocaleData[i].LCType | LOCALE_NOUSEROVERRIDE,
501 szBuffer,
502 ARRAYSIZE(szBuffer)))
503 {
504 RegSetValueExW(hLocaleKey,
505 LocaleData[i].pValue,
506 0,
507 REG_SZ,
508 (PBYTE)szBuffer,
509 (wcslen(szBuffer) + 1) * sizeof(WCHAR));
510 }
511
512 i++;
513 }
514
515done:
516 RegCloseKey(hLocaleKey);
517}
518
519
520VOID
522{
524 RECT rcParent;
525 RECT rcWindow;
526
528 if (hWndParent == NULL)
530
531 GetWindowRect(hWndParent, &rcParent);
532 GetWindowRect(hWnd, &rcWindow);
533
535 HWND_TOP,
536 ((rcParent.right - rcParent.left) - (rcWindow.right - rcWindow.left)) / 2,
537 ((rcParent.bottom - rcParent.top) - (rcWindow.bottom - rcWindow.top)) / 2,
538 0,
539 0,
540 SWP_NOSIZE);
541}
542
543static
544VOID
546 LPDRAWITEMSTRUCT lpDrawItem,
547 PSTATE pState,
548 UINT uCtlID)
549{
550 HDC hdcMem;
551 LONG left;
552
553 if (lpDrawItem->CtlID == uCtlID)
554 {
555 /* Position image in centre of dialog */
556 left = (lpDrawItem->rcItem.right - pState->ImageInfo.cxSource) / 2;
557
558 hdcMem = CreateCompatibleDC(lpDrawItem->hDC);
559 if (hdcMem != NULL)
560 {
562
563 SelectObject(hdcMem, pState->ImageInfo.hBitmap);
564 GdiAlphaBlend(lpDrawItem->hDC,
565 left,
566 lpDrawItem->rcItem.top,
567 pState->ImageInfo.cxSource,
568 pState->ImageInfo.cySource,
569 hdcMem,
570 0, 0,
571 pState->ImageInfo.cxSource,
572 pState->ImageInfo.cySource,
573 BlendFunc);
575 }
576 }
577}
578
579
580static
584 HWND hwndDlg,
585 UINT uMsg,
588{
589 PSTATE pState;
590
591 /* Retrieve pointer to the state */
592 pState = (PSTATE)GetWindowLongPtrW(hwndDlg, GWLP_USERDATA);
593
594 switch (uMsg)
595 {
596 case WM_INITDIALOG:
597 {
598 /* Save pointer to the state */
599 pState = (PSTATE)lParam;
600 SetWindowLongPtrW(hwndDlg, GWLP_USERDATA, (DWORD_PTR)pState);
601
602 /* Center the dialog window */
603 CenterWindow(hwndDlg);
604
605 /* Fill the language and keyboard layout lists */
608
609 /* In unattended mode, advance to the next page */
610 if (pState->Unattend->bEnabled)
612 return TRUE;
613 }
614
615 case WM_DRAWITEM:
617 return TRUE;
618
619 case WM_COMMAND:
620 switch (LOWORD(wParam))
621 {
622 case IDC_LANGUAGELIST:
624 {
625 LCID NewLcid;
626 INT iCurSel;
627
628 iCurSel = SendDlgItemMessageW(hwndDlg,
631 0,
632 0);
633 if (iCurSel == CB_ERR)
634 break;
635
636 NewLcid = SendDlgItemMessageW(hwndDlg,
639 iCurSel,
640 0);
641 if (NewLcid == (LCID)CB_ERR)
642 break;
643
644 TRACE("LCID: 0x%08lx\n", NewLcid);
646 NewLcid);
647 }
648 break;
649
650 case IDOK:
651 if (HIWORD(wParam) == BN_CLICKED)
652 {
653 LCID NewLcid;
654 INT iCurSel;
655
656 iCurSel = SendDlgItemMessageW(hwndDlg,
659 0,
660 0);
661 if (iCurSel == CB_ERR)
662 break;
663
664 NewLcid = SendDlgItemMessageW(hwndDlg,
667 iCurSel,
668 0);
669 if (NewLcid == (LCID)CB_ERR)
670 break;
671
672 /* Set the locale for the current thread */
673 NtSetDefaultLocale(TRUE, NewLcid);
674
675 /* Store the locale settings in the registry */
677
678 /* Set UI language for this thread */
679 SetThreadLocale(NewLcid);
680
682
683 pState->NextPage = STARTPAGE;
684 EndDialog(hwndDlg, LOWORD(wParam));
685 }
686 break;
687
688 case IDCANCEL:
689 if (HIWORD(wParam) == BN_CLICKED)
690 {
691 static WCHAR szMsg[RC_STRING_MAX_SIZE];
692 INT ret;
694 ret = MessageBoxW(hwndDlg, szMsg, L"ReactOS LiveCD", MB_ICONWARNING | MB_YESNO | MB_DEFBUTTON2);
695 if (ret == IDOK || ret == IDYES)
696 {
697 pState->NextPage = DONE;
698 pState->Run = REBOOT;
699 EndDialog(hwndDlg, LOWORD(wParam));
700 }
701 }
702 break;
703
704 default:
705 break;
706 }
707 break;
708
709 default:
710 break;
711 }
712
713 return FALSE;
714}
715
716static
720 HWND hwndDlg,
721 UINT uMsg,
724{
725 PSTATE pState;
726
727 /* Retrieve pointer to the state */
728 pState = (PSTATE)GetWindowLongPtrW(hwndDlg, GWLP_USERDATA);
729
730 switch (uMsg)
731 {
732 case WM_INITDIALOG:
733 {
734 /* Save pointer to the state */
735 pState = (PSTATE)lParam;
736 SetWindowLongPtrW(hwndDlg, GWLP_USERDATA, (DWORD_PTR)pState);
737
738 /* Center the dialog window */
739 CenterWindow(hwndDlg);
740
741 /* If the ReactOS Installer could not be located, directly start
742 * the LiveCD. Otherwise, directly start the installer if we are
743 * in unattended mode. */
744 if (!*Installer)
745 {
746 /* Disable the "Install" button and click on "Run LiveCD" */
749 }
750 else if (pState->Unattend->bEnabled)
751 {
752 /* Click on "Install" */
754 }
755 return TRUE;
756 }
757
758 case WM_DRAWITEM:
760 return TRUE;
761
762 case WM_COMMAND:
763 if (HIWORD(wParam) == BN_CLICKED)
764 {
765 switch (LOWORD(wParam))
766 {
767 case IDC_RUN:
768 pState->NextPage = DONE;
769 pState->Run = SHELL;
770 EndDialog(hwndDlg, LOWORD(wParam));
771 break;
772
773 case IDC_INSTALL:
774 pState->NextPage = DONE;
775 pState->Run = INSTALLER;
776 EndDialog(hwndDlg, LOWORD(wParam));
777 break;
778
779 case IDOK:
780 pState->NextPage = LOCALEPAGE;
781 EndDialog(hwndDlg, LOWORD(wParam));
782 break;
783
784 case IDCANCEL:
785 if (HIWORD(wParam) == BN_CLICKED)
786 {
787 static WCHAR szMsg[RC_STRING_MAX_SIZE];
788 INT ret;
790 ret = MessageBoxW(hwndDlg, szMsg, L"ReactOS LiveCD", MB_ICONWARNING | MB_YESNO | MB_DEFBUTTON2);
791 if (ret == IDOK || ret == IDYES)
792 {
793 pState->NextPage = DONE;
794 pState->Run = REBOOT;
795 EndDialog(hwndDlg, LOWORD(wParam));
796 }
797 }
798 break;
799
800 default:
801 break;
802 }
803 }
804 break;
805
806 default:
807 break;
808 }
809
810 return FALSE;
811}
812
813static VOID
815 _In_ LPCWSTR UnattendInf,
816 _Out_ LIVECD_UNATTEND* pUnattend)
817{
819
820 pUnattend->bEnabled = FALSE;
821
822 if (!GetPrivateProfileStringW(L"Unattend", L"Signature", L"", Buffer, _countof(Buffer), UnattendInf))
823 {
824 ERR("Unable to parse Signature\n");
825 return;
826 }
827
828 if (_wcsicmp(Buffer, L"$ReactOS$") && _wcsicmp(Buffer, L"$Windows NT$"))
829 {
830 TRACE("Unknown signature: %S\n", Buffer);
831 return;
832 }
833
834 if (!GetPrivateProfileStringW(L"Unattend", L"UnattendSetupEnabled", L"", Buffer, _countof(Buffer), UnattendInf))
835 {
836 ERR("Unable to parse UnattendSetupEnabled\n");
837 return;
838 }
839
840 if (_wcsicmp(Buffer, L"yes") != 0)
841 {
842 TRACE("Unattended setup is not enabled\n");
843 return;
844 }
845 /* If the user presses Ctrl+Shift+F10, disable unattended setup */
847 {
848 WARN("Unattended setup is disabled by keypress\n");
849 return;
850 }
851
852 pUnattend->bEnabled = TRUE;
853 pUnattend->LocaleID = 0;
854
855 if (GetPrivateProfileStringW(L"Unattend", L"LocaleID", L"", Buffer, _countof(Buffer), UnattendInf) && Buffer[0])
856 {
857 pUnattend->LocaleID = wcstol(Buffer, NULL, 16);
858 }
859}
860
861
867static BOOL
869 _In_ PCWSTR pInstallerName,
870 _Out_writes_z_(PathSize) PWSTR pInstallerPath,
871 _In_ SIZE_T PathSize)
872{
873 SYSTEM_INFO SystemInfo;
874 SIZE_T cchInstallerNameLen;
875 PWSTR ptr;
876 DWORD dwAttribs;
877
878 cchInstallerNameLen = wcslen(pInstallerName);
879 if (PathSize < cchInstallerNameLen)
880 {
881 /* The buffer is not large enough to contain the installer file name */
882 *pInstallerPath = UNICODE_NULL;
883 return FALSE;
884 }
885
886 /*
887 * First, try to find the installer using the default drive, under
888 * the directory whose name corresponds to the currently-running
889 * CPU architecture.
890 */
891 GetSystemInfo(&SystemInfo);
892
893 *pInstallerPath = UNICODE_NULL;
894 /* Alternatively one can use SharedUserData->NtSystemRoot */
895 GetSystemWindowsDirectoryW(pInstallerPath, PathSize - cchInstallerNameLen - 1);
896 ptr = wcschr(pInstallerPath, L'\\');
897 if (ptr)
898 *++ptr = UNICODE_NULL;
899 else
900 *pInstallerPath = UNICODE_NULL;
901
902 /* Append the corresponding CPU architecture */
903 switch (SystemInfo.wProcessorArchitecture)
904 {
906 StringCchCatW(pInstallerPath, PathSize, L"I386");
907 break;
908
910 StringCchCatW(pInstallerPath, PathSize, L"MIPS");
911 break;
912
914 StringCchCatW(pInstallerPath, PathSize, L"ALPHA");
915 break;
916
918 StringCchCatW(pInstallerPath, PathSize, L"PPC");
919 break;
920
922 StringCchCatW(pInstallerPath, PathSize, L"SHX");
923 break;
924
926 StringCchCatW(pInstallerPath, PathSize, L"ARM");
927 break;
928
930 StringCchCatW(pInstallerPath, PathSize, L"IA64");
931 break;
932
934 StringCchCatW(pInstallerPath, PathSize, L"ALPHA64");
935 break;
936
938 StringCchCatW(pInstallerPath, PathSize, L"AMD64");
939 break;
940
941 // case PROCESSOR_ARCHITECTURE_MSIL: /* .NET CPU-independent code */
943 default:
944 WARN("Unknown processor architecture %lu\n", SystemInfo.wProcessorArchitecture);
946 break;
947 }
948
950 StringCchCatW(pInstallerPath, PathSize, L"\\");
951 StringCchCatW(pInstallerPath, PathSize, pInstallerName);
952
953 dwAttribs = GetFileAttributesW(pInstallerPath);
954 if ((dwAttribs != INVALID_FILE_ATTRIBUTES) &&
955 !(dwAttribs & FILE_ATTRIBUTE_DIRECTORY))
956 {
957 /* We have found the installer */
958 return TRUE;
959 }
960
961 WARN("Couldn't find the installer '%s', trying alternative.\n", debugstr_w(pInstallerPath));
962
963 /*
964 * We failed. Try to find the installer from either the current
965 * ReactOS installation directory, or from our current directory.
966 */
967 *pInstallerPath = UNICODE_NULL;
968 /* Alternatively one can use SharedUserData->NtSystemRoot */
969 if (GetSystemWindowsDirectoryW(pInstallerPath, PathSize - cchInstallerNameLen - 1))
970 StringCchCatW(pInstallerPath, PathSize, L"\\");
971 StringCchCatW(pInstallerPath, PathSize, pInstallerName);
972
973 dwAttribs = GetFileAttributesW(pInstallerPath);
974 if ((dwAttribs != INVALID_FILE_ATTRIBUTES) &&
975 !(dwAttribs & FILE_ATTRIBUTE_DIRECTORY))
976 {
977 /* We have found the installer */
978 return TRUE;
979 }
980
981 /* Installer not found */
982 ERR("Couldn't find the installer '%s'\n", debugstr_w(pInstallerPath));
983 *pInstallerPath = UNICODE_NULL;
984 return FALSE;
985}
986
987VOID
989 PSTATE pState)
990{
991 LIVECD_UNATTEND Unattend = {0};
992 WCHAR UnattendInf[MAX_PATH];
993
994 /* Try to locate the ReactOS Installer */
995 if (!ExpandInstallerPath(L"reactos.exe", Installer, _countof(Installer)))
997 if (*Installer)
998 TRACE("ReactOS Installer: '%S'\n", Installer);
999 else
1000 WARN("Could not find the ReactOS Installer\n");
1001
1002 /* If the ReactOS Installer was located, use its path for the
1003 * unattended file; otherwise, use the current ReactOS directory. */
1004 StringCchCopyW(UnattendInf, _countof(UnattendInf), Installer);
1005 if (*UnattendInf)
1006 {
1007 /* Find the last path separator and truncate the path there.
1008 * If there is none, NUL the path. */
1009 PWCHAR ptr = wcsrchr(UnattendInf, L'\\');
1010 if (!ptr)
1011 ptr = UnattendInf;
1012 *ptr = UNICODE_NULL;
1013 }
1014 if (!*UnattendInf)
1015 {
1016 /* No actual path was found, fall back to the ReactOS directory */
1017 GetWindowsDirectoryW(UnattendInf, _countof(UnattendInf));
1018 }
1019 StringCchCatW(UnattendInf, _countof(UnattendInf), L"\\unattend.inf");
1020 ParseUnattend(UnattendInf, &Unattend);
1021 pState->Unattend = &Unattend;
1022
1023 InitLogo(&pState->ImageInfo, NULL);
1024
1025 while (pState->NextPage != DONE)
1026 {
1027 switch (pState->NextPage)
1028 {
1029 case LOCALEPAGE:
1032 NULL,
1034 (LPARAM)pState);
1035 break;
1036
1037 case STARTPAGE:
1040 NULL,
1042 (LPARAM)pState);
1043 break;
1044
1045 default:
1046 break;
1047 }
1048 }
1049
1050 DeleteObject(pState->ImageInfo.hBitmap);
1051}
1052
1053/* EOF */
static HDC hDC
Definition: 3dtext.c:33
HWND hWnd
Definition: settings.c:17
#define RC_STRING_MAX_SIZE
Definition: resource.h:3
#define index(s, c)
Definition: various.h:29
#define IDD_STARTPAGE
Definition: resource.h:27
#define WARN(fmt,...)
Definition: precomp.h:61
#define ERR(fmt,...)
Definition: precomp.h:57
#define IDC_LOCALELOGO
Definition: resource.h:14
#define IDB_ROSLOGO
Definition: resource.h:6
#define IDB_ROSMASK
Definition: resource.h:7
#define IDC_LAYOUTLIST
Definition: resource.h:17
#define IDC_STARTLOGO
Definition: resource.h:20
#define IDD_LOCALEPAGE
Definition: resource.h:13
#define IDC_LANGUAGELIST
Definition: resource.h:15
#define IDS_CANCEL_CONFIRM
Definition: resource.h:30
#define IDS_SPAIN
Definition: resource.h:32
#define IDC_RUN
Definition: resource.h:21
DWORD GetPixel(LPDIRECTDRAWSURFACE7 Surface, UINT x, UINT y)
Definition: blt.cpp:2
#define RegCloseKey(hKey)
Definition: registry.h:49
HINSTANCE hInstance
Definition: charmap.c:19
Definition: bufpool.h:45
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
static const BLENDFUNCTION BlendFunc
Definition: general.c:34
static PIMGINFO pImgInfo
Definition: general.c:33
#define ARRAYSIZE(array)
Definition: filtermapper.c:47
LONG WINAPI RegOpenKeyExW(HKEY hKey, LPCWSTR lpSubKey, DWORD ulOptions, REGSAM samDesired, PHKEY phkResult)
Definition: reg.c:3333
LONG WINAPI RegEnumKeyExW(_In_ HKEY hKey, _In_ DWORD dwIndex, _Out_ LPWSTR lpName, _Inout_ LPDWORD lpcbName, _Reserved_ LPDWORD lpReserved, _Out_opt_ LPWSTR lpClass, _Inout_opt_ LPDWORD lpcbClass, _Out_opt_ PFILETIME lpftLastWriteTime)
Definition: reg.c:2504
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 wcschr
Definition: compat.h:17
#define wcsrchr
Definition: compat.h:16
#define FreeLibrary(x)
Definition: compat.h:748
#define MAX_PATH
Definition: compat.h:34
#define CALLBACK
Definition: compat.h:35
#define LoadLibraryW(x)
Definition: compat.h:747
DWORD WINAPI ExpandEnvironmentStringsW(IN LPCWSTR lpSrc, IN LPWSTR lpDst, IN DWORD nSize)
Definition: environ.c:492
DWORD WINAPI GetFileAttributesW(LPCWSTR lpFileName)
Definition: fileinfo.c:636
UINT WINAPI GetSystemWindowsDirectoryW(OUT LPWSTR lpBuffer, IN UINT uSize)
Definition: path.c:2316
UINT WINAPI GetWindowsDirectoryW(OUT LPWSTR lpBuffer, IN UINT uSize)
Definition: path.c:2271
VOID WINAPI GetSystemInfo(IN LPSYSTEM_INFO lpSystemInfo)
Definition: sysinfo.c:143
INT WINAPI GetPrivateProfileStringW(LPCWSTR section, LPCWSTR entry, LPCWSTR def_val, LPWSTR buffer, UINT len, LPCWSTR filename)
Definition: profile.c:1142
BOOL WINAPI SetThreadLocale(LCID lcid)
Definition: locale.c:2822
BOOL WINAPI EnumSystemLocalesW(LOCALE_ENUMPROCW lpfnLocaleEnum, DWORD dwFlags)
Definition: locale.c:3001
BOOL WINAPI IsValidLocale(LCID lcid, DWORD flags)
Definition: locale.c:2925
LCID WINAPI GetUserDefaultLCID(void)
Definition: locale.c:1216
INT WINAPI GetLocaleInfoW(LCID lcid, LCTYPE lctype, LPWSTR buffer, INT len)
Definition: locale.c:1675
LCID lcid
Definition: locale.c:5660
_ACRTIMP __msvcrt_ulong __cdecl wcstoul(const wchar_t *, wchar_t **, int)
Definition: wcs.c:2917
_ACRTIMP __msvcrt_long __cdecl wcstol(const wchar_t *, wchar_t **, int)
Definition: wcs.c:2752
_ACRTIMP int __cdecl _wtoi(const wchar_t *)
Definition: wcs.c:2778
_ACRTIMP int __cdecl _wcsicmp(const wchar_t *, const wchar_t *)
Definition: wcs.c:164
_ACRTIMP size_t __cdecl wcslen(const wchar_t *)
Definition: wcs.c:2988
_ACRTIMP int __cdecl wcscmp(const wchar_t *, const wchar_t *)
Definition: wcs.c:1977
static const WCHAR Cleanup[]
Definition: register.c:80
#define GetBValue(quad)
Definition: precomp.h:71
#define GetGValue(quad)
Definition: precomp.h:70
#define GetRValue(quad)
Definition: precomp.h:69
return ret
Definition: mutex.c:147
#define L(x)
Definition: resources.c:13
unsigned int BOOL
Definition: ntddk_ex.h:94
unsigned long DWORD
Definition: ntddk_ex.h:95
#define IDC_INSTALL
Definition: fontview.h:13
FxAutoRegKey hKey
PWCHAR pValue
pKey DeleteObject()
GLclampf GLclampf GLclampf alpha
Definition: gl.h:1740
GLdouble GLdouble GLdouble r
Definition: gl.h:2055
GLuint index
Definition: glext.h:6031
GLboolean GLboolean GLboolean b
Definition: glext.h:6204
GLint left
Definition: glext.h:7726
GLboolean GLboolean g
Definition: glext.h:6204
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint GLint GLint j
Definition: glfuncs.h:250
unsigned int UINT
Definition: sysinfo.c:13
#define b
Definition: ke_i.h:79
#define debugstr_w
Definition: kernel32.h:32
#define REG_SZ
Definition: layer.c:22
static VOID CreateLanguagesList(HWND hwnd, PSTATE pState)
Definition: livecd.c:179
static VOID CreateKeyboardLayoutList(HWND hItemsList)
Definition: livecd.c:340
static INT_PTR CALLBACK LocaleDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
Definition: livecd.c:583
static BOOL ExpandInstallerPath(_In_ PCWSTR pInstallerName, _Out_writes_z_(PathSize) PWSTR pInstallerPath, _In_ SIZE_T PathSize)
Expands the path for the ReactOS Installer "reactos.exe". See also base/setup/welcome/welcome....
Definition: livecd.c:868
HWND hLocaleList
Definition: livecd.c:11
HWND hList
Definition: livecd.c:10
static VOID InitializeDefaultUserLocale(PLCID pNewLcid)
Definition: livecd.c:398
VOID RunLiveCD(PSTATE pState)
Definition: livecd.c:988
WCHAR Installer[MAX_PATH]
Definition: livecd.c:14
struct _LIVECD_UNATTEND LIVECD_UNATTEND
static VOID ParseUnattend(_In_ LPCWSTR UnattendInf, _Out_ LIVECD_UNATTEND *pUnattend)
Definition: livecd.c:814
VOID CenterWindow(HWND hWnd)
Definition: livecd.c:521
static INT_PTR CALLBACK StartDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
Definition: livecd.c:719
static VOID SetKeyboardLayout(HWND hwnd)
Definition: livecd.c:273
static VOID OnDrawItem(LPDRAWITEMSTRUCT lpDrawItem, PSTATE pState, UINT uCtlID)
Definition: livecd.c:545
static VOID SelectKeyboardForLanguage(HWND hwnd, LCID lcid)
Definition: livecd.c:297
BOOL IsMiniNT(VOID)
Check whether we are running in MiniNT mode (e.g. live medium).
Definition: livecd.c:110
static BOOL CALLBACK LocalesEnumProc(LPTSTR lpLocale)
Definition: livecd.c:129
static VOID InitLogo(PIMGINFO pImgInfo, HWND hwndDlg)
Definition: livecd.c:27
BOOL bSpain
Definition: livecd.c:12
static BOOL GetLayoutName(LPCWSTR szLCID, LPWSTR szName)
Definition: livecd.c:207
#define ZeroMemory
Definition: minwinbase.h:31
LONG_PTR LPARAM
Definition: minwindef.h:175
UINT_PTR WPARAM
Definition: minwindef.h:174
LPCWSTR szPath
Definition: env.c:37
PSDBQUERYRESULT_VISTA PVOID DWORD * dwSize
Definition: env.c:56
static PVOID ptr
Definition: dispmode.c:27
#define _swprintf(buf, format,...)
Definition: sprintf.c:56
BITMAPINFO bmpi
Definition: alphablend.c:68
BOOL WINAPI GdiAlphaBlend(HDC hdcDst, int xDst, int yDst, int widthDst, int heightDst, HDC hdcSrc, int xSrc, int ySrc, int widthSrc, int heightSrc, BLENDFUNCTION blendFunction)
#define AC_SRC_ALPHA
Definition: alphablend.c:9
static HBITMAP
Definition: button.c:44
static HDC
Definition: imagelist.c:88
int k
Definition: mpi.c:3369
LPSTR LPTSTR
Definition: ms-dtyp.idl:131
UINT_PTR HKL
Definition: msctf.idl:125
#define PROCESSOR_ARCHITECTURE_IA64
Definition: ketypes.h:111
#define PROCESSOR_ARCHITECTURE_ALPHA64
Definition: ketypes.h:112
#define PROCESSOR_ARCHITECTURE_ALPHA
Definition: ketypes.h:107
#define PROCESSOR_ARCHITECTURE_ARM
Definition: ketypes.h:110
#define PROCESSOR_ARCHITECTURE_UNKNOWN
Definition: ketypes.h:115
#define PROCESSOR_ARCHITECTURE_SHX
Definition: ketypes.h:109
#define PROCESSOR_ARCHITECTURE_MIPS
Definition: ketypes.h:106
#define PROCESSOR_ARCHITECTURE_PPC
Definition: ketypes.h:108
#define PROCESSOR_ARCHITECTURE_AMD64
Definition: ketypes.h:114
#define PROCESSOR_ARCHITECTURE_INTEL
Definition: ketypes.h:105
#define _Out_writes_z_(s)
Definition: no_sal2.h:180
#define _Out_
Definition: no_sal2.h:160
#define _In_
Definition: no_sal2.h:158
struct _STATE * PSTATE
#define KEY_READ
Definition: nt_native.h:1026
#define KEY_QUERY_VALUE
Definition: nt_native.h:1019
#define KEY_ENUMERATE_SUB_KEYS
Definition: nt_native.h:1022
#define FILE_ATTRIBUTE_DIRECTORY
Definition: nt_native.h:705
#define KEY_WRITE
Definition: nt_native.h:1034
* PLCID
Definition: ntbasedef.h:521
#define UNICODE_NULL
#define SORT_DEFAULT
#define MAKELCID(lgid, srtid)
NTSTATUS NTAPI NtSetDefaultLocale(IN BOOLEAN UserProfile, IN LCID DefaultLocaleId)
Definition: locale.c:433
#define LOWORD(l)
Definition: pedump.c:82
BYTE * PBYTE
Definition: pedump.c:66
short WCHAR
Definition: pedump.c:58
long LONG
Definition: pedump.c:60
#define INT
Definition: polytest.cpp:20
TCHAR langSel[255]
Definition: powercfg.c:17
static const WCHAR szName[]
Definition: powrprof.c:45
#define DONE
Definition: rnr20lib.h:14
#define SUBLANG_SPANISH
Definition: nls.h:336
#define MAKELANGID(p, s)
Definition: nls.h:15
#define LANG_SPANISH
Definition: nls.h:123
#define LANGIDFROMLCID(l)
Definition: nls.h:18
DWORD LCID
Definition: nls.h:13
#define PRIMARYLANGID(l)
Definition: nls.h:16
#define SUBLANG_SPANISH_MODERN
Definition: nls.h:338
wcscpy
#define LoadStringW
Definition: utils.h:64
#define _countof(array)
Definition: sndvol32.h:70
#define TRACE(s)
Definition: solgame.cpp:4
STRSAFEAPI StringCchCatW(STRSAFE_LPWSTR pszDest, size_t cchDest, STRSAFE_LPCWSTR pszSrc)
Definition: strsafe.h:325
STRSAFEAPI StringCchCopyW(STRSAFE_LPWSTR pszDest, size_t cchDest, STRSAFE_LPCWSTR pszSrc)
Definition: strsafe.h:149
INT iPlanes
Definition: userinit.h:52
INT cxSource
Definition: userinit.h:50
INT iBits
Definition: userinit.h:53
INT cySource
Definition: userinit.h:51
HBITMAP hBitmap
Definition: userinit.h:49
LCID LocaleID
Definition: livecd.c:19
BOOL bEnabled
Definition: livecd.c:18
WORD wProcessorArchitecture
Definition: winbase.h:894
Definition: parser.c:49
USHORT biBitCount
Definition: precomp.h:34
ULONG biCompression
Definition: precomp.h:35
BITMAPINFOHEADER bmiHeader
Definition: wingdi.h:1922
LONG bmHeight
Definition: wingdi.h:1869
LONG bmWidth
Definition: wingdi.h:1868
WORD bmPlanes
Definition: wingdi.h:1871
WORD bmBitsPixel
Definition: wingdi.h:1872
LONG right
Definition: windef.h:108
LONG bottom
Definition: windef.h:109
LONG top
Definition: windef.h:107
LONG left
Definition: windef.h:106
#define GWLP_USERDATA
Definition: treelist.c:63
uint16_t * PWSTR
Definition: typedefs.h:56
int32_t INT_PTR
Definition: typedefs.h:64
const uint16_t * PCWSTR
Definition: typedefs.h:57
const uint16_t * LPCWSTR
Definition: typedefs.h:57
uint32_t DWORD_PTR
Definition: typedefs.h:65
unsigned char * LPBYTE
Definition: typedefs.h:53
uint16_t * LPWSTR
Definition: typedefs.h:56
ULONG_PTR SIZE_T
Definition: typedefs.h:80
int32_t INT
Definition: typedefs.h:58
uint16_t * PWCHAR
Definition: typedefs.h:56
uint32_t ULONG
Definition: typedefs.h:59
#define HIWORD(l)
Definition: typedefs.h:247
#define BI_RGB
Definition: uefivid.c:46
@ REBOOT
Definition: userinit.h:44
@ INSTALLER
Definition: userinit.h:43
@ SHELL
Definition: userinit.h:42
@ LOCALEPAGE
Definition: userinit.h:35
@ STARTPAGE
Definition: userinit.h:36
#define INVALID_FILE_ATTRIBUTES
Definition: vfdcmd.c:23
static const WCHAR lang[]
Definition: wbemdisp.c:287
_Must_inspect_result_ _In_ WDFDEVICE _In_ PCUNICODE_STRING KeyName
Definition: wdfdevice.h:2705
HDC hdcMem
Definition: welcome.c:104
HBITMAP WINAPI CreateDIBSection(HDC hDC, CONST BITMAPINFO *BitmapInfo, UINT Usage, VOID **Bits, HANDLE hSection, DWORD dwOffset)
Definition: bitmap.c:245
#define GetModuleHandle
Definition: winbase.h:3548
_In_ LONG _In_ HWND hwnd
Definition: winddi.h:4023
DWORD COLORREF
Definition: windef.h:100
#define DIB_RGB_COLORS
Definition: wingdi.h:367
#define AC_SRC_OVER
Definition: wingdi.h:1369
HGDIOBJ WINAPI SelectObject(_In_ HDC, _In_ HGDIOBJ)
Definition: dc.c:1546
HDC WINAPI CreateCompatibleDC(_In_opt_ HDC hdc)
struct tagBITMAPINFO BITMAPINFO
#define GetObject
Definition: wingdi.h:4914
BOOL WINAPI DeleteDC(_In_ HDC)
#define LOCALE_ICURRDIGITS
Definition: winnls.h:64
#define LOCALE_SCOUNTRY
Definition: winnls.h:40
#define LOCALE_SDATE
Definition: winnls.h:68
#define LCID_INSTALLED
Definition: winnls.h:224
#define LOCALE_SGROUPING
Definition: winnls.h:54
#define LOCALE_ICOUNTRY
Definition: winnls.h:39
#define LOCALE_SDECIMAL
Definition: winnls.h:52
#define LOCALE_IDATE
Definition: winnls.h:73
#define LOCALE_IFIRSTWEEKOFYEAR
Definition: winnls.h:86
#define LOCALE_IMEASURE
Definition: winnls.h:51
#define LOCALE_SLONGDATE
Definition: winnls.h:71
#define LOCALE_S1159
Definition: winnls.h:81
#define LOCALE_SSHORTDATE
Definition: winnls.h:70
#define LOCALE_SPOSITIVESIGN
Definition: winnls.h:127
#define LOCALE_SMONDECIMALSEP
Definition: winnls.h:61
#define LOCALE_ITIME
Definition: winnls.h:75
#define LOCALE_ICURRENCY
Definition: winnls.h:66
#define LOCALE_ITLZERO
Definition: winnls.h:78
#define LOCALE_SLANGUAGE
Definition: winnls.h:31
#define LOCALE_SMONTHOUSANDSEP
Definition: winnls.h:62
#define LOCALE_NOUSEROVERRIDE
Definition: winnls.h:19
#define LOCALE_IDIGITS
Definition: winnls.h:55
#define LCID_SUPPORTED
Definition: winnls.h:225
#define LOCALE_STHOUSAND
Definition: winnls.h:53
#define LOCALE_STIMEFORMAT
Definition: winnls.h:72
#define LOCALE_IFIRSTDAYOFWEEK
Definition: winnls.h:85
#define LOCALE_STIME
Definition: winnls.h:69
#define LOCALE_SABBREVLANGNAME
Definition: winnls.h:37
#define LOCALE_INEGNUMBER
Definition: winnls.h:57
#define LOCALE_SNEGATIVESIGN
Definition: winnls.h:128
DWORD LCTYPE
Definition: winnls.h:592
#define LOCALE_S2359
Definition: winnls.h:82
#define LOCALE_SNATIVEDIGITS
Definition: winnls.h:58
#define LOCALE_SLIST
Definition: winnls.h:50
#define LOCALE_ILZERO
Definition: winnls.h:56
#define LOCALE_ICALENDARTYPE
Definition: winnls.h:83
#define LOCALE_SMONGROUPING
Definition: winnls.h:63
#define LOCALE_SCURRENCY
Definition: winnls.h:59
#define LOCALE_INEGCURR
Definition: winnls.h:67
#define LOCALE_ITIMEMARKPOSN
Definition: winnls.h:76
#define HKEY_LOCAL_MACHINE
Definition: winreg.h:12
#define HKEY_USERS
Definition: winreg.h:13
int WINAPI ReleaseDC(_In_opt_ HWND, _In_ HDC)
BOOL WINAPI GetKeyboardLayoutNameW(_Out_writes_(KL_NAMELENGTH) LPWSTR)
#define CB_SELECTSTRING
Definition: winuser.h:1989
#define CB_SETITEMDATA
Definition: winuser.h:1995
#define MAKEWPARAM(l, h)
Definition: winuser.h:4117
#define IMAGE_BITMAP
Definition: winuser.h:211
#define GetWindowLongPtrW
Definition: winuser.h:4983
#define KLF_SETFORPROCESS
Definition: winuser.h:117
#define IDCANCEL
Definition: winuser.h:842
#define VK_F10
Definition: winuser.h:2300
#define KLF_REPLACELANG
Definition: winuser.h:115
BOOL WINAPI GetWindowRect(_In_ HWND, _Out_ LPRECT)
BOOL WINAPI SetWindowPos(_In_ HWND, _In_opt_ HWND, _In_ int, _In_ int, _In_ int, _In_ int, _In_ UINT)
#define KLF_ACTIVATE
Definition: winuser.h:111
#define WM_COMMAND
Definition: winuser.h:1768
#define CB_ERR
Definition: winuser.h:2471
HANDLE WINAPI LoadImageW(_In_opt_ HINSTANCE hInst, _In_ LPCWSTR name, _In_ UINT type, _In_ int cx, _In_ int cy, _In_ UINT fuLoad)
Definition: cursoricon.c:2572
#define CB_SETCURSEL
Definition: winuser.h:1990
#define VK_CONTROL
Definition: winuser.h:2239
#define SWP_NOSIZE
Definition: winuser.h:1256
#define WM_INITDIALOG
Definition: winuser.h:1767
#define MB_YESNO
Definition: winuser.h:828
#define CB_GETCOUNT
Definition: winuser.h:1971
int WINAPI MessageBoxW(_In_opt_ HWND hWnd, _In_opt_ LPCWSTR lpText, _In_opt_ LPCWSTR lpCaption, _In_ UINT uType)
HWND WINAPI GetDlgItem(_In_opt_ HWND, _In_ int)
#define IDOK
Definition: winuser.h:841
#define WM_DRAWITEM
Definition: winuser.h:1673
#define CBN_SELCHANGE
Definition: winuser.h:2008
#define SPIF_SENDCHANGE
Definition: winuser.h:1600
LRESULT WINAPI SendDlgItemMessageW(_In_ HWND, _In_ int, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
HWND WINAPI GetDesktopWindow(void)
Definition: window.c:628
#define HWND_TOP
Definition: winuser.h:1218
HKL WINAPI LoadKeyboardLayoutW(_In_ LPCWSTR, _In_ UINT)
#define CB_ADDSTRING
Definition: winuser.h:1965
#define CB_GETITEMDATA
Definition: winuser.h:1979
BOOL WINAPI EnableWindow(_In_ HWND, _In_ BOOL)
HDC WINAPI GetDC(_In_opt_ HWND)
#define wsprintf
Definition: winuser.h:6031
BOOL WINAPI SystemParametersInfoW(_In_ UINT uiAction, _In_ UINT uiParam, _Inout_opt_ PVOID pvParam, _In_ UINT fWinIni)
#define MB_ICONWARNING
Definition: winuser.h:797
HWND WINAPI GetParent(_In_ HWND)
#define MB_DEFBUTTON2
Definition: winuser.h:810
#define LR_DEFAULTCOLOR
Definition: winuser.h:1098
#define VK_SHIFT
Definition: winuser.h:2238
#define BN_CLICKED
Definition: winuser.h:1954
#define MAKEINTRESOURCEW(i)
Definition: winuser.h:582
#define IDYES
Definition: winuser.h:846
#define CB_GETCURSEL
Definition: winuser.h:1972
#define SetWindowLongPtrW
Definition: winuser.h:5512
LRESULT WINAPI SendMessageW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
SHORT WINAPI GetKeyState(_In_ int)
INT_PTR WINAPI DialogBoxParamW(_In_opt_ HINSTANCE, _In_ LPCWSTR, _In_opt_ HWND, _In_opt_ DLGPROC, _In_ LPARAM)
BOOL WINAPI EndDialog(_In_ HWND, _In_ INT_PTR)