ReactOS  0.4.12-dev-409-g9f418243
wizard.c File Reference
#include "newdev_private.h"
#include <wincon.h>
#include <cfgmgr32.h>
#include <shlobj.h>
Include dependency graph for wizard.c:

Go to the source code of this file.

Functions

static VOID CenterWindow (IN HWND hWnd)
 
static BOOL SetFailedInstall (IN HDEVINFO DeviceInfoSet, IN PSP_DEVINFO_DATA DevInfoData OPTIONAL, IN BOOLEAN Set)
 
static BOOL CanDisableDevice (IN DEVINST DevInst, IN HMACHINE hMachine, OUT BOOL *CanDisable)
 
static BOOL IsDeviceStarted (IN DEVINST DevInst, IN HMACHINE hMachine, OUT BOOL *IsEnabled)
 
static BOOL StartDevice (IN HDEVINFO DeviceInfoSet, IN PSP_DEVINFO_DATA DevInfoData OPTIONAL, IN BOOL bEnable, IN DWORD HardwareProfile OPTIONAL, OUT BOOL *bNeedReboot OPTIONAL)
 
static DWORD WINAPI FindDriverProc (IN LPVOID lpParam)
 
static DWORD WINAPI InstallDriverProc (IN LPVOID lpParam)
 
static VOID PopulateCustomPathCombo (IN HWND hwndCombo)
 
static VOID SaveCustomPath (IN HWND hwndCombo)
 
static INT_PTR CALLBACK WelcomeDlgProc (IN HWND hwndDlg, IN UINT uMsg, IN WPARAM wParam, IN LPARAM lParam)
 
static void IncludePath (HWND Dlg, BOOL Enabled)
 
static void AutoDriver (HWND Dlg, BOOL Enabled)
 
static INT_PTR CALLBACK CHSourceDlgProc (IN HWND hwndDlg, IN UINT uMsg, IN WPARAM wParam, IN LPARAM lParam)
 
static INT_PTR CALLBACK SearchDrvDlgProc (IN HWND hwndDlg, IN UINT uMsg, IN WPARAM wParam, IN LPARAM lParam)
 
static INT_PTR CALLBACK InstallDrvDlgProc (IN HWND hwndDlg, IN UINT uMsg, IN WPARAM wParam, IN LPARAM lParam)
 
static INT_PTR CALLBACK NoDriverDlgProc (IN HWND hwndDlg, IN UINT uMsg, IN WPARAM wParam, IN LPARAM lParam)
 
static INT_PTR CALLBACK InstallFailedDlgProc (IN HWND hwndDlg, IN UINT uMsg, IN WPARAM wParam, IN LPARAM lParam)
 
static INT_PTR CALLBACK NeedRebootDlgProc (IN HWND hwndDlg, IN UINT uMsg, IN WPARAM wParam, IN LPARAM lParam)
 
static INT_PTR CALLBACK FinishDlgProc (IN HWND hwndDlg, IN UINT uMsg, IN WPARAM wParam, IN LPARAM lParam)
 
static HFONT CreateTitleFont (VOID)
 
BOOL DisplayWizard (IN PDEVINSTDATA DevInstData, IN HWND hwndParent, IN UINT startPage)
 

Variables

HANDLE hThread
 

Function Documentation

◆ AutoDriver()

static void AutoDriver ( HWND  Dlg,
BOOL  Enabled 
)
static

Definition at line 553 of file wizard.c.

554 {
558 }
#define IDC_CHECK_MEDIA
Definition: resource.h:14
static void IncludePath(HWND Dlg, BOOL Enabled)
Definition: wizard.c:546
UINT WINAPI IsDlgButtonChecked(_In_ HWND, _In_ int)
HWND WINAPI GetDlgItem(_In_opt_ HWND, _In_ int)
BOOL WINAPI EnableWindow(_In_ HWND, _In_ BOOL)
#define IDC_CHECK_PATH
Definition: resource.h:15

Referenced by CHSourceDlgProc().

◆ CanDisableDevice()

static BOOL CanDisableDevice ( IN DEVINST  DevInst,
IN HMACHINE  hMachine,
OUT BOOL CanDisable 
)
static

Definition at line 93 of file wizard.c.

97 {
98  CONFIGRET cr;
99  ULONG Status, ProblemNumber;
100  BOOL Ret = FALSE;
101 
103  &ProblemNumber,
104  DevInst,
105  0,
106  hMachine);
107  if (cr == CR_SUCCESS)
108  {
109  *CanDisable = ((Status & DN_DISABLEABLE) != 0);
110  Ret = TRUE;
111  }
112 
113  return Ret;
114 }
CONFIGRET WINAPI CM_Get_DevNode_Status_Ex(_Out_ PULONG pulStatus, _Out_ PULONG pulProblemNumber, _In_ DEVINST dnDevInst, _In_ ULONG ulFlags, _In_opt_ HMACHINE hMachine)
Definition: cfgmgr.c:3412
#define TRUE
Definition: types.h:120
#define DN_DISABLEABLE
Definition: cfg.h:131
#define CR_SUCCESS
Definition: cfgmgr32.h:842
unsigned int BOOL
Definition: ntddk_ex.h:94
Status
Definition: gdiplustypes.h:24
RETURN_TYPE CONFIGRET
Definition: cfgmgr32.h:74
unsigned int ULONG
Definition: retypes.h:1

Referenced by NoDriverDlgProc().

◆ CenterWindow()

static VOID CenterWindow ( IN HWND  hWnd)
static

Definition at line 30 of file wizard.c.

32 {
34  RECT rcParent;
35  RECT rcWindow;
36 
38  if (hWndParent == NULL)
40 
41  GetWindowRect(hWndParent, &rcParent);
42  GetWindowRect(hWnd, &rcWindow);
43 
45  hWnd,
46  HWND_TOP,
47  ((rcParent.right - rcParent.left) - (rcWindow.right - rcWindow.left)) / 2,
48  ((rcParent.bottom - rcParent.top) - (rcWindow.bottom - rcWindow.top)) / 2,
49  0,
50  0,
51  SWP_NOSIZE);
52 }
HWND hWnd
Definition: settings.c:17
LONG top
Definition: windef.h:292
#define HWND_TOP
Definition: winuser.h:1193
LONG left
Definition: windef.h:291
LONG right
Definition: windef.h:293
smooth NULL
Definition: ftsmooth.c:416
HWND WINAPI GetDesktopWindow(void)
Definition: window.c:622
#define SWP_NOSIZE
Definition: winuser.h:1230
HWND WINAPI GetParent(_In_ HWND)
LONG bottom
Definition: windef.h:294
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)

Referenced by CHSourceDlgProc(), FinishDlgProc(), InstallDrvDlgProc(), InstallFailedDlgProc(), NeedRebootDlgProc(), NoDriverDlgProc(), SearchDrvDlgProc(), and WelcomeDlgProc().

◆ CHSourceDlgProc()

static INT_PTR CALLBACK CHSourceDlgProc ( IN HWND  hwndDlg,
IN UINT  uMsg,
IN WPARAM  wParam,
IN LPARAM  lParam 
)
static

Definition at line 561 of file wizard.c.

566 {
567  PDEVINSTDATA DevInstData;
568 
569  /* Retrieve pointer to the global setup data */
570  DevInstData = (PDEVINSTDATA)GetWindowLongPtr(hwndDlg, GWLP_USERDATA);
571 
572  switch (uMsg)
573  {
574  case WM_INITDIALOG:
575  {
576  HWND hwndControl;
577  DWORD dwStyle;
578 
579  /* Get pointer to the global setup data */
580  DevInstData = (PDEVINSTDATA)((LPPROPSHEETPAGE)lParam)->lParam;
581  SetWindowLongPtr(hwndDlg, GWLP_USERDATA, (DWORD_PTR)DevInstData);
582 
583  hwndControl = GetParent(hwndDlg);
584 
585  /* Center the wizard window */
586  CenterWindow(hwndControl);
587 
588  /* Hide the system menu */
589  dwStyle = GetWindowLongPtr(hwndControl, GWL_STYLE);
590  SetWindowLongPtr(hwndControl, GWL_STYLE, dwStyle & ~WS_SYSMENU);
591 
593 
595  hwndDlg,
597  BM_SETCHECK,
598  (WPARAM)TRUE,
599  (LPARAM)0);
600  AutoDriver(hwndDlg, TRUE);
601  IncludePath(hwndDlg, FALSE);
602 
603  /* Disable manual driver choice for now */
605 
606  break;
607  }
608 
609  case WM_COMMAND:
610  {
611  switch (LOWORD(wParam))
612  {
614  AutoDriver(hwndDlg, TRUE);
615  return TRUE;
616 
617  case IDC_RADIO_CHOOSE:
618  AutoDriver(hwndDlg, FALSE);
619  return TRUE;
620 
621  case IDC_CHECK_PATH:
622  IncludePath(hwndDlg, IsDlgButtonChecked(hwndDlg, IDC_CHECK_PATH));
623  return TRUE;
624 
625  case IDC_BROWSE:
626  {
627  BROWSEINFO bi = { 0 };
628  LPITEMIDLIST pidl;
629 
630  bi.hwndOwner = hwndDlg;
631  bi.ulFlags = BIF_RETURNONLYFSDIRS;
632  pidl = SHBrowseForFolder(&bi);
633  if (pidl)
634  {
636  IMalloc* malloc;
637 
638  if (SHGetPathFromIDListW(pidl, Directory))
639  {
640  /* Set the IDC_COMBO_PATH text */
642  }
643 
644  /* Free memory, if possible */
646  {
647  IMalloc_Free(malloc, pidl);
648  IMalloc_Release(malloc);
649  }
650  return TRUE;
651  }
652  break;
653  }
654  }
655  break;
656  }
657 
658  case WM_NOTIFY:
659  {
660  LPNMHDR lpnm = (LPNMHDR)lParam;
661 
662  switch (lpnm->code)
663  {
664  case PSN_SETACTIVE:
665  /* Enable the Next and Back buttons */
667  break;
668 
669  case PSN_WIZNEXT:
670  /* Handle a Next button click, if necessary */
672  {
674  HeapFree(GetProcessHeap(), 0, DevInstData->CustomSearchPath);
675  DevInstData->CustomSearchPath = NULL;
677  DevInstData,
680  GetDlgItem(hwndDlg, IDC_COMBO_PATH)))
681  {
683  }
684  else
685  {
687  }
688  }
689  else
690  {
691  /* FIXME */;
692  }
693  return TRUE;
694 
695  default:
696  break;
697  }
698  break;
699  }
700 
701  default:
702  break;
703  }
704 
705  return FALSE;
706 }
#define IDC_CHECK_MEDIA
Definition: resource.h:14
static VOID CenterWindow(IN HWND hWnd)
Definition: wizard.c:30
#define TRUE
Definition: types.h:120
__wchar_t WCHAR
Definition: xmlstorage.h:180
#define IDC_BROWSE
Definition: resource.h:21
static VOID PopulateCustomPathCombo(IN HWND hwndCombo)
Definition: wizard.c:265
BOOL WINAPI SHGetPathFromIDListW(LPCITEMIDLIST pidl, LPWSTR pszPath)
Definition: pidl.c:1280
static VOID SaveCustomPath(IN HWND hwndCombo)
Definition: wizard.c:340
#define PSWIZB_NEXT
Definition: prsht.h:154
HRESULT WINAPI SHGetMalloc(LPMALLOC *lpmal)
Definition: shellole.c:290
static void IncludePath(HWND Dlg, BOOL Enabled)
Definition: wizard.c:546
#define IDD_SEARCHDRV
Definition: resource.h:23
LPWSTR CustomSearchPath
BOOL WINAPI SetWindowTextW(_In_ HWND, _In_opt_ LPCWSTR)
#define SendDlgItemMessage
Definition: winuser.h:5708
#define BROWSEINFO
Definition: shlobj.h:1113
#define PSN_SETACTIVE
Definition: prsht.h:115
#define IDC_RADIO_CHOOSE
Definition: resource.h:13
#define SetWindowLongPtr
Definition: treelist.c:70
WPARAM wParam
Definition: combotst.c:138
struct tagNMHDR * LPNMHDR
UINT_PTR WPARAM
Definition: windef.h:207
UINT code
Definition: winuser.h:3112
LONG_PTR LPARAM
Definition: windef.h:208
#define GWLP_USERDATA
Definition: treelist.c:63
#define LPPROPSHEETPAGE
Definition: prsht.h:372
smooth NULL
Definition: ftsmooth.c:416
#define PSN_WIZNEXT
Definition: prsht.h:121
#define PropSheet_SetWizButtons(d, f)
Definition: prsht.h:339
UINT WINAPI IsDlgButtonChecked(_In_ HWND, _In_ int)
#define SHBrowseForFolder
Definition: shlobj.h:1156
#define BM_SETCHECK
Definition: winuser.h:1882
#define GetProcessHeap()
Definition: compat.h:395
HWND WINAPI GetDlgItem(_In_opt_ HWND, _In_ int)
#define PSWIZB_BACK
Definition: prsht.h:153
#define MAX_PATH
Definition: compat.h:26
unsigned long DWORD
Definition: ntddk_ex.h:95
#define PropSheet_SetCurSelByID(d, i)
Definition: prsht.h:336
#define IDC_RADIO_SEARCHHERE
Definition: resource.h:12
#define WM_COMMAND
Definition: winuser.h:1716
#define IDD_INSTALLFAILED
Definition: resource.h:26
uint32_t DWORD_PTR
Definition: typedefs.h:63
BOOL WINAPI EnableWindow(_In_ HWND, _In_ BOOL)
#define GWL_STYLE
Definition: winuser.h:846
HWND WINAPI GetParent(_In_ HWND)
#define IDC_CHECK_PATH
Definition: resource.h:15
#define BIF_RETURNONLYFSDIRS
Definition: shlobj.h:1120
static void AutoDriver(HWND Dlg, BOOL Enabled)
Definition: wizard.c:553
base for all directory entries
Definition: entries.h:138
BOOL PrepareFoldersToScan(IN PDEVINSTDATA DevInstData, IN BOOL IncludeRemovableDevices, IN BOOL IncludeCustomPath, IN HWND hwndCombo OPTIONAL)
Definition: newdev.c:447
#define malloc
Definition: debug_ros.c:4
#define IDC_COMBO_PATH
Definition: resource.h:18
#define GetWindowLongPtr
Definition: treelist.c:73
#define WS_SYSMENU
Definition: pedump.c:629
ITEMIDLIST UNALIGNED * LPITEMIDLIST
Definition: shtypes.idl:41
#define WM_INITDIALOG
Definition: winuser.h:1715
LPARAM lParam
Definition: combotst.c:139
struct _DEVINSTDATA * PDEVINSTDATA
#define LOWORD(l)
Definition: pedump.c:82
#define HeapFree(x, y, z)
Definition: compat.h:394
#define WM_NOTIFY
Definition: richedit.h:61
#define SUCCEEDED(hr)
Definition: intsafe.h:57

Referenced by DisplayWizard().

◆ CreateTitleFont()

static HFONT CreateTitleFont ( VOID  )
static

Definition at line 1273 of file wizard.c.

1274 {
1275  NONCLIENTMETRICSW ncm;
1276  LOGFONTW LogFont;
1277  HDC hdc;
1278  INT FontSize;
1279  HFONT hFont;
1280 
1281  ncm.cbSize = sizeof(NONCLIENTMETRICSW);
1282  SystemParametersInfo(SPI_GETNONCLIENTMETRICS, 0, &ncm, 0);
1283 
1284  LogFont = ncm.lfMessageFont;
1285  LogFont.lfWeight = FW_BOLD;
1286  wcscpy(LogFont.lfFaceName, L"MS Shell Dlg");
1287 
1288  hdc = GetDC(NULL);
1289  FontSize = 12;
1290  LogFont.lfHeight = 0 - GetDeviceCaps (hdc, LOGPIXELSY) * FontSize / 72;
1291  hFont = CreateFontIndirectW(&LogFont);
1292  ReleaseDC(NULL, hdc);
1293 
1294  return hFont;
1295 }
#define HDC
Definition: msvc.h:22
HDC WINAPI GetDC(_In_opt_ HWND)
LONG lfHeight
Definition: dimm.idl:59
#define SystemParametersInfo
Definition: winuser.h:5724
int32_t INT
Definition: typedefs.h:56
HFONT hFont
Definition: main.c:53
int WINAPI ReleaseDC(_In_opt_ HWND, _In_ HDC)
HDC hdc
Definition: msvc.h:53
smooth NULL
Definition: ftsmooth.c:416
HFONT WINAPI CreateFontIndirectW(_In_ const LOGFONTW *)
_CRTIMP wchar_t *__cdecl wcscpy(_Out_writes_z_(_String_length_(_Source)+1) wchar_t *_Dest, _In_z_ const wchar_t *_Source)
static const WCHAR L[]
Definition: oid.c:1087
int WINAPI GetDeviceCaps(_In_opt_ HDC, _In_ int)
#define FW_BOLD
Definition: wingdi.h:377
static DWORD *static HFONT(WINAPI *pCreateFontIndirectExA)(const ENUMLOGFONTEXDVA *)
WCHAR lfFaceName[LF_FACESIZE]
Definition: dimm.idl:72
#define LOGPIXELSY
Definition: wingdi.h:718
LONG lfWeight
Definition: dimm.idl:63

Referenced by DisplayWizard().

◆ DisplayWizard()

BOOL DisplayWizard ( IN PDEVINSTDATA  DevInstData,
IN HWND  hwndParent,
IN UINT  startPage 
)

Definition at line 1298 of file wizard.c.

1302 {
1303  PROPSHEETHEADER psh;
1304  HPROPSHEETPAGE ahpsp[IDD_MAXIMUMPAGE + 1];
1305  PROPSHEETPAGE psp;
1306 
1307  /* zero based index */
1308  startPage -= IDD_FIRSTPAGE;
1309 
1310  /* Create the Welcome page */
1311  ZeroMemory(&psp, sizeof(PROPSHEETPAGE));
1312  psp.dwSize = sizeof(PROPSHEETPAGE);
1313  psp.dwFlags = PSP_DEFAULT | PSP_HIDEHEADER | PSP_USETITLE;
1314  psp.hInstance = hDllInstance;
1315  psp.lParam = (LPARAM)DevInstData;
1316  psp.pszTitle = MAKEINTRESOURCE(DevInstData->bUpdate ? IDS_UPDATEWIZARDTITLE : IDS_INSTALLWIZARDTITLE);
1317  psp.pfnDlgProc = WelcomeDlgProc;
1318  psp.pszTemplate = MAKEINTRESOURCE(IDD_WELCOMEPAGE);
1320 
1321  /* Create the Select Source page */
1322  psp.dwFlags = PSP_DEFAULT | PSP_USEHEADERTITLE | PSP_USETITLE;
1323  psp.pszHeaderTitle = MAKEINTRESOURCE(IDS_CHSOURCE_TITLE);
1324  psp.pfnDlgProc = CHSourceDlgProc;
1325  psp.pszTemplate = MAKEINTRESOURCE(IDD_CHSOURCE);
1327 
1328  /* Create the Search driver page */
1329  psp.dwFlags = PSP_DEFAULT | PSP_USEHEADERTITLE | PSP_USETITLE;
1330  psp.pszHeaderTitle = MAKEINTRESOURCE(IDS_SEARCHDRV_TITLE);
1331  psp.pfnDlgProc = SearchDrvDlgProc;
1332  psp.pszTemplate = MAKEINTRESOURCE(IDD_SEARCHDRV);
1334 
1335  /* Create the Install driver page */
1336  psp.dwFlags = PSP_DEFAULT | PSP_USEHEADERTITLE | PSP_USETITLE;
1337  psp.pszHeaderTitle = MAKEINTRESOURCE(IDS_INSTALLDRV_TITLE);
1338  psp.pfnDlgProc = InstallDrvDlgProc;
1339  psp.pszTemplate = MAKEINTRESOURCE(IDD_INSTALLDRV);
1341 
1342  /* Create the No driver page */
1343  psp.dwFlags = PSP_DEFAULT | PSP_HIDEHEADER | PSP_USETITLE;
1344  psp.pfnDlgProc = NoDriverDlgProc;
1345  psp.pszTemplate = MAKEINTRESOURCE(IDD_NODRIVER);
1347 
1348  /* Create the Install failed page */
1349  psp.dwFlags = PSP_DEFAULT | PSP_HIDEHEADER | PSP_USETITLE;
1350  psp.pfnDlgProc = InstallFailedDlgProc;
1351  psp.pszTemplate = MAKEINTRESOURCE(IDD_INSTALLFAILED);
1353 
1354  /* Create the Need reboot page */
1355  psp.dwFlags = PSP_DEFAULT | PSP_HIDEHEADER | PSP_USETITLE;
1356  psp.pfnDlgProc = NeedRebootDlgProc;
1357  psp.pszTemplate = MAKEINTRESOURCE(IDD_NEEDREBOOT);
1359 
1360  /* Create the Finish page */
1361  psp.dwFlags = PSP_DEFAULT | PSP_HIDEHEADER | PSP_USETITLE;
1362  psp.pfnDlgProc = FinishDlgProc;
1363  psp.pszTemplate = MAKEINTRESOURCE(IDD_FINISHPAGE);
1365 
1366  /* Create the property sheet */
1367  psh.dwSize = sizeof(PROPSHEETHEADER);
1368  psh.dwFlags = PSH_WIZARD97 | PSH_WATERMARK | PSH_HEADER;
1369  psh.hInstance = hDllInstance;
1370  psh.hwndParent = hwndParent;
1371  psh.nPages = IDD_MAXIMUMPAGE + 1;
1372  psh.nStartPage = startPage;
1373  psh.phpage = ahpsp;
1374  psh.pszbmWatermark = MAKEINTRESOURCE(IDB_WATERMARK);
1375  psh.pszbmHeader = MAKEINTRESOURCE(IDB_HEADER);
1376 
1377  /* Create title font */
1378  DevInstData->hTitleFont = CreateTitleFont();
1379 
1380  /* Display the wizard */
1381  PropertySheet(&psh);
1382 
1383  DeleteObject(DevInstData->hTitleFont);
1384 
1385  return TRUE;
1386 }
#define MAKEINTRESOURCE
Definition: winuser.h:591
#define IDD_INSTALLDRV
Definition: resource.h:24
#define TRUE
Definition: types.h:120
static INT_PTR CALLBACK InstallDrvDlgProc(IN HWND hwndDlg, IN UINT uMsg, IN WPARAM wParam, IN LPARAM lParam)
Definition: wizard.c:804
#define IDS_INSTALLWIZARDTITLE
Definition: resource.h:32
#define IDD_NEEDREBOOT
Definition: resource.h:27
#define IDS_INSTALLDRV_TITLE
Definition: resource.h:36
#define ZeroMemory
Definition: winbase.h:1635
BOOL WINAPI DeleteObject(_In_ HGDIOBJ)
#define IDD_SEARCHDRV
Definition: resource.h:23
#define IDD_NODRIVER
Definition: resource.h:25
#define IDS_UPDATEWIZARDTITLE
Definition: resource.h:33
#define IDB_HEADER
Definition: resource.h:30
static INT_PTR CALLBACK NoDriverDlgProc(IN HWND hwndDlg, IN UINT uMsg, IN WPARAM wParam, IN LPARAM lParam)
Definition: wizard.c:915
struct _PSP * HPROPSHEETPAGE
Definition: mstask.idl:90
#define IDD_CHSOURCE
Definition: resource.h:22
#define IDD_FIRSTPAGE
Definition: resource.h:29
#define PROPSHEETHEADER
Definition: prsht.h:374
static HWND hwndParent
Definition: cryptui.c:300
static INT_PTR CALLBACK SearchDrvDlgProc(IN HWND hwndDlg, IN UINT uMsg, IN WPARAM wParam, IN LPARAM lParam)
Definition: wizard.c:709
#define IDD_WELCOMEPAGE
Definition: resource.h:21
#define CreatePropertySheetPage
Definition: prsht.h:381
static HINSTANCE hDllInstance
Definition: clb.c:30
#define PSP_DEFAULT
Definition: prsht.h:22
static INT_PTR CALLBACK InstallFailedDlgProc(IN HWND hwndDlg, IN UINT uMsg, IN WPARAM wParam, IN LPARAM lParam)
Definition: wizard.c:1036
static HFONT CreateTitleFont(VOID)
Definition: wizard.c:1273
static INT_PTR CALLBACK NeedRebootDlgProc(IN HWND hwndDlg, IN UINT uMsg, IN WPARAM wParam, IN LPARAM lParam)
Definition: wizard.c:1115
#define IDD_FINISHPAGE
Definition: resource.h:34
#define IDS_CHSOURCE_TITLE
Definition: resource.h:34
#define IDD_INSTALLFAILED
Definition: resource.h:26
#define PSP_USETITLE
Definition: prsht.h:26
#define IDS_SEARCHDRV_TITLE
Definition: resource.h:35
#define IDB_WATERMARK
Definition: resource.h:4
#define PropertySheet
Definition: prsht.h:382
static INT_PTR CALLBACK WelcomeDlgProc(IN HWND hwndDlg, IN UINT uMsg, IN WPARAM wParam, IN LPARAM lParam)
Definition: wizard.c:450
static INT_PTR CALLBACK CHSourceDlgProc(IN HWND hwndDlg, IN UINT uMsg, IN WPARAM wParam, IN LPARAM lParam)
Definition: wizard.c:561
#define IDD_MAXIMUMPAGE
Definition: resource.h:30
static INT_PTR CALLBACK FinishDlgProc(IN HWND hwndDlg, IN UINT uMsg, IN WPARAM wParam, IN LPARAM lParam)
Definition: wizard.c:1194
#define PROPSHEETPAGE
Definition: prsht.h:371
#define LPARAM
Definition: msvc.h:38

Referenced by DevInstallW(), and InstallDevInstEx().

◆ FindDriverProc()

static DWORD WINAPI FindDriverProc ( IN LPVOID  lpParam)
static

Definition at line 211 of file wizard.c.

213 {
214  PDEVINSTDATA DevInstData;
215  DWORD config_flags;
216  BOOL result = FALSE;
217 
218  DevInstData = (PDEVINSTDATA)lpParam;
219 
220  result = ScanFoldersForDriver(DevInstData);
221 
222  if (result)
223  {
224  PostMessage(DevInstData->hDialog, WM_SEARCH_FINISHED, 1, 0);
225  }
226  else
227  {
228  /* Update device configuration */
230  DevInstData->hDevInfo,
231  &DevInstData->devInfoData,
233  NULL,
234  (BYTE *)&config_flags,
235  sizeof(config_flags),
236  NULL))
237  {
238  config_flags |= CONFIGFLAG_FAILEDINSTALL;
240  DevInstData->hDevInfo,
241  &DevInstData->devInfoData,
243  (BYTE *)&config_flags, sizeof(config_flags));
244  }
245 
246  PostMessage(DevInstData->hDialog, WM_SEARCH_FINISHED, 0, 0);
247  }
248  return 0;
249 }
SP_DEVINFO_DATA devInfoData
#define SetupDiGetDeviceRegistryProperty
Definition: setupapi.h:2597
smooth NULL
Definition: ftsmooth.c:416
#define PostMessage
Definition: winuser.h:5698
unsigned int BOOL
Definition: ntddk_ex.h:94
unsigned long DWORD
Definition: ntddk_ex.h:95
HDEVINFO hDevInfo
unsigned char BYTE
Definition: mem.h:68
#define SPDRP_CONFIGFLAGS
Definition: setupapi.h:512
BOOL WINAPI SetupDiSetDeviceRegistryPropertyW(HDEVINFO DeviceInfoSet, PSP_DEVINFO_DATA DeviceInfoData, DWORD Property, const BYTE *PropertyBuffer, DWORD PropertyBufferSize)
Definition: devinst.c:3457
#define WM_SEARCH_FINISHED
GLuint64EXT * result
Definition: glext.h:11304
BOOL ScanFoldersForDriver(IN PDEVINSTDATA DevInstData)
Definition: newdev.c:412
struct _DEVINSTDATA * PDEVINSTDATA
#define CONFIGFLAG_FAILEDINSTALL
Definition: regstr.h:396

Referenced by SearchDrvDlgProc().

◆ FinishDlgProc()

static INT_PTR CALLBACK FinishDlgProc ( IN HWND  hwndDlg,
IN UINT  uMsg,
IN WPARAM  wParam,
IN LPARAM  lParam 
)
static

Definition at line 1194 of file wizard.c.

1199 {
1200  PDEVINSTDATA DevInstData;
1202 
1203  /* Retrieve pointer to the global setup data */
1204  DevInstData = (PDEVINSTDATA)GetWindowLongPtr(hwndDlg, GWLP_USERDATA);
1205 
1206  switch (uMsg)
1207  {
1208  case WM_INITDIALOG:
1209  {
1210  HWND hwndControl;
1211 
1212  /* Get pointer to the global setup data */
1213  DevInstData = (PDEVINSTDATA)((LPPROPSHEETPAGE)lParam)->lParam;
1214  SetWindowLongPtr(hwndDlg, GWLP_USERDATA, (DWORD_PTR)DevInstData);
1215 
1216  /* Center the wizard window */
1217  CenterWindow(GetParent(hwndDlg));
1218 
1219  hwndControl = GetDlgItem(GetParent(hwndDlg), IDCANCEL);
1220  ShowWindow(hwndControl, SW_HIDE);
1221  EnableWindow(hwndControl, FALSE);
1222 
1224  hwndDlg,
1225  IDC_DEVICE,
1226  WM_SETTEXT,
1227  0,
1228  (LPARAM)DevInstData->drvInfoData.Description);
1229 
1230  /* Set title font */
1232  hwndDlg,
1234  WM_SETFONT,
1235  (WPARAM)DevInstData->hTitleFont,
1236  (LPARAM)TRUE);
1237  break;
1238  }
1239 
1240  case WM_NOTIFY:
1241  {
1242  LPNMHDR lpnm = (LPNMHDR)lParam;
1243 
1244  switch (lpnm->code)
1245  {
1246  case PSN_SETACTIVE:
1247  /* Enable the correct buttons on for the active page */
1249  break;
1250 
1251  case PSN_WIZBACK:
1252  /* Handle a Back button click, if necessary */
1253  break;
1254 
1255  case PSN_WIZFINISH:
1256  /* Handle a Finish button click, if necessary */
1257  break;
1258 
1259  default:
1260  break;
1261  }
1262  break;
1263  }
1264 
1265  default:
1266  break;
1267  }
1268 
1269  return FALSE;
1270 }
#define IDC_DEVICE
Definition: resource.h:8
static VOID CenterWindow(IN HWND hWnd)
Definition: wizard.c:30
#define TRUE
Definition: types.h:120
#define UNREFERENCED_PARAMETER(P)
Definition: ntbasedef.h:323
#define SW_HIDE
Definition: winuser.h:762
#define SendDlgItemMessage
Definition: winuser.h:5708
BOOL WINAPI ShowWindow(_In_ HWND, _In_ int)
#define PSN_SETACTIVE
Definition: prsht.h:115
#define SetWindowLongPtr
Definition: treelist.c:70
WPARAM wParam
Definition: combotst.c:138
struct tagNMHDR * LPNMHDR
UINT_PTR WPARAM
Definition: windef.h:207
UINT code
Definition: winuser.h:3112
#define PSN_WIZFINISH
Definition: prsht.h:122
LONG_PTR LPARAM
Definition: windef.h:208
#define GWLP_USERDATA
Definition: treelist.c:63
SP_DRVINFO_DATA_W drvInfoData
#define LPPROPSHEETPAGE
Definition: prsht.h:372
WCHAR Description[LINE_LEN]
Definition: setupapi.h:1011
#define PropSheet_SetWizButtons(d, f)
Definition: prsht.h:339
#define WM_SETTEXT
Definition: winuser.h:1599
#define IDC_FINISHTITLE
Definition: resource.h:60
#define PSWIZB_FINISH
Definition: prsht.h:155
HWND WINAPI GetDlgItem(_In_opt_ HWND, _In_ int)
uint32_t DWORD_PTR
Definition: typedefs.h:63
BOOL WINAPI EnableWindow(_In_ HWND, _In_ BOOL)
HWND WINAPI GetParent(_In_ HWND)
#define WM_SETFONT
Definition: winuser.h:1632
#define PSN_WIZBACK
Definition: prsht.h:120
#define GetWindowLongPtr
Definition: treelist.c:73
#define IDCANCEL
Definition: winuser.h:825
#define WM_INITDIALOG
Definition: winuser.h:1715
LPARAM lParam
Definition: combotst.c:139
struct _DEVINSTDATA * PDEVINSTDATA
#define WM_NOTIFY
Definition: richedit.h:61

Referenced by DisplayWizard().

◆ IncludePath()

static void IncludePath ( HWND  Dlg,
BOOL  Enabled 
)
static

Definition at line 546 of file wizard.c.

547 {
550 }
#define IDC_BROWSE
Definition: resource.h:21
HWND WINAPI GetDlgItem(_In_opt_ HWND, _In_ int)
BOOL WINAPI EnableWindow(_In_ HWND, _In_ BOOL)
#define IDC_COMBO_PATH
Definition: resource.h:18

Referenced by AutoDriver(), and CHSourceDlgProc().

◆ InstallDriverProc()

static DWORD WINAPI InstallDriverProc ( IN LPVOID  lpParam)
static

Definition at line 252 of file wizard.c.

254 {
255  PDEVINSTDATA DevInstData;
256  BOOL res;
257 
258  DevInstData = (PDEVINSTDATA)lpParam;
259  res = InstallCurrentDriver(DevInstData);
260  PostMessage(DevInstData->hDialog, WM_INSTALL_FINISHED, res ? 0 : 1, 0);
261  return 0;
262 }
#define WM_INSTALL_FINISHED
#define PostMessage
Definition: winuser.h:5698
unsigned int BOOL
Definition: ntddk_ex.h:94
BOOL InstallCurrentDriver(IN PDEVINSTDATA DevInstData)
Definition: newdev.c:521
GLuint res
Definition: glext.h:9613
struct _DEVINSTDATA * PDEVINSTDATA

Referenced by InstallDrvDlgProc().

◆ InstallDrvDlgProc()

static INT_PTR CALLBACK InstallDrvDlgProc ( IN HWND  hwndDlg,
IN UINT  uMsg,
IN WPARAM  wParam,
IN LPARAM  lParam 
)
static

Definition at line 804 of file wizard.c.

809 {
810  PDEVINSTDATA DevInstData;
812 
813  /* Retrieve pointer to the global setup data */
814  DevInstData = (PDEVINSTDATA)GetWindowLongPtr(hwndDlg, GWLP_USERDATA);
815 
816  switch (uMsg)
817  {
818  case WM_INITDIALOG:
819  {
820  HWND hwndControl;
821  DWORD dwStyle;
822 
823  /* Get pointer to the global setup data */
824  DevInstData = (PDEVINSTDATA)((LPPROPSHEETPAGE)lParam)->lParam;
825  SetWindowLongPtr(hwndDlg, GWLP_USERDATA, (DWORD_PTR)DevInstData);
826 
827  DevInstData->hDialog = hwndDlg;
828  hwndControl = GetParent(hwndDlg);
829 
830  /* Center the wizard window */
831  CenterWindow(hwndControl);
832 
834  hwndDlg,
835  IDC_DEVICE,
836  WM_SETTEXT,
837  0,
838  (LPARAM)DevInstData->drvInfoData.Description);
839 
840  /* Hide the system menu */
841  dwStyle = GetWindowLongPtr(hwndControl, GWL_STYLE);
842  SetWindowLongPtr(hwndControl, GWL_STYLE, dwStyle & ~WS_SYSMENU);
843  break;
844  }
845 
846  case WM_INSTALL_FINISHED:
847  {
849  hThread = 0;
850  if (wParam == 0)
851  {
852  SP_DEVINSTALL_PARAMS installParams;
853 
854  SetFailedInstall(DevInstData->hDevInfo,
855  &DevInstData->devInfoData,
856  FALSE);
857 
858  /* Should we reboot? */
859  installParams.cbSize = sizeof(SP_DEVINSTALL_PARAMS);
861  DevInstData->hDevInfo,
862  &DevInstData->devInfoData,
863  &installParams))
864  {
865  if (installParams.Flags & (DI_NEEDRESTART | DI_NEEDREBOOT))
866  {
868  }
869  else
871  break;
872  }
873  }
875  break;
876  }
877 
878  case WM_NOTIFY:
879  {
880  LPNMHDR lpnm = (LPNMHDR)lParam;
881 
882  switch (lpnm->code)
883  {
884  case PSN_SETACTIVE:
886  hThread = CreateThread(NULL, 0, InstallDriverProc, DevInstData, 0, &dwThreadId);
887  break;
888 
889  case PSN_KILLACTIVE:
890  if (hThread != 0)
891  {
893  return TRUE;
894  }
895  break;
896 
897  case PSN_WIZNEXT:
898  /* Handle a Next button click, if necessary */
899  break;
900 
901  default:
902  break;
903  }
904  break;
905  }
906 
907  default:
908  break;
909  }
910 
911  return FALSE;
912 }
#define IDC_DEVICE
Definition: resource.h:8
static VOID CenterWindow(IN HWND hWnd)
Definition: wizard.c:30
SP_DEVINFO_DATA devInfoData
#define TRUE
Definition: types.h:120
#define CloseHandle
Definition: compat.h:398
#define DI_NEEDREBOOT
Definition: setupapi.h:54
#define SetupDiGetDeviceInstallParams
Definition: setupapi.h:2593
#define PSWIZB_NEXT
Definition: prsht.h:154
#define IDD_NEEDREBOOT
Definition: resource.h:27
#define SendDlgItemMessage
Definition: winuser.h:5708
#define PSN_SETACTIVE
Definition: prsht.h:115
#define SetWindowLongPtr
Definition: treelist.c:70
WPARAM wParam
Definition: combotst.c:138
#define DWLP_MSGRESULT
Definition: winuser.h:864
struct tagNMHDR * LPNMHDR
UINT code
Definition: winuser.h:3112
#define WM_INSTALL_FINISHED
static DWORD WINAPI InstallDriverProc(IN LPVOID lpParam)
Definition: wizard.c:252
#define PSN_KILLACTIVE
Definition: prsht.h:116
LONG_PTR LPARAM
Definition: windef.h:208
#define GWLP_USERDATA
Definition: treelist.c:63
SP_DRVINFO_DATA_W drvInfoData
HANDLE WINAPI DECLSPEC_HOTPATCH CreateThread(IN LPSECURITY_ATTRIBUTES lpThreadAttributes, IN DWORD dwStackSize, IN LPTHREAD_START_ROUTINE lpStartAddress, IN LPVOID lpParameter, IN DWORD dwCreationFlags, OUT LPDWORD lpThreadId)
Definition: thread.c:112
#define LPPROPSHEETPAGE
Definition: prsht.h:372
smooth NULL
Definition: ftsmooth.c:416
#define PSN_WIZNEXT
Definition: prsht.h:121
WCHAR Description[LINE_LEN]
Definition: setupapi.h:1011
#define PropSheet_SetWizButtons(d, f)
Definition: prsht.h:339
#define WM_SETTEXT
Definition: winuser.h:1599
#define PSWIZB_BACK
Definition: prsht.h:153
unsigned long DWORD
Definition: ntddk_ex.h:95
SP_DEVINSTALL_PARAMS_A SP_DEVINSTALL_PARAMS
Definition: setupapi.h:1150
HDEVINFO hDevInfo
DWORD dwThreadId
Definition: fdebug.c:31
#define PropSheet_SetCurSelByID(d, i)
Definition: prsht.h:336
#define IDD_FINISHPAGE
Definition: resource.h:34
#define IDD_INSTALLFAILED
Definition: resource.h:26
uint32_t DWORD_PTR
Definition: typedefs.h:63
#define GWL_STYLE
Definition: winuser.h:846
HWND WINAPI GetParent(_In_ HWND)
static BOOL SetFailedInstall(IN HDEVINFO DeviceInfoSet, IN PSP_DEVINFO_DATA DevInfoData OPTIONAL, IN BOOLEAN Set)
Definition: wizard.c:55
HANDLE hThread
Definition: wizard.c:27
#define DI_NEEDRESTART
Definition: setupapi.h:53
#define GetWindowLongPtr
Definition: treelist.c:73
#define WS_SYSMENU
Definition: pedump.c:629
#define WM_INITDIALOG
Definition: winuser.h:1715
LPARAM lParam
Definition: combotst.c:139
struct _DEVINSTDATA * PDEVINSTDATA
#define WM_NOTIFY
Definition: richedit.h:61

Referenced by DisplayWizard().

◆ InstallFailedDlgProc()

static INT_PTR CALLBACK InstallFailedDlgProc ( IN HWND  hwndDlg,
IN UINT  uMsg,
IN WPARAM  wParam,
IN LPARAM  lParam 
)
static

Definition at line 1036 of file wizard.c.

1041 {
1042  PDEVINSTDATA DevInstData;
1044 
1045  /* Retrieve pointer to the global setup data */
1046  DevInstData = (PDEVINSTDATA)GetWindowLongPtr(hwndDlg, GWLP_USERDATA);
1047 
1048  switch (uMsg)
1049  {
1050  case WM_INITDIALOG:
1051  {
1052  HWND hwndControl;
1053 
1054  /* Get pointer to the global setup data */
1055  DevInstData = (PDEVINSTDATA)((LPPROPSHEETPAGE)lParam)->lParam;
1056  SetWindowLongPtr(hwndDlg, GWLP_USERDATA, (DWORD_PTR)DevInstData);
1057 
1058  /* Center the wizard window */
1059  CenterWindow(GetParent(hwndDlg));
1060 
1061  hwndControl = GetDlgItem(GetParent(hwndDlg), IDCANCEL);
1062  ShowWindow(hwndControl, SW_HIDE);
1063  EnableWindow(hwndControl, FALSE);
1064 
1066  hwndDlg,
1067  IDC_DEVICE,
1068  WM_SETTEXT,
1069  0,
1070  (LPARAM)DevInstData->drvInfoData.Description);
1071 
1072  /* Set title font */
1074  hwndDlg,
1076  WM_SETFONT,
1077  (WPARAM)DevInstData->hTitleFont,
1078  (LPARAM)TRUE);
1079  break;
1080  }
1081 
1082  case WM_NOTIFY:
1083  {
1084  LPNMHDR lpnm = (LPNMHDR)lParam;
1085 
1086  switch (lpnm->code)
1087  {
1088  case PSN_SETACTIVE:
1089  /* Enable the correct buttons on for the active page */
1091  break;
1092 
1093  case PSN_WIZBACK:
1094  /* Handle a Back button click, if necessary */
1095  break;
1096 
1097  case PSN_WIZFINISH:
1098  /* Handle a Finish button click, if necessary */
1099  break;
1100 
1101  default:
1102  break;
1103  }
1104  break;
1105  }
1106 
1107  default:
1108  break;
1109  }
1110 
1111  return FALSE;
1112 }
#define IDC_DEVICE
Definition: resource.h:8
static VOID CenterWindow(IN HWND hWnd)
Definition: wizard.c:30
#define TRUE
Definition: types.h:120
#define UNREFERENCED_PARAMETER(P)
Definition: ntbasedef.h:323
#define SW_HIDE
Definition: winuser.h:762
#define SendDlgItemMessage
Definition: winuser.h:5708
BOOL WINAPI ShowWindow(_In_ HWND, _In_ int)
#define PSN_SETACTIVE
Definition: prsht.h:115
#define SetWindowLongPtr
Definition: treelist.c:70
WPARAM wParam
Definition: combotst.c:138
struct tagNMHDR * LPNMHDR
UINT_PTR WPARAM
Definition: windef.h:207
UINT code
Definition: winuser.h:3112
#define PSN_WIZFINISH
Definition: prsht.h:122
LONG_PTR LPARAM
Definition: windef.h:208
#define GWLP_USERDATA
Definition: treelist.c:63
SP_DRVINFO_DATA_W drvInfoData
#define LPPROPSHEETPAGE
Definition: prsht.h:372
WCHAR Description[LINE_LEN]
Definition: setupapi.h:1011
#define PropSheet_SetWizButtons(d, f)
Definition: prsht.h:339
#define WM_SETTEXT
Definition: winuser.h:1599
#define IDC_FINISHTITLE
Definition: resource.h:60
#define PSWIZB_FINISH
Definition: prsht.h:155
HWND WINAPI GetDlgItem(_In_opt_ HWND, _In_ int)
uint32_t DWORD_PTR
Definition: typedefs.h:63
BOOL WINAPI EnableWindow(_In_ HWND, _In_ BOOL)
HWND WINAPI GetParent(_In_ HWND)
#define WM_SETFONT
Definition: winuser.h:1632
#define PSN_WIZBACK
Definition: prsht.h:120
#define GetWindowLongPtr
Definition: treelist.c:73
#define IDCANCEL
Definition: winuser.h:825
#define WM_INITDIALOG
Definition: winuser.h:1715
LPARAM lParam
Definition: combotst.c:139
struct _DEVINSTDATA * PDEVINSTDATA
#define WM_NOTIFY
Definition: richedit.h:61

Referenced by DisplayWizard().

◆ IsDeviceStarted()

static BOOL IsDeviceStarted ( IN DEVINST  DevInst,
IN HMACHINE  hMachine,
OUT BOOL IsEnabled 
)
static

Definition at line 117 of file wizard.c.

121 {
122  CONFIGRET cr;
123  ULONG Status, ProblemNumber;
124  BOOL Ret = FALSE;
125 
127  &Status,
128  &ProblemNumber,
129  DevInst,
130  0,
131  hMachine);
132  if (cr == CR_SUCCESS)
133  {
134  *IsEnabled = ((Status & DN_STARTED) != 0);
135  Ret = TRUE;
136  }
137 
138  return Ret;
139 }
CONFIGRET WINAPI CM_Get_DevNode_Status_Ex(_Out_ PULONG pulStatus, _Out_ PULONG pulProblemNumber, _In_ DEVINST dnDevInst, _In_ ULONG ulFlags, _In_opt_ HMACHINE hMachine)
Definition: cfgmgr.c:3412
#define TRUE
Definition: types.h:120
#define CR_SUCCESS
Definition: cfgmgr32.h:842
unsigned int BOOL
Definition: ntddk_ex.h:94
Status
Definition: gdiplustypes.h:24
RETURN_TYPE CONFIGRET
Definition: cfgmgr32.h:74
#define DN_STARTED
Definition: cfg.h:121
unsigned int ULONG
Definition: retypes.h:1

Referenced by NoDriverDlgProc().

◆ NeedRebootDlgProc()

static INT_PTR CALLBACK NeedRebootDlgProc ( IN HWND  hwndDlg,
IN UINT  uMsg,
IN WPARAM  wParam,
IN LPARAM  lParam 
)
static

Definition at line 1115 of file wizard.c.

1120 {
1121  PDEVINSTDATA DevInstData;
1123 
1124  /* Retrieve pointer to the global setup data */
1125  DevInstData = (PDEVINSTDATA)GetWindowLongPtr(hwndDlg, GWLP_USERDATA);
1126 
1127  switch (uMsg)
1128  {
1129  case WM_INITDIALOG:
1130  {
1131  HWND hwndControl;
1132 
1133  /* Get pointer to the global setup data */
1134  DevInstData = (PDEVINSTDATA)((LPPROPSHEETPAGE)lParam)->lParam;
1135  SetWindowLongPtr(hwndDlg, GWLP_USERDATA, (DWORD_PTR)DevInstData);
1136 
1137  /* Center the wizard window */
1138  CenterWindow(GetParent(hwndDlg));
1139 
1140  hwndControl = GetDlgItem(GetParent(hwndDlg), IDCANCEL);
1141  ShowWindow(hwndControl, SW_HIDE);
1142  EnableWindow(hwndControl, FALSE);
1143 
1145  hwndDlg,
1146  IDC_DEVICE,
1147  WM_SETTEXT,
1148  0,
1149  (LPARAM)DevInstData->drvInfoData.Description);
1150 
1151  /* Set title font */
1153  hwndDlg,
1155  WM_SETFONT,
1156  (WPARAM)DevInstData->hTitleFont,
1157  (LPARAM)TRUE);
1158  break;
1159  }
1160 
1161  case WM_NOTIFY:
1162  {
1163  LPNMHDR lpnm = (LPNMHDR)lParam;
1164 
1165  switch (lpnm->code)
1166  {
1167  case PSN_SETACTIVE:
1168  /* Enable the correct buttons on for the active page */
1170  break;
1171 
1172  case PSN_WIZBACK:
1173  /* Handle a Back button click, if necessary */
1174  break;
1175 
1176  case PSN_WIZFINISH:
1177  /* Handle a Finish button click, if necessary */
1178  break;
1179 
1180  default:
1181  break;
1182  }
1183  break;
1184  }
1185 
1186  default:
1187  break;
1188  }
1189 
1190  return FALSE;
1191 }
#define IDC_DEVICE
Definition: resource.h:8
static VOID CenterWindow(IN HWND hWnd)
Definition: wizard.c:30
#define TRUE
Definition: types.h:120
#define UNREFERENCED_PARAMETER(P)
Definition: ntbasedef.h:323
#define SW_HIDE
Definition: winuser.h:762
#define SendDlgItemMessage
Definition: winuser.h:5708
BOOL WINAPI ShowWindow(_In_ HWND, _In_ int)
#define PSN_SETACTIVE
Definition: prsht.h:115
#define SetWindowLongPtr
Definition: treelist.c:70
WPARAM wParam
Definition: combotst.c:138
struct tagNMHDR * LPNMHDR
UINT_PTR WPARAM
Definition: windef.h:207
UINT code
Definition: winuser.h:3112
#define PSN_WIZFINISH
Definition: prsht.h:122
LONG_PTR LPARAM
Definition: windef.h:208
#define GWLP_USERDATA
Definition: treelist.c:63
SP_DRVINFO_DATA_W drvInfoData
#define LPPROPSHEETPAGE
Definition: prsht.h:372
WCHAR Description[LINE_LEN]
Definition: setupapi.h:1011
#define PropSheet_SetWizButtons(d, f)
Definition: prsht.h:339
#define WM_SETTEXT
Definition: winuser.h:1599
#define IDC_FINISHTITLE
Definition: resource.h:60
#define PSWIZB_FINISH
Definition: prsht.h:155
HWND WINAPI GetDlgItem(_In_opt_ HWND, _In_ int)
uint32_t DWORD_PTR
Definition: typedefs.h:63
BOOL WINAPI EnableWindow(_In_ HWND, _In_ BOOL)
HWND WINAPI GetParent(_In_ HWND)
#define WM_SETFONT
Definition: winuser.h:1632
#define PSN_WIZBACK
Definition: prsht.h:120
#define GetWindowLongPtr
Definition: treelist.c:73
#define IDCANCEL
Definition: winuser.h:825
#define WM_INITDIALOG
Definition: winuser.h:1715
LPARAM lParam
Definition: combotst.c:139
struct _DEVINSTDATA * PDEVINSTDATA
#define WM_NOTIFY
Definition: richedit.h:61

Referenced by DisplayWizard().

◆ NoDriverDlgProc()

static INT_PTR CALLBACK NoDriverDlgProc ( IN HWND  hwndDlg,
IN UINT  uMsg,
IN WPARAM  wParam,
IN LPARAM  lParam 
)
static

Definition at line 915 of file wizard.c.

920 {
921  PDEVINSTDATA DevInstData;
922  HWND hwndControl;
923 
925 
926  /* Get pointer to the global setup data */
927  DevInstData = (PDEVINSTDATA)GetWindowLongPtr(hwndDlg, GWLP_USERDATA);
928 
929  switch (uMsg)
930  {
931  case WM_INITDIALOG:
932  {
933  BOOL DisableableDevice = FALSE;
934 
935  /* Get pointer to the global setup data */
936  DevInstData = (PDEVINSTDATA)((LPPROPSHEETPAGE)lParam)->lParam;
937  SetWindowLongPtr(hwndDlg, GWLP_USERDATA, (DWORD_PTR)DevInstData);
938 
939  /* Center the wizard window */
940  CenterWindow(GetParent(hwndDlg));
941 
942  hwndControl = GetDlgItem(GetParent(hwndDlg), IDCANCEL);
943  ShowWindow(hwndControl, SW_HIDE);
944  EnableWindow(hwndControl, FALSE);
945 
946  /* Set title font */
948  hwndDlg,
950  WM_SETFONT,
951  (WPARAM)DevInstData->hTitleFont,
952  (LPARAM)TRUE);
953 
954  /* disable the "do not show this dialog anymore" checkbox
955  if the device cannot be disabled */
957  DevInstData->devInfoData.DevInst,
958  NULL,
959  &DisableableDevice);
960  EnableWindow(
961  GetDlgItem(hwndDlg, IDC_DONOTSHOWDLG),
962  DisableableDevice);
963  break;
964  }
965 
966  case WM_NOTIFY:
967  {
968  LPNMHDR lpnm = (LPNMHDR)lParam;
969 
970  switch (lpnm->code)
971  {
972  case PSN_SETACTIVE:
973  /* Enable the correct buttons on for the active page */
975  break;
976 
977  case PSN_WIZBACK:
978  /* Handle a Back button click, if necessary */
979  hwndControl = GetDlgItem(GetParent(hwndDlg), IDCANCEL);
980  ShowWindow(hwndControl, SW_SHOW);
981  EnableWindow(hwndControl, TRUE);
983  return TRUE;
984 
985  case PSN_WIZFINISH:
986  {
987  BOOL DisableableDevice = FALSE;
988  BOOL IsStarted = FALSE;
989 
990  if (CanDisableDevice(DevInstData->devInfoData.DevInst,
991  NULL,
992  &DisableableDevice) &&
993  DisableableDevice &&
995  DevInstData->devInfoData.DevInst,
996  NULL,
997  &IsStarted) &&
998  !IsStarted &&
1000  hwndDlg,
1002  BM_GETCHECK,
1003  (WPARAM)0, (LPARAM)0) == BST_CHECKED)
1004  {
1005  /* disable the device */
1006  StartDevice(
1007  DevInstData->hDevInfo,
1008  &DevInstData->devInfoData,
1009  FALSE,
1010  0,
1011  NULL);
1012  }
1013  else
1014  {
1015  SetFailedInstall(DevInstData->hDevInfo,
1016  &DevInstData->devInfoData,
1017  FALSE);
1018  }
1019  break;
1020  }
1021 
1022  default:
1023  break;
1024  }
1025  break;
1026  }
1027 
1028  default:
1029  break;
1030  }
1031 
1032  return FALSE;
1033 }
static VOID CenterWindow(IN HWND hWnd)
Definition: wizard.c:30
SP_DEVINFO_DATA devInfoData
#define TRUE
Definition: types.h:120
#define UNREFERENCED_PARAMETER(P)
Definition: ntbasedef.h:323
#define SW_HIDE
Definition: winuser.h:762
#define SendDlgItemMessage
Definition: winuser.h:5708
BOOL WINAPI ShowWindow(_In_ HWND, _In_ int)
#define PSN_SETACTIVE
Definition: prsht.h:115
#define SetWindowLongPtr
Definition: treelist.c:70
WPARAM wParam
Definition: combotst.c:138
#define IDC_DONOTSHOWDLG
Definition: resource.h:11
struct tagNMHDR * LPNMHDR
UINT_PTR WPARAM
Definition: windef.h:207
static BOOL IsDeviceStarted(IN DEVINST DevInst, IN HMACHINE hMachine, OUT BOOL *IsEnabled)
Definition: wizard.c:117
UINT code
Definition: winuser.h:3112
#define PSN_WIZFINISH
Definition: prsht.h:122
LONG_PTR LPARAM
Definition: windef.h:208
#define IDD_CHSOURCE
Definition: resource.h:22
#define GWLP_USERDATA
Definition: treelist.c:63
#define LPPROPSHEETPAGE
Definition: prsht.h:372
smooth NULL
Definition: ftsmooth.c:416
#define BM_GETCHECK
Definition: winuser.h:1879
#define SW_SHOW
Definition: winuser.h:769
#define PropSheet_SetWizButtons(d, f)
Definition: prsht.h:339
#define IDC_FINISHTITLE
Definition: resource.h:60
#define PSWIZB_FINISH
Definition: prsht.h:155
unsigned int BOOL
Definition: ntddk_ex.h:94
HWND WINAPI GetDlgItem(_In_opt_ HWND, _In_ int)
#define PSWIZB_BACK
Definition: prsht.h:153
static BOOL StartDevice(IN HDEVINFO DeviceInfoSet, IN PSP_DEVINFO_DATA DevInfoData OPTIONAL, IN BOOL bEnable, IN DWORD HardwareProfile OPTIONAL, OUT BOOL *bNeedReboot OPTIONAL)
Definition: wizard.c:142
HDEVINFO hDevInfo
#define PropSheet_SetCurSelByID(d, i)
Definition: prsht.h:336
uint32_t DWORD_PTR
Definition: typedefs.h:63
BOOL WINAPI EnableWindow(_In_ HWND, _In_ BOOL)
HWND WINAPI GetParent(_In_ HWND)
static BOOL SetFailedInstall(IN HDEVINFO DeviceInfoSet, IN PSP_DEVINFO_DATA DevInfoData OPTIONAL, IN BOOLEAN Set)
Definition: wizard.c:55
#define BST_CHECKED
Definition: winuser.h:197
#define WM_SETFONT
Definition: winuser.h:1632
#define PSN_WIZBACK
Definition: prsht.h:120
#define GetWindowLongPtr
Definition: treelist.c:73
static BOOL CanDisableDevice(IN DEVINST DevInst, IN HMACHINE hMachine, OUT BOOL *CanDisable)
Definition: wizard.c:93
#define IDCANCEL
Definition: winuser.h:825
#define WM_INITDIALOG
Definition: winuser.h:1715
LPARAM lParam
Definition: combotst.c:139
struct _DEVINSTDATA * PDEVINSTDATA
#define WM_NOTIFY
Definition: richedit.h:61

Referenced by DisplayWizard().

◆ PopulateCustomPathCombo()

static VOID PopulateCustomPathCombo ( IN HWND  hwndCombo)
static

Definition at line 265 of file wizard.c.

267 {
268  HKEY hKey = NULL;
269  DWORD dwRegType;
270  DWORD dwPathLength = 0;
271  LPWSTR Buffer = NULL;
272  LPCWSTR Path;
273  LONG rc;
274 
275  (void)ComboBox_ResetContent(hwndCombo);
276 
277  /* RegGetValue would have been better... */
278  rc = RegOpenKeyEx(
281  0,
283  &hKey);
284  if (rc != ERROR_SUCCESS)
285  {
286  TRACE("RegOpenKeyEx() failed with error 0x%lx\n", rc);
287  goto cleanup;
288  }
289  rc = RegQueryValueExW(
290  hKey,
291  L"Installation Sources",
292  NULL,
293  &dwRegType,
294  NULL,
295  &dwPathLength);
296  if (rc != ERROR_SUCCESS || dwRegType != REG_MULTI_SZ)
297  {
298  TRACE("RegQueryValueEx() failed with error 0x%lx\n", rc);
299  goto cleanup;
300  }
301 
302  /* Allocate enough space to add 2 NULL chars at the end of the string */
303  Buffer = HeapAlloc(GetProcessHeap(), 0, dwPathLength + 2 * sizeof(WCHAR));
304  if (!Buffer)
305  {
306  TRACE("HeapAlloc() failed\n");
307  goto cleanup;
308  }
309  rc = RegQueryValueExW(
310  hKey,
311  L"Installation Sources",
312  NULL,
313  NULL,
314  (LPBYTE)Buffer,
315  &dwPathLength);
316  if (rc != ERROR_SUCCESS)
317  {
318  TRACE("RegQueryValueEx() failed with error 0x%lx\n", rc);
319  goto cleanup;
320  }
321 
322  Buffer[dwPathLength / sizeof(WCHAR)] = UNICODE_NULL;
323  Buffer[dwPathLength / sizeof(WCHAR) + 1] = UNICODE_NULL;
324 
325  /* Populate combo box */
326  for (Path = Buffer; *Path; Path += wcslen(Path) + 1)
327  {
328  (void)ComboBox_AddString(hwndCombo, Path);
329  if (Path == Buffer)
330  (void)ComboBox_SetCurSel(hwndCombo, 0);
331  }
332 
333 cleanup:
334  if (hKey != NULL)
335  RegCloseKey(hKey);
337 }
struct png_info_def **typedef void(__cdecl typeof(png_destroy_read_struct))(struct png_struct_def **
Definition: typeof.h:47
#define ComboBox_AddString(hwndCtl, lpsz)
Definition: windowsx.h:16
#define ERROR_SUCCESS
Definition: deptool.c:10
__wchar_t WCHAR
Definition: xmlstorage.h:180
const WCHAR * LPCWSTR
Definition: xmlstorage.h:185
#define WCHAR
Definition: msvc.h:43
LONG WINAPI RegCloseKey(HKEY hKey)
Definition: reg.c:423
unsigned char * LPBYTE
Definition: typedefs.h:52
#define UNICODE_NULL
long LONG
Definition: pedump.c:60
#define REG_MULTI_SZ
Definition: nt_native.h:1501
smooth NULL
Definition: ftsmooth.c:416
Definition: bufpool.h:45
#define TRACE(s)
Definition: solgame.cpp:4
#define GetProcessHeap()
Definition: compat.h:395
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
LONG WINAPI RegQueryValueExW(_In_ HKEY hkeyorg, _In_ LPCWSTR name, _In_ LPDWORD reserved, _In_ LPDWORD type, _In_ LPBYTE data, _In_ LPDWORD count)
Definition: reg.c:4134
unsigned long DWORD
Definition: ntddk_ex.h:95
#define REGSTR_KEY_SETUP
Definition: regstr.h:105
static const WCHAR L[]
Definition: oid.c:1087
#define ComboBox_SetCurSel(hwndCtl, index)
Definition: windowsx.h:41
#define RegOpenKeyEx
Definition: winreg.h:520
PRTL_UNICODE_STRING_BUFFER Path
#define ComboBox_ResetContent(hwndCtl)
Definition: windowsx.h:38
#define KEY_QUERY_VALUE
Definition: nt_native.h:1016
char * cleanup(char *str)
Definition: wpickclick.c:99
#define REGSTR_PATH_SETUP
Definition: regstr.h:23
WCHAR * LPWSTR
Definition: xmlstorage.h:184
size_t __cdecl wcslen(_In_z_ const wchar_t *_Str)
#define HeapFree(x, y, z)
Definition: compat.h:394
#define HKEY_LOCAL_MACHINE
Definition: winreg.h:12

Referenced by CHSourceDlgProc().

◆ SaveCustomPath()

static VOID SaveCustomPath ( IN HWND  hwndCombo)
static

Definition at line 340 of file wizard.c.

342 {
343  LPWSTR CustomPath = NULL;
344  DWORD CustomPathLength;
345  LPWSTR Buffer = NULL;
346  LPWSTR pBuffer; /* Pointer into Buffer */
347  int ItemsCount, Length;
348  int i;
349  DWORD TotalLength = 0;
350  BOOL UseCustomPath = TRUE;
351  HKEY hKey = NULL;
352  LONG rc;
353 
354  /* Get custom path */
355  Length = ComboBox_GetTextLength(hwndCombo) + 1;
356  CustomPath = HeapAlloc(GetProcessHeap(), 0, Length * sizeof(WCHAR));
357  if (!CustomPath)
358  {
359  TRACE("HeapAlloc() failed\n");
360  goto cleanup;
361  }
362  CustomPathLength = GetWindowTextW(hwndCombo, CustomPath, Length) + 1;
363 
364  /* Calculate length of the buffer */
365  ItemsCount = ComboBox_GetCount(hwndCombo);
366  if (ItemsCount == CB_ERR)
367  {
368  TRACE("ComboBox_GetCount() failed\n");
369  goto cleanup;
370  }
371  for (i = 0; i < ItemsCount; i++)
372  {
373  Length = ComboBox_GetLBTextLen(hwndCombo, i);
374  if (Length == CB_ERR)
375  {
376  TRACE("ComboBox_GetLBTextLen() failed\n");
377  goto cleanup;
378  }
379  TotalLength += Length + 1;
380  }
381  TotalLength++; /* Final NULL char */
382 
383  /* Allocate buffer */
384  Buffer = HeapAlloc(GetProcessHeap(), 0, (CustomPathLength + TotalLength + 1) * sizeof(WCHAR));
385  if (!Buffer)
386  {
387  TRACE("HeapAlloc() failed\n");
388  goto cleanup;
389  }
390 
391  /* Fill the buffer */
392  pBuffer = &Buffer[CustomPathLength];
393  for (i = 0; i < ItemsCount; i++)
394  {
395  Length = ComboBox_GetLBText(hwndCombo, i, pBuffer);
396  if (Length == CB_ERR)
397  {
398  TRACE("ComboBox_GetLBText() failed\n");
399  goto cleanup;
400  }
401  else if (UseCustomPath && _wcsicmp(CustomPath, pBuffer) == 0)
402  UseCustomPath = FALSE;
403  pBuffer += 1 + Length;
404  }
405  *pBuffer = '\0'; /* Add final NULL char */
406 
407  if (!UseCustomPath)
408  {
409  /* Nothing to save to registry */
410  goto cleanup;
411  }
412 
413  TotalLength += CustomPathLength;
414  wcscpy(Buffer, CustomPath);
415 
416  /* Save the buffer */
417  /* RegSetKeyValue would have been better... */
418  rc = RegOpenKeyEx(
421  0,
423  &hKey);
424  if (rc != ERROR_SUCCESS)
425  {
426  TRACE("RegOpenKeyEx() failed with error 0x%lx\n", rc);
427  goto cleanup;
428  }
429  rc = RegSetValueExW(
430  hKey,
431  L"Installation Sources",
432  0,
433  REG_MULTI_SZ,
434  (const BYTE*)Buffer,
435  TotalLength * sizeof(WCHAR));
436  if (rc != ERROR_SUCCESS)
437  {
438  TRACE("RegSetValueEx() failed with error 0x%lx\n", rc);
439  goto cleanup;
440  }
441 
442 cleanup:
443  if (hKey != NULL)
444  RegCloseKey(hKey);
445  HeapFree(GetProcessHeap(), 0, CustomPath);
447 }
#define TRUE
Definition: types.h:120
#define ERROR_SUCCESS
Definition: deptool.c:10
#define KEY_SET_VALUE
Definition: nt_native.h:1017
#define ComboBox_GetLBText(hwndCtl, index, lpszBuffer)
Definition: windowsx.h:31
__wchar_t WCHAR
Definition: xmlstorage.h:180
_In_ ULONG TotalLength
Definition: usbdlib.h:145
#define ComboBox_GetTextLength(hwndCtl)
Definition: windowsx.h:34
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
LONG WINAPI RegCloseKey(HKEY hKey)
Definition: reg.c:423
long LONG
Definition: pedump.c:60
#define REG_MULTI_SZ
Definition: nt_native.h:1501
smooth NULL
Definition: ftsmooth.c:416
PVOID pBuffer
Definition: bufpool.h:45
#define CB_ERR
Definition: winuser.h:2389
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:4917
#define ComboBox_GetCount(hwndCtl)
Definition: windowsx.h:23
#define TRACE(s)
Definition: solgame.cpp:4
unsigned int BOOL
Definition: ntddk_ex.h:94
#define GetProcessHeap()
Definition: compat.h:395
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
unsigned long DWORD
Definition: ntddk_ex.h:95
_In_ ULONG _In_ ULONG _In_ ULONG Length
Definition: ntddpcm.h:101
#define REGSTR_KEY_SETUP
Definition: regstr.h:105
_CRTIMP wchar_t *__cdecl wcscpy(_Out_writes_z_(_String_length_(_Source)+1) wchar_t *_Dest, _In_z_ const wchar_t *_Source)
static const WCHAR L[]
Definition: oid.c:1087
unsigned char BYTE
Definition: mem.h:68
#define ComboBox_GetLBTextLen(hwndCtl, index)
Definition: windowsx.h:32
#define RegOpenKeyEx
Definition: winreg.h:520
int WINAPI GetWindowTextW(HWND hWnd, LPWSTR lpString, int nMaxCount)
Definition: window.c:1378
char * cleanup(char *str)
Definition: wpickclick.c:99
#define REGSTR_PATH_SETUP
Definition: regstr.h:23
WCHAR * LPWSTR
Definition: xmlstorage.h:184
#define HeapFree(x, y, z)
Definition: compat.h:394
_Check_return_ _CRTIMP int __cdecl _wcsicmp(_In_z_ const wchar_t *_Str1, _In_z_ const wchar_t *_Str2)
#define HKEY_LOCAL_MACHINE
Definition: winreg.h:12

Referenced by CHSourceDlgProc().

◆ SearchDrvDlgProc()

static INT_PTR CALLBACK SearchDrvDlgProc ( IN HWND  hwndDlg,
IN UINT  uMsg,
IN WPARAM  wParam,
IN LPARAM  lParam 
)
static

Definition at line 709 of file wizard.c.

714 {
715  PDEVINSTDATA DevInstData;
717 
718  /* Retrieve pointer to the global setup data */
719  DevInstData = (PDEVINSTDATA)GetWindowLongPtr(hwndDlg, GWLP_USERDATA);
720 
721  switch (uMsg)
722  {
723  case WM_INITDIALOG:
724  {
725  HWND hwndControl;
726  DWORD dwStyle;
727 
728  /* Get pointer to the global setup data */
729  DevInstData = (PDEVINSTDATA)((LPPROPSHEETPAGE)lParam)->lParam;
730  SetWindowLongPtr(hwndDlg, GWLP_USERDATA, (DWORD_PTR)DevInstData);
731 
732  DevInstData->hDialog = hwndDlg;
733  hwndControl = GetParent(hwndDlg);
734 
735  /* Center the wizard window */
736  CenterWindow(hwndControl);
737 
739  hwndDlg,
740  IDC_DEVICE,
741  WM_SETTEXT,
742  0,
743  (LPARAM)DevInstData->buffer);
744 
745  /* Hide the system menu */
746  dwStyle = GetWindowLongPtr(hwndControl, GWL_STYLE);
747  SetWindowLongPtr(hwndControl, GWL_STYLE, dwStyle & ~WS_SYSMENU);
748  break;
749  }
750 
751  case WM_SEARCH_FINISHED:
752  {
754  hThread = 0;
755  if (wParam == 0)
757  else
759  break;
760  }
761 
762  case WM_NOTIFY:
763  {
764  LPNMHDR lpnm = (LPNMHDR)lParam;
765 
766  switch (lpnm->code)
767  {
768  case PSN_SETACTIVE:
770  /* Yes, we can safely ignore the problem (if any) */
772  DevInstData->hDevInfo,
773  &DevInstData->devInfoData,
775  hThread = CreateThread(NULL, 0, FindDriverProc, DevInstData, 0, &dwThreadId);
776  break;
777 
778  case PSN_KILLACTIVE:
779  if (hThread != 0)
780  {
782  return TRUE;
783  }
784  break;
785 
786  case PSN_WIZNEXT:
787  /* Handle a Next button click, if necessary */
788  break;
789 
790  default:
791  break;
792  }
793  break;
794  }
795 
796  default:
797  break;
798  }
799 
800  return FALSE;
801 }
#define IDC_DEVICE
Definition: resource.h:8
static VOID CenterWindow(IN HWND hWnd)
Definition: wizard.c:30
SP_DEVINFO_DATA devInfoData
#define IDD_INSTALLDRV
Definition: resource.h:24
#define TRUE
Definition: types.h:120
#define CloseHandle
Definition: compat.h:398
#define PSWIZB_NEXT
Definition: prsht.h:154
#define IDD_NODRIVER
Definition: resource.h:25
#define SendDlgItemMessage
Definition: winuser.h:5708
#define PSN_SETACTIVE
Definition: prsht.h:115
#define SetWindowLongPtr
Definition: treelist.c:70
WPARAM wParam
Definition: combotst.c:138
#define DWLP_MSGRESULT
Definition: winuser.h:864
struct tagNMHDR * LPNMHDR
UINT code
Definition: winuser.h:3112
#define PSN_KILLACTIVE
Definition: prsht.h:116
LONG_PTR LPARAM
Definition: windef.h:208
#define GWLP_USERDATA
Definition: treelist.c:63
HANDLE WINAPI DECLSPEC_HOTPATCH CreateThread(IN LPSECURITY_ATTRIBUTES lpThreadAttributes, IN DWORD dwStackSize, IN LPTHREAD_START_ROUTINE lpStartAddress, IN LPVOID lpParameter, IN DWORD dwCreationFlags, OUT LPDWORD lpThreadId)
Definition: thread.c:112
#define LPPROPSHEETPAGE
Definition: prsht.h:372
smooth NULL
Definition: ftsmooth.c:416
#define PSN_WIZNEXT
Definition: prsht.h:121
#define SPDIT_COMPATDRIVER
Definition: setupapi.h:501
#define PropSheet_SetWizButtons(d, f)
Definition: prsht.h:339
#define WM_SETTEXT
Definition: winuser.h:1599
#define PSWIZB_BACK
Definition: prsht.h:153
unsigned long DWORD
Definition: ntddk_ex.h:95
HDEVINFO hDevInfo
DWORD dwThreadId
Definition: fdebug.c:31
#define PropSheet_SetCurSelByID(d, i)
Definition: prsht.h:336
uint32_t DWORD_PTR
Definition: typedefs.h:63
#define GWL_STYLE
Definition: winuser.h:846
BOOL WINAPI SetupDiDestroyDriverInfoList(IN HDEVINFO DeviceInfoSet, IN PSP_DEVINFO_DATA DeviceInfoData OPTIONAL, IN DWORD DriverType)
Definition: driver.c:1208
HWND WINAPI GetParent(_In_ HWND)
HANDLE hThread
Definition: wizard.c:27
#define WM_SEARCH_FINISHED
#define GetWindowLongPtr
Definition: treelist.c:73
#define WS_SYSMENU
Definition: pedump.c:629
#define WM_INITDIALOG
Definition: winuser.h:1715
LPARAM lParam
Definition: combotst.c:139
static DWORD WINAPI FindDriverProc(IN LPVOID lpParam)
Definition: wizard.c:211
struct _DEVINSTDATA * PDEVINSTDATA
#define WM_NOTIFY
Definition: richedit.h:61

Referenced by DisplayWizard().

◆ SetFailedInstall()

static BOOL SetFailedInstall ( IN HDEVINFO  DeviceInfoSet,
IN PSP_DEVINFO_DATA DevInfoData  OPTIONAL,
IN BOOLEAN  Set 
)
static

Definition at line 55 of file wizard.c.

59 {
60  DWORD dwType, dwSize, dwFlags = 0;
61 
62  dwSize = sizeof(dwFlags);
64  DevInfoData,
66  &dwType,
67  (PBYTE)&dwFlags,
68  dwSize,
69  &dwSize))
70  {
71  return FALSE;
72  }
73 
74  if (Set)
76  else
78 
80  DevInfoData,
82  (PBYTE)&dwFlags,
83  dwSize))
84  {
85 
86  return FALSE;
87  }
88 
89  return TRUE;
90 }
#define TRUE
Definition: types.h:120
#define SetupDiGetDeviceRegistryProperty
Definition: setupapi.h:2597
static BOOL Set
Definition: pageheap.c:10
unsigned long DWORD
Definition: ntddk_ex.h:95
#define SetupDiSetDeviceRegistryProperty
Definition: setupapi.h:2614
_In_ PCCERT_CONTEXT _In_ DWORD dwFlags
Definition: wincrypt.h:1175
#define SPDRP_CONFIGFLAGS
Definition: setupapi.h:512
BYTE * PBYTE
Definition: pedump.c:66
PSDBQUERYRESULT_VISTA PVOID DWORD * dwSize
Definition: env.c:54
#define CONFIGFLAG_FAILEDINSTALL
Definition: regstr.h:396

Referenced by InstallDrvDlgProc(), NoDriverDlgProc(), and WelcomeDlgProc().

◆ StartDevice()

static BOOL StartDevice ( IN HDEVINFO  DeviceInfoSet,
IN PSP_DEVINFO_DATA DevInfoData  OPTIONAL,
IN BOOL  bEnable,
IN DWORD HardwareProfile  OPTIONAL,
OUT BOOL *bNeedReboot  OPTIONAL 
)
static

Definition at line 142 of file wizard.c.

148 {
151  DWORD LastErr;
152  BOOL Ret = FALSE;
153 
156  pcp.HwProfile = HardwareProfile;
157 
158  if (bEnable)
159  {
160  /* try to enable the device on the global profile */
161  pcp.StateChange = DICS_ENABLE;
162  pcp.Scope = DICS_FLAG_GLOBAL;
163 
164  /* ignore errors */
165  LastErr = GetLastError();
168  DevInfoData,
169  &pcp.ClassInstallHeader,
170  sizeof(SP_PROPCHANGE_PARAMS)))
171  {
175  DevInfoData);
176  }
177  SetLastError(LastErr);
178  }
179 
180  /* try config-specific */
183 
186  DevInfoData,
187  &pcp.ClassInstallHeader,
188  sizeof(SP_PROPCHANGE_PARAMS)) &&
191  DevInfoData))
192  {
193  dp.cbSize = sizeof(SP_DEVINSTALL_PARAMS);
196  DevInfoData,
197  &dp))
198  {
199  if (bNeedReboot != NULL)
200  {
201  *bNeedReboot = ((dp.Flags & (DI_NEEDRESTART | DI_NEEDREBOOT)) != 0);
202  }
203 
204  Ret = TRUE;
205  }
206  }
207  return Ret;
208 }
#define TRUE
Definition: types.h:120
#define DI_NEEDREBOOT
Definition: setupapi.h:54
#define SetupDiGetDeviceInstallParams
Definition: setupapi.h:2593
DWORD WINAPI GetLastError(VOID)
Definition: except.c:1059
BOOL WINAPI SetupDiCallClassInstaller(DI_FUNCTION InstallFunction, HDEVINFO DeviceInfoSet, PSP_DEVINFO_DATA DeviceInfoData)
Definition: devinst.c:4029
#define DIF_PROPERTYCHANGE
Definition: setupapi.h:137
#define DICS_ENABLE
Definition: setupapi.h:112
#define DICS_DISABLE
Definition: setupapi.h:114
smooth NULL
Definition: ftsmooth.c:416
SP_CLASSINSTALL_HEADER ClassInstallHeader
Definition: setupapi.h:911
unsigned int BOOL
Definition: ntddk_ex.h:94
#define DICS_FLAG_CONFIGSPECIFIC
Definition: setupapi.h:115
unsigned long DWORD
Definition: ntddk_ex.h:95
SP_DEVINSTALL_PARAMS_A SP_DEVINSTALL_PARAMS
Definition: setupapi.h:1150
#define SetLastError(x)
Definition: compat.h:409
#define DICS_FLAG_GLOBAL
Definition: setupapi.h:113
_In_ BOOL bEnable
Definition: winddi.h:3426
struct _SP_CLASSINSTALL_HEADER SP_CLASSINSTALL_HEADER
#define DI_NEEDRESTART
Definition: setupapi.h:53
#define SetupDiSetClassInstallParams
Definition: setupapi.h:2611
DI_FUNCTION InstallFunction
Definition: setupapi.h:899

Referenced by NoDriverDlgProc(), and PciPdoIrpStartDevice().

◆ WelcomeDlgProc()

static INT_PTR CALLBACK WelcomeDlgProc ( IN HWND  hwndDlg,
IN UINT  uMsg,
IN WPARAM  wParam,
IN LPARAM  lParam 
)
static

Definition at line 450 of file wizard.c.

455 {
456  PDEVINSTDATA DevInstData;
458 
459  /* Retrieve pointer to the global setup data */
460  DevInstData = (PDEVINSTDATA)GetWindowLongPtr(hwndDlg, GWLP_USERDATA);
461 
462  switch (uMsg)
463  {
464  case WM_INITDIALOG:
465  {
466  HWND hwndControl;
467  DWORD dwStyle;
468 
469  /* Get pointer to the global setup data */
470  DevInstData = (PDEVINSTDATA)((LPPROPSHEETPAGE)lParam)->lParam;
471  SetWindowLongPtr(hwndDlg, GWLP_USERDATA, (DWORD_PTR)DevInstData);
472 
473  hwndControl = GetParent(hwndDlg);
474 
475  /* Center the wizard window */
476  CenterWindow(hwndControl);
477 
478  /* Hide the system menu */
479  dwStyle = GetWindowLongPtr(hwndControl, GWL_STYLE);
480  SetWindowLongPtr(hwndControl, GWL_STYLE, dwStyle & ~WS_SYSMENU);
481 
482  /* Set title font */
484  hwndDlg,
486  WM_SETFONT,
487  (WPARAM)DevInstData->hTitleFont,
488  (LPARAM)TRUE);
489 
491  hwndDlg,
492  IDC_DEVICE,
493  WM_SETTEXT,
494  0,
495  (LPARAM)DevInstData->buffer);
496 
498  hwndDlg,
500  BM_SETCHECK,
501  (WPARAM)TRUE,
502  (LPARAM)0);
503 
504  SetFailedInstall(DevInstData->hDevInfo,
505  &DevInstData->devInfoData,
506  TRUE);
507  break;
508  }
509 
510  case WM_NOTIFY:
511  {
512  LPNMHDR lpnm = (LPNMHDR)lParam;
513 
514  switch (lpnm->code)
515  {
516  case PSN_SETACTIVE:
517  /* Enable the Next button */
519  break;
520 
521  case PSN_WIZNEXT:
522  /* Handle a Next button click, if necessary */
524  {
525  if (PrepareFoldersToScan(DevInstData, TRUE, FALSE, NULL))
527  else
529  }
530  return TRUE;
531 
532  default:
533  break;
534  }
535  break;
536  }
537 
538  default:
539  break;
540  }
541 
542  return FALSE;
543 }
#define IDC_DEVICE
Definition: resource.h:8
static VOID CenterWindow(IN HWND hWnd)
Definition: wizard.c:30
SP_DEVINFO_DATA devInfoData
#define TRUE
Definition: types.h:120
#define IDC_RADIO_AUTO
Definition: resource.h:9
#define UNREFERENCED_PARAMETER(P)
Definition: ntbasedef.h:323
#define PSWIZB_NEXT
Definition: prsht.h:154
#define IDD_SEARCHDRV
Definition: resource.h:23
#define SendDlgItemMessage
Definition: winuser.h:5708
#define PSN_SETACTIVE
Definition: prsht.h:115
#define SetWindowLongPtr
Definition: treelist.c:70
WPARAM wParam
Definition: combotst.c:138
struct tagNMHDR * LPNMHDR
UINT_PTR WPARAM
Definition: windef.h:207
UINT code
Definition: winuser.h:3112
LONG_PTR LPARAM
Definition: windef.h:208
#define GWLP_USERDATA
Definition: treelist.c:63
#define LPPROPSHEETPAGE
Definition: prsht.h:372
smooth NULL
Definition: ftsmooth.c:416
#define PSN_WIZNEXT
Definition: prsht.h:121
#define BM_GETCHECK
Definition: winuser.h:1879
#define PropSheet_SetWizButtons(d, f)
Definition: prsht.h:339
#define WM_SETTEXT
Definition: winuser.h:1599
#define BM_SETCHECK
Definition: winuser.h:1882
unsigned long DWORD
Definition: ntddk_ex.h:95
HDEVINFO hDevInfo
#define PropSheet_SetCurSelByID(d, i)
Definition: prsht.h:336
#define IDD_INSTALLFAILED
Definition: resource.h:26
uint32_t DWORD_PTR
Definition: typedefs.h:63
#define IDC_WELCOMETITLE
Definition: resource.h:16
#define GWL_STYLE
Definition: winuser.h:846
HWND WINAPI GetParent(_In_ HWND)
static BOOL SetFailedInstall(IN HDEVINFO DeviceInfoSet, IN PSP_DEVINFO_DATA DevInfoData OPTIONAL, IN BOOLEAN Set)
Definition: wizard.c:55
#define BST_CHECKED
Definition: winuser.h:197
#define WM_SETFONT
Definition: winuser.h:1632
BOOL PrepareFoldersToScan(IN PDEVINSTDATA DevInstData, IN BOOL IncludeRemovableDevices, IN BOOL IncludeCustomPath, IN HWND hwndCombo OPTIONAL)
Definition: newdev.c:447
#define GetWindowLongPtr
Definition: treelist.c:73
#define WS_SYSMENU
Definition: pedump.c:629
#define WM_INITDIALOG
Definition: winuser.h:1715
LPARAM lParam
Definition: combotst.c:139
struct _DEVINSTDATA * PDEVINSTDATA
#define WM_NOTIFY
Definition: richedit.h:61

Referenced by DisplayWizard().

Variable Documentation

◆ hThread

HANDLE hThread

Definition at line 27 of file wizard.c.

Referenced by _DoDLLInjection(), _ServiceMain(), AcceptConnections(), addr_to_linear(), check_thread_instance(), CommonInstall(), CreateLobbyMessageReceptionThread(), CreateRemoteThread(), CreateServers(), CreateServiceThread(), CSysTray::CreateSysTrayThread(), CreateTestThread(), CsrAddStaticServerThread(), CsrApiPortInitialize(), CsrCreateProcess(), CsrCreateRemoteThread(), CsrCreateThread(), CsrExecServerThread(), CsrpCheckRequestThreads(), CsrSbCreateSession(), DbgUiIssueRemoteBreakin(), EndLocalThread(), ExpCreateWorkerThread(), fetch_thread_info(), GetExitCodeThread(), GetThreadContext(), GetThreadIOPendingFlag(), GetThreadPriority(), GetThreadPriorityBoost(), GetThreadSelectorEntry(), GetThreadTimes(), GuiConsoleInputThread(), HandleLogoff(), HandleShutdown(), i386_get_addr(), IDirectSoundCaptureBufferImpl_Start(), init(), CDesktopThread::Initialize(), COutputPin::InitializeIOThread(), InitiateSoundStreaming(), InitProgressDialog(), InstallDrvDlgProc(), CZipFolder::InvokeCommand(), LocalScheduleJob(), MailSlotReader(), main(), mmTaskCreate(), NtOpenThread(), OpenPropSheet(), PlayLogonSound(), PrintThreads(), PspCreateThread(), QueueUserAPC(), CDeviceView::Refresh(), ResumeThread(), RunSetup(), SaveThreadHandle(), SearchDrvDlgProc(), ServiceInit(), ServiceMain(), SetThreadAffinityMask(), SetThreadContext(), SetThreadIdealProcessor(), SetThreadPriority(), SetThreadPriorityBoost(), SetThreadToken(), SHCreateThread(), StackWalk(), StackWalk64(), START_TEST(), CProgressDialog::StartProgressDialog(), StartSystemShutdown(), StartTestCORE10188(), SuspendThread(), TerminateThread(), test_attach_input(), test_CreateRemoteThread(), test_DragQueryFile(), test_events(), test_http_connection(), test_ImmThreads(), test_interthread_messages(), test_menu_input(), test_pack_CREATE_PROCESS_DEBUG_INFO(), test_pack_CREATE_THREAD_DEBUG_INFO(), test_pack_PROCESS_INFORMATION(), test_QueryInformationJobObject(), test_runner(), test_send(), Test_SimpleParameters(), test_smresult(), test_thread_handle_close(), TestMessages(), WdmAudCommitWaveBufferByMMixer(), WdmAudSetMixerDeviceFormatByLegacy(), WinMain(), WlxAssignShellProtection(), wmain(), WriterThread::WriterThread(), and wWinMain().