ReactOS  0.4.13-dev-563-g0561610
hdwwiz.c File Reference
#include "resource.h"
#include "hdwwiz.h"
Include dependency graph for hdwwiz.c:

Go to the source code of this file.

Typedefs

typedef BOOL(WINAPIPINSTALL_NEW_DEVICE) (HWND, LPGUID, PDWORD)
 

Functions

static HFONT CreateTitleFont (VOID)
 
static INT_PTR CALLBACK StartPageDlgProc (HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
 
static INT_PTR CALLBACK SearchPageDlgProc (HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
 
static INT_PTR CALLBACK IsConnectedPageDlgProc (HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
 
static INT_PTR CALLBACK FinishPageDlgProc (HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
 
static INT_PTR CALLBACK NotConnectedPageDlgProc (HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
 
static VOID TrimGuidString (LPWSTR szString, LPWSTR szNewString)
 
static VOID InitProbeListPage (HWND hwndDlg)
 
static INT_PTR CALLBACK ProbeListPageDlgProc (HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
 
static INT_PTR CALLBACK SelectWayPageDlgProc (HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
 
static INT_PTR CALLBACK DevStatusPageDlgProc (HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
 
static INT EnumDeviceClasses (INT ClassIndex, LPWSTR DevClassName, LPWSTR DevClassDesc, BOOL *DevPresent, INT *ClassImage)
 
static VOID InitHardWareTypesPage (HWND hwndDlg)
 
static INT_PTR CALLBACK HdTypesPageDlgProc (HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
 
static INT_PTR CALLBACK ProgressPageDlgProc (HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
 
static int CALLBACK PropSheetProc (HWND hwndDlg, UINT uMsg, LPARAM lParam)
 
static VOID HardwareWizardInit (HWND hwnd)
 
BOOL WINAPI InstallNewDevice (HWND hwndParent, LPGUID ClassGuid, PDWORD pReboot)
 
VOID WINAPI AddHardwareWizard (HWND hwnd, LPWSTR lpName)
 
LONG CALLBACK CPlApplet (HWND hwndCpl, UINT uMsg, LPARAM lParam1, LPARAM lParam2)
 
BOOL WINAPI DllMain (HINSTANCE hinstDLL, DWORD dwReason, LPVOID lpvReserved)
 

Variables

HINSTANCE hApplet = NULL
 
HFONT hTitleFont
 
SP_CLASSIMAGELIST_DATA ImageListData
 
PWSTR pDeviceStatusText
 
HANDLE hProcessHeap
 
HDEVINFO hDevInfoTypes
 

Typedef Documentation

◆ PINSTALL_NEW_DEVICE

typedef BOOL(WINAPI * PINSTALL_NEW_DEVICE) (HWND, LPGUID, PDWORD)

Definition at line 39 of file hdwwiz.c.

Function Documentation

◆ AddHardwareWizard()

VOID WINAPI AddHardwareWizard ( HWND  hwnd,
LPWSTR  lpName 
)

Definition at line 937 of file hdwwiz.c.

938 {
939  if (lpName != NULL)
940  {
941  DPRINT1("No support of remote installation yet!\n");
942  return;
943  }
944 
946 }
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
_In_ LPCSTR lpName
Definition: winbase.h:2729
smooth NULL
Definition: ftsmooth.c:416
static VOID HardwareWizardInit(HWND hwnd)
Definition: hdwwiz.c:797
#define DPRINT1
Definition: precomp.h:8

Referenced by CPlApplet().

◆ CPlApplet()

LONG CALLBACK CPlApplet ( HWND  hwndCpl,
UINT  uMsg,
LPARAM  lParam1,
LPARAM  lParam2 
)

Definition at line 950 of file hdwwiz.c.

951 {
952  switch (uMsg)
953  {
954  case CPL_INIT:
955  return TRUE;
956 
957  case CPL_GETCOUNT:
958  return 1;
959 
960  case CPL_INQUIRE:
961  {
962  CPLINFO *CPlInfo = (CPLINFO*)lParam2;
963  CPlInfo->lData = 0;
964  CPlInfo->idIcon = IDI_CPLICON;
965  CPlInfo->idName = IDS_CPLNAME;
966  CPlInfo->idInfo = IDS_CPLDESCRIPTION;
967  }
968  break;
969 
970  case CPL_DBLCLK:
971  AddHardwareWizard(hwndCpl, NULL);
972  break;
973  }
974 
975  return FALSE;
976 }
#define TRUE
Definition: types.h:120
Definition: cpl.h:24
int idInfo
Definition: cpl.h:27
int idIcon
Definition: cpl.h:25
#define CPL_DBLCLK
Definition: cpl.h:16
#define IDS_CPLNAME
Definition: resource.h:8
VOID WINAPI AddHardwareWizard(HWND hwnd, LPWSTR lpName)
Definition: hdwwiz.c:937
smooth NULL
Definition: ftsmooth.c:416
#define IDS_CPLDESCRIPTION
Definition: resource.h:9
#define IDI_CPLICON
Definition: resource.h:4
#define CPL_INIT
Definition: cpl.h:12
#define CPL_INQUIRE
Definition: cpl.h:14
LONG_PTR lData
Definition: cpl.h:28
int idName
Definition: cpl.h:26
#define CPL_GETCOUNT
Definition: cpl.h:13

◆ CreateTitleFont()

static HFONT CreateTitleFont ( VOID  )
static

Definition at line 45 of file hdwwiz.c.

46 {
47  NONCLIENTMETRICS ncm;
48  LOGFONT LogFont;
49  HDC hdc;
50  INT FontSize;
51  HFONT hFont;
52 
53  ncm.cbSize = sizeof(NONCLIENTMETRICS);
54  SystemParametersInfo(SPI_GETNONCLIENTMETRICS, 0, &ncm, 0);
55 
56  LogFont = ncm.lfMessageFont;
57  LogFont.lfWeight = FW_BOLD;
58  wcscpy(LogFont.lfFaceName, L"MS Shell Dlg");
59 
60  hdc = GetDC(NULL);
61  FontSize = 12;
62  LogFont.lfHeight = 0 - GetDeviceCaps (hdc, LOGPIXELSY) * FontSize / 72;
63  hFont = CreateFontIndirect(&LogFont);
64  ReleaseDC(NULL, hdc);
65 
66  return hFont;
67 }
HDC WINAPI GetDC(_In_opt_ HWND)
static HDC
Definition: imagelist.c:92
#define SystemParametersInfo
Definition: winuser.h:5724
int32_t INT
Definition: typedefs.h:56
HFONT hFont
Definition: main.c:53
LONG lfHeight
Definition: dimm.idl:42
int WINAPI ReleaseDC(_In_opt_ HWND, _In_ HDC)
LONG lfWeight
Definition: dimm.idl:46
smooth NULL
Definition: ftsmooth.c:416
_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 CreateFontIndirect
Definition: wingdi.h:4422
static DWORD *static HFONT(WINAPI *pCreateFontIndirectExA)(const ENUMLOGFONTEXDVA *)
CHAR lfFaceName[LF_FACESIZE]
Definition: dimm.idl:55
#define LOGPIXELSY
Definition: wingdi.h:718

Referenced by HardwareWizardInit().

◆ DevStatusPageDlgProc()

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

Definition at line 517 of file hdwwiz.c.

518 {
519  switch (uMsg)
520  {
521  case WM_INITDIALOG:
522  {
523  /* Set title font */
525  }
526  break;
527 
528  case WM_NOTIFY:
529  {
530  LPNMHDR lpnm = (LPNMHDR)lParam;
531 
532  switch (lpnm->code)
533  {
534  case PSN_SETACTIVE:
535  {
536  /* Set status text */
538 
540  }
541  break;
542 
543  case PSN_WIZBACK:
544  {
546  return TRUE;
547  }
548  }
549  }
550  break;
551  }
552 
553  return FALSE;
554 }
#define IDC_HWSTATUSEDIT
Definition: resource.h:52
PWSTR pDeviceStatusText
Definition: hdwwiz.c:35
#define TRUE
Definition: types.h:120
UINT_PTR WPARAM
Definition: windef.h:207
#define SendDlgItemMessage
Definition: winuser.h:5708
#define PSN_SETACTIVE
Definition: prsht.h:115
#define SetWindowLongPtr
Definition: treelist.c:70
#define DWLP_MSGRESULT
Definition: winuser.h:864
struct tagNMHDR * LPNMHDR
HFONT hTitleFont
Definition: hdwwiz.c:33
UINT code
Definition: winuser.h:3112
LONG_PTR LPARAM
Definition: windef.h:208
#define PropSheet_SetWizButtons(d, f)
Definition: prsht.h:339
#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
HWND WINAPI GetParent(_In_ HWND)
#define IDD_PROBELISTPAGE
Definition: resource.h:29
#define SetWindowText
Definition: winuser.h:5723
#define WM_SETFONT
Definition: winuser.h:1632
#define PSN_WIZBACK
Definition: prsht.h:120
#define WM_INITDIALOG
Definition: winuser.h:1715
LPARAM lParam
Definition: combotst.c:139
#define WM_NOTIFY
Definition: richedit.h:61

Referenced by HardwareWizardInit().

◆ DllMain()

BOOL WINAPI DllMain ( HINSTANCE  hinstDLL,
DWORD  dwReason,
LPVOID  lpvReserved 
)

Definition at line 979 of file hdwwiz.c.

980 {
982 
983  switch (dwReason)
984  {
985  case DLL_PROCESS_ATTACH:
986  hApplet = hinstDLL;
988  DisableThreadLibraryCalls(hinstDLL);
989  break;
990  }
991 
992  return TRUE;
993 }
#define TRUE
Definition: types.h:120
#define UNREFERENCED_PARAMETER(P)
Definition: ntbasedef.h:323
BOOL WINAPI DisableThreadLibraryCalls(IN HMODULE hLibModule)
Definition: loader.c:85
#define DLL_PROCESS_ATTACH
Definition: compat.h:120
static IN DWORD IN LPVOID lpvReserved
DWORD dwReason
Definition: misc.cpp:154
HINSTANCE hApplet
Definition: hdwwiz.c:32
#define GetProcessHeap()
Definition: compat.h:395
HANDLE hProcessHeap
Definition: hdwwiz.c:36

◆ EnumDeviceClasses()

static INT EnumDeviceClasses ( INT  ClassIndex,
LPWSTR  DevClassName,
LPWSTR  DevClassDesc,
BOOL DevPresent,
INT ClassImage 
)
static

Definition at line 557 of file hdwwiz.c.

562 {
563  GUID ClassGuid;
564  HKEY KeyClass;
565  WCHAR ClassName[MAX_STR_SIZE];
567  UINT Ret;
568 
569  *DevPresent = FALSE;
570  *DevClassName = L'\0';
571 
572  Ret = CM_Enumerate_Classes(ClassIndex,
573  &ClassGuid,
574  0);
575  if (Ret != CR_SUCCESS)
576  {
577  /* All classes enumerated */
578  if(Ret == CR_NO_SUCH_VALUE)
579  {
581  return -1;
582  }
583 
584  if (Ret == CR_INVALID_DATA)
585  {
586  ; /* FIXME: What should we do here? */
587  }
588 
589  /* Handle other errors... */
590  }
591 
592  if (SetupDiClassNameFromGuid(&ClassGuid,
593  ClassName,
594  RequiredSize,
595  &RequiredSize))
596  {
597  lstrcpy(DevClassName, ClassName);
598  }
599 
601  &ClassGuid,
602  ClassImage))
603  {
604  /* FIXME: Can we do this?
605  * Set the blank icon: IDI_SETUPAPI_BLANK = 41
606  * It'll be image 24 in the imagelist */
607  *ClassImage = 24;
608  }
609 
610  /* Get device info for all devices of a particular class */
611  hDevInfoTypes = SetupDiGetClassDevs(&ClassGuid,
612  NULL,
613  NULL,
614  DIGCF_PRESENT);
616  {
618  return 0;
619  }
620 
621  KeyClass = SetupDiOpenClassRegKeyEx(&ClassGuid,
624  NULL,
625  0);
626  if (KeyClass != INVALID_HANDLE_VALUE)
627  {
628 
630 
631  if (RegQueryValue(KeyClass,
632  NULL,
633  DevClassDesc,
634  &dwSize) != ERROR_SUCCESS)
635  {
636  *DevClassDesc = L'\0';
637  }
638  }
639  else
640  {
641  return -3;
642  }
643 
644  *DevPresent = TRUE;
645 
646  RegCloseKey(KeyClass);
647 
648  return 0;
649 }
#define MAXIMUM_ALLOWED
Definition: nt_native.h:83
#define TRUE
Definition: types.h:120
#define ERROR_SUCCESS
Definition: deptool.c:10
CONFIGRET WINAPI CM_Enumerate_Classes(_In_ ULONG ulClassIndex, _Out_ LPGUID ClassGuid, _In_ ULONG ulFlags)
Definition: cfgmgr.c:1848
#define INVALID_HANDLE_VALUE
Definition: compat.h:391
#define CR_NO_SUCH_VALUE
Definition: cfgmgr32.h:883
LONG WINAPI RegCloseKey(HKEY hKey)
Definition: reg.c:423
long LONG
Definition: pedump.c:60
#define CR_SUCCESS
Definition: cfgmgr32.h:842
#define DIOCR_INSTALLER
Definition: setupapi.h:176
smooth NULL
Definition: ftsmooth.c:416
_Inout_ PRTL_BUFFER _In_ SIZE_T RequiredSize
#define MAX_STR_SIZE
Definition: hdwwiz.h:21
#define SetupDiOpenClassRegKeyEx
Definition: setupapi.h:2608
HDEVINFO hDevInfoTypes
Definition: hdwwiz.c:37
__wchar_t WCHAR
Definition: xmlstorage.h:180
unsigned long DWORD
Definition: ntddk_ex.h:95
BOOL WINAPI SetupDiGetClassImageIndex(IN PSP_CLASSIMAGELIST_DATA ClassImageListData, IN CONST GUID *ClassGuid, OUT PINT ImageIndex)
Definition: devclass.c:396
#define CR_INVALID_DATA
Definition: cfgmgr32.h:877
static const WCHAR L[]
Definition: oid.c:1250
#define SetupDiClassNameFromGuid
Definition: setupapi.h:2572
#define SetupDiGetClassDevs
Definition: setupapi.h:2588
#define lstrcpy
Definition: winbase.h:3688
unsigned int UINT
Definition: ndis.h:50
#define RegQueryValue
Definition: winreg.h:523
PSDBQUERYRESULT_VISTA PVOID DWORD * dwSize
Definition: env.c:54
SP_CLASSIMAGELIST_DATA ImageListData
Definition: hdwwiz.c:34
#define DIGCF_PRESENT
Definition: setupapi.h:171

Referenced by InitHardWareTypesPage().

◆ FinishPageDlgProc()

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

Definition at line 190 of file hdwwiz.c.

191 {
192  switch (uMsg)
193  {
194  case WM_INITDIALOG:
195  {
196  /* Set title font */
198  }
199  break;
200 
201  case WM_NOTIFY:
202  {
203  LPNMHDR lpnm = (LPNMHDR)lParam;
204 
205  switch (lpnm->code)
206  {
207  case PSN_SETACTIVE:
208  {
209  /* Only "Finish" button */
211  }
212  break;
213  }
214  }
215  break;
216  }
217 
218  return FALSE;
219 }
#define TRUE
Definition: types.h:120
UINT_PTR WPARAM
Definition: windef.h:207
#define SendDlgItemMessage
Definition: winuser.h:5708
#define PSN_SETACTIVE
Definition: prsht.h:115
struct tagNMHDR * LPNMHDR
HFONT hTitleFont
Definition: hdwwiz.c:33
UINT code
Definition: winuser.h:3112
LONG_PTR LPARAM
Definition: windef.h:208
#define PropSheet_SetWizButtons(d, f)
Definition: prsht.h:339
#define IDC_FINISHTITLE
Definition: resource.h:60
#define PSWIZB_FINISH
Definition: prsht.h:155
HWND WINAPI GetParent(_In_ HWND)
#define WM_SETFONT
Definition: winuser.h:1632
#define WM_INITDIALOG
Definition: winuser.h:1715
LPARAM lParam
Definition: combotst.c:139
#define WM_NOTIFY
Definition: richedit.h:61

Referenced by HardwareWizardInit().

◆ HardwareWizardInit()

static VOID HardwareWizardInit ( HWND  hwnd)
static

Definition at line 797 of file hdwwiz.c.

798 {
799  HPROPSHEETPAGE ahpsp[10];
800  PROPSHEETPAGE psp = {0};
801  PROPSHEETHEADER psh;
802  UINT nPages = 0;
803 
804  /* Create the Start page, until setup is working */
805  psp.dwSize = sizeof(PROPSHEETPAGE);
806  psp.dwFlags = PSP_DEFAULT | PSP_HIDEHEADER;
807  psp.hInstance = hApplet;
808  psp.lParam = 0;
809  psp.pfnDlgProc = StartPageDlgProc;
810  psp.pszTemplate = MAKEINTRESOURCE(IDD_STARTPAGE);
811  ahpsp[nPages++] = CreatePropertySheetPage(&psp);
812 
813  /* Create search page */
814  psp.dwSize = sizeof(PROPSHEETPAGE);
815  psp.dwFlags = PSP_DEFAULT | PSP_USEHEADERTITLE | PSP_USEHEADERSUBTITLE;
816  psp.pszHeaderTitle = MAKEINTRESOURCE(IDS_SEARCHTITLE);
817  psp.pszHeaderSubTitle = NULL;
818  psp.hInstance = hApplet;
819  psp.lParam = 0;
820  psp.pfnDlgProc = SearchPageDlgProc;
821  psp.pszTemplate = MAKEINTRESOURCE(IDD_SEARCHPAGE);
822  ahpsp[nPages++] = CreatePropertySheetPage(&psp);
823 
824  /* Create is connected page */
825  psp.dwSize = sizeof(PROPSHEETPAGE);
826  psp.dwFlags = PSP_DEFAULT | PSP_USEHEADERTITLE | PSP_USEHEADERSUBTITLE;
827  psp.pszHeaderTitle = MAKEINTRESOURCE(IDS_ISCONNECTED);
828  psp.pszHeaderSubTitle = NULL;
829  psp.hInstance = hApplet;
830  psp.lParam = 0;
831  psp.pfnDlgProc = IsConnectedPageDlgProc;
832  psp.pszTemplate = MAKEINTRESOURCE(IDD_ISCONNECTEDPAGE);
833  ahpsp[nPages++] = CreatePropertySheetPage(&psp);
834 
835  /* Create probe list page */
836  psp.dwSize = sizeof(PROPSHEETPAGE);
837  psp.dwFlags = PSP_DEFAULT | PSP_USEHEADERTITLE | PSP_USEHEADERSUBTITLE;
838  psp.pszHeaderTitle = MAKEINTRESOURCE(IDS_PROBELISTTITLE);
839  psp.pszHeaderSubTitle = NULL;
840  psp.hInstance = hApplet;
841  psp.lParam = 0;
842  psp.pfnDlgProc = ProbeListPageDlgProc;
843  psp.pszTemplate = MAKEINTRESOURCE(IDD_PROBELISTPAGE);
844  ahpsp[nPages++] = CreatePropertySheetPage(&psp);
845 
846  /* Create select search way page */
847  psp.dwSize = sizeof(PROPSHEETPAGE);
848  psp.dwFlags = PSP_DEFAULT | PSP_USEHEADERTITLE | PSP_USEHEADERSUBTITLE;
849  psp.pszHeaderTitle = MAKEINTRESOURCE(IDS_SELECTWAYTITLE);
850  psp.pszHeaderSubTitle = NULL;
851  psp.hInstance = hApplet;
852  psp.lParam = 0;
853  psp.pfnDlgProc = SelectWayPageDlgProc;
854  psp.pszTemplate = MAKEINTRESOURCE(IDD_SELECTWAYPAGE);
855  ahpsp[nPages++] = CreatePropertySheetPage(&psp);
856 
857  /* Create device status page */
858  psp.dwSize = sizeof(PROPSHEETPAGE);
859  psp.dwFlags = PSP_DEFAULT | PSP_HIDEHEADER;
860  psp.hInstance = hApplet;
861  psp.lParam = 0;
862  psp.pfnDlgProc = DevStatusPageDlgProc;
863  psp.pszTemplate = MAKEINTRESOURCE(IDD_HWSTATUSPAGE);
864  ahpsp[nPages++] = CreatePropertySheetPage(&psp);
865 
866  /* Create hardware types page */
867  psp.dwSize = sizeof(PROPSHEETPAGE);
868  psp.dwFlags = PSP_DEFAULT | PSP_USEHEADERTITLE | PSP_USEHEADERSUBTITLE;
869  psp.pszHeaderTitle = MAKEINTRESOURCE(IDS_HDTYPESTITLE);
870  psp.pszHeaderSubTitle = NULL;
871  psp.hInstance = hApplet;
872  psp.lParam = 0;
873  psp.pfnDlgProc = HdTypesPageDlgProc;
874  psp.pszTemplate = MAKEINTRESOURCE(IDD_HWTYPESPAGE);
875  ahpsp[nPages++] = CreatePropertySheetPage(&psp);
876 
877  /* Create progress page */
878  psp.dwSize = sizeof(PROPSHEETPAGE);
879  psp.dwFlags = PSP_DEFAULT | PSP_USEHEADERTITLE | PSP_USEHEADERSUBTITLE;
880  psp.pszHeaderTitle = MAKEINTRESOURCE(IDS_SEARCHTITLE);
881  psp.pszHeaderSubTitle = NULL;
882  psp.hInstance = hApplet;
883  psp.lParam = 0;
884  psp.pfnDlgProc = ProgressPageDlgProc;
885  psp.pszTemplate = MAKEINTRESOURCE(IDD_PROGRESSPAGE);
886  ahpsp[nPages++] = CreatePropertySheetPage(&psp);
887 
888  /* Create finish page */
889  psp.dwSize = sizeof(PROPSHEETPAGE);
890  psp.dwFlags = PSP_DEFAULT | PSP_HIDEHEADER;
891  psp.hInstance = hApplet;
892  psp.lParam = 0;
893  psp.pfnDlgProc = FinishPageDlgProc;
894  psp.pszTemplate = MAKEINTRESOURCE(IDD_FINISHPAGE);
895  ahpsp[nPages++] = CreatePropertySheetPage(&psp);
896 
897  /* Create not connected page */
898  psp.dwSize = sizeof(PROPSHEETPAGE);
899  psp.dwFlags = PSP_DEFAULT | PSP_HIDEHEADER;
900  psp.hInstance = hApplet;
901  psp.lParam = 0;
902  psp.pfnDlgProc = NotConnectedPageDlgProc;
903  psp.pszTemplate = MAKEINTRESOURCE(IDD_NOTCONNECTEDPAGE);
904  ahpsp[nPages++] = CreatePropertySheetPage(&psp);
905 
906  /* Create the property sheet */
907  psh.dwSize = sizeof(PROPSHEETHEADER);
908  psh.dwFlags = PSH_WIZARD97 | PSH_WATERMARK | PSH_HEADER | PSH_USEICONID | PSH_USECALLBACK;
909  psh.hInstance = hApplet;
910  psh.pszIcon = MAKEINTRESOURCEW(IDI_CPLICON);
911  psh.hwndParent = hwnd;
912  psh.nPages = nPages;
913  psh.nStartPage = 0;
914  psh.phpage = ahpsp;
915  psh.pszbmWatermark = MAKEINTRESOURCE(IDB_WATERMARK);
916  psh.pszbmHeader = MAKEINTRESOURCE(IDB_HEADER);
917  psh.pfnCallback = PropSheetProc;
918 
919  /* Create title font */
921 
922  /* Display the wizard */
923  PropertySheet(&psh);
924 
926 }
static INT_PTR CALLBACK SearchPageDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
Definition: hdwwiz.c:101
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
#define MAKEINTRESOURCE
Definition: winuser.h:591
#define IDD_SELECTWAYPAGE
Definition: resource.h:31
static int CALLBACK PropSheetProc(HWND hwndDlg, UINT uMsg, LPARAM lParam)
Definition: hdwwiz.c:780
#define IDS_PROBELISTTITLE
Definition: resource.h:15
static HFONT CreateTitleFont(VOID)
Definition: hdwwiz.c:45
#define IDD_STARTPAGE
Definition: resource.h:18
static INT_PTR CALLBACK DevStatusPageDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
Definition: hdwwiz.c:517
#define IDD_PROGRESSPAGE
Definition: resource.h:32
BOOL WINAPI DeleteObject(_In_ HGDIOBJ)
static INT_PTR CALLBACK HdTypesPageDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
Definition: hdwwiz.c:714
#define IDD_HWSTATUSPAGE
Definition: resource.h:30
static INT_PTR CALLBACK FinishPageDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
Definition: hdwwiz.c:190
#define PSH_USECALLBACK
Definition: prsht.h:48
#define IDB_HEADER
Definition: resource.h:30
static INT_PTR CALLBACK SelectWayPageDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
Definition: hdwwiz.c:476
HFONT hTitleFont
Definition: hdwwiz.c:33
static INT_PTR CALLBACK IsConnectedPageDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
Definition: hdwwiz.c:131
#define PSH_USEICONID
Definition: prsht.h:42
#define IDS_ISCONNECTED
Definition: resource.h:21
struct _PSP * HPROPSHEETPAGE
Definition: mstask.idl:90
smooth NULL
Definition: ftsmooth.c:416
#define PROPSHEETHEADER
Definition: prsht.h:374
HINSTANCE hApplet
Definition: hdwwiz.c:32
#define IDS_SELECTWAYTITLE
Definition: resource.h:18
#define CreatePropertySheetPage
Definition: prsht.h:381
#define PSP_DEFAULT
Definition: prsht.h:22
#define IDI_CPLICON
Definition: resource.h:4
static INT_PTR CALLBACK ProbeListPageDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
Definition: hdwwiz.c:400
#define IDD_SEARCHPAGE
Definition: resource.h:25
#define IDS_SEARCHTITLE
Definition: resource.h:17
#define IDD_FINISHPAGE
Definition: resource.h:34
static INT_PTR CALLBACK StartPageDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
Definition: hdwwiz.c:70
#define IDD_NOTCONNECTEDPAGE
Definition: resource.h:28
#define IDD_ISCONNECTEDPAGE
Definition: resource.h:27
static INT_PTR CALLBACK ProgressPageDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
Definition: hdwwiz.c:750
#define IDD_PROBELISTPAGE
Definition: resource.h:29
#define IDB_WATERMARK
Definition: resource.h:4
unsigned int UINT
Definition: ndis.h:50
#define IDD_HWTYPESPAGE
Definition: resource.h:35
#define PropertySheet
Definition: prsht.h:382
static INT_PTR CALLBACK NotConnectedPageDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
Definition: hdwwiz.c:222
#define MAKEINTRESOURCEW(i)
Definition: winuser.h:582
#define IDS_HDTYPESTITLE
Definition: resource.h:19
#define PROPSHEETPAGE
Definition: prsht.h:371

Referenced by AddHardwareWizard().

◆ HdTypesPageDlgProc()

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

Definition at line 714 of file hdwwiz.c.

715 {
716  switch (uMsg)
717  {
718  case WM_INITDIALOG:
719  {
720  InitHardWareTypesPage(hwndDlg);
721  }
722  break;
723 
724  case WM_NOTIFY:
725  {
726  LPNMHDR lpnm = (LPNMHDR)lParam;
727 
728  switch (lpnm->code)
729  {
730  case PSN_SETACTIVE:
731  {
733  }
734  break;
735 
736  case PSN_WIZBACK:
737  {
739  return TRUE;
740  }
741  }
742  }
743  break;
744  }
745 
746  return FALSE;
747 }
#define IDD_SELECTWAYPAGE
Definition: resource.h:31
#define TRUE
Definition: types.h:120
#define PSN_SETACTIVE
Definition: prsht.h:115
#define SetWindowLongPtr
Definition: treelist.c:70
static VOID InitHardWareTypesPage(HWND hwndDlg)
Definition: hdwwiz.c:652
#define DWLP_MSGRESULT
Definition: winuser.h:864
struct tagNMHDR * LPNMHDR
UINT code
Definition: winuser.h:3112
#define PropSheet_SetWizButtons(d, f)
Definition: prsht.h:339
#define PSWIZB_BACK
Definition: prsht.h:153
HWND WINAPI GetParent(_In_ HWND)
#define PSN_WIZBACK
Definition: prsht.h:120
#define WM_INITDIALOG
Definition: winuser.h:1715
LPARAM lParam
Definition: combotst.c:139
#define WM_NOTIFY
Definition: richedit.h:61

Referenced by HardwareWizardInit().

◆ InitHardWareTypesPage()

static VOID InitHardWareTypesPage ( HWND  hwndDlg)
static

Definition at line 652 of file hdwwiz.c.

653 {
654  HWND hList = GetDlgItem(hwndDlg, IDC_HWTYPESLIST);
655  WCHAR DevName[MAX_STR_SIZE];
656  WCHAR DevDesc[MAX_STR_SIZE];
657  BOOL DevExist = FALSE;
658  INT ClassRet, DevImage, Index = 0;
659  LV_COLUMN Column;
660  LV_ITEM Item;
661  RECT Rect;
662 
663  if (!hList) return;
664 
665  ZeroMemory(&Column, sizeof(LV_COLUMN));
666 
668 
669  Column.mask = LVCF_FMT | LVCF_TEXT | LVCF_WIDTH;
670  Column.fmt = LVCFMT_LEFT;
671  Column.iSubItem = 0;
672  Column.pszText = NULL;
673  Column.cx = Rect.right - GetSystemMetrics(SM_CXVSCROLL);
674  (VOID) ListView_InsertColumn(hList, 0, &Column);
675 
676  ZeroMemory(&Item, sizeof(LV_ITEM));
677 
678  do
679  {
680  ClassRet = EnumDeviceClasses(Index,
681  DevName,
682  DevDesc,
683  &DevExist,
684  &DevImage);
685 
686  if ((ClassRet != -1) && (DevExist))
687  {
688  Item.mask = LVIF_TEXT | LVIF_PARAM | LVIF_STATE | LVIF_IMAGE;
689  Item.iItem = Index;
690  Item.iImage = DevImage;
691 
692  if (DevDesc[0] != L'\0')
693  Item.pszText = (LPWSTR) DevDesc;
694  else
695  Item.pszText = (LPWSTR) DevName;
696 
697  (VOID) ListView_InsertItem(hList, &Item);
698 
699  /* Kill InfoList initialized in EnumDeviceClasses */
700  if (hDevInfoTypes)
701  {
704  }
705  }
706  Index++;
707  }
708  while (ClassRet != -1);
709 
711 }
#define LV_ITEM
Definition: commctrl.h:2309
#define LVCF_WIDTH
Definition: commctrl.h:2559
#define LVSIL_SMALL
Definition: commctrl.h:2271
#define LVCF_TEXT
Definition: commctrl.h:2560
#define LV_COLUMN
Definition: commctrl.h:2519
#define LVCFMT_LEFT
Definition: commctrl.h:2570
#define ZeroMemory
Definition: winbase.h:1635
#define ListView_InsertItem(hwnd, pitem)
Definition: commctrl.h:2380
int32_t INT
Definition: typedefs.h:56
#define LVIF_TEXT
Definition: commctrl.h:2281
#define ListView_InsertColumn(hwnd, iCol, pcol)
Definition: commctrl.h:2608
unsigned int BOOL
Definition: ntddk_ex.h:94
#define ListView_SetImageList(hwnd, himl, iImageList)
Definition: commctrl.h:2276
smooth NULL
Definition: ftsmooth.c:416
#define IDC_HWTYPESLIST
Definition: resource.h:51
#define MAX_STR_SIZE
Definition: hdwwiz.h:21
HDEVINFO hDevInfoTypes
Definition: hdwwiz.c:37
HWND WINAPI GetDlgItem(_In_opt_ HWND, _In_ int)
__wchar_t WCHAR
Definition: xmlstorage.h:180
BOOL WINAPI SetupDiDestroyDeviceInfoList(HDEVINFO devinfo)
Definition: devinst.c:2898
#define LVIF_IMAGE
Definition: commctrl.h:2282
static const UCHAR Index[8]
Definition: usbohci.c:18
int WINAPI GetSystemMetrics(_In_ int)
static INT EnumDeviceClasses(INT ClassIndex, LPWSTR DevClassName, LPWSTR DevClassDesc, BOOL *DevPresent, INT *ClassImage)
Definition: hdwwiz.c:557
static const WCHAR L[]
Definition: oid.c:1250
#define VOID
Definition: acefi.h:82
HWND hList
Definition: livecd.c:10
BOOL WINAPI GetClientRect(_In_ HWND, _Out_ LPRECT)
#define LVCF_FMT
Definition: commctrl.h:2558
#define SM_CXVSCROLL
Definition: winuser.h:951
#define LVIF_PARAM
Definition: commctrl.h:2283
WCHAR * LPWSTR
Definition: xmlstorage.h:184
#define LVIF_STATE
Definition: commctrl.h:2284
SP_CLASSIMAGELIST_DATA ImageListData
Definition: hdwwiz.c:34
struct Rect Rect

Referenced by HdTypesPageDlgProc().

◆ InitProbeListPage()

static VOID InitProbeListPage ( HWND  hwndDlg)
static

Definition at line 280 of file hdwwiz.c.

281 {
282  LV_COLUMN Column;
283  LV_ITEM Item;
285  szTrimGuid[MAX_STR_SIZE], szStatusText[MAX_STR_SIZE];
286  HWND hList = GetDlgItem(hwndDlg, IDC_PROBELIST);
287  PWSTR pstrStatusText;
288  HDEVINFO hDevInfo;
289  SP_DEVINFO_DATA DevInfoData;
290  ULONG ulStatus, ulProblemNumber;
291  GUID ClassGuid;
292  RECT Rect;
293  DWORD Index;
294 
295  if (!hList) return;
296 
297  ZeroMemory(&Column, sizeof(LV_COLUMN));
298 
300 
301  Column.mask = LVCF_FMT | LVCF_TEXT | LVCF_WIDTH;
302  Column.fmt = LVCFMT_LEFT;
303  Column.iSubItem = 0;
304  Column.pszText = NULL;
305  Column.cx = Rect.right - GetSystemMetrics(SM_CXVSCROLL);
306  (VOID) ListView_InsertColumn(hList, 0, &Column);
307 
308  ZeroMemory(&Item, sizeof(LV_ITEM));
309 
310  LoadString(hApplet, IDS_ADDNEWDEVICE, szBuffer, sizeof(szBuffer) / sizeof(WCHAR));
311 
312  Item.mask = LVIF_TEXT | LVIF_PARAM | LVIF_STATE | LVIF_IMAGE;
313  Item.pszText = (LPWSTR) szBuffer;
314  Item.iItem = (INT) ListView_GetItemCount(hList);
315  Item.iImage = -1;
316  (VOID) ListView_InsertItem(hList, &Item);
317 
319 
320  if (hDevInfo == INVALID_HANDLE_VALUE) return;
321 
322  /* Get the device image List */
325 
326  DevInfoData.cbSize = sizeof(SP_DEVINFO_DATA);
327  for (Index = 0; TRUE; Index++)
328  {
329  szBuffer[0] = L'\0';
330 
331  if (!SetupDiEnumDeviceInfo(hDevInfo, Index, &DevInfoData)) break;
332 
333  if (CM_Get_DevNode_Status_Ex(&ulStatus, &ulProblemNumber, DevInfoData.DevInst, 0, NULL) == CR_SUCCESS)
334  {
335  if (ulStatus & DN_NO_SHOW_IN_DM) continue;
336  }
337 
338  /* Get the device's friendly name */
339  if (!SetupDiGetDeviceRegistryProperty(hDevInfo,
340  &DevInfoData,
342  0,
343  (BYTE*)szBuffer,
344  MAX_STR_SIZE,
345  NULL))
346  {
347  /* If the friendly name fails, try the description instead */
349  &DevInfoData,
351  0,
352  (BYTE*)szBuffer,
353  MAX_STR_SIZE,
354  NULL);
355  }
356 
358  &DevInfoData,
360  0,
361  (BYTE*)szGuid,
362  MAX_STR_SIZE,
363  NULL);
364 
365  TrimGuidString(szGuid, szTrimGuid);
366  UuidFromStringW(szTrimGuid, &ClassGuid);
367 
369  &ClassGuid,
370  &Item.iImage);
371 
373  DevInfoData.DevInst,
374  ulProblemNumber,
375  szStatusText,
376  sizeof(szStatusText) / sizeof(WCHAR));
377 
378  pstrStatusText = (PWSTR)HeapAlloc(hProcessHeap, 0, sizeof(szStatusText));
379  lstrcpy(pstrStatusText, szStatusText);
380 
381  if (szBuffer[0] != L'\0')
382  {
383  /* Set device name */
384  Item.pszText = (LPWSTR) szBuffer;
385  Item.mask = LVIF_TEXT | LVIF_PARAM | LVIF_STATE | LVIF_IMAGE;
386  Item.lParam = (LPARAM) pstrStatusText;
387  Item.iItem = (INT) ListView_GetItemCount(hList);
388  (VOID) ListView_InsertItem(hList, &Item);
389  }
390 
391  DevInfoData.cbSize = sizeof(SP_DEVINFO_DATA);
392  }
393 
397 }
BOOL WINAPI SetupDiEnumDeviceInfo(HDEVINFO devinfo, DWORD index, PSP_DEVINFO_DATA info)
Definition: devinst.c:1792
#define LV_ITEM
Definition: commctrl.h:2309
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:3445
#define TRUE
Definition: types.h:120
static VOID TrimGuidString(LPWSTR szString, LPWSTR szNewString)
Definition: hdwwiz.c:259
#define LVCF_WIDTH
Definition: commctrl.h:2559
#define LVSIL_SMALL
Definition: commctrl.h:2271
#define LVCF_TEXT
Definition: commctrl.h:2560
uint16_t * PWSTR
Definition: typedefs.h:54
#define LV_COLUMN
Definition: commctrl.h:2519
#define INT
Definition: polytest.cpp:20
#define LVS_EX_FULLROWSELECT
Definition: commctrl.h:2706
#define LVCFMT_LEFT
Definition: commctrl.h:2570
#define INVALID_HANDLE_VALUE
Definition: compat.h:391
#define ZeroMemory
Definition: winbase.h:1635
#define SetupDiGetDeviceRegistryProperty
Definition: setupapi.h:2598
#define ListView_InsertItem(hwnd, pitem)
Definition: commctrl.h:2380
BOOL WINAPI SetupDiGetClassImageList(OUT PSP_CLASSIMAGELIST_DATA ClassImageListData)
Definition: devclass.c:441
#define SPDRP_CLASSGUID
Definition: setupapi.h:510
#define LVIF_TEXT
Definition: commctrl.h:2281
#define ListView_InsertColumn(hwnd, iCol, pcol)
Definition: commctrl.h:2608
#define IDC_PROBELIST
Definition: resource.h:39
#define SetupDiGetClassDevsEx
Definition: setupapi.h:2589
RPC_STATUS WINAPI UuidFromStringW(RPC_WSTR s, UUID *uuid)
Definition: rpcrt4_main.c:615
#define CR_SUCCESS
Definition: cfgmgr32.h:842
#define ListView_SetImageList(hwnd, himl, iImageList)
Definition: commctrl.h:2276
smooth NULL
Definition: ftsmooth.c:416
UINT WINAPI DeviceProblemTextW(IN HMACHINE hMachine OPTIONAL, IN DEVINST dnDevInst, IN ULONG uProblemId, OUT LPWSTR lpString, IN UINT uMaxString)
Definition: devprblm.cpp:491
LONG_PTR LPARAM
Definition: windef.h:208
HINSTANCE hApplet
Definition: hdwwiz.c:32
#define ListView_GetItemCount(hwnd)
Definition: commctrl.h:2279
#define DN_NO_SHOW_IN_DM
Definition: cfg.h:148
struct _SP_DEVINFO_DATA SP_DEVINFO_DATA
#define MAX_STR_SIZE
Definition: hdwwiz.h:21
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
HWND WINAPI GetDlgItem(_In_opt_ HWND, _In_ int)
__wchar_t WCHAR
Definition: xmlstorage.h:180
BOOL WINAPI SetupDiDestroyDeviceInfoList(HDEVINFO devinfo)
Definition: devinst.c:2898
#define LVIF_IMAGE
Definition: commctrl.h:2282
static const UCHAR Index[8]
Definition: usbohci.c:18
#define SPDRP_FRIENDLYNAME
Definition: setupapi.h:514
int WINAPI GetSystemMetrics(_In_ int)
unsigned long DWORD
Definition: ntddk_ex.h:95
BOOL WINAPI SetupDiGetClassImageIndex(IN PSP_CLASSIMAGELIST_DATA ClassImageListData, IN CONST GUID *ClassGuid, OUT PINT ImageIndex)
Definition: devclass.c:396
#define ListView_SetExtendedListViewStyle(hwndLV, dw)
Definition: commctrl.h:2697
#define DIGCF_ALLCLASSES
Definition: setupapi.h:172
static const WCHAR L[]
Definition: oid.c:1250
#define VOID
Definition: acefi.h:82
unsigned char BYTE
Definition: mem.h:68
#define SPDRP_DEVICEDESC
Definition: setupapi.h:502
HWND hList
Definition: livecd.c:10
BOOL WINAPI GetClientRect(_In_ HWND, _Out_ LPRECT)
#define LVCF_FMT
Definition: commctrl.h:2558
static const WCHAR szGuid[]
Definition: rtlstr.c:1892
#define lstrcpy
Definition: winbase.h:3688
HANDLE hProcessHeap
Definition: hdwwiz.c:36
#define SM_CXVSCROLL
Definition: winuser.h:951
#define LVIF_PARAM
Definition: commctrl.h:2283
unsigned int ULONG
Definition: retypes.h:1
WCHAR * LPWSTR
Definition: xmlstorage.h:184
#define LVIF_STATE
Definition: commctrl.h:2284
#define IDS_ADDNEWDEVICE
Definition: resource.h:20
#define LoadString
Definition: winuser.h:5685
SP_CLASSIMAGELIST_DATA ImageListData
Definition: hdwwiz.c:34
struct Rect Rect
#define DIGCF_PRESENT
Definition: setupapi.h:171

Referenced by ProbeListPageDlgProc().

◆ InstallNewDevice()

BOOL WINAPI InstallNewDevice ( HWND  hwndParent,
LPGUID  ClassGuid,
PDWORD  pReboot 
)

Definition at line 931 of file hdwwiz.c.

932 {
933  return FALSE;
934 }

◆ IsConnectedPageDlgProc()

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

Definition at line 131 of file hdwwiz.c.

132 {
133  switch (uMsg)
134  {
135  case WM_COMMAND:
136  {
137  if(HIWORD(wParam) == BN_CLICKED)
138  {
139  if ((SendDlgItemMessage(hwndDlg, IDC_CONNECTED, BM_GETCHECK, 0, 0) == BST_CHECKED) ||
141  {
143  }
144  else
145  {
147  }
148  }
149  }
150  break;
151 
152  case WM_NOTIFY:
153  {
154  LPNMHDR lpnm = (LPNMHDR)lParam;
155 
156  switch (lpnm->code)
157  {
158  case PSN_SETACTIVE:
159  {
160  if ((SendDlgItemMessage(hwndDlg, IDC_CONNECTED, BM_GETCHECK, 0, 0) == BST_CHECKED) ||
162  {
164  }
165  else
166  {
168  }
169  }
170  break;
171 
172  case PSN_WIZNEXT:
173  {
176  else
178 
179  return TRUE;
180  }
181  }
182  }
183  break;
184  }
185 
186  return FALSE;
187 }
#define TRUE
Definition: types.h:120
#define PSWIZB_NEXT
Definition: prsht.h:154
#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 IDC_CONNECTED
Definition: resource.h:55
#define PSN_WIZNEXT
Definition: prsht.h:121
#define BM_GETCHECK
Definition: winuser.h:1879
#define PropSheet_SetWizButtons(d, f)
Definition: prsht.h:339
#define PSWIZB_BACK
Definition: prsht.h:153
#define BN_CLICKED
Definition: winuser.h:1886
#define WM_COMMAND
Definition: winuser.h:1716
#define IDD_NOTCONNECTEDPAGE
Definition: resource.h:28
HWND WINAPI GetParent(_In_ HWND)
#define IDD_PROBELISTPAGE
Definition: resource.h:29
#define BST_CHECKED
Definition: winuser.h:197
#define IDC_NOTCONNECTED
Definition: resource.h:56
#define HIWORD(l)
Definition: typedefs.h:246
LPARAM lParam
Definition: combotst.c:139
#define WM_NOTIFY
Definition: richedit.h:61

Referenced by HardwareWizardInit().

◆ NotConnectedPageDlgProc()

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

Definition at line 222 of file hdwwiz.c.

223 {
224  switch (uMsg)
225  {
226  case WM_INITDIALOG:
227  {
228  /* Set title font */
230  }
231  break;
232 
233  case WM_NOTIFY:
234  {
235  LPNMHDR lpnm = (LPNMHDR)lParam;
236 
237  switch (lpnm->code)
238  {
239  case PSN_SETACTIVE:
240  {
242  }
243  break;
244 
245  case PSN_WIZBACK:
246  {
248  return TRUE;
249  }
250  }
251  }
252  break;
253  }
254 
255  return FALSE;
256 }
#define TRUE
Definition: types.h:120
UINT_PTR WPARAM
Definition: windef.h:207
#define SendDlgItemMessage
Definition: winuser.h:5708
#define PSN_SETACTIVE
Definition: prsht.h:115
#define SetWindowLongPtr
Definition: treelist.c:70
#define DWLP_MSGRESULT
Definition: winuser.h:864
struct tagNMHDR * LPNMHDR
HFONT hTitleFont
Definition: hdwwiz.c:33
UINT code
Definition: winuser.h:3112
LONG_PTR LPARAM
Definition: windef.h:208
#define PropSheet_SetWizButtons(d, f)
Definition: prsht.h:339
#define IDC_FINISHTITLE
Definition: resource.h:60
#define PSWIZB_FINISH
Definition: prsht.h:155
#define PSWIZB_BACK
Definition: prsht.h:153
#define IDD_ISCONNECTEDPAGE
Definition: resource.h:27
HWND WINAPI GetParent(_In_ HWND)
#define WM_SETFONT
Definition: winuser.h:1632
#define PSN_WIZBACK
Definition: prsht.h:120
#define WM_INITDIALOG
Definition: winuser.h:1715
LPARAM lParam
Definition: combotst.c:139
#define WM_NOTIFY
Definition: richedit.h:61

Referenced by HardwareWizardInit().

◆ ProbeListPageDlgProc()

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

Definition at line 400 of file hdwwiz.c.

401 {
402  INT Index;
403 
404  switch (uMsg)
405  {
406  case WM_INITDIALOG:
407  {
409  InitProbeListPage(hwndDlg);
410  }
411  break;
412 
413  case WM_NOTIFY:
414  {
415  LPNMHDR lpnm = (LPNMHDR)lParam;
416 
417  switch (lpnm->code)
418  {
419  case PSN_SETACTIVE:
420  {
422  }
423  break;
424 
425  case PSN_WIZNEXT:
426  {
428  if (Index == -1) Index = 0;
429 
430  if (Index == 0)
431  {
433  }
434  else
435  {
436  LVITEM Item;
437  PWSTR pts;
438 
439  ZeroMemory(&Item, sizeof(LV_ITEM));
440  Item.mask = LVIF_PARAM;
441  Item.iItem = Index;
442  (VOID) ListView_GetItem(GetDlgItem(hwndDlg, IDC_PROBELIST), &Item);
443  pts = (PWSTR) Item.lParam;
445 
447  }
448  return TRUE;
449  }
450  }
451  }
452  break;
453 
454  case WM_DESTROY:
455  {
456  INT Index;
457  LVITEM Item;
458 
459  for (Index = ListView_GetItemCount(GetDlgItem(hwndDlg, IDC_PROBELIST)); --Index > 0;)
460  {
461  ZeroMemory(&Item, sizeof(LV_ITEM));
462  Item.mask = LVIF_PARAM;
463  Item.iItem = Index;
464  (VOID) ListView_GetItem(GetDlgItem(hwndDlg, IDC_PROBELIST), &Item);
465  HeapFree(hProcessHeap, 0, (LPVOID) Item.lParam);
466  }
468  }
469  break;
470  }
471 
472  return FALSE;
473 }
#define LV_ITEM
Definition: commctrl.h:2309
#define IDD_SELECTWAYPAGE
Definition: resource.h:31
PWSTR pDeviceStatusText
Definition: hdwwiz.c:35
#define TRUE
Definition: types.h:120
uint16_t * PWSTR
Definition: typedefs.h:54
#define INT
Definition: polytest.cpp:20
#define PSWIZB_NEXT
Definition: prsht.h:154
#define ZeroMemory
Definition: winbase.h:1635
#define IDD_HWSTATUSPAGE
Definition: resource.h:30
#define PSN_SETACTIVE
Definition: prsht.h:115
int32_t INT
Definition: typedefs.h:56
#define SetWindowLongPtr
Definition: treelist.c:70
#define DWLP_MSGRESULT
Definition: winuser.h:864
struct tagNMHDR * LPNMHDR
static VOID InitProbeListPage(HWND hwndDlg)
Definition: hdwwiz.c:280
UINT code
Definition: winuser.h:3112
#define IDC_PROBELIST
Definition: resource.h:39
#define PSN_WIZNEXT
Definition: prsht.h:121
#define ListView_GetItemCount(hwnd)
Definition: commctrl.h:2279
#define LVNI_FOCUSED
Definition: commctrl.h:2395
#define PropSheet_SetWizButtons(d, f)
Definition: prsht.h:339
#define WM_DESTROY
Definition: winuser.h:1591
#define MAX_STR_SIZE
Definition: hdwwiz.h:21
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
HWND WINAPI GetDlgItem(_In_opt_ HWND, _In_ int)
#define PSWIZB_BACK
Definition: prsht.h:153
static const UCHAR Index[8]
Definition: usbohci.c:18
_CRTIMP wchar_t *__cdecl wcscpy(_Out_writes_z_(_String_length_(_Source)+1) wchar_t *_Dest, _In_z_ const wchar_t *_Source)
#define VOID
Definition: acefi.h:82
HWND WINAPI GetParent(_In_ HWND)
HANDLE hProcessHeap
Definition: hdwwiz.c:36
#define ListView_GetItem(hwnd, pitem)
Definition: commctrl.h:2366
#define SendMessage
Definition: winuser.h:5709
#define LVIF_PARAM
Definition: commctrl.h:2283
#define LVITEM
Definition: commctrl.h:2347
#define LVM_GETNEXTITEM
Definition: commctrl.h:2405
#define WM_INITDIALOG
Definition: winuser.h:1715
LPARAM lParam
Definition: combotst.c:139
#define HeapFree(x, y, z)
Definition: compat.h:394
#define WM_NOTIFY
Definition: richedit.h:61

Referenced by HardwareWizardInit().

◆ ProgressPageDlgProc()

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

Definition at line 750 of file hdwwiz.c.

751 {
752  switch (uMsg)
753  {
754  case WM_NOTIFY:
755  {
756  LPNMHDR lpnm = (LPNMHDR)lParam;
757 
758  switch (lpnm->code)
759  {
760  case PSN_SETACTIVE:
761  {
763  }
764  break;
765 
766  case PSN_WIZBACK:
767  {
769  return TRUE;
770  }
771  }
772  }
773  break;
774  }
775 
776  return FALSE;
777 }
#define IDD_SELECTWAYPAGE
Definition: resource.h:31
#define TRUE
Definition: types.h:120
#define PSN_SETACTIVE
Definition: prsht.h:115
#define SetWindowLongPtr
Definition: treelist.c:70
#define DWLP_MSGRESULT
Definition: winuser.h:864
struct tagNMHDR * LPNMHDR
UINT code
Definition: winuser.h:3112
#define PropSheet_SetWizButtons(d, f)
Definition: prsht.h:339
#define PSWIZB_BACK
Definition: prsht.h:153
HWND WINAPI GetParent(_In_ HWND)
#define PSN_WIZBACK
Definition: prsht.h:120
LPARAM lParam
Definition: combotst.c:139
#define WM_NOTIFY
Definition: richedit.h:61

Referenced by HardwareWizardInit().

◆ PropSheetProc()

static int CALLBACK PropSheetProc ( HWND  hwndDlg,
UINT  uMsg,
LPARAM  lParam 
)
static

Definition at line 780 of file hdwwiz.c.

781 {
782  // NOTE: This callback is needed to set large icon correctly.
783  HICON hIcon;
784  switch (uMsg)
785  {
786  case PSCB_INITIALIZED:
787  {
789  SendMessageW(hwndDlg, WM_SETICON, ICON_BIG, (LPARAM)hIcon);
790  break;
791  }
792  }
793  return 0;
794 }
static HICON
Definition: imagelist.c:84
LONG_PTR LPARAM
Definition: windef.h:208
HINSTANCE hApplet
Definition: hdwwiz.c:32
#define IDI_CPLICON
Definition: resource.h:4
#define PSCB_INITIALIZED
Definition: prsht.h:75
HICON hIcon
Definition: msconfig.c:44
LRESULT WINAPI SendMessageW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
HICON WINAPI LoadIconW(_In_opt_ HINSTANCE, _In_ LPCWSTR)
Definition: cursoricon.c:2044
#define MAKEINTRESOURCEW(i)
Definition: winuser.h:582
#define ICON_BIG
Definition: tnclass.cpp:51

Referenced by HardwareWizardInit().

◆ SearchPageDlgProc()

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

Definition at line 101 of file hdwwiz.c.

102 {
103  switch (uMsg)
104  {
105  case WM_INITDIALOG:
106  {
107  /* TODO: PnP devices search */
108  }
109  break;
110 
111  case WM_NOTIFY:
112  {
113  LPNMHDR lpnm = (LPNMHDR)lParam;
114 
115  switch (lpnm->code)
116  {
117  case PSN_SETACTIVE:
118  {
120  }
121  break;
122  }
123  }
124  break;
125  }
126 
127  return FALSE;
128 }
#define PSWIZB_NEXT
Definition: prsht.h:154
#define PSN_SETACTIVE
Definition: prsht.h:115
struct tagNMHDR * LPNMHDR
UINT code
Definition: winuser.h:3112
#define PropSheet_SetWizButtons(d, f)
Definition: prsht.h:339
#define PSWIZB_BACK
Definition: prsht.h:153
HWND WINAPI GetParent(_In_ HWND)
#define WM_INITDIALOG
Definition: winuser.h:1715
LPARAM lParam
Definition: combotst.c:139
#define WM_NOTIFY
Definition: richedit.h:61

Referenced by HardwareWizardInit().

◆ SelectWayPageDlgProc()

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

Definition at line 476 of file hdwwiz.c.

477 {
478  switch (uMsg)
479  {
480  case WM_NOTIFY:
481  {
482  LPNMHDR lpnm = (LPNMHDR)lParam;
483 
484  switch (lpnm->code)
485  {
486  case PSN_SETACTIVE:
487  {
491  else
492  {
495  }
496  }
497  break;
498 
499  case PSN_WIZNEXT:
500  {
503  else
505 
506  return TRUE;
507  }
508  }
509  }
510  break;
511  }
512 
513  return FALSE;
514 }
#define TRUE
Definition: types.h:120
#define IDD_PROGRESSPAGE
Definition: resource.h:32
#define PSWIZB_NEXT
Definition: prsht.h:154
#define IDC_MANUALLYINST
Definition: resource.h:43
#define SendDlgItemMessage
Definition: winuser.h:5708
#define PSN_SETACTIVE
Definition: prsht.h:115
#define SetWindowLongPtr
Definition: treelist.c:70
#define DWLP_MSGRESULT
Definition: winuser.h:864
struct tagNMHDR * LPNMHDR
UINT code
Definition: winuser.h:3112
#define PSN_WIZNEXT
Definition: prsht.h:121
#define BM_GETCHECK
Definition: winuser.h:1879
#define PropSheet_SetWizButtons(d, f)
Definition: prsht.h:339
#define BM_SETCHECK
Definition: winuser.h:1882
#define PSWIZB_BACK
Definition: prsht.h:153
#define IDC_AUTOINSTALL
Definition: resource.h:42
HWND WINAPI GetParent(_In_ HWND)
#define IDD_HWTYPESPAGE
Definition: resource.h:35
#define BST_CHECKED
Definition: winuser.h:197
LPARAM lParam
Definition: combotst.c:139
#define WM_NOTIFY
Definition: richedit.h:61

Referenced by HardwareWizardInit().

◆ StartPageDlgProc()

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

Definition at line 70 of file hdwwiz.c.

71 {
72  switch (uMsg)
73  {
74  case WM_INITDIALOG:
75  {
76  /* Set title font */
78  }
79  break;
80 
81  case WM_NOTIFY:
82  {
83  LPNMHDR lpnm = (LPNMHDR)lParam;
84 
85  switch (lpnm->code)
86  {
87  case PSN_SETACTIVE:
88  {
90  }
91  break;
92  }
93  }
94  break;
95  }
96 
97  return FALSE;
98 }
#define TRUE
Definition: types.h:120
#define PSWIZB_NEXT
Definition: prsht.h:154
UINT_PTR WPARAM
Definition: windef.h:207
#define SendDlgItemMessage
Definition: winuser.h:5708
#define PSN_SETACTIVE
Definition: prsht.h:115
struct tagNMHDR * LPNMHDR
HFONT hTitleFont
Definition: hdwwiz.c:33
UINT code
Definition: winuser.h:3112
LONG_PTR LPARAM
Definition: windef.h:208
#define PropSheet_SetWizButtons(d, f)
Definition: prsht.h:339
#define IDC_FINISHTITLE
Definition: resource.h:60
HWND WINAPI GetParent(_In_ HWND)
#define WM_SETFONT
Definition: winuser.h:1632
#define WM_INITDIALOG
Definition: winuser.h:1715
LPARAM lParam
Definition: combotst.c:139
#define WM_NOTIFY
Definition: richedit.h:61

Referenced by HardwareWizardInit().

◆ TrimGuidString()

static VOID TrimGuidString ( LPWSTR  szString,
LPWSTR  szNewString 
)
static

Definition at line 259 of file hdwwiz.c.

260 {
261  WCHAR szBuffer[39];
262  INT Index;
263 
264  if (wcslen(szString) == 38)
265  {
266  if ((szString[0] == L'{') && (szString[37] == L'}'))
267  {
268  for (Index = 0; Index < wcslen(szString); Index++)
269  szBuffer[Index] = szString[Index + 1];
270 
271  szBuffer[36] = L'\0';
272  wcscpy(szNewString, szBuffer);
273  return;
274  }
275  }
276  wcscpy(szNewString, L"\0");
277 }
int32_t INT
Definition: typedefs.h:56
__wchar_t WCHAR
Definition: xmlstorage.h:180
static const UCHAR Index[8]
Definition: usbohci.c:18
_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
size_t __cdecl wcslen(_In_z_ const wchar_t *_Str)

Referenced by InitProbeListPage().

Variable Documentation

◆ hApplet

HINSTANCE hApplet = NULL

Definition at line 32 of file hdwwiz.c.

Referenced by DllMain(), HardwareWizardInit(), InitProbeListPage(), and PropSheetProc().

◆ hDevInfoTypes

HDEVINFO hDevInfoTypes

Definition at line 37 of file hdwwiz.c.

Referenced by EnumDeviceClasses(), and InitHardWareTypesPage().

◆ hProcessHeap

HANDLE hProcessHeap

Definition at line 36 of file hdwwiz.c.

Referenced by DllMain(), InitProbeListPage(), and ProbeListPageDlgProc().

◆ hTitleFont

◆ ImageListData

◆ pDeviceStatusText

PWSTR pDeviceStatusText

Definition at line 35 of file hdwwiz.c.

Referenced by DevStatusPageDlgProc(), and ProbeListPageDlgProc().