ReactOS  0.4.10-dev-358-g66981e1
reactos.c File Reference
#include "reactos.h"
#include "resource.h"
Include dependency graph for reactos.c:

Go to the source code of this file.

Functions

LONG LoadGenentry (HINF hinf, PCTSTR name, PGENENTRY *gen, PINFCONTEXT context)
 
static VOID CenterWindow (HWND hWnd)
 
static HFONT CreateTitleFont (VOID)
 
static INT_PTR CALLBACK StartDlgProc (HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
 
static INT_PTR CALLBACK TypeDlgProc (HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
 
static INT_PTR CALLBACK DeviceDlgProc (HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
 
static INT_PTR CALLBACK SummaryDlgProc (HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
 
static INT_PTR CALLBACK ProcessDlgProc (HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
 
static INT_PTR CALLBACK RestartDlgProc (HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
 
BOOL LoadSetupData (PSETUPDATA pSetupData)
 
BOOL isUnattendSetup (VOID)
 
int WINAPI _tWinMain (HINSTANCE hInst, HINSTANCE hPrevInstance, LPTSTR lpszCmdLine, int nCmdShow)
 

Function Documentation

int WINAPI _tWinMain ( HINSTANCE  hInst,
HINSTANCE  hPrevInstance,
LPTSTR  lpszCmdLine,
int  nCmdShow 
)

Definition at line 790 of file reactos.c.

794 {
795  PSETUPDATA pSetupData = NULL;
796  PROPSHEETHEADER psh;
797  HPROPSHEETPAGE ahpsp[8];
798  PROPSHEETPAGE psp = {0};
799  UINT nPages = 0;
800 
801  pSetupData = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(SETUPDATA));
802  if (pSetupData == NULL)
803  {
804  return 1;
805  }
806 
807  pSetupData->hInstance = hInst;
808  pSetupData->bUnattend = isUnattendSetup();
809 
810  LoadString(hInst,IDS_ABORTSETUP, pSetupData->szAbortMessage, sizeof(pSetupData->szAbortMessage)/sizeof(TCHAR));
811  LoadString(hInst,IDS_ABORTSETUP2, pSetupData->szAbortTitle, sizeof(pSetupData->szAbortTitle)/sizeof(TCHAR));
812 
813  /* Create title font */
814  pSetupData->hTitleFont = CreateTitleFont();
815 
816  if (!pSetupData->bUnattend)
817  {
818  if (!LoadSetupData(pSetupData))
819  {
820  HeapFree(GetProcessHeap(), 0, pSetupData);
821  return 0;
822  }
823 
824  /* Create the Start page, until setup is working */
825  psp.dwSize = sizeof(PROPSHEETPAGE);
826  psp.dwFlags = PSP_DEFAULT | PSP_HIDEHEADER;
827  psp.hInstance = hInst;
828  psp.lParam = (LPARAM)pSetupData;
829  psp.pfnDlgProc = StartDlgProc;
830  psp.pszTemplate = MAKEINTRESOURCE(IDD_STARTPAGE);
831  ahpsp[nPages++] = CreatePropertySheetPage(&psp);
832 
833  /* Create install type selection page */
834  psp.dwSize = sizeof(PROPSHEETPAGE);
835  psp.dwFlags = PSP_DEFAULT | PSP_USEHEADERTITLE | PSP_USEHEADERSUBTITLE;
836  psp.pszHeaderTitle = MAKEINTRESOURCE(IDS_TYPETITLE);
837  psp.pszHeaderSubTitle = MAKEINTRESOURCE(IDS_TYPESUBTITLE);
838  psp.hInstance = hInst;
839  psp.lParam = (LPARAM)pSetupData;
840  psp.pfnDlgProc = TypeDlgProc;
841  psp.pszTemplate = MAKEINTRESOURCE(IDD_TYPEPAGE);
842  ahpsp[nPages++] = CreatePropertySheetPage(&psp);
843 
844  /* Create device settings page */
845  psp.dwSize = sizeof(PROPSHEETPAGE);
846  psp.dwFlags = PSP_DEFAULT | PSP_USEHEADERTITLE | PSP_USEHEADERSUBTITLE;
847  psp.pszHeaderTitle = MAKEINTRESOURCE(IDS_DEVICETITLE);
848  psp.pszHeaderSubTitle = MAKEINTRESOURCE(IDS_DEVICESUBTITLE);
849  psp.hInstance = hInst;
850  psp.lParam = (LPARAM)pSetupData;
851  psp.pfnDlgProc = DeviceDlgProc;
852  psp.pszTemplate = MAKEINTRESOURCE(IDD_DEVICEPAGE);
853  ahpsp[nPages++] = CreatePropertySheetPage(&psp);
854 
855  /* Create install device settings page / boot method / install directory */
856  psp.dwSize = sizeof(PROPSHEETPAGE);
857  psp.dwFlags = PSP_DEFAULT | PSP_USEHEADERTITLE | PSP_USEHEADERSUBTITLE;
858  psp.pszHeaderTitle = MAKEINTRESOURCE(IDS_DRIVETITLE);
859  psp.pszHeaderSubTitle = MAKEINTRESOURCE(IDS_DRIVESUBTITLE);
860  psp.hInstance = hInst;
861  psp.lParam = (LPARAM)pSetupData;
862  psp.pfnDlgProc = DriveDlgProc;
863  psp.pszTemplate = MAKEINTRESOURCE(IDD_DRIVEPAGE);
864  ahpsp[nPages++] = CreatePropertySheetPage(&psp);
865 
866  /* Create summary page */
867  psp.dwSize = sizeof(PROPSHEETPAGE);
868  psp.dwFlags = PSP_DEFAULT | PSP_USEHEADERTITLE | PSP_USEHEADERSUBTITLE;
869  psp.pszHeaderTitle = MAKEINTRESOURCE(IDS_SUMMARYTITLE);
870  psp.pszHeaderSubTitle = MAKEINTRESOURCE(IDS_SUMMARYSUBTITLE);
871  psp.hInstance = hInst;
872  psp.lParam = (LPARAM)pSetupData;
873  psp.pfnDlgProc = SummaryDlgProc;
874  psp.pszTemplate = MAKEINTRESOURCE(IDD_SUMMARYPAGE);
875  ahpsp[nPages++] = CreatePropertySheetPage(&psp);
876  }
877 
878  /* Create installation progress page */
879  psp.dwSize = sizeof(PROPSHEETPAGE);
880  psp.dwFlags = PSP_DEFAULT | PSP_USEHEADERTITLE | PSP_USEHEADERSUBTITLE;
881  psp.pszHeaderTitle = MAKEINTRESOURCE(IDS_PROCESSTITLE);
882  psp.pszHeaderSubTitle = MAKEINTRESOURCE(IDS_PROCESSSUBTITLE);
883  psp.hInstance = hInst;
884  psp.lParam = (LPARAM)pSetupData;
885  psp.pfnDlgProc = ProcessDlgProc;
886  psp.pszTemplate = MAKEINTRESOURCE(IDD_PROCESSPAGE);
887  ahpsp[nPages++] = CreatePropertySheetPage(&psp);
888 
889  /* Create finish to reboot page */
890  psp.dwSize = sizeof(PROPSHEETPAGE);
891  psp.dwFlags = PSP_DEFAULT | PSP_HIDEHEADER;
892  psp.hInstance = hInst;
893  psp.lParam = (LPARAM)pSetupData;
894  psp.pfnDlgProc = RestartDlgProc;
895  psp.pszTemplate = MAKEINTRESOURCE(IDD_RESTARTPAGE);
896  ahpsp[nPages++] = CreatePropertySheetPage(&psp);
897 
898  /* Create the property sheet */
899  psh.dwSize = sizeof(PROPSHEETHEADER);
900  psh.dwFlags = PSH_WIZARD97 | PSH_WATERMARK | PSH_HEADER;
901  psh.hInstance = hInst;
902  psh.hwndParent = NULL;
903  psh.nPages = nPages;
904  psh.nStartPage = 0;
905  psh.phpage = ahpsp;
906  psh.pszbmWatermark = MAKEINTRESOURCE(IDB_WATERMARK);
907  psh.pszbmHeader = MAKEINTRESOURCE(IDB_HEADER);
908 
909  /* Display the wizard */
910  PropertySheet(&psh);
911 
912  if (pSetupData->hTitleFont)
913  DeleteObject(pSetupData->hTitleFont);
914 
915  HeapFree(GetProcessHeap(), 0, pSetupData);
916 
917 #if 0
918  EnableShutdownPrivilege();
920 #endif
921 
922  return 0;
923 }
#define IDS_DEVICESUBTITLE
Definition: resource.h:62
#define MAKEINTRESOURCE
Definition: winuser.h:591
#define IDD_DRIVEPAGE
Definition: resource.h:29
#define IDS_ABORTSETUP2
Definition: resource.h:70
BOOL LoadSetupData(PSETUPDATA pSetupData)
Definition: reactos.c:498
#define IDS_PROCESSTITLE
Definition: resource.h:65
static INT_PTR CALLBACK TypeDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
Definition: reactos.c:139
#define IDD_STARTPAGE
Definition: resource.h:14
#define IDS_ABORTSETUP
Definition: resource.h:69
TCHAR szAbortMessage[512]
Definition: reactos.h:71
static INT_PTR CALLBACK DeviceDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
Definition: reactos.c:204
BOOL WINAPI DeleteObject(_In_ HGDIOBJ)
#define EWX_REBOOT
Definition: winuser.h:633
#define IDB_HEADER
Definition: resource.h:30
#define IDD_PROCESSPAGE
Definition: resource.h:38
static INT_PTR CALLBACK ProcessDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
Definition: reactos.c:372
#define IDS_DRIVETITLE
Definition: resource.h:63
#define IDS_PROCESSSUBTITLE
Definition: resource.h:66
BOOL bUnattend
Definition: reactos.h:67
BOOL isUnattendSetup(VOID)
Definition: reactos.c:705
struct _PSP * HPROPSHEETPAGE
Definition: mstask.idl:90
smooth NULL
Definition: ftsmooth.c:416
#define PROPSHEETHEADER
Definition: prsht.h:374
#define IDS_DEVICETITLE
Definition: resource.h:61
#define IDD_DEVICEPAGE
Definition: resource.h:23
static INT_PTR CALLBACK StartDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
Definition: reactos.c:86
#define CreatePropertySheetPage
Definition: prsht.h:381
char TCHAR
Definition: xmlstorage.h:189
#define IDS_TYPETITLE
Definition: resource.h:59
#define PSP_DEFAULT
Definition: prsht.h:22
#define GetProcessHeap()
Definition: compat.h:395
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
HINSTANCE hInstance
Definition: reactos.h:66
#define IDD_RESTARTPAGE
Definition: resource.h:43
#define IDD_TYPEPAGE
Definition: resource.h:17
static HFONT CreateTitleFont(VOID)
Definition: reactos.c:61
INT_PTR CALLBACK DriveDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
Definition: drivepage.c:144
TCHAR szAbortTitle[64]
Definition: reactos.h:72
#define IDS_DRIVESUBTITLE
Definition: resource.h:64
BOOL WINAPI ExitWindowsEx(_In_ UINT, _In_ DWORD)
HINSTANCE hInst
Definition: dxdiag.c:13
#define IDS_SUMMARYSUBTITLE
Definition: resource.h:72
#define IDS_SUMMARYTITLE
Definition: resource.h:71
static INT_PTR CALLBACK SummaryDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
Definition: reactos.c:322
#define IDB_WATERMARK
Definition: resource.h:4
unsigned int UINT
Definition: ndis.h:50
#define HEAP_ZERO_MEMORY
Definition: compat.h:123
#define PropertySheet
Definition: prsht.h:382
HFONT hTitleFont
Definition: reactos.h:69
#define IDS_TYPESUBTITLE
Definition: resource.h:60
static INT_PTR CALLBACK RestartDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
Definition: reactos.c:424
#define HeapFree(x, y, z)
Definition: compat.h:394
#define IDD_SUMMARYPAGE
Definition: resource.h:55
#define LoadString
Definition: winuser.h:5680
#define PROPSHEETPAGE
Definition: prsht.h:371
#define LPARAM
Definition: msvc.h:38
static VOID CenterWindow ( HWND  hWnd)
static

Definition at line 38 of file reactos.c.

Referenced by ExplorerAboutDlg::ExplorerAboutDlg(), FindProgramDlg::FindProgramDlg(), MdiSdiDlg::MdiSdiDlg(), and StartDlgProc().

39 {
41  RECT rcParent;
42  RECT rcWindow;
43 
44  hWndParent = GetParent(hWnd);
45  if (hWndParent == NULL)
46  hWndParent = GetDesktopWindow();
47 
48  GetWindowRect(hWndParent, &rcParent);
49  GetWindowRect(hWnd, &rcWindow);
50 
52  HWND_TOP,
53  ((rcParent.right - rcParent.left) - (rcWindow.right - rcWindow.left)) / 2,
54  ((rcParent.bottom - rcParent.top) - (rcWindow.bottom - rcWindow.top)) / 2,
55  0,
56  0,
57  SWP_NOSIZE);
58 }
HWND hWnd
Definition: settings.c:17
LONG top
Definition: windef.h:297
HANDLE HWND
Definition: compat.h:13
#define HWND_TOP
Definition: winuser.h:1188
LONG left
Definition: windef.h:296
LONG right
Definition: windef.h:298
smooth NULL
Definition: ftsmooth.c:416
HWND WINAPI GetDesktopWindow(void)
Definition: window.c:635
#define SWP_NOSIZE
Definition: winuser.h:1225
HWND WINAPI GetParent(_In_ HWND)
LONG bottom
Definition: windef.h:299
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)
static HFONT CreateTitleFont ( VOID  )
static

Definition at line 61 of file reactos.c.

Referenced by _tWinMain().

62 {
63  NONCLIENTMETRICS ncm;
64  LOGFONT LogFont;
65  HDC hdc;
66  INT FontSize;
67  HFONT hFont;
68 
69  ncm.cbSize = sizeof(NONCLIENTMETRICS);
70  SystemParametersInfo(SPI_GETNONCLIENTMETRICS, 0, &ncm, 0);
71 
72  LogFont = ncm.lfMessageFont;
73  LogFont.lfWeight = FW_BOLD;
74  _tcscpy(LogFont.lfFaceName, _T("MS Shell Dlg"));
75 
76  hdc = GetDC(NULL);
77  FontSize = 12;
78  LogFont.lfHeight = 0 - GetDeviceCaps (hdc, LOGPIXELSY) * FontSize / 72;
79  hFont = CreateFontIndirect(&LogFont);
80  ReleaseDC(NULL, hdc);
81 
82  return hFont;
83 }
#define HDC
Definition: msvc.h:22
HDC WINAPI GetDC(_In_opt_ HWND)
#define SystemParametersInfo
Definition: winuser.h:5719
_TCHAR * _tcscpy(_TCHAR *to, const _TCHAR *from)
Definition: tcscpy.h:8
int32_t INT
Definition: typedefs.h:56
HFONT hFont
Definition: main.c:53
LONG lfHeight
Definition: dimm.idl:42
int WINAPI ReleaseDC(_In_opt_ HWND, _In_ HDC)
HDC hdc
Definition: msvc.h:53
LONG lfWeight
Definition: dimm.idl:46
smooth NULL
Definition: ftsmooth.c:416
#define _T(x)
Definition: vfdio.h:22
int WINAPI GetDeviceCaps(_In_opt_ HDC, _In_ int)
#define FW_BOLD
Definition: wingdi.h:376
#define CreateFontIndirect
Definition: wingdi.h:4421
static DWORD *static HFONT(WINAPI *pCreateFontIndirectExA)(const ENUMLOGFONTEXDVA *)
CHAR lfFaceName[LF_FACESIZE]
Definition: dimm.idl:55
#define LOGPIXELSY
Definition: wingdi.h:717
static INT_PTR CALLBACK DeviceDlgProc ( HWND  hwndDlg,
UINT  uMsg,
WPARAM  wParam,
LPARAM  lParam 
)
static

Definition at line 204 of file reactos.c.

Referenced by _tWinMain().

208 {
209  PSETUPDATA pSetupData;
210  LONG i;
211  LRESULT tindex;
212  HWND hList;
213 
214  /* Retrieve pointer to the global setup data */
215  pSetupData = (PSETUPDATA)GetWindowLongPtr(hwndDlg, GWLP_USERDATA);
216 
217  switch (uMsg)
218  {
219  case WM_INITDIALOG:
220  /* Save pointer to the global setup data */
221  pSetupData = (PSETUPDATA)((LPPROPSHEETPAGE)lParam)->lParam;
222  SetWindowLongPtr(hwndDlg, GWLP_USERDATA, (DWORD_PTR)pSetupData);
223 
224  hList = GetDlgItem(hwndDlg, IDC_COMPUTER);
225 
226  for (i=0; i < pSetupData->CompCount; i++)
227  {
228  tindex = SendMessage(hList, CB_ADDSTRING, (WPARAM) 0, (LPARAM) pSetupData->pComputers[i].Value);
229  SendMessage(hList, CB_SETITEMDATA, tindex, i);
230  }
231  SendMessage(hList, CB_SETCURSEL, 0, 0); // set first as default
232 
233  hList = GetDlgItem(hwndDlg, IDC_DISPLAY);
234 
235  for (i=0; i < pSetupData->DispCount; i++)
236  {
237  tindex = SendMessage(hList, CB_ADDSTRING, (WPARAM) 0, (LPARAM) pSetupData->pDisplays[i].Value);
238  SendMessage(hList, CB_SETITEMDATA, tindex, i);
239  }
240  SendMessage(hList, CB_SETCURSEL, 0, 0); // set first as default
241 
242  hList = GetDlgItem(hwndDlg, IDC_KEYBOARD);
243 
244  for (i=0; i < pSetupData->KeybCount; i++)
245  {
246  tindex = SendMessage(hList,CB_ADDSTRING,(WPARAM)0,(LPARAM)pSetupData->pKeyboards[i].Value);
247  SendMessage(hList,CB_SETITEMDATA,tindex,i);
248  }
249  SendMessage(hList,CB_SETCURSEL,0,0); // set first as default
250  break;
251 
252  case WM_NOTIFY:
253  {
254  LPNMHDR lpnm = (LPNMHDR)lParam;
255 
256  switch (lpnm->code)
257  {
258  case PSN_SETACTIVE:
260  break;
261 
262  case PSN_QUERYCANCEL:
263  SetWindowLongPtr(hwndDlg,
265  MessageBox(GetParent(hwndDlg),
266  pSetupData->szAbortMessage,
267  pSetupData->szAbortTitle,
269  return TRUE;
270 
271  case PSN_WIZNEXT: // set the selected data
272  {
273  hList = GetDlgItem(hwndDlg, IDC_COMPUTER);
274 
275  tindex = SendMessage(hList, CB_GETCURSEL, (WPARAM) 0, (LPARAM) 0);
276  if (tindex != CB_ERR)
277  {
278  pSetupData->SelectedComputer = SendMessage(hList,
280  (WPARAM) tindex,
281  (LPARAM) 0);
282  }
283 
284  hList = GetDlgItem(hwndDlg, IDC_DISPLAY);
285 
286  tindex = SendMessage(hList, CB_GETCURSEL, (WPARAM) 0, (LPARAM) 0);
287  if (tindex != CB_ERR)
288  {
289  pSetupData->SelectedDisplay = SendMessage(hList,
291  (WPARAM) tindex,
292  (LPARAM) 0);
293  }
294 
295  hList =GetDlgItem(hwndDlg, IDC_KEYBOARD);
296 
297  tindex = SendMessage(hList, CB_GETCURSEL, (WPARAM) 0, (LPARAM) 0);
298  if (tindex != CB_ERR)
299  {
300  pSetupData->SelectedKeyboard = SendMessage(hList,
302  (WPARAM) tindex,
303  (LPARAM) 0);
304  }
305  return TRUE;
306  }
307 
308  default:
309  break;
310  }
311  }
312  break;
313 
314  default:
315  break;
316 
317  }
318  return FALSE;
319 }
#define CB_SETITEMDATA
Definition: winuser.h:1922
#define TRUE
Definition: types.h:120
#define IDYES
Definition: winuser.h:829
LONG SelectedComputer
Definition: reactos.h:84
#define CB_GETITEMDATA
Definition: winuser.h:1906
TCHAR szAbortMessage[512]
Definition: reactos.h:71
UINT uMsg
Definition: precomp.h:45
#define PSWIZB_NEXT
Definition: prsht.h:154
HANDLE HWND
Definition: compat.h:13
TCHAR Value[128]
Definition: reactos.h:60
#define PSN_SETACTIVE
Definition: prsht.h:115
#define CB_GETCURSEL
Definition: winuser.h:1899
#define DWLP_MSGRESULT
Definition: winuser.h:859
struct tagNMHDR * LPNMHDR
#define IDC_COMPUTER
Definition: resource.h:24
UINT_PTR WPARAM
Definition: windef.h:207
LONG SelectedDisplay
Definition: reactos.h:85
#define PSN_QUERYCANCEL
Definition: prsht.h:123
UINT code
Definition: winuser.h:3107
GLenum GLclampf GLint i
Definition: glfuncs.h:14
#define FALSE
Definition: types.h:117
#define MB_YESNO
Definition: winuser.h:811
long LONG
Definition: pedump.c:60
LONG_PTR LPARAM
Definition: windef.h:208
#define CB_ADDSTRING
Definition: winuser.h:1892
#define LPPROPSHEETPAGE
Definition: prsht.h:372
#define MB_ICONQUESTION
Definition: winuser.h:783
#define PSN_WIZNEXT
Definition: prsht.h:121
PGENENTRY pDisplays
Definition: reactos.h:97
#define PropSheet_SetWizButtons(d, f)
Definition: prsht.h:339
PGENENTRY pComputers
Definition: reactos.h:95
PGENENTRY pKeyboards
Definition: reactos.h:99
#define CB_ERR
Definition: winuser.h:2384
LONG DispCount
Definition: reactos.h:98
HWND WINAPI GetDlgItem(_In_opt_ HWND, _In_ int)
#define PSWIZB_BACK
Definition: prsht.h:153
#define GWLP_USERDATA
Definition: winuser.h:851
LONG KeybCount
Definition: reactos.h:100
#define IDC_DISPLAY
Definition: resource.h:19
#define IDC_KEYBOARD
Definition: resource.h:26
TCHAR szAbortTitle[64]
Definition: reactos.h:72
#define MessageBox
Definition: winuser.h:5683
#define CB_SETCURSEL
Definition: winuser.h:1917
#define SetWindowLongPtr
Definition: winuser.h:5715
uint32_t DWORD_PTR
Definition: typedefs.h:63
HWND hList
Definition: livecd.c:10
HWND WINAPI GetParent(_In_ HWND)
UINT WPARAM LPARAM lParam
Definition: precomp.h:45
#define SendMessage
Definition: winuser.h:5704
LONG CompCount
Definition: reactos.h:96
#define GetWindowLongPtr
Definition: winuser.h:5658
LONG_PTR LRESULT
Definition: windef.h:209
LONG SelectedKeyboard
Definition: reactos.h:86
#define WM_INITDIALOG
Definition: winuser.h:1710
#define WM_NOTIFY
Definition: richedit.h:61
struct _SETUPDATA * PSETUPDATA
BOOL isUnattendSetup ( VOID  )

Definition at line 705 of file reactos.c.

Referenced by _tWinMain().

706 {
708  WCHAR *ch;
709  HINF hUnattendedInf;
710  INFCONTEXT InfContext;
711  TCHAR szValue[MAX_PATH];
712  DWORD LineLength;
713  //HKEY hKey;
714  BOOL result = 0;
715 
716  GetModuleFileNameW(NULL, szPath, MAX_PATH);
717  ch = strrchrW(szPath, L'\\');
718  if (ch != NULL)
719  *ch = L'\0';
720 
721  wcscat(szPath, L"\\unattend.inf");
722  hUnattendedInf = SetupOpenInfFileW(szPath, NULL, INF_STYLE_OLDNT, NULL);
723 
724  if (hUnattendedInf != INVALID_HANDLE_VALUE)
725  {
726  if (SetupFindFirstLine(hUnattendedInf, _T("Unattend"), _T("UnattendSetupEnabled"),&InfContext))
727  {
728  if (SetupGetStringField(&InfContext,
729  1,
730  szValue,
731  sizeof(szValue) / sizeof(TCHAR),
732  &LineLength) && (_tcsicmp(szValue, _T("yes")) == 0))
733  {
734  result = 1; // unattendSetup enabled
735  // read values and store in SetupData
736  }
737  }
738  SetupCloseInfFile(hUnattendedInf);
739  }
740 
741  return result;
742 }
DWORD WINAPI GetModuleFileNameW(HINSTANCE hModule, LPWSTR lpFilename, DWORD nSize)
Definition: loader.c:606
#define _tcsicmp
Definition: xmlstorage.h:205
#define SetupFindFirstLine
Definition: setupapi.h:2618
__wchar_t WCHAR
Definition: xmlstorage.h:180
#define INVALID_HANDLE_VALUE
Definition: compat.h:391
#define SetupOpenInfFileW
Definition: inffile.h:34
DWORD DWORD
Definition: winlogon.h:83
smooth NULL
Definition: ftsmooth.c:416
char TCHAR
Definition: xmlstorage.h:189
#define _T(x)
Definition: vfdio.h:22
unsigned int BOOL
Definition: ntddk_ex.h:94
#define MAX_PATH
Definition: compat.h:26
#define INF_STYLE_OLDNT
Definition: setupapi.h:439
#define SetupGetStringField
Definition: setupapi.h:2633
static const WCHAR L[]
Definition: oid.c:1087
PULONG HINF
Definition: inffile.h:37
WINE_UNICODE_INLINE WCHAR * strrchrW(const WCHAR *str, WCHAR ch)
Definition: unicode.h:254
LPCWSTR szPath
Definition: env.c:35
_CRTIMP wchar_t *__cdecl wcscat(_Inout_updates_z_(_String_length_(_Dest)+_String_length_(_Source)+1) wchar_t *_Dest, _In_z_ const wchar_t *_Source)
#define SetupCloseInfFile
Definition: usetup.h:101
GLuint64EXT * result
Definition: glext.h:11304
LONG LoadGenentry ( HINF  hinf,
PCTSTR  name,
PGENENTRY gen,
PINFCONTEXT  context 
)

Definition at line 668 of file reactos.c.

Referenced by LoadSetupData().

669 {
670  LONG TotalCount;
671  DWORD LineLength;
672 
673  TotalCount = SetupGetLineCount(hinf, name);
674  if (TotalCount > 0)
675  {
676  *gen = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(GENENTRY) * TotalCount);
677  if (*gen != NULL)
678  {
679  if (SetupFindFirstLine(hinf, name, NULL, context))
680  {
681  LONG Count = 0;
682  do
683  {
684  SetupGetStringField(context,
685  0,
686  (*gen)[Count].Id,
687  sizeof((*gen)[Count].Id) / sizeof(TCHAR),
688  &LineLength);
689 
690  SetupGetStringField(context,
691  1,
692  (*gen)[Count].Value,
693  sizeof((*gen)[Count].Value) / sizeof(TCHAR),
694  &LineLength);
695  ++Count;
696  }
697  while (SetupFindNextLine(context, context) && Count < TotalCount);
698  }
699  }
700  else return 0;
701  }
702  return TotalCount;
703 }
#define SetupFindFirstLine
Definition: setupapi.h:2618
_Inout_ __drv_aliasesMem PSLIST_ENTRY _Inout_ PSLIST_ENTRY _In_ ULONG Count
Definition: exfuncs.h:1015
DWORD DWORD
Definition: winlogon.h:83
DWORD Id
long LONG
Definition: pedump.c:60
smooth NULL
Definition: ftsmooth.c:416
char TCHAR
Definition: xmlstorage.h:189
#define GetProcessHeap()
Definition: compat.h:395
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
#define SetupGetStringField
Definition: setupapi.h:2633
#define SetupFindNextLine
Definition: usetup.h:102
UINTN UINT8 Value
Definition: acefiex.h:751
#define HEAP_ZERO_MEMORY
Definition: compat.h:123
Definition: name.c:36
#define SetupGetLineCount
Definition: setupapi.h:2627
BOOL LoadSetupData ( PSETUPDATA  pSetupData)

Definition at line 498 of file reactos.c.

Referenced by _tWinMain().

500 {
502  TCHAR tmp[10];
503  WCHAR *ch;
504  HINF hTxtsetupSif = INVALID_HANDLE_VALUE;
505  INFCONTEXT InfContext;
506  //TCHAR szValue[MAX_PATH];
507  DWORD LineLength;
508  LONG Count;
509  BOOL ret = TRUE;
510 
512  ch = strrchrW(szPath,L'\\');
513  if (ch != NULL)
514  *ch = L'\0';
515 
516  wcscat(szPath, L"\\txtsetup.sif");
517  hTxtsetupSif = SetupOpenInfFileW(szPath, NULL, INF_STYLE_OLDNT, NULL);
518  if (hTxtsetupSif == INVALID_HANDLE_VALUE)
519  {
520  TCHAR message[512], caption[64];
521 
522  // txtsetup.sif cannot be found
523  LoadString(pSetupData->hInstance, IDS_NO_TXTSETUP_SIF, message, sizeof(message)/sizeof(TCHAR));
524  LoadString(pSetupData->hInstance, IDS_CAPTION, caption, sizeof(caption)/sizeof(TCHAR));
525 
526  MessageBox(NULL, message, caption, MB_OK | MB_ICONERROR);
527  return FALSE;
528  }
529 
530  // get language list
531  pSetupData->LangCount = SetupGetLineCount(hTxtsetupSif, _T("Language"));
532  if (pSetupData->LangCount > 0)
533  {
534  pSetupData->pLanguages = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(LANG) * pSetupData->LangCount);
535  if (pSetupData->pLanguages == NULL)
536  {
537  ret = FALSE;
538  goto done;
539  }
540 
541  Count = 0;
542  if (SetupFindFirstLine(hTxtsetupSif, _T("Language"), NULL, &InfContext))
543  {
544  do
545  {
546  SetupGetStringField(&InfContext,
547  0,
548  pSetupData->pLanguages[Count].LangId,
549  sizeof(pSetupData->pLanguages[Count].LangId) / sizeof(TCHAR),
550  &LineLength);
551 
552  SetupGetStringField(&InfContext,
553  1,
554  pSetupData->pLanguages[Count].LangName,
555  sizeof(pSetupData->pLanguages[Count].LangName) / sizeof(TCHAR),
556  &LineLength);
557  ++Count;
558  }
559  while (SetupFindNextLine(&InfContext, &InfContext) && Count < pSetupData->LangCount);
560  }
561  }
562 
563  // get keyboard layout list
564  pSetupData->KbLayoutCount = SetupGetLineCount(hTxtsetupSif, _T("KeyboardLayout"));
565  if (pSetupData->KbLayoutCount > 0)
566  {
567  pSetupData->pKbLayouts = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(KBLAYOUT) * pSetupData->KbLayoutCount);
568  if (pSetupData->pKbLayouts == NULL)
569  {
570  ret = FALSE;
571  goto done;
572  }
573 
574  Count = 0;
575  if (SetupFindFirstLine(hTxtsetupSif, _T("KeyboardLayout"), NULL, &InfContext))
576  {
577  do
578  {
579  SetupGetStringField(&InfContext,
580  0,
581  pSetupData->pKbLayouts[Count].LayoutId,
582  sizeof(pSetupData->pKbLayouts[Count].LayoutId) / sizeof(TCHAR),
583  &LineLength);
584 
585  SetupGetStringField(&InfContext,
586  1,
587  pSetupData->pKbLayouts[Count].LayoutName,
588  sizeof(pSetupData->pKbLayouts[Count].LayoutName) / sizeof(TCHAR),
589  &LineLength);
590  ++Count;
591  }
592  while (SetupFindNextLine(&InfContext, &InfContext) && Count < pSetupData->KbLayoutCount);
593  }
594  }
595 
596  // get default for keyboard and language
597  pSetupData->DefaultKBLayout = -1;
598  pSetupData->DefaultLang = -1;
599 
600  // TODO: get defaults from underlaying running system
601  if (SetupFindFirstLine(hTxtsetupSif, _T("NLS"), _T("DefaultLayout"), &InfContext))
602  {
603  SetupGetStringField(&InfContext, 1, tmp, sizeof(tmp) / sizeof(TCHAR), &LineLength);
604  for (Count = 0; Count < pSetupData->KbLayoutCount; Count++)
605  {
606  if (_tcscmp(tmp, pSetupData->pKbLayouts[Count].LayoutId) == 0)
607  {
608  pSetupData->DefaultKBLayout = Count;
609  break;
610  }
611  }
612  }
613 
614  if (SetupFindFirstLine(hTxtsetupSif, _T("NLS"), _T("DefaultLanguage"), &InfContext))
615  {
616  SetupGetStringField(&InfContext, 1, tmp, sizeof(tmp) / sizeof(TCHAR), &LineLength);
617  for (Count = 0; Count < pSetupData->LangCount; Count++)
618  {
619  if (_tcscmp(tmp, pSetupData->pLanguages[Count].LangId) == 0)
620  {
621  pSetupData->DefaultLang = Count;
622  break;
623  }
624  }
625  }
626 
627  // get computers list
628  pSetupData->CompCount = LoadGenentry(hTxtsetupSif,_T("Computer"),&pSetupData->pComputers,&InfContext);
629 
630  // get display list
631  pSetupData->DispCount = LoadGenentry(hTxtsetupSif,_T("Display"),&pSetupData->pDisplays,&InfContext);
632 
633  // get keyboard list
634  pSetupData->KeybCount = LoadGenentry(hTxtsetupSif, _T("Keyboard"),&pSetupData->pKeyboards,&InfContext);
635 
636  // get install directory
637  if (SetupFindFirstLine(hTxtsetupSif, _T("SetupData"), _T("DefaultPath"), &InfContext))
638  {
639  SetupGetStringField(&InfContext,
640  1,
641  pSetupData->InstallDir,
642  sizeof(pSetupData->InstallDir) / sizeof(TCHAR),
643  &LineLength);
644  }
645 
646 done:
647  if (ret == FALSE)
648  {
649  if (pSetupData->pKbLayouts != NULL)
650  {
651  HeapFree(GetProcessHeap(), 0, pSetupData->pKbLayouts);
652  pSetupData->pKbLayouts = NULL;
653  }
654 
655  if (pSetupData->pLanguages != NULL)
656  {
657  HeapFree(GetProcessHeap(), 0, pSetupData->pLanguages);
658  pSetupData->pLanguages = NULL;
659  }
660  }
661 
662  if (hTxtsetupSif != INVALID_HANDLE_VALUE)
663  SetupCloseInfFile(hTxtsetupSif);
664 
665  return ret;
666 }
LONG LoadGenentry(HINF hinf, PCTSTR name, PGENENTRY *gen, PINFCONTEXT context)
Definition: reactos.c:668
DWORD WINAPI GetModuleFileNameW(HINSTANCE hModule, LPWSTR lpFilename, DWORD nSize)
Definition: loader.c:606
Definition: tftpd.h:59
#define TRUE
Definition: types.h:120
TCHAR LangId[9]
Definition: reactos.h:44
#define SetupFindFirstLine
Definition: setupapi.h:2618
int _tcscmp(const _TCHAR *s1, const _TCHAR *s2)
Definition: tcscmp.h:8
__wchar_t WCHAR
Definition: xmlstorage.h:180
#define IDS_NO_TXTSETUP_SIF
Definition: resource.h:73
#define INVALID_HANDLE_VALUE
Definition: compat.h:391
_Inout_ __drv_aliasesMem PSLIST_ENTRY _Inout_ PSLIST_ENTRY _In_ ULONG Count
Definition: exfuncs.h:1015
#define SetupOpenInfFileW
Definition: inffile.h:34
LONG DefaultKBLayout
Definition: reactos.h:92
DWORD DWORD
Definition: winlogon.h:83
TCHAR LangName[128]
Definition: reactos.h:45
#define IDS_CAPTION
Definition: resource.h:74
PKBLAYOUT pKbLayouts
Definition: reactos.h:93
LONG KbLayoutCount
Definition: reactos.h:94
TCHAR LayoutId[9]
Definition: reactos.h:50
LONG DefaultLang
Definition: reactos.h:89
#define FALSE
Definition: types.h:117
long LONG
Definition: pedump.c:60
smooth NULL
Definition: ftsmooth.c:416
PGENENTRY pDisplays
Definition: reactos.h:97
TCHAR LayoutName[128]
Definition: reactos.h:51
PGENENTRY pComputers
Definition: reactos.h:95
PGENENTRY pKeyboards
Definition: reactos.h:99
LONG DispCount
Definition: reactos.h:98
char TCHAR
Definition: xmlstorage.h:189
#define _T(x)
Definition: vfdio.h:22
unsigned int BOOL
Definition: ntddk_ex.h:94
#define GetProcessHeap()
Definition: compat.h:395
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
LONG KeybCount
Definition: reactos.h:100
HINSTANCE hInstance
Definition: reactos.h:66
#define MAX_PATH
Definition: compat.h:26
#define INF_STYLE_OLDNT
Definition: setupapi.h:439
TCHAR InstallDir[MAX_PATH]
Definition: reactos.h:83
Definition: reactos.h:42
#define SetupGetStringField
Definition: setupapi.h:2633
int ret
static const WCHAR L[]
Definition: oid.c:1087
#define SetupFindNextLine
Definition: usetup.h:102
#define MB_ICONERROR
Definition: winuser.h:781
#define MessageBox
Definition: winuser.h:5683
PULONG HINF
Definition: inffile.h:37
WINE_UNICODE_INLINE WCHAR * strrchrW(const WCHAR *str, WCHAR ch)
Definition: unicode.h:254
PLANG pLanguages
Definition: reactos.h:90
LPCWSTR szPath
Definition: env.c:35
_CRTIMP wchar_t *__cdecl wcscat(_Inout_updates_z_(_String_length_(_Dest)+_String_length_(_Source)+1) wchar_t *_Dest, _In_z_ const wchar_t *_Source)
#define MB_OK
Definition: winuser.h:784
#define HEAP_ZERO_MEMORY
Definition: compat.h:123
#define SetupGetLineCount
Definition: setupapi.h:2627
LONG CompCount
Definition: reactos.h:96
#define SetupCloseInfFile
Definition: usetup.h:101
#define HeapFree(x, y, z)
Definition: compat.h:394
LONG LangCount
Definition: reactos.h:91
#define LoadString
Definition: winuser.h:5680
static INT_PTR CALLBACK ProcessDlgProc ( HWND  hwndDlg,
UINT  uMsg,
WPARAM  wParam,
LPARAM  lParam 
)
static

Definition at line 372 of file reactos.c.

Referenced by _tWinMain().

376 {
377  PSETUPDATA pSetupData;
378 
379  /* Retrieve pointer to the global setup data */
380  pSetupData = (PSETUPDATA)GetWindowLongPtr(hwndDlg, GWLP_USERDATA);
381 
382  switch (uMsg)
383  {
384  case WM_INITDIALOG:
385  /* Save pointer to the global setup data */
386  pSetupData = (PSETUPDATA)((LPPROPSHEETPAGE)lParam)->lParam;
387  SetWindowLongPtr(hwndDlg, GWLP_USERDATA, (DWORD_PTR)pSetupData);
388  break;
389 
390  case WM_NOTIFY:
391  {
392  LPNMHDR lpnm = (LPNMHDR)lParam;
393 
394  switch (lpnm->code)
395  {
396  case PSN_SETACTIVE:
398  // disable all buttons during installation process
399  // PropSheet_SetWizButtons(GetParent(hwndDlg), 0 );
400  break;
401  case PSN_QUERYCANCEL:
402  SetWindowLongPtr(hwndDlg,
404  MessageBox(GetParent(hwndDlg),
405  pSetupData->szAbortMessage,
406  pSetupData->szAbortTitle,
408  return TRUE;
409  default:
410  break;
411  }
412  }
413  break;
414 
415  default:
416  break;
417 
418  }
419 
420  return FALSE;
421 }
#define TRUE
Definition: types.h:120
#define IDYES
Definition: winuser.h:829
TCHAR szAbortMessage[512]
Definition: reactos.h:71
UINT uMsg
Definition: precomp.h:45
#define PSWIZB_NEXT
Definition: prsht.h:154
#define PSN_SETACTIVE
Definition: prsht.h:115
#define DWLP_MSGRESULT
Definition: winuser.h:859
struct tagNMHDR * LPNMHDR
#define PSN_QUERYCANCEL
Definition: prsht.h:123
UINT code
Definition: winuser.h:3107
#define FALSE
Definition: types.h:117
#define MB_YESNO
Definition: winuser.h:811
#define LPPROPSHEETPAGE
Definition: prsht.h:372
#define MB_ICONQUESTION
Definition: winuser.h:783
#define PropSheet_SetWizButtons(d, f)
Definition: prsht.h:339
#define GWLP_USERDATA
Definition: winuser.h:851
TCHAR szAbortTitle[64]
Definition: reactos.h:72
#define MessageBox
Definition: winuser.h:5683
#define SetWindowLongPtr
Definition: winuser.h:5715
uint32_t DWORD_PTR
Definition: typedefs.h:63
HWND WINAPI GetParent(_In_ HWND)
UINT WPARAM LPARAM lParam
Definition: precomp.h:45
#define GetWindowLongPtr
Definition: winuser.h:5658
#define WM_INITDIALOG
Definition: winuser.h:1710
#define WM_NOTIFY
Definition: richedit.h:61
struct _SETUPDATA * PSETUPDATA
static INT_PTR CALLBACK RestartDlgProc ( HWND  hwndDlg,
UINT  uMsg,
WPARAM  wParam,
LPARAM  lParam 
)
static

Definition at line 424 of file reactos.c.

Referenced by _tWinMain().

428 {
429  PSETUPDATA pSetupData;
430 
431  /* Retrieve pointer to the global setup data */
432  pSetupData = (PSETUPDATA)GetWindowLongPtr(hwndDlg, GWLP_USERDATA);
433 
434  switch (uMsg)
435  {
436  case WM_INITDIALOG:
437  /* Save pointer to the global setup data */
438  pSetupData = (PSETUPDATA)((LPPROPSHEETPAGE)lParam)->lParam;
439  SetWindowLongPtr(hwndDlg, GWLP_USERDATA, (DWORD_PTR)pSetupData);
440 
441  /* Set title font */
442  /*SendDlgItemMessage(hwndDlg,
443  IDC_STARTTITLE,
444  WM_SETFONT,
445  (WPARAM)hTitleFont,
446  (LPARAM)TRUE);*/
447  break;
448 
449  case WM_TIMER:
450  {
451  INT Position;
452  HWND hWndProgress;
453 
454  hWndProgress = GetDlgItem(hwndDlg, IDC_RESTART_PROGRESS);
455  Position = SendMessage(hWndProgress, PBM_GETPOS, 0, 0);
456  if (Position == 300)
457  {
458  KillTimer(hwndDlg, 1);
460  }
461  else
462  {
463  SendMessage(hWndProgress, PBM_SETPOS, Position + 1, 0);
464  }
465  return TRUE;
466  }
467 
468  case WM_DESTROY:
469  return TRUE;
470 
471  case WM_NOTIFY:
472  {
473  LPNMHDR lpnm = (LPNMHDR)lParam;
474 
475  switch (lpnm->code)
476  {
477  case PSN_SETACTIVE: // Only "Finish" for closing the App
481  SetTimer(hwndDlg, 1, 50, NULL);
482  break;
483 
484  default:
485  break;
486  }
487  }
488  break;
489 
490  default:
491  break;
492 
493  }
494 
495  return FALSE;
496 }
#define TRUE
Definition: types.h:120
#define MAKELPARAM(l, h)
Definition: winuser.h:3910
UINT uMsg
Definition: precomp.h:45
HANDLE HWND
Definition: compat.h:13
#define PBM_SETPOS
Definition: commctrl.h:2154
#define PSBTN_FINISH
Definition: prsht.h:148
#define SendDlgItemMessage
Definition: winuser.h:5703
#define PSN_SETACTIVE
Definition: prsht.h:115
int32_t INT
Definition: typedefs.h:56
struct tagNMHDR * LPNMHDR
UINT code
Definition: winuser.h:3107
#define PBM_SETRANGE
Definition: commctrl.h:2153
#define FALSE
Definition: types.h:117
#define LPPROPSHEETPAGE
Definition: prsht.h:372
smooth NULL
Definition: ftsmooth.c:416
#define IDC_RESTART_PROGRESS
Definition: resource.h:44
#define PropSheet_SetWizButtons(d, f)
Definition: prsht.h:339
UINT_PTR WINAPI SetTimer(_In_opt_ HWND, _In_ UINT_PTR, _In_ UINT, _In_opt_ TIMERPROC)
#define WM_DESTROY
Definition: winuser.h:1586
#define PSWIZB_FINISH
Definition: prsht.h:155
HWND WINAPI GetDlgItem(_In_opt_ HWND, _In_ int)
#define GWLP_USERDATA
Definition: winuser.h:851
#define WM_TIMER
Definition: winuser.h:1713
BOOL WINAPI KillTimer(_In_opt_ HWND, _In_ UINT_PTR)
#define SetWindowLongPtr
Definition: winuser.h:5715
uint32_t DWORD_PTR
Definition: typedefs.h:63
UINT64 Position
Definition: acefiex.h:384
HWND WINAPI GetParent(_In_ HWND)
UINT WPARAM LPARAM lParam
Definition: precomp.h:45
#define SendMessage
Definition: winuser.h:5704
#define GetWindowLongPtr
Definition: winuser.h:5658
#define PropSheet_PressButton(d, i)
Definition: prsht.h:330
#define WM_INITDIALOG
Definition: winuser.h:1710
#define PBM_GETPOS
Definition: commctrl.h:2164
#define WM_NOTIFY
Definition: richedit.h:61
struct _SETUPDATA * PSETUPDATA
static INT_PTR CALLBACK StartDlgProc ( HWND  hwndDlg,
UINT  uMsg,
WPARAM  wParam,
LPARAM  lParam 
)
static

Definition at line 86 of file reactos.c.

Referenced by _tWinMain().

90 {
91  PSETUPDATA pSetupData;
92 
93  /* Retrieve pointer to the global setup data */
94  pSetupData = (PSETUPDATA)GetWindowLongPtr(hwndDlg, GWLP_USERDATA);
95 
96  switch (uMsg)
97  {
98  case WM_INITDIALOG:
99  /* Save pointer to the global setup data */
100  pSetupData = (PSETUPDATA)((LPPROPSHEETPAGE)lParam)->lParam;
101  SetWindowLongPtr(hwndDlg, GWLP_USERDATA, (DWORD_PTR)pSetupData);
102 
103  /* Center the wizard window */
104  CenterWindow(GetParent(hwndDlg));
105 
106  /* Set title font */
107  SendDlgItemMessage(hwndDlg,
109  WM_SETFONT,
110  (WPARAM)pSetupData->hTitleFont,
111  (LPARAM)TRUE);
112  break;
113 
114  case WM_NOTIFY:
115  {
116  LPNMHDR lpnm = (LPNMHDR)lParam;
117 
118  switch (lpnm->code)
119  {
120  case PSN_SETACTIVE:
122  break;
123 
124  default:
125  break;
126  }
127  }
128  break;
129 
130  default:
131  break;
132 
133  }
134 
135  return FALSE;
136 }
#define TRUE
Definition: types.h:120
#define IDC_STARTTITLE
Definition: resource.h:15
UINT uMsg
Definition: precomp.h:45
#define PSWIZB_NEXT
Definition: prsht.h:154
#define SendDlgItemMessage
Definition: winuser.h:5703
#define PSN_SETACTIVE
Definition: prsht.h:115
struct tagNMHDR * LPNMHDR
UINT_PTR WPARAM
Definition: windef.h:207
UINT code
Definition: winuser.h:3107
#define FALSE
Definition: types.h:117
LONG_PTR LPARAM
Definition: windef.h:208
#define LPPROPSHEETPAGE
Definition: prsht.h:372
#define PropSheet_SetWizButtons(d, f)
Definition: prsht.h:339
#define GWLP_USERDATA
Definition: winuser.h:851
#define SetWindowLongPtr
Definition: winuser.h:5715
uint32_t DWORD_PTR
Definition: typedefs.h:63
static VOID CenterWindow(HWND hWnd)
Definition: reactos.c:38
HWND WINAPI GetParent(_In_ HWND)
UINT WPARAM LPARAM lParam
Definition: precomp.h:45
#define WM_SETFONT
Definition: winuser.h:1627
HFONT hTitleFont
Definition: reactos.h:69
#define GetWindowLongPtr
Definition: winuser.h:5658
#define WM_INITDIALOG
Definition: winuser.h:1710
#define WM_NOTIFY
Definition: richedit.h:61
struct _SETUPDATA * PSETUPDATA
static INT_PTR CALLBACK SummaryDlgProc ( HWND  hwndDlg,
UINT  uMsg,
WPARAM  wParam,
LPARAM  lParam 
)
static

Definition at line 322 of file reactos.c.

Referenced by _tWinMain().

326 {
327  PSETUPDATA pSetupData;
328 
329  /* Retrieve pointer to the global setup data */
330  pSetupData = (PSETUPDATA)GetWindowLongPtr(hwndDlg, GWLP_USERDATA);
331 
332  switch (uMsg)
333  {
334  case WM_INITDIALOG:
335  /* Save pointer to the global setup data */
336  pSetupData = (PSETUPDATA)((LPPROPSHEETPAGE)lParam)->lParam;
337  SetWindowLongPtr(hwndDlg, GWLP_USERDATA, (DWORD_PTR)pSetupData);
338  break;
339 
340  case WM_NOTIFY:
341  {
342  LPNMHDR lpnm = (LPNMHDR)lParam;
343 
344  switch (lpnm->code)
345  {
346  case PSN_SETACTIVE:
348  break;
349 
350  case PSN_QUERYCANCEL:
351  SetWindowLongPtr(hwndDlg,
353  MessageBox(GetParent(hwndDlg),
354  pSetupData->szAbortMessage,
355  pSetupData->szAbortTitle,
357  return TRUE;
358  default:
359  break;
360  }
361  }
362  break;
363 
364  default:
365  break;
366  }
367 
368  return FALSE;
369 }
#define TRUE
Definition: types.h:120
#define IDYES
Definition: winuser.h:829
TCHAR szAbortMessage[512]
Definition: reactos.h:71
UINT uMsg
Definition: precomp.h:45
#define PSWIZB_NEXT
Definition: prsht.h:154
#define PSN_SETACTIVE
Definition: prsht.h:115
#define DWLP_MSGRESULT
Definition: winuser.h:859
struct tagNMHDR * LPNMHDR
#define PSN_QUERYCANCEL
Definition: prsht.h:123
UINT code
Definition: winuser.h:3107
#define FALSE
Definition: types.h:117
#define MB_YESNO
Definition: winuser.h:811
#define LPPROPSHEETPAGE
Definition: prsht.h:372
#define MB_ICONQUESTION
Definition: winuser.h:783
#define PropSheet_SetWizButtons(d, f)
Definition: prsht.h:339
#define PSWIZB_BACK
Definition: prsht.h:153
#define GWLP_USERDATA
Definition: winuser.h:851
TCHAR szAbortTitle[64]
Definition: reactos.h:72
#define MessageBox
Definition: winuser.h:5683
#define SetWindowLongPtr
Definition: winuser.h:5715
uint32_t DWORD_PTR
Definition: typedefs.h:63
HWND WINAPI GetParent(_In_ HWND)
UINT WPARAM LPARAM lParam
Definition: precomp.h:45
#define GetWindowLongPtr
Definition: winuser.h:5658
#define WM_INITDIALOG
Definition: winuser.h:1710
#define WM_NOTIFY
Definition: richedit.h:61
struct _SETUPDATA * PSETUPDATA
static INT_PTR CALLBACK TypeDlgProc ( HWND  hwndDlg,
UINT  uMsg,
WPARAM  wParam,
LPARAM  lParam 
)
static

Definition at line 139 of file reactos.c.

Referenced by _tWinMain().

143 {
144  PSETUPDATA pSetupData;
145 
146  /* Retrieve pointer to the global setup data */
147  pSetupData = (PSETUPDATA)GetWindowLongPtr(hwndDlg, GWLP_USERDATA);
148 
149  switch (uMsg)
150  {
151  case WM_INITDIALOG:
152  /* Save pointer to the global setup data */
153  pSetupData = (PSETUPDATA)((LPPROPSHEETPAGE)lParam)->lParam;
154  SetWindowLongPtr(hwndDlg, GWLP_USERDATA, (DWORD_PTR)pSetupData);
155 
156  /* Check the 'install' radio button */
158 
159  /* Disable the 'update' radio button and text */
162  break;
163 
164  case WM_NOTIFY:
165  {
166  LPNMHDR lpnm = (LPNMHDR)lParam;
167 
168  switch (lpnm->code)
169  {
170  case PSN_SETACTIVE:
172  break;
173 
174  case PSN_QUERYCANCEL:
175  SetWindowLongPtr(hwndDlg,
177  MessageBox(GetParent(hwndDlg),
178  pSetupData->szAbortMessage,
179  pSetupData->szAbortTitle,
181  return TRUE;
182 
183  case PSN_WIZNEXT: // set the selected data
184  pSetupData->RepairUpdateFlag = !(SendMessage(GetDlgItem(hwndDlg, IDC_INSTALL),
185  BM_GETCHECK,
186  (WPARAM) 0,
187  (LPARAM) 0) == BST_CHECKED);
188  return TRUE;
189 
190  default:
191  break;
192  }
193  }
194  break;
195 
196  default:
197  break;
198 
199  }
200  return FALSE;
201 }
BOOL WINAPI CheckDlgButton(_In_ HWND, _In_ int, _In_ UINT)
#define TRUE
Definition: types.h:120
#define IDYES
Definition: winuser.h:829
TCHAR szAbortMessage[512]
Definition: reactos.h:71
UINT uMsg
Definition: precomp.h:45
#define PSWIZB_NEXT
Definition: prsht.h:154
#define PSN_SETACTIVE
Definition: prsht.h:115
BOOLEAN RepairUpdateFlag
Definition: reactos.h:87
#define DWLP_MSGRESULT
Definition: winuser.h:859
struct tagNMHDR * LPNMHDR
UINT_PTR WPARAM
Definition: windef.h:207
#define PSN_QUERYCANCEL
Definition: prsht.h:123
UINT code
Definition: winuser.h:3107
#define FALSE
Definition: types.h:117
#define MB_YESNO
Definition: winuser.h:811
LONG_PTR LPARAM
Definition: windef.h:208
#define LPPROPSHEETPAGE
Definition: prsht.h:372
#define MB_ICONQUESTION
Definition: winuser.h:783
#define PSN_WIZNEXT
Definition: prsht.h:121
#define IDC_UPDATETEXT
Definition: resource.h:21
#define BM_GETCHECK
Definition: winuser.h:1874
#define PropSheet_SetWizButtons(d, f)
Definition: prsht.h:339
HWND WINAPI GetDlgItem(_In_opt_ HWND, _In_ int)
#define PSWIZB_BACK
Definition: prsht.h:153
#define GWLP_USERDATA
Definition: winuser.h:851
TCHAR szAbortTitle[64]
Definition: reactos.h:72
#define MessageBox
Definition: winuser.h:5683
#define IDC_UPDATE
Definition: resource.h:20
#define SetWindowLongPtr
Definition: winuser.h:5715
uint32_t DWORD_PTR
Definition: typedefs.h:63
BOOL WINAPI EnableWindow(_In_ HWND, _In_ BOOL)
HWND WINAPI GetParent(_In_ HWND)
UINT WPARAM LPARAM lParam
Definition: precomp.h:45
#define BST_CHECKED
Definition: winuser.h:197
#define SendMessage
Definition: winuser.h:5704
#define GetWindowLongPtr
Definition: winuser.h:5658
#define IDC_INSTALL
Definition: fontview.h:13
#define WM_INITDIALOG
Definition: winuser.h:1710
#define WM_NOTIFY
Definition: richedit.h:61
struct _SETUPDATA * PSETUPDATA