ReactOS  0.4.15-dev-3182-g7b62228
wizard.c File Reference
#include "newdev_private.h"
#include <wincon.h>
#include <cfgmgr32.h>
#include <shlobj.h>
#include <shlwapi.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 563 of file wizard.c.

564 {
568 }
#define IDC_CHECK_MEDIA
Definition: resource.h:14
static void IncludePath(HWND Dlg, BOOL Enabled)
Definition: wizard.c:556
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 117 of file wizard.c.

121 {
122  CONFIGRET cr;
123  ULONG Status, ProblemNumber;
124  BOOL Ret = FALSE;
125 
127  &ProblemNumber,
128  DevInst,
129  0,
130  hMachine);
131  if (cr == CR_SUCCESS)
132  {
133  *CanDisable = ((Status & DN_DISABLEABLE) != 0);
134  Ret = TRUE;
135  }
136 
137  return Ret;
138 }
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:3587
#define TRUE
Definition: types.h:120
#define DN_DISABLEABLE
Definition: cfg.h:131
#define FALSE
Definition: types.h:117
unsigned int BOOL
Definition: ntddk_ex.h:94
#define CR_SUCCESS
Definition: cfgmgr32.h:842
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 31 of file wizard.c.

33 {
35  RECT rcParent;
36  RECT rcWindow;
37 
39  if (hWndParent == NULL)
41 
42  GetWindowRect(hWndParent, &rcParent);
43  GetWindowRect(hWnd, &rcWindow);
44 
46  hWnd,
47  HWND_TOP,
48  ((rcParent.right - rcParent.left) - (rcWindow.right - rcWindow.left)) / 2,
49  ((rcParent.bottom - rcParent.top) - (rcWindow.bottom - rcWindow.top)) / 2,
50  0,
51  0,
52  SWP_NOSIZE);
53 }
HWND hWnd
Definition: settings.c:17
LONG top
Definition: windef.h:307
#define HWND_TOP
Definition: winuser.h:1193
LONG left
Definition: windef.h:306
LONG right
Definition: windef.h:308
HWND WINAPI GetDesktopWindow(void)
Definition: window.c:656
#define SWP_NOSIZE
Definition: winuser.h:1231
HWND WINAPI GetParent(_In_ HWND)
#define NULL
Definition: types.h:112
LONG bottom
Definition: windef.h:309
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 571 of file wizard.c.

576 {
577  PDEVINSTDATA DevInstData;
578 
579  /* Retrieve pointer to the global setup data */
580  DevInstData = (PDEVINSTDATA)GetWindowLongPtr(hwndDlg, GWLP_USERDATA);
581 
582  switch (uMsg)
583  {
584  case WM_INITDIALOG:
585  {
586  HWND hwndControl, hwndCombo;
587  DWORD dwStyle;
588  COMBOBOXINFO info = { sizeof(info) };
589 
590  /* Get pointer to the global setup data */
591  DevInstData = (PDEVINSTDATA)((LPPROPSHEETPAGE)lParam)->lParam;
592  SetWindowLongPtr(hwndDlg, GWLP_USERDATA, (DWORD_PTR)DevInstData);
593 
594  hwndControl = GetParent(hwndDlg);
595 
596  /* Center the wizard window */
597  CenterWindow(hwndControl);
598 
599  /* Hide the system menu */
600  dwStyle = GetWindowLongPtr(hwndControl, GWL_STYLE);
601  SetWindowLongPtr(hwndControl, GWL_STYLE, dwStyle & ~WS_SYSMENU);
602 
603  hwndCombo = GetDlgItem(hwndDlg, IDC_COMBO_PATH);
604  PopulateCustomPathCombo(hwndCombo);
605 
606  GetComboBoxInfo(hwndCombo, &info);
608 
610  hwndDlg,
612  BM_SETCHECK,
613  (WPARAM)TRUE,
614  (LPARAM)0);
615  AutoDriver(hwndDlg, TRUE);
616  IncludePath(hwndDlg, FALSE);
617 
618  /* Disable manual driver choice for now */
620 
621  break;
622  }
623 
624  case WM_COMMAND:
625  {
626  switch (LOWORD(wParam))
627  {
629  AutoDriver(hwndDlg, TRUE);
630  return TRUE;
631 
632  case IDC_RADIO_CHOOSE:
633  AutoDriver(hwndDlg, FALSE);
634  return TRUE;
635 
636  case IDC_CHECK_PATH:
637  IncludePath(hwndDlg, IsDlgButtonChecked(hwndDlg, IDC_CHECK_PATH));
638  return TRUE;
639 
640  case IDC_BROWSE:
641  {
642  BROWSEINFO bi = { 0 };
643  LPITEMIDLIST pidl;
644 
645  bi.hwndOwner = hwndDlg;
646  bi.ulFlags = BIF_USENEWUI | BIF_RETURNONLYFSDIRS;
647  pidl = SHBrowseForFolder(&bi);
648  if (pidl)
649  {
651  IMalloc* malloc;
652 
653  if (SHGetPathFromIDListW(pidl, Directory))
654  {
655  /* Set the IDC_COMBO_PATH text */
657  }
658 
659  /* Free memory, if possible */
661  {
662  IMalloc_Free(malloc, pidl);
663  IMalloc_Release(malloc);
664  }
665  return TRUE;
666  }
667  break;
668  }
669  }
670  break;
671  }
672 
673  case WM_NOTIFY:
674  {
675  LPNMHDR lpnm = (LPNMHDR)lParam;
676 
677  switch (lpnm->code)
678  {
679  case PSN_SETACTIVE:
680  /* Enable the Next and Back buttons */
682  break;
683 
684  case PSN_WIZNEXT:
685  /* Handle a Next button click, if necessary */
687  {
689  HeapFree(GetProcessHeap(), 0, DevInstData->CustomSearchPath);
690  DevInstData->CustomSearchPath = NULL;
692  DevInstData,
695  GetDlgItem(hwndDlg, IDC_COMBO_PATH)))
696  {
698  }
699  else
700  {
702  }
703  }
704  else
705  {
706  /* FIXME */;
707  }
708  return TRUE;
709 
710  default:
711  break;
712  }
713  break;
714  }
715 
716  default:
717  break;
718  }
719 
720  return FALSE;
721 }
#define IDC_CHECK_MEDIA
Definition: resource.h:14
static VOID CenterWindow(IN HWND hWnd)
Definition: wizard.c:31
#define TRUE
Definition: types.h:120
#define IDC_BROWSE
Definition: resource.h:21
static VOID PopulateCustomPathCombo(IN HWND hwndCombo)
Definition: wizard.c:275
BOOL WINAPI SHGetPathFromIDListW(LPCITEMIDLIST pidl, LPWSTR pszPath)
Definition: pidl.c:1294
static VOID SaveCustomPath(IN HWND hwndCombo)
Definition: wizard.c:350
#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:556
#define IDD_SEARCHDRV
Definition: resource.h:23
LPWSTR CustomSearchPath
BOOL WINAPI SetWindowTextW(_In_ HWND, _In_opt_ LPCWSTR)
UINT_PTR WPARAM
Definition: windef.h:207
#define SendDlgItemMessage
Definition: winuser.h:5818
#define BROWSEINFO
Definition: shlobj.h:1137
#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 code
Definition: winuser.h:3135
#define FALSE
Definition: types.h:117
if SUCCEEDED(hr)
#define GWLP_USERDATA
Definition: treelist.c:63
#define LPPROPSHEETPAGE
Definition: prsht.h:390
#define PSN_WIZNEXT
Definition: prsht.h:121
LONG_PTR LPARAM
Definition: windef.h:208
#define PropSheet_SetWizButtons(d, f)
Definition: prsht.h:357
UINT WINAPI IsDlgButtonChecked(_In_ HWND, _In_ int)
#define SHBrowseForFolder
Definition: shlobj.h:1180
HRESULT WINAPI SHAutoComplete(HWND hwndEdit, DWORD dwFlags)
Definition: autocomp.cpp:191
#define BM_SETCHECK
Definition: winuser.h:1904
#define GetProcessHeap()
Definition: compat.h:595
HWND WINAPI GetDlgItem(_In_opt_ HWND, _In_ int)
__wchar_t WCHAR
Definition: xmlstorage.h:180
#define PSWIZB_BACK
Definition: prsht.h:153
#define MAX_PATH
Definition: compat.h:34
unsigned long DWORD
Definition: ntddk_ex.h:95
#define BIF_USENEWUI
Definition: shlobj.h:1151
struct _test_info info[]
Definition: SetCursorPos.c:19
#define PropSheet_SetCurSelByID(d, i)
Definition: prsht.h:354
#define IDC_RADIO_SEARCHHERE
Definition: resource.h:12
#define WM_COMMAND
Definition: winuser.h:1723
#define IDD_INSTALLFAILED
Definition: resource.h:26
uint32_t DWORD_PTR
Definition: typedefs.h:65
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:1144
#define NULL
Definition: types.h:112
static void AutoDriver(HWND Dlg, BOOL Enabled)
Definition: wizard.c:563
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:1722
LPARAM lParam
Definition: combotst.c:139
struct _DEVINSTDATA * PDEVINSTDATA
#define LOWORD(l)
Definition: pedump.c:82
#define HeapFree(x, y, z)
Definition: compat.h:594
#define WM_NOTIFY
Definition: richedit.h:61
BOOL WINAPI GetComboBoxInfo(_In_ HWND, _Inout_ PCOMBOBOXINFO)
#define SHACF_FILESYS_DIRS
Definition: shlwapi.h:1918

Referenced by DisplayWizard().

◆ CreateTitleFont()

static HFONT CreateTitleFont ( VOID  )
static

Definition at line 1288 of file wizard.c.

1289 {
1290  NONCLIENTMETRICSW ncm;
1291  LOGFONTW LogFont;
1292  HDC hdc;
1293  INT FontSize;
1294  HFONT hFont;
1295 
1296  ncm.cbSize = sizeof(NONCLIENTMETRICSW);
1297  SystemParametersInfo(SPI_GETNONCLIENTMETRICS, 0, &ncm, 0);
1298 
1299  LogFont = ncm.lfMessageFont;
1300  LogFont.lfWeight = FW_BOLD;
1301  wcscpy(LogFont.lfFaceName, L"MS Shell Dlg");
1302 
1303  hdc = GetDC(NULL);
1304  FontSize = 12;
1305  LogFont.lfHeight = 0 - GetDeviceCaps (hdc, LOGPIXELSY) * FontSize / 72;
1306  hFont = CreateFontIndirectW(&LogFont);
1307  ReleaseDC(NULL, hdc);
1308 
1309  return hFont;
1310 }
HDC WINAPI GetDC(_In_opt_ HWND)
LONG lfHeight
Definition: dimm.idl:59
static HDC
Definition: imagelist.c:92
#define SystemParametersInfo
Definition: winuser.h:5834
int32_t INT
Definition: typedefs.h:58
HFONT hFont
Definition: main.c:53
int WINAPI ReleaseDC(_In_opt_ HWND, _In_ HDC)
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:1250
HDC hdc
Definition: main.c:9
int WINAPI GetDeviceCaps(_In_opt_ HDC, _In_ int)
#define FW_BOLD
Definition: wingdi.h:377
#define NULL
Definition: types.h:112
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 1313 of file wizard.c.

1317 {
1318  PROPSHEETHEADER psh = {0};
1319  HPROPSHEETPAGE ahpsp[IDD_MAXIMUMPAGE + 1];
1320  PROPSHEETPAGE psp = {0};
1321  HRESULT hr = CoInitialize(NULL); /* for SHAutoComplete */
1322 
1323  /* zero based index */
1324  startPage -= IDD_FIRSTPAGE;
1325 
1326  /* Create the Welcome page */
1327  ZeroMemory(&psp, sizeof(PROPSHEETPAGE));
1328  psp.dwSize = sizeof(PROPSHEETPAGE);
1329  psp.dwFlags = PSP_DEFAULT | PSP_HIDEHEADER | PSP_USETITLE;
1330  psp.hInstance = hDllInstance;
1331  psp.lParam = (LPARAM)DevInstData;
1332  psp.pszTitle = MAKEINTRESOURCE(DevInstData->bUpdate ? IDS_UPDATEWIZARDTITLE : IDS_INSTALLWIZARDTITLE);
1333  psp.pfnDlgProc = WelcomeDlgProc;
1334  psp.pszTemplate = MAKEINTRESOURCE(IDD_WELCOMEPAGE);
1336 
1337  /* Create the Select Source page */
1338  psp.dwFlags = PSP_DEFAULT | PSP_USEHEADERTITLE | PSP_USETITLE;
1339  psp.pszHeaderTitle = MAKEINTRESOURCE(IDS_CHSOURCE_TITLE);
1340  psp.pfnDlgProc = CHSourceDlgProc;
1341  psp.pszTemplate = MAKEINTRESOURCE(IDD_CHSOURCE);
1343 
1344  /* Create the Search driver page */
1345  psp.dwFlags = PSP_DEFAULT | PSP_USEHEADERTITLE | PSP_USETITLE;
1346  psp.pszHeaderTitle = MAKEINTRESOURCE(IDS_SEARCHDRV_TITLE);
1347  psp.pfnDlgProc = SearchDrvDlgProc;
1348  psp.pszTemplate = MAKEINTRESOURCE(IDD_SEARCHDRV);
1350 
1351  /* Create the Install driver page */
1352  psp.dwFlags = PSP_DEFAULT | PSP_USEHEADERTITLE | PSP_USETITLE;
1353  psp.pszHeaderTitle = MAKEINTRESOURCE(IDS_INSTALLDRV_TITLE);
1354  psp.pfnDlgProc = InstallDrvDlgProc;
1355  psp.pszTemplate = MAKEINTRESOURCE(IDD_INSTALLDRV);
1357 
1358  /* Create the No driver page */
1359  psp.dwFlags = PSP_DEFAULT | PSP_HIDEHEADER | PSP_USETITLE;
1360  psp.pfnDlgProc = NoDriverDlgProc;
1361  psp.pszTemplate = MAKEINTRESOURCE(IDD_NODRIVER);
1363 
1364  /* Create the Install failed page */
1365  psp.dwFlags = PSP_DEFAULT | PSP_HIDEHEADER | PSP_USETITLE;
1366  psp.pfnDlgProc = InstallFailedDlgProc;
1367  psp.pszTemplate = MAKEINTRESOURCE(IDD_INSTALLFAILED);
1369 
1370  /* Create the Need reboot page */
1371  psp.dwFlags = PSP_DEFAULT | PSP_HIDEHEADER | PSP_USETITLE;
1372  psp.pfnDlgProc = NeedRebootDlgProc;
1373  psp.pszTemplate = MAKEINTRESOURCE(IDD_NEEDREBOOT);
1375 
1376  /* Create the Finish page */
1377  psp.dwFlags = PSP_DEFAULT | PSP_HIDEHEADER | PSP_USETITLE;
1378  psp.pfnDlgProc = FinishDlgProc;
1379  psp.pszTemplate = MAKEINTRESOURCE(IDD_FINISHPAGE);
1381 
1382  /* Create the property sheet */
1383  psh.dwSize = sizeof(PROPSHEETHEADER);
1384  psh.dwFlags = PSH_WIZARD97 | PSH_WATERMARK | PSH_HEADER;
1385  psh.hInstance = hDllInstance;
1386  psh.hwndParent = hwndParent;
1387  psh.nPages = IDD_MAXIMUMPAGE + 1;
1388  psh.nStartPage = startPage;
1389  psh.phpage = ahpsp;
1390  psh.pszbmWatermark = MAKEINTRESOURCE(IDB_WATERMARK);
1391  psh.pszbmHeader = MAKEINTRESOURCE(IDB_HEADER);
1392 
1393  /* Create title font */
1394  DevInstData->hTitleFont = CreateTitleFont();
1395 
1396  /* Display the wizard */
1397  PropertySheet(&psh);
1398 
1399  DeleteObject(DevInstData->hTitleFont);
1400 
1401  if (SUCCEEDED(hr))
1402  CoUninitialize();
1403  return TRUE;
1404 }
#define MAKEINTRESOURCE
Definition: winuser.h:591
#define IDD_INSTALLDRV
Definition: resource.h:24
static INT_PTR CALLBACK InstallDrvDlgProc(IN HWND hwndDlg, IN UINT uMsg, IN WPARAM wParam, IN LPARAM lParam)
Definition: wizard.c:819
HRESULT hr
Definition: shlfolder.c:183
#define TRUE
Definition: types.h:120
#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:1664
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:930
if SUCCEEDED(hr)
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:392
static HWND hwndParent
Definition: cryptui.c:300
LONG_PTR LPARAM
Definition: windef.h:208
static INT_PTR CALLBACK SearchDrvDlgProc(IN HWND hwndDlg, IN UINT uMsg, IN WPARAM wParam, IN LPARAM lParam)
Definition: wizard.c:724
#define IDD_WELCOMEPAGE
Definition: resource.h:21
#define CreatePropertySheetPage
Definition: prsht.h:399
static HINSTANCE hDllInstance
Definition: clb.c:30
#define PSP_DEFAULT
Definition: prsht.h:22
LONG HRESULT
Definition: typedefs.h:79
static INT_PTR CALLBACK InstallFailedDlgProc(IN HWND hwndDlg, IN UINT uMsg, IN WPARAM wParam, IN LPARAM lParam)
Definition: wizard.c:1051
static HFONT CreateTitleFont(VOID)
Definition: wizard.c:1288
static INT_PTR CALLBACK NeedRebootDlgProc(IN HWND hwndDlg, IN UINT uMsg, IN WPARAM wParam, IN LPARAM lParam)
Definition: wizard.c:1130
#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
void WINAPI DECLSPEC_HOTPATCH CoUninitialize(void)
Definition: compobj.c:2067
#define IDB_WATERMARK
Definition: resource.h:4
#define NULL
Definition: types.h:112
HRESULT WINAPI CoInitialize(LPVOID lpReserved)
Definition: compobj.c:1964
#define PropertySheet
Definition: prsht.h:400
static INT_PTR CALLBACK WelcomeDlgProc(IN HWND hwndDlg, IN UINT uMsg, IN WPARAM wParam, IN LPARAM lParam)
Definition: wizard.c:460
static INT_PTR CALLBACK CHSourceDlgProc(IN HWND hwndDlg, IN UINT uMsg, IN WPARAM wParam, IN LPARAM lParam)
Definition: wizard.c:571
#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:1209
#define PROPSHEETPAGE
Definition: prsht.h:389

Referenced by DevInstallW(), and InstallDevInstEx().

◆ FindDriverProc()

static DWORD WINAPI FindDriverProc ( IN LPVOID  lpParam)
static

Definition at line 235 of file wizard.c.

237 {
238  PDEVINSTDATA DevInstData;
239  BOOL result = FALSE;
240 
241  DevInstData = (PDEVINSTDATA)lpParam;
242 
243  result = ScanFoldersForDriver(DevInstData);
244 
245  if (result)
246  {
247  PostMessage(DevInstData->hDialog, WM_SEARCH_FINISHED, 1, 0);
248  }
249  else
250  {
251  /* Update device configuration */
252  SetFailedInstall(DevInstData->hDevInfo,
253  &DevInstData->devInfoData,
254  TRUE);
255 
256  PostMessage(DevInstData->hDialog, WM_SEARCH_FINISHED, 0, 0);
257  }
258  return 0;
259 }
SP_DEVINFO_DATA devInfoData
GLuint64EXT * result
Definition: glext.h:11304
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
unsigned int BOOL
Definition: ntddk_ex.h:94
#define PostMessage
Definition: winuser.h:5808
HDEVINFO hDevInfo
static BOOL SetFailedInstall(IN HDEVINFO DeviceInfoSet, IN PSP_DEVINFO_DATA DevInfoData OPTIONAL, IN BOOLEAN Set)
Definition: wizard.c:56
#define WM_SEARCH_FINISHED
BOOL ScanFoldersForDriver(IN PDEVINSTDATA DevInstData)
Definition: newdev.c:412
struct _DEVINSTDATA * PDEVINSTDATA

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 1209 of file wizard.c.

1214 {
1215  PDEVINSTDATA DevInstData;
1217 
1218  /* Retrieve pointer to the global setup data */
1219  DevInstData = (PDEVINSTDATA)GetWindowLongPtr(hwndDlg, GWLP_USERDATA);
1220 
1221  switch (uMsg)
1222  {
1223  case WM_INITDIALOG:
1224  {
1225  HWND hwndControl;
1226 
1227  /* Get pointer to the global setup data */
1228  DevInstData = (PDEVINSTDATA)((LPPROPSHEETPAGE)lParam)->lParam;
1229  SetWindowLongPtr(hwndDlg, GWLP_USERDATA, (DWORD_PTR)DevInstData);
1230 
1231  /* Center the wizard window */
1232  CenterWindow(GetParent(hwndDlg));
1233 
1234  hwndControl = GetDlgItem(GetParent(hwndDlg), IDCANCEL);
1235  ShowWindow(hwndControl, SW_HIDE);
1236  EnableWindow(hwndControl, FALSE);
1237 
1239  hwndDlg,
1240  IDC_DEVICE,
1241  WM_SETTEXT,
1242  0,
1243  (LPARAM)DevInstData->drvInfoData.Description);
1244 
1245  /* Set title font */
1247  hwndDlg,
1249  WM_SETFONT,
1250  (WPARAM)DevInstData->hTitleFont,
1251  (LPARAM)TRUE);
1252  break;
1253  }
1254 
1255  case WM_NOTIFY:
1256  {
1257  LPNMHDR lpnm = (LPNMHDR)lParam;
1258 
1259  switch (lpnm->code)
1260  {
1261  case PSN_SETACTIVE:
1262  /* Enable the correct buttons on for the active page */
1264  break;
1265 
1266  case PSN_WIZBACK:
1267  /* Handle a Back button click, if necessary */
1268  break;
1269 
1270  case PSN_WIZFINISH:
1271  /* Handle a Finish button click, if necessary */
1272  break;
1273 
1274  default:
1275  break;
1276  }
1277  break;
1278  }
1279 
1280  default:
1281  break;
1282  }
1283 
1284  return FALSE;
1285 }
#define IDC_DEVICE
Definition: resource.h:8
static VOID CenterWindow(IN HWND hWnd)
Definition: wizard.c:31
#define TRUE
Definition: types.h:120
#define UNREFERENCED_PARAMETER(P)
Definition: ntbasedef.h:317
#define SW_HIDE
Definition: winuser.h:762
UINT_PTR WPARAM
Definition: windef.h:207
#define SendDlgItemMessage
Definition: winuser.h:5818
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 code
Definition: winuser.h:3135
#define FALSE
Definition: types.h:117
#define PSN_WIZFINISH
Definition: prsht.h:122
#define GWLP_USERDATA
Definition: treelist.c:63
SP_DRVINFO_DATA_W drvInfoData
#define LPPROPSHEETPAGE
Definition: prsht.h:390
LONG_PTR LPARAM
Definition: windef.h:208
WCHAR Description[LINE_LEN]
Definition: setupapi.h:1016
#define PropSheet_SetWizButtons(d, f)
Definition: prsht.h:357
#define WM_SETTEXT
Definition: winuser.h:1600
#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:65
BOOL WINAPI EnableWindow(_In_ HWND, _In_ BOOL)
HWND WINAPI GetParent(_In_ HWND)
#define WM_SETFONT
Definition: winuser.h:1633
#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:1722
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 556 of file wizard.c.

557 {
560 }
#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 262 of file wizard.c.

264 {
265  PDEVINSTDATA DevInstData;
266  BOOL res;
267 
268  DevInstData = (PDEVINSTDATA)lpParam;
269  res = InstallCurrentDriver(DevInstData);
270  PostMessage(DevInstData->hDialog, WM_INSTALL_FINISHED, res ? 0 : 1, 0);
271  return 0;
272 }
#define WM_INSTALL_FINISHED
unsigned int BOOL
Definition: ntddk_ex.h:94
#define PostMessage
Definition: winuser.h:5808
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 819 of file wizard.c.

824 {
825  PDEVINSTDATA DevInstData;
827 
828  /* Retrieve pointer to the global setup data */
829  DevInstData = (PDEVINSTDATA)GetWindowLongPtr(hwndDlg, GWLP_USERDATA);
830 
831  switch (uMsg)
832  {
833  case WM_INITDIALOG:
834  {
835  HWND hwndControl;
836  DWORD dwStyle;
837 
838  /* Get pointer to the global setup data */
839  DevInstData = (PDEVINSTDATA)((LPPROPSHEETPAGE)lParam)->lParam;
840  SetWindowLongPtr(hwndDlg, GWLP_USERDATA, (DWORD_PTR)DevInstData);
841 
842  DevInstData->hDialog = hwndDlg;
843  hwndControl = GetParent(hwndDlg);
844 
845  /* Center the wizard window */
846  CenterWindow(hwndControl);
847 
849  hwndDlg,
850  IDC_DEVICE,
851  WM_SETTEXT,
852  0,
853  (LPARAM)DevInstData->drvInfoData.Description);
854 
855  /* Hide the system menu */
856  dwStyle = GetWindowLongPtr(hwndControl, GWL_STYLE);
857  SetWindowLongPtr(hwndControl, GWL_STYLE, dwStyle & ~WS_SYSMENU);
858  break;
859  }
860 
861  case WM_INSTALL_FINISHED:
862  {
864  hThread = 0;
865  if (wParam == 0)
866  {
867  SP_DEVINSTALL_PARAMS installParams;
868 
869  SetFailedInstall(DevInstData->hDevInfo,
870  &DevInstData->devInfoData,
871  FALSE);
872 
873  /* Should we reboot? */
874  installParams.cbSize = sizeof(SP_DEVINSTALL_PARAMS);
876  DevInstData->hDevInfo,
877  &DevInstData->devInfoData,
878  &installParams))
879  {
880  if (installParams.Flags & (DI_NEEDRESTART | DI_NEEDREBOOT))
881  {
883  }
884  else
886  break;
887  }
888  }
890  break;
891  }
892 
893  case WM_NOTIFY:
894  {
895  LPNMHDR lpnm = (LPNMHDR)lParam;
896 
897  switch (lpnm->code)
898  {
899  case PSN_SETACTIVE:
901  hThread = CreateThread(NULL, 0, InstallDriverProc, DevInstData, 0, &dwThreadId);
902  break;
903 
904  case PSN_KILLACTIVE:
905  if (hThread != 0)
906  {
908  return TRUE;
909  }
910  break;
911 
912  case PSN_WIZNEXT:
913  /* Handle a Next button click, if necessary */
914  break;
915 
916  default:
917  break;
918  }
919  break;
920  }
921 
922  default:
923  break;
924  }
925 
926  return FALSE;
927 }
#define IDC_DEVICE
Definition: resource.h:8
static VOID CenterWindow(IN HWND hWnd)
Definition: wizard.c:31
SP_DEVINFO_DATA devInfoData
#define CloseHandle
Definition: compat.h:598
#define DI_NEEDREBOOT
Definition: setupapi.h:54
#define TRUE
Definition: types.h:120
#define SetupDiGetDeviceInstallParams
Definition: setupapi.h:2599
#define PSWIZB_NEXT
Definition: prsht.h:154
#define IDD_NEEDREBOOT
Definition: resource.h:27
#define SendDlgItemMessage
Definition: winuser.h:5818
#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:3135
#define WM_INSTALL_FINISHED
static DWORD WINAPI InstallDriverProc(IN LPVOID lpParam)
Definition: wizard.c:262
#define PSN_KILLACTIVE
Definition: prsht.h:116
#define FALSE
Definition: types.h:117
#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:136
#define LPPROPSHEETPAGE
Definition: prsht.h:390
#define PSN_WIZNEXT
Definition: prsht.h:121
LONG_PTR LPARAM
Definition: windef.h:208
WCHAR Description[LINE_LEN]
Definition: setupapi.h:1016
#define PropSheet_SetWizButtons(d, f)
Definition: prsht.h:357
#define WM_SETTEXT
Definition: winuser.h:1600
#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:1155
HDEVINFO hDevInfo
DWORD dwThreadId
Definition: fdebug.c:31
#define PropSheet_SetCurSelByID(d, i)
Definition: prsht.h:354
#define IDD_FINISHPAGE
Definition: resource.h:34
#define IDD_INSTALLFAILED
Definition: resource.h:26
uint32_t DWORD_PTR
Definition: typedefs.h:65
#define GWL_STYLE
Definition: winuser.h:846
HWND WINAPI GetParent(_In_ HWND)
#define NULL
Definition: types.h:112
static BOOL SetFailedInstall(IN HDEVINFO DeviceInfoSet, IN PSP_DEVINFO_DATA DevInfoData OPTIONAL, IN BOOLEAN Set)
Definition: wizard.c:56
HANDLE hThread
Definition: wizard.c:28
#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:1722
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 1051 of file wizard.c.

1056 {
1057  PDEVINSTDATA DevInstData;
1059 
1060  /* Retrieve pointer to the global setup data */
1061  DevInstData = (PDEVINSTDATA)GetWindowLongPtr(hwndDlg, GWLP_USERDATA);
1062 
1063  switch (uMsg)
1064  {
1065  case WM_INITDIALOG:
1066  {
1067  HWND hwndControl;
1068 
1069  /* Get pointer to the global setup data */
1070  DevInstData = (PDEVINSTDATA)((LPPROPSHEETPAGE)lParam)->lParam;
1071  SetWindowLongPtr(hwndDlg, GWLP_USERDATA, (DWORD_PTR)DevInstData);
1072 
1073  /* Center the wizard window */
1074  CenterWindow(GetParent(hwndDlg));
1075 
1076  hwndControl = GetDlgItem(GetParent(hwndDlg), IDCANCEL);
1077  ShowWindow(hwndControl, SW_HIDE);
1078  EnableWindow(hwndControl, FALSE);
1079 
1081  hwndDlg,
1082  IDC_DEVICE,
1083  WM_SETTEXT,
1084  0,
1085  (LPARAM)DevInstData->drvInfoData.Description);
1086 
1087  /* Set title font */
1089  hwndDlg,
1091  WM_SETFONT,
1092  (WPARAM)DevInstData->hTitleFont,
1093  (LPARAM)TRUE);
1094  break;
1095  }
1096 
1097  case WM_NOTIFY:
1098  {
1099  LPNMHDR lpnm = (LPNMHDR)lParam;
1100 
1101  switch (lpnm->code)
1102  {
1103  case PSN_SETACTIVE:
1104  /* Enable the correct buttons on for the active page */
1106  break;
1107 
1108  case PSN_WIZBACK:
1109  /* Handle a Back button click, if necessary */
1110  break;
1111 
1112  case PSN_WIZFINISH:
1113  /* Handle a Finish button click, if necessary */
1114  break;
1115 
1116  default:
1117  break;
1118  }
1119  break;
1120  }
1121 
1122  default:
1123  break;
1124  }
1125 
1126  return FALSE;
1127 }
#define IDC_DEVICE
Definition: resource.h:8
static VOID CenterWindow(IN HWND hWnd)
Definition: wizard.c:31
#define TRUE
Definition: types.h:120
#define UNREFERENCED_PARAMETER(P)
Definition: ntbasedef.h:317
#define SW_HIDE
Definition: winuser.h:762
UINT_PTR WPARAM
Definition: windef.h:207
#define SendDlgItemMessage
Definition: winuser.h:5818
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 code
Definition: winuser.h:3135
#define FALSE
Definition: types.h:117
#define PSN_WIZFINISH
Definition: prsht.h:122
#define GWLP_USERDATA
Definition: treelist.c:63
SP_DRVINFO_DATA_W drvInfoData
#define LPPROPSHEETPAGE
Definition: prsht.h:390
LONG_PTR LPARAM
Definition: windef.h:208
WCHAR Description[LINE_LEN]
Definition: setupapi.h:1016
#define PropSheet_SetWizButtons(d, f)
Definition: prsht.h:357
#define WM_SETTEXT
Definition: winuser.h:1600
#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:65
BOOL WINAPI EnableWindow(_In_ HWND, _In_ BOOL)
HWND WINAPI GetParent(_In_ HWND)
#define WM_SETFONT
Definition: winuser.h:1633
#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:1722
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 141 of file wizard.c.

145 {
146  CONFIGRET cr;
147  ULONG Status, ProblemNumber;
148  BOOL Ret = FALSE;
149 
151  &Status,
152  &ProblemNumber,
153  DevInst,
154  0,
155  hMachine);
156  if (cr == CR_SUCCESS)
157  {
158  *IsEnabled = ((Status & DN_STARTED) != 0);
159  Ret = TRUE;
160  }
161 
162  return Ret;
163 }
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:3587
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
unsigned int BOOL
Definition: ntddk_ex.h:94
#define CR_SUCCESS
Definition: cfgmgr32.h:842
Status
Definition: gdiplustypes.h:24
return pProvider IsEnabled(ProviderControl)
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 1130 of file wizard.c.

1135 {
1136  PDEVINSTDATA DevInstData;
1138 
1139  /* Retrieve pointer to the global setup data */
1140  DevInstData = (PDEVINSTDATA)GetWindowLongPtr(hwndDlg, GWLP_USERDATA);
1141 
1142  switch (uMsg)
1143  {
1144  case WM_INITDIALOG:
1145  {
1146  HWND hwndControl;
1147 
1148  /* Get pointer to the global setup data */
1149  DevInstData = (PDEVINSTDATA)((LPPROPSHEETPAGE)lParam)->lParam;
1150  SetWindowLongPtr(hwndDlg, GWLP_USERDATA, (DWORD_PTR)DevInstData);
1151 
1152  /* Center the wizard window */
1153  CenterWindow(GetParent(hwndDlg));
1154 
1155  hwndControl = GetDlgItem(GetParent(hwndDlg), IDCANCEL);
1156  ShowWindow(hwndControl, SW_HIDE);
1157  EnableWindow(hwndControl, FALSE);
1158 
1160  hwndDlg,
1161  IDC_DEVICE,
1162  WM_SETTEXT,
1163  0,
1164  (LPARAM)DevInstData->drvInfoData.Description);
1165 
1166  /* Set title font */
1168  hwndDlg,
1170  WM_SETFONT,
1171  (WPARAM)DevInstData->hTitleFont,
1172  (LPARAM)TRUE);
1173  break;
1174  }
1175 
1176  case WM_NOTIFY:
1177  {
1178  LPNMHDR lpnm = (LPNMHDR)lParam;
1179 
1180  switch (lpnm->code)
1181  {
1182  case PSN_SETACTIVE:
1183  /* Enable the correct buttons on for the active page */
1185  break;
1186 
1187  case PSN_WIZBACK:
1188  /* Handle a Back button click, if necessary */
1189  break;
1190 
1191  case PSN_WIZFINISH:
1192  /* Handle a Finish button click, if necessary */
1193  break;
1194 
1195  default:
1196  break;
1197  }
1198  break;
1199  }
1200 
1201  default:
1202  break;
1203  }
1204 
1205  return FALSE;
1206 }
#define IDC_DEVICE
Definition: resource.h:8
static VOID CenterWindow(IN HWND hWnd)
Definition: wizard.c:31
#define TRUE
Definition: types.h:120
#define UNREFERENCED_PARAMETER(P)
Definition: ntbasedef.h:317
#define SW_HIDE
Definition: winuser.h:762
UINT_PTR WPARAM
Definition: windef.h:207
#define SendDlgItemMessage
Definition: winuser.h:5818
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 code
Definition: winuser.h:3135
#define FALSE
Definition: types.h:117
#define PSN_WIZFINISH
Definition: prsht.h:122
#define GWLP_USERDATA
Definition: treelist.c:63
SP_DRVINFO_DATA_W drvInfoData
#define LPPROPSHEETPAGE
Definition: prsht.h:390
LONG_PTR LPARAM
Definition: windef.h:208
WCHAR Description[LINE_LEN]
Definition: setupapi.h:1016
#define PropSheet_SetWizButtons(d, f)
Definition: prsht.h:357
#define WM_SETTEXT
Definition: winuser.h:1600
#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:65
BOOL WINAPI EnableWindow(_In_ HWND, _In_ BOOL)
HWND WINAPI GetParent(_In_ HWND)
#define WM_SETFONT
Definition: winuser.h:1633
#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:1722
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 930 of file wizard.c.

935 {
936  PDEVINSTDATA DevInstData;
937  HWND hwndControl;
938 
940 
941  /* Get pointer to the global setup data */
942  DevInstData = (PDEVINSTDATA)GetWindowLongPtr(hwndDlg, GWLP_USERDATA);
943 
944  switch (uMsg)
945  {
946  case WM_INITDIALOG:
947  {
948  BOOL DisableableDevice = FALSE;
949 
950  /* Get pointer to the global setup data */
951  DevInstData = (PDEVINSTDATA)((LPPROPSHEETPAGE)lParam)->lParam;
952  SetWindowLongPtr(hwndDlg, GWLP_USERDATA, (DWORD_PTR)DevInstData);
953 
954  /* Center the wizard window */
955  CenterWindow(GetParent(hwndDlg));
956 
957  hwndControl = GetDlgItem(GetParent(hwndDlg), IDCANCEL);
958  ShowWindow(hwndControl, SW_HIDE);
959  EnableWindow(hwndControl, FALSE);
960 
961  /* Set title font */
963  hwndDlg,
965  WM_SETFONT,
966  (WPARAM)DevInstData->hTitleFont,
967  (LPARAM)TRUE);
968 
969  /* disable the "do not show this dialog anymore" checkbox
970  if the device cannot be disabled */
972  DevInstData->devInfoData.DevInst,
973  NULL,
974  &DisableableDevice);
975  EnableWindow(
976  GetDlgItem(hwndDlg, IDC_DONOTSHOWDLG),
977  DisableableDevice);
978  break;
979  }
980 
981  case WM_NOTIFY:
982  {
983  LPNMHDR lpnm = (LPNMHDR)lParam;
984 
985  switch (lpnm->code)
986  {
987  case PSN_SETACTIVE:
988  /* Enable the correct buttons on for the active page */
990  break;
991 
992  case PSN_WIZBACK:
993  /* Handle a Back button click, if necessary */
994  hwndControl = GetDlgItem(GetParent(hwndDlg), IDCANCEL);
995  ShowWindow(hwndControl, SW_SHOW);
996  EnableWindow(hwndControl, TRUE);
998  return TRUE;
999 
1000  case PSN_WIZFINISH:
1001  {
1002  BOOL DisableableDevice = FALSE;
1003  BOOL IsStarted = FALSE;
1004 
1005  if (CanDisableDevice(DevInstData->devInfoData.DevInst,
1006  NULL,
1007  &DisableableDevice) &&
1008  DisableableDevice &&
1010  DevInstData->devInfoData.DevInst,
1011  NULL,
1012  &IsStarted) &&
1013  !IsStarted &&
1015  hwndDlg,
1017  BM_GETCHECK,
1018  (WPARAM)0, (LPARAM)0) == BST_CHECKED)
1019  {
1020  /* disable the device */
1021  StartDevice(
1022  DevInstData->hDevInfo,
1023  &DevInstData->devInfoData,
1024  FALSE,
1025  0,
1026  NULL);
1027  }
1028  else
1029  {
1030  SetFailedInstall(DevInstData->hDevInfo,
1031  &DevInstData->devInfoData,
1032  FALSE);
1033  }
1034  break;
1035  }
1036 
1037  default:
1038  break;
1039  }
1040  break;
1041  }
1042 
1043  default:
1044  break;
1045  }
1046 
1047  return FALSE;
1048 }
static VOID CenterWindow(IN HWND hWnd)
Definition: wizard.c:31
SP_DEVINFO_DATA devInfoData
#define TRUE
Definition: types.h:120
#define UNREFERENCED_PARAMETER(P)
Definition: ntbasedef.h:317
#define SW_HIDE
Definition: winuser.h:762
UINT_PTR WPARAM
Definition: windef.h:207
#define SendDlgItemMessage
Definition: winuser.h:5818
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
static BOOL IsDeviceStarted(IN DEVINST DevInst, IN HMACHINE hMachine, OUT BOOL *IsEnabled)
Definition: wizard.c:141
UINT code
Definition: winuser.h:3135
#define FALSE
Definition: types.h:117
#define PSN_WIZFINISH
Definition: prsht.h:122
unsigned int BOOL
Definition: ntddk_ex.h:94
#define IDD_CHSOURCE
Definition: resource.h:22
#define GWLP_USERDATA
Definition: treelist.c:63
#define LPPROPSHEETPAGE
Definition: prsht.h:390
LONG_PTR LPARAM
Definition: windef.h:208
#define BM_GETCHECK
Definition: winuser.h:1901
#define SW_SHOW
Definition: winuser.h:769
#define PropSheet_SetWizButtons(d, f)
Definition: prsht.h:357
#define IDC_FINISHTITLE
Definition: resource.h:60
#define PSWIZB_FINISH
Definition: prsht.h:155
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:166
HDEVINFO hDevInfo
#define PropSheet_SetCurSelByID(d, i)
Definition: prsht.h:354
uint32_t DWORD_PTR
Definition: typedefs.h:65
BOOL WINAPI EnableWindow(_In_ HWND, _In_ BOOL)
HWND WINAPI GetParent(_In_ HWND)
#define NULL
Definition: types.h:112
static BOOL SetFailedInstall(IN HDEVINFO DeviceInfoSet, IN PSP_DEVINFO_DATA DevInfoData OPTIONAL, IN BOOLEAN Set)
Definition: wizard.c:56
#define BST_CHECKED
Definition: winuser.h:197
#define WM_SETFONT
Definition: winuser.h:1633
#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:117
#define IDCANCEL
Definition: winuser.h:825
#define WM_INITDIALOG
Definition: winuser.h:1722
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 275 of file wizard.c.

277 {
278  HKEY hKey = NULL;
279  DWORD dwRegType;
280  DWORD dwPathLength = 0;
281  LPWSTR Buffer = NULL;
282  LPCWSTR Path;
283  LONG rc;
284 
285  (void)ComboBox_ResetContent(hwndCombo);
286 
287  /* RegGetValue would have been better... */
288  rc = RegOpenKeyEx(
291  0,
293  &hKey);
294  if (rc != ERROR_SUCCESS)
295  {
296  TRACE("RegOpenKeyEx() failed with error 0x%lx\n", rc);
297  goto cleanup;
298  }
299  rc = RegQueryValueExW(
300  hKey,
301  L"Installation Sources",
302  NULL,
303  &dwRegType,
304  NULL,
305  &dwPathLength);
306  if (rc != ERROR_SUCCESS || dwRegType != REG_MULTI_SZ)
307  {
308  TRACE("RegQueryValueEx() failed with error 0x%lx\n", rc);
309  goto cleanup;
310  }
311 
312  /* Allocate enough space to add 2 NULL chars at the end of the string */
313  Buffer = HeapAlloc(GetProcessHeap(), 0, dwPathLength + 2 * sizeof(WCHAR));
314  if (!Buffer)
315  {
316  TRACE("HeapAlloc() failed\n");
317  goto cleanup;
318  }
319  rc = RegQueryValueExW(
320  hKey,
321  L"Installation Sources",
322  NULL,
323  NULL,
324  (LPBYTE)Buffer,
325  &dwPathLength);
326  if (rc != ERROR_SUCCESS)
327  {
328  TRACE("RegQueryValueEx() failed with error 0x%lx\n", rc);
329  goto cleanup;
330  }
331 
332  Buffer[dwPathLength / sizeof(WCHAR)] = UNICODE_NULL;
333  Buffer[dwPathLength / sizeof(WCHAR) + 1] = UNICODE_NULL;
334 
335  /* Populate combo box */
336  for (Path = Buffer; *Path; Path += wcslen(Path) + 1)
337  {
338  (void)ComboBox_AddString(hwndCombo, Path);
339  if (Path == Buffer)
340  (void)ComboBox_SetCurSel(hwndCombo, 0);
341  }
342 
343 cleanup:
344  if (hKey != NULL)
345  RegCloseKey(hKey);
347 }
struct png_info_def **typedef void(__cdecl typeof(png_destroy_read_struct))(struct png_struct_def **
Definition: typeof.h:49
#define ComboBox_AddString(hwndCtl, lpsz)
Definition: windowsx.h:16
#define ERROR_SUCCESS
Definition: deptool.c:10
const WCHAR * LPCWSTR
Definition: xmlstorage.h:185
LONG WINAPI RegCloseKey(HKEY hKey)
Definition: reg.c:423
unsigned char * LPBYTE
Definition: typedefs.h:53
#define UNICODE_NULL
long LONG
Definition: pedump.c:60
#define REG_MULTI_SZ
Definition: nt_native.h:1501
Definition: bufpool.h:45
#define TRACE(s)
Definition: solgame.cpp:4
#define GetProcessHeap()
Definition: compat.h:595
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:4116
__wchar_t WCHAR
Definition: xmlstorage.h:180
unsigned long DWORD
Definition: ntddk_ex.h:95
#define REGSTR_KEY_SETUP
Definition: regstr.h:105
static const WCHAR L[]
Definition: oid.c:1250
#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
FxAutoRegKey hKey
#define KEY_QUERY_VALUE
Definition: nt_native.h:1016
#define NULL
Definition: types.h:112
_CRTIMP size_t __cdecl wcslen(_In_z_ const wchar_t *_Str)
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:594
#define HKEY_LOCAL_MACHINE
Definition: winreg.h:12

Referenced by CHSourceDlgProc().

◆ SaveCustomPath()

static VOID SaveCustomPath ( IN HWND  hwndCombo)
static

Definition at line 350 of file wizard.c.

352 {
353  LPWSTR CustomPath = NULL;
354  DWORD CustomPathLength;
355  LPWSTR Buffer = NULL;
356  LPWSTR pBuffer; /* Pointer into Buffer */
357  int ItemsCount, Length;
358  int i;
359  DWORD TotalLength = 0;
360  BOOL UseCustomPath = TRUE;
361  HKEY hKey = NULL;
362  LONG rc;
363 
364  /* Get custom path */
365  Length = ComboBox_GetTextLength(hwndCombo) + 1;
366  CustomPath = HeapAlloc(GetProcessHeap(), 0, Length * sizeof(WCHAR));
367  if (!CustomPath)
368  {
369  TRACE("HeapAlloc() failed\n");
370  goto cleanup;
371  }
372  CustomPathLength = GetWindowTextW(hwndCombo, CustomPath, Length) + 1;
373 
374  /* Calculate length of the buffer */
375  ItemsCount = ComboBox_GetCount(hwndCombo);
376  if (ItemsCount == CB_ERR)
377  {
378  TRACE("ComboBox_GetCount() failed\n");
379  goto cleanup;
380  }
381  for (i = 0; i < ItemsCount; i++)
382  {
383  Length = ComboBox_GetLBTextLen(hwndCombo, i);
384  if (Length == CB_ERR)
385  {
386  TRACE("ComboBox_GetLBTextLen() failed\n");
387  goto cleanup;
388  }
389  TotalLength += Length + 1;
390  }
391  TotalLength++; /* Final NULL char */
392 
393  /* Allocate buffer */
394  Buffer = HeapAlloc(GetProcessHeap(), 0, (CustomPathLength + TotalLength + 1) * sizeof(WCHAR));
395  if (!Buffer)
396  {
397  TRACE("HeapAlloc() failed\n");
398  goto cleanup;
399  }
400 
401  /* Fill the buffer */
402  pBuffer = &Buffer[CustomPathLength];
403  for (i = 0; i < ItemsCount; i++)
404  {
405  Length = ComboBox_GetLBText(hwndCombo, i, pBuffer);
406  if (Length == CB_ERR)
407  {
408  TRACE("ComboBox_GetLBText() failed\n");
409  goto cleanup;
410  }
411  else if (UseCustomPath && _wcsicmp(CustomPath, pBuffer) == 0)
412  UseCustomPath = FALSE;
413  pBuffer += 1 + Length;
414  }
415  *pBuffer = '\0'; /* Add final NULL char */
416 
417  if (!UseCustomPath)
418  {
419  /* Nothing to save to registry */
420  goto cleanup;
421  }
422 
423  TotalLength += CustomPathLength;
424  wcscpy(Buffer, CustomPath);
425 
426  /* Save the buffer */
427  /* RegSetKeyValue would have been better... */
428  rc = RegOpenKeyEx(
431  0,
433  &hKey);
434  if (rc != ERROR_SUCCESS)
435  {
436  TRACE("RegOpenKeyEx() failed with error 0x%lx\n", rc);
437  goto cleanup;
438  }
439  rc = RegSetValueExW(
440  hKey,
441  L"Installation Sources",
442  0,
443  REG_MULTI_SZ,
444  (const BYTE*)Buffer,
445  TotalLength * sizeof(WCHAR));
446  if (rc != ERROR_SUCCESS)
447  {
448  TRACE("RegSetValueEx() failed with error 0x%lx\n", rc);
449  goto cleanup;
450  }
451 
452 cleanup:
453  if (hKey != NULL)
454  RegCloseKey(hKey);
455  HeapFree(GetProcessHeap(), 0, CustomPath);
457 }
_In_ ULONG _In_ ULONG _In_ ULONG Length
Definition: ntddpcm.h:101
#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
#define TRUE
Definition: types.h:120
_In_ ULONG TotalLength
Definition: usbdlib.h:158
#define ComboBox_GetTextLength(hwndCtl)
Definition: windowsx.h:34
LONG WINAPI RegCloseKey(HKEY hKey)
Definition: reg.c:423
#define FALSE
Definition: types.h:117
unsigned int BOOL
Definition: ntddk_ex.h:94
long LONG
Definition: pedump.c:60
#define REG_MULTI_SZ
Definition: nt_native.h:1501
PVOID pBuffer
Definition: bufpool.h:45
#define CB_ERR
Definition: winuser.h:2411
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:4895
#define ComboBox_GetCount(hwndCtl)
Definition: windowsx.h:23
#define TRACE(s)
Definition: solgame.cpp:4
#define GetProcessHeap()
Definition: compat.h:595
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
__wchar_t WCHAR
Definition: xmlstorage.h:180
unsigned long DWORD
Definition: ntddk_ex.h:95
#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:1250
#define ComboBox_GetLBTextLen(hwndCtl, index)
Definition: windowsx.h:32
unsigned char BYTE
Definition: xxhash.c:193
#define RegOpenKeyEx
Definition: winreg.h:520
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
int WINAPI GetWindowTextW(HWND hWnd, LPWSTR lpString, int nMaxCount)
Definition: window.c:1412
FxAutoRegKey hKey
#define NULL
Definition: types.h:112
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:594
_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 724 of file wizard.c.

729 {
730  PDEVINSTDATA DevInstData;
732 
733  /* Retrieve pointer to the global setup data */
734  DevInstData = (PDEVINSTDATA)GetWindowLongPtr(hwndDlg, GWLP_USERDATA);
735 
736  switch (uMsg)
737  {
738  case WM_INITDIALOG:
739  {
740  HWND hwndControl;
741  DWORD dwStyle;
742 
743  /* Get pointer to the global setup data */
744  DevInstData = (PDEVINSTDATA)((LPPROPSHEETPAGE)lParam)->lParam;
745  SetWindowLongPtr(hwndDlg, GWLP_USERDATA, (DWORD_PTR)DevInstData);
746 
747  DevInstData->hDialog = hwndDlg;
748  hwndControl = GetParent(hwndDlg);
749 
750  /* Center the wizard window */
751  CenterWindow(hwndControl);
752 
754  hwndDlg,
755  IDC_DEVICE,
756  WM_SETTEXT,
757  0,
758  (LPARAM)DevInstData->buffer);
759 
760  /* Hide the system menu */
761  dwStyle = GetWindowLongPtr(hwndControl, GWL_STYLE);
762  SetWindowLongPtr(hwndControl, GWL_STYLE, dwStyle & ~WS_SYSMENU);
763  break;
764  }
765 
766  case WM_SEARCH_FINISHED:
767  {
769  hThread = 0;
770  if (wParam == 0)
772  else
774  break;
775  }
776 
777  case WM_NOTIFY:
778  {
779  LPNMHDR lpnm = (LPNMHDR)lParam;
780 
781  switch (lpnm->code)
782  {
783  case PSN_SETACTIVE:
785  /* Yes, we can safely ignore the problem (if any) */
787  DevInstData->hDevInfo,
788  &DevInstData->devInfoData,
790  hThread = CreateThread(NULL, 0, FindDriverProc, DevInstData, 0, &dwThreadId);
791  break;
792 
793  case PSN_KILLACTIVE:
794  if (hThread != 0)
795  {
797  return TRUE;
798  }
799  break;
800 
801  case PSN_WIZNEXT:
802  /* Handle a Next button click, if necessary */
803  break;
804 
805  default:
806  break;
807  }
808  break;
809  }
810 
811  default:
812  break;
813  }
814 
815  return FALSE;
816 }
#define IDC_DEVICE
Definition: resource.h:8
static VOID CenterWindow(IN HWND hWnd)
Definition: wizard.c:31
SP_DEVINFO_DATA devInfoData
#define IDD_INSTALLDRV
Definition: resource.h:24
#define CloseHandle
Definition: compat.h:598
#define TRUE
Definition: types.h:120
#define PSWIZB_NEXT
Definition: prsht.h:154
#define IDD_NODRIVER
Definition: resource.h:25
#define SendDlgItemMessage
Definition: winuser.h:5818
#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:3135
#define PSN_KILLACTIVE
Definition: prsht.h:116
#define FALSE
Definition: types.h:117
#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:136
#define LPPROPSHEETPAGE
Definition: prsht.h:390
#define PSN_WIZNEXT
Definition: prsht.h:121
LONG_PTR LPARAM
Definition: windef.h:208
#define SPDIT_COMPATDRIVER
Definition: setupapi.h:506
#define PropSheet_SetWizButtons(d, f)
Definition: prsht.h:357
#define WM_SETTEXT
Definition: winuser.h:1600
#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:354
uint32_t DWORD_PTR
Definition: typedefs.h:65
#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)
#define NULL
Definition: types.h:112
HANDLE hThread
Definition: wizard.c:28
#define WM_SEARCH_FINISHED
#define GetWindowLongPtr
Definition: treelist.c:73
#define WS_SYSMENU
Definition: pedump.c:629
#define WM_INITDIALOG
Definition: winuser.h:1722
LPARAM lParam
Definition: combotst.c:139
static DWORD WINAPI FindDriverProc(IN LPVOID lpParam)
Definition: wizard.c:235
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 56 of file wizard.c.

60 {
61  DWORD dwType, dwSize, dwFlags = 0;
62 
63  dwSize = sizeof(dwFlags);
65  DevInfoData,
67  &dwType,
68  (PBYTE)&dwFlags,
69  dwSize,
70  &dwSize))
71  {
72  return FALSE;
73  }
74 
75  if (Set)
77  else
79 
81  DevInfoData,
83  (PBYTE)&dwFlags,
84  dwSize))
85  {
86 
87  return FALSE;
88  }
89 
90  if (Set)
91  {
92  /* Set the 'Unknown' device class */
93  PWSTR pszUnknown = L"Unknown";
95  DevInfoData,
97  (PBYTE)pszUnknown,
98  (wcslen(pszUnknown) + 1) * sizeof(WCHAR));
99 
100  PWSTR pszUnknownGuid = L"{4D36E97E-E325-11CE-BFC1-08002BE10318}";
102  DevInfoData,
104  (PBYTE)pszUnknownGuid,
105  (wcslen(pszUnknownGuid) + 1) * sizeof(WCHAR));
106 
107  /* Set device problem code CM_PROB_FAILED_INSTALL */
108  CM_Set_DevNode_Problem(DevInfoData->DevInst,
111  }
112 
113  return TRUE;
114 }
#define TRUE
Definition: types.h:120
uint16_t * PWSTR
Definition: typedefs.h:56
CONFIGRET WINAPI CM_Set_DevNode_Problem(_In_ DEVINST dnDevInst, _In_ ULONG ulProblem, _In_ ULONG ulFlags)
Definition: cfgmgr.c:7745
#define SetupDiGetDeviceRegistryProperty
Definition: setupapi.h:2603
static BOOL Set
Definition: pageheap.c:10
#define SPDRP_CLASSGUID
Definition: setupapi.h:515
#define CM_SET_DEVNODE_PROBLEM_OVERRIDE
Definition: cfgmgr32.h:807
#define FALSE
Definition: types.h:117
__wchar_t WCHAR
Definition: xmlstorage.h:180
unsigned long DWORD
Definition: ntddk_ex.h:95
#define SetupDiSetDeviceRegistryProperty
Definition: setupapi.h:2620
#define SPDRP_CLASS
Definition: setupapi.h:514
static const WCHAR L[]
Definition: oid.c:1250
_In_ PCCERT_CONTEXT _In_ DWORD dwFlags
Definition: wincrypt.h:1175
#define SPDRP_CONFIGFLAGS
Definition: setupapi.h:517
_CRTIMP size_t __cdecl wcslen(_In_z_ const wchar_t *_Str)
#define CM_PROB_FAILED_INSTALL
Definition: cfg.h:58
BOOL WINAPI SetupDiSetDeviceRegistryPropertyW(HDEVINFO DeviceInfoSet, PSP_DEVINFO_DATA DeviceInfoData, DWORD Property, const BYTE *PropertyBuffer, DWORD PropertyBufferSize)
Definition: devinst.c:3448
BYTE * PBYTE
Definition: pedump.c:66
PSDBQUERYRESULT_VISTA PVOID DWORD * dwSize
Definition: env.c:56
#define CONFIGFLAG_FAILEDINSTALL
Definition: regstr.h:396

Referenced by FindDriverProc(), 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 166 of file wizard.c.

172 {
175  DWORD LastErr;
176  BOOL Ret = FALSE;
177 
180  pcp.HwProfile = HardwareProfile;
181 
182  if (bEnable)
183  {
184  /* try to enable the device on the global profile */
185  pcp.StateChange = DICS_ENABLE;
186  pcp.Scope = DICS_FLAG_GLOBAL;
187 
188  /* ignore errors */
189  LastErr = GetLastError();
192  DevInfoData,
193  &pcp.ClassInstallHeader,
194  sizeof(SP_PROPCHANGE_PARAMS)))
195  {
199  DevInfoData);
200  }
201  SetLastError(LastErr);
202  }
203 
204  /* try config-specific */
207 
210  DevInfoData,
211  &pcp.ClassInstallHeader,
212  sizeof(SP_PROPCHANGE_PARAMS)) &&
215  DevInfoData))
216  {
217  dp.cbSize = sizeof(SP_DEVINSTALL_PARAMS);
220  DevInfoData,
221  &dp))
222  {
223  if (bNeedReboot != NULL)
224  {
225  *bNeedReboot = ((dp.Flags & (DI_NEEDRESTART | DI_NEEDREBOOT)) != 0);
226  }
227 
228  Ret = TRUE;
229  }
230  }
231  return Ret;
232 }
#define DI_NEEDREBOOT
Definition: setupapi.h:54
#define TRUE
Definition: types.h:120
#define SetupDiGetDeviceInstallParams
Definition: setupapi.h:2599
DWORD WINAPI GetLastError(VOID)
Definition: except.c:1040
BOOL WINAPI SetupDiCallClassInstaller(DI_FUNCTION InstallFunction, HDEVINFO DeviceInfoSet, PSP_DEVINFO_DATA DeviceInfoData)
Definition: devinst.c:4020
#define DIF_PROPERTYCHANGE
Definition: setupapi.h:137
#define DICS_ENABLE
Definition: setupapi.h:112
#define FALSE
Definition: types.h:117
unsigned int BOOL
Definition: ntddk_ex.h:94
#define DICS_DISABLE
Definition: setupapi.h:114
SP_CLASSINSTALL_HEADER ClassInstallHeader
Definition: setupapi.h:916
#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:1155
#define SetLastError(x)
Definition: compat.h:611
#define DICS_FLAG_GLOBAL
Definition: setupapi.h:113
_In_ BOOL bEnable
Definition: winddi.h:3426
#define NULL
Definition: types.h:112
struct _SP_CLASSINSTALL_HEADER SP_CLASSINSTALL_HEADER
#define DI_NEEDRESTART
Definition: setupapi.h:53
#define SetupDiSetClassInstallParams
Definition: setupapi.h:2617
DI_FUNCTION InstallFunction
Definition: setupapi.h:904

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 460 of file wizard.c.

465 {
466  PDEVINSTDATA DevInstData;
468 
469  /* Retrieve pointer to the global setup data */
470  DevInstData = (PDEVINSTDATA)GetWindowLongPtr(hwndDlg, GWLP_USERDATA);
471 
472  switch (uMsg)
473  {
474  case WM_INITDIALOG:
475  {
476  HWND hwndControl;
477  DWORD dwStyle;
478 
479  /* Get pointer to the global setup data */
480  DevInstData = (PDEVINSTDATA)((LPPROPSHEETPAGE)lParam)->lParam;
481  SetWindowLongPtr(hwndDlg, GWLP_USERDATA, (DWORD_PTR)DevInstData);
482 
483  hwndControl = GetParent(hwndDlg);
484 
485  /* Center the wizard window */
486  CenterWindow(hwndControl);
487 
488  /* Hide the system menu */
489  dwStyle = GetWindowLongPtr(hwndControl, GWL_STYLE);
490  SetWindowLongPtr(hwndControl, GWL_STYLE, dwStyle & ~WS_SYSMENU);
491 
492  /* Set title font */
494  hwndDlg,
496  WM_SETFONT,
497  (WPARAM)DevInstData->hTitleFont,
498  (LPARAM)TRUE);
499 
501  hwndDlg,
502  IDC_DEVICE,
503  WM_SETTEXT,
504  0,
505  (LPARAM)DevInstData->buffer);
506 
508  hwndDlg,
510  BM_SETCHECK,
511  (WPARAM)TRUE,
512  (LPARAM)0);
513 
514  SetFailedInstall(DevInstData->hDevInfo,
515  &DevInstData->devInfoData,
516  TRUE);
517  break;
518  }
519 
520  case WM_NOTIFY:
521  {
522  LPNMHDR lpnm = (LPNMHDR)lParam;
523 
524  switch (lpnm->code)
525  {
526  case PSN_SETACTIVE:
527  /* Enable the Next button */
529  break;
530 
531  case PSN_WIZNEXT:
532  /* Handle a Next button click, if necessary */
534  {
535  if (PrepareFoldersToScan(DevInstData, TRUE, FALSE, NULL))
537  else
539  }
540  return TRUE;
541 
542  default:
543  break;
544  }
545  break;
546  }
547 
548  default:
549  break;
550  }
551 
552  return FALSE;
553 }
#define IDC_DEVICE
Definition: resource.h:8
static VOID CenterWindow(IN HWND hWnd)
Definition: wizard.c:31
SP_DEVINFO_DATA devInfoData
#define IDC_RADIO_AUTO
Definition: resource.h:9
#define TRUE
Definition: types.h:120
#define UNREFERENCED_PARAMETER(P)
Definition: ntbasedef.h:317
#define PSWIZB_NEXT
Definition: prsht.h:154
#define IDD_SEARCHDRV
Definition: resource.h:23
UINT_PTR WPARAM
Definition: windef.h:207
#define SendDlgItemMessage
Definition: winuser.h:5818
#define PSN_SETACTIVE
Definition: prsht.h:115
#define SetWindowLongPtr
Definition: treelist.c:70
WPARAM wParam
Definition: combotst.c:138
struct tagNMHDR * LPNMHDR
UINT code
Definition: winuser.h:3135
#define FALSE
Definition: types.h:117
#define GWLP_USERDATA
Definition: treelist.c:63
#define LPPROPSHEETPAGE
Definition: prsht.h:390
#define PSN_WIZNEXT
Definition: prsht.h:121
LONG_PTR LPARAM
Definition: windef.h:208
#define BM_GETCHECK
Definition: winuser.h:1901
#define PropSheet_SetWizButtons(d, f)
Definition: prsht.h:357
#define WM_SETTEXT
Definition: winuser.h:1600
#define BM_SETCHECK
Definition: winuser.h:1904
unsigned long DWORD
Definition: ntddk_ex.h:95
HDEVINFO hDevInfo
#define PropSheet_SetCurSelByID(d, i)
Definition: prsht.h:354
#define IDD_INSTALLFAILED
Definition: resource.h:26
uint32_t DWORD_PTR
Definition: typedefs.h:65
#define IDC_WELCOMETITLE
Definition: resource.h:16
#define GWL_STYLE
Definition: winuser.h:846
HWND WINAPI GetParent(_In_ HWND)
#define NULL
Definition: types.h:112
static BOOL SetFailedInstall(IN HDEVINFO DeviceInfoSet, IN PSP_DEVINFO_DATA DevInfoData OPTIONAL, IN BOOLEAN Set)
Definition: wizard.c:56
#define BST_CHECKED
Definition: winuser.h:197
#define WM_SETFONT
Definition: winuser.h:1633
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:1722
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 28 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(), DialogProc_0(), DialogProc_1(), DoFormatDrive(), EndLocalThread(), ExpCreateWorkerThread(), fetch_thread_info(), FormatDriveDlg(), 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(), JustDoIt(), LocalScheduleJob(), MailSlotReader(), main(), mmTaskCreate(), NtOpenThread(), Window::OnCommand(), OpenPropSheet(), PlayLogonSound(), PrintThreads(), PspCreateThread(), QueueUserAPC(), CDeviceView::Refresh(), ResumeThread(), RunSetup(), CZipCreator::runThread(), SaveThreadHandle(), SearchDrvDlgProc(), ServiceInit(), ServiceMain(), SetThreadAffinityMask(), SetThreadContext(), SetThreadIdealProcessor(), SetThreadPriority(), SetThreadPriorityBoost(), SetThreadToken(), SHCreateThread(), SlideWindow(), 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(), WdmAudSetMixerDeviceFormatByLegacy(), WinMain(), WlxAssignShellProtection(), wmain(), WriterThread::WriterThread(), and wWinMain().