ReactOS  0.4.15-dev-4569-g032c50f
wizard.c
Go to the documentation of this file.
1 /*
2  * New device installer (newdev.dll)
3  *
4  * Copyright 2006 HervĂ© Poussineau (hpoussin@reactos.org)
5  *
6  * This library is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU Lesser General Public
8  * License as published by the Free Software Foundation; either
9  * version 2.1 of the License, or (at your option) any later version.
10  *
11  * This library is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14  * Lesser General Public License for more details.
15  *
16  * You should have received a copy of the GNU Lesser General Public
17  * License along with this library; if not, write to the Free Software
18  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
19  */
20 
21 #include "newdev_private.h"
22 
23 #include <wincon.h>
24 #include <cfgmgr32.h>
25 #include <shlobj.h>
26 #include <shlwapi.h>
27 
29 
30 static VOID
32  IN HWND hWnd)
33 {
35  RECT rcParent;
36  RECT rcWindow;
37 
39  if (hWndParent == NULL)
41 
42  GetWindowRect(hWndParent, &rcParent);
43  GetWindowRect(hWnd, &rcWindow);
44 
45  /* Check if the child window fits inside the parent window */
46  if (rcWindow.left < rcParent.left || rcWindow.top < rcParent.top ||
47  rcWindow.right > rcParent.right || rcWindow.bottom > rcParent.bottom)
48  {
49  return;
50  }
51 
53  hWnd,
54  HWND_TOP,
55  ((rcParent.right - rcParent.left) - (rcWindow.right - rcWindow.left)) / 2,
56  ((rcParent.bottom - rcParent.top) - (rcWindow.bottom - rcWindow.top)) / 2,
57  0,
58  0,
59  SWP_NOSIZE);
60 }
61 
62 static BOOL
65  IN PSP_DEVINFO_DATA DevInfoData OPTIONAL,
66  IN BOOLEAN Set)
67 {
68  DWORD dwType, dwSize, dwFlags = 0;
69 
70  dwSize = sizeof(dwFlags);
72  DevInfoData,
74  &dwType,
75  (PBYTE)&dwFlags,
76  dwSize,
77  &dwSize))
78  {
79  return FALSE;
80  }
81 
82  if (Set)
84  else
86 
88  DevInfoData,
90  (PBYTE)&dwFlags,
91  dwSize))
92  {
93 
94  return FALSE;
95  }
96 
97  if (Set)
98  {
99  /* Set the 'Unknown' device class */
100  PWSTR pszUnknown = L"Unknown";
102  DevInfoData,
103  SPDRP_CLASS,
104  (PBYTE)pszUnknown,
105  (wcslen(pszUnknown) + 1) * sizeof(WCHAR));
106 
107  PWSTR pszUnknownGuid = L"{4D36E97E-E325-11CE-BFC1-08002BE10318}";
109  DevInfoData,
111  (PBYTE)pszUnknownGuid,
112  (wcslen(pszUnknownGuid) + 1) * sizeof(WCHAR));
113 
114  /* Set device problem code CM_PROB_FAILED_INSTALL */
115  CM_Set_DevNode_Problem(DevInfoData->DevInst,
118  }
119 
120  return TRUE;
121 }
122 
123 static BOOL
125  IN DEVINST DevInst,
126  IN HMACHINE hMachine,
127  OUT BOOL *CanDisable)
128 {
129  CONFIGRET cr;
130  ULONG Status, ProblemNumber;
131  BOOL Ret = FALSE;
132 
134  &ProblemNumber,
135  DevInst,
136  0,
137  hMachine);
138  if (cr == CR_SUCCESS)
139  {
140  *CanDisable = ((Status & DN_DISABLEABLE) != 0);
141  Ret = TRUE;
142  }
143 
144  return Ret;
145 }
146 
147 static BOOL
149  IN DEVINST DevInst,
150  IN HMACHINE hMachine,
151  OUT BOOL *IsEnabled)
152 {
153  CONFIGRET cr;
154  ULONG Status, ProblemNumber;
155  BOOL Ret = FALSE;
156 
158  &Status,
159  &ProblemNumber,
160  DevInst,
161  0,
162  hMachine);
163  if (cr == CR_SUCCESS)
164  {
165  *IsEnabled = ((Status & DN_STARTED) != 0);
166  Ret = TRUE;
167  }
168 
169  return Ret;
170 }
171 
172 static BOOL
175  IN PSP_DEVINFO_DATA DevInfoData OPTIONAL,
176  IN BOOL bEnable,
177  IN DWORD HardwareProfile OPTIONAL,
178  OUT BOOL *bNeedReboot OPTIONAL)
179 {
182  DWORD LastErr;
183  BOOL Ret = FALSE;
184 
187  pcp.HwProfile = HardwareProfile;
188 
189  if (bEnable)
190  {
191  /* try to enable the device on the global profile */
192  pcp.StateChange = DICS_ENABLE;
193  pcp.Scope = DICS_FLAG_GLOBAL;
194 
195  /* ignore errors */
196  LastErr = GetLastError();
199  DevInfoData,
200  &pcp.ClassInstallHeader,
201  sizeof(SP_PROPCHANGE_PARAMS)))
202  {
206  DevInfoData);
207  }
208  SetLastError(LastErr);
209  }
210 
211  /* try config-specific */
214 
217  DevInfoData,
218  &pcp.ClassInstallHeader,
219  sizeof(SP_PROPCHANGE_PARAMS)) &&
222  DevInfoData))
223  {
224  dp.cbSize = sizeof(SP_DEVINSTALL_PARAMS);
227  DevInfoData,
228  &dp))
229  {
230  if (bNeedReboot != NULL)
231  {
232  *bNeedReboot = ((dp.Flags & (DI_NEEDRESTART | DI_NEEDREBOOT)) != 0);
233  }
234 
235  Ret = TRUE;
236  }
237  }
238  return Ret;
239 }
240 
241 static DWORD WINAPI
243  IN LPVOID lpParam)
244 {
245  PDEVINSTDATA DevInstData;
246  BOOL result = FALSE;
247 
248  DevInstData = (PDEVINSTDATA)lpParam;
249 
250  result = ScanFoldersForDriver(DevInstData);
251 
252  if (result)
253  {
254  PostMessage(DevInstData->hDialog, WM_SEARCH_FINISHED, 1, 0);
255  }
256  else
257  {
258  if (!DevInstData->bUpdate)
259  {
260  /* Update device configuration */
261  SetFailedInstall(DevInstData->hDevInfo,
262  &DevInstData->devInfoData,
263  TRUE);
264  }
265  PostMessage(DevInstData->hDialog, WM_SEARCH_FINISHED, 0, 0);
266  }
267  return 0;
268 }
269 
270 static DWORD WINAPI
272  IN LPVOID lpParam)
273 {
274  PDEVINSTDATA DevInstData;
275  BOOL res;
276 
277  DevInstData = (PDEVINSTDATA)lpParam;
278  res = InstallCurrentDriver(DevInstData);
279  PostMessage(DevInstData->hDialog, WM_INSTALL_FINISHED, res ? 0 : 1, 0);
280  return 0;
281 }
282 
283 static VOID
285  IN HWND hwndCombo)
286 {
287  HKEY hKey = NULL;
288  DWORD dwRegType;
289  DWORD dwPathLength = 0;
290  LPWSTR Buffer = NULL;
291  LPCWSTR Path;
292  LONG rc;
293 
294  (void)ComboBox_ResetContent(hwndCombo);
295 
296  /* RegGetValue would have been better... */
297  rc = RegOpenKeyEx(
300  0,
302  &hKey);
303  if (rc != ERROR_SUCCESS)
304  {
305  TRACE("RegOpenKeyEx() failed with error 0x%lx\n", rc);
306  goto cleanup;
307  }
308  rc = RegQueryValueExW(
309  hKey,
310  L"Installation Sources",
311  NULL,
312  &dwRegType,
313  NULL,
314  &dwPathLength);
315  if (rc != ERROR_SUCCESS || dwRegType != REG_MULTI_SZ)
316  {
317  TRACE("RegQueryValueEx() failed with error 0x%lx\n", rc);
318  goto cleanup;
319  }
320 
321  /* Allocate enough space to add 2 NULL chars at the end of the string */
322  Buffer = HeapAlloc(GetProcessHeap(), 0, dwPathLength + 2 * sizeof(WCHAR));
323  if (!Buffer)
324  {
325  TRACE("HeapAlloc() failed\n");
326  goto cleanup;
327  }
328  rc = RegQueryValueExW(
329  hKey,
330  L"Installation Sources",
331  NULL,
332  NULL,
333  (LPBYTE)Buffer,
334  &dwPathLength);
335  if (rc != ERROR_SUCCESS)
336  {
337  TRACE("RegQueryValueEx() failed with error 0x%lx\n", rc);
338  goto cleanup;
339  }
340 
341  Buffer[dwPathLength / sizeof(WCHAR)] = UNICODE_NULL;
342  Buffer[dwPathLength / sizeof(WCHAR) + 1] = UNICODE_NULL;
343 
344  /* Populate combo box */
345  for (Path = Buffer; *Path; Path += wcslen(Path) + 1)
346  {
347  (void)ComboBox_AddString(hwndCombo, Path);
348  if (Path == Buffer)
349  (void)ComboBox_SetCurSel(hwndCombo, 0);
350  }
351 
352 cleanup:
353  if (hKey != NULL)
354  RegCloseKey(hKey);
356 }
357 
358 static VOID
360  IN HWND hwndCombo)
361 {
362  LPWSTR CustomPath = NULL;
363  DWORD CustomPathLength;
364  LPWSTR Buffer = NULL;
365  LPWSTR pBuffer; /* Pointer into Buffer */
366  int ItemsCount, Length;
367  int i;
368  DWORD TotalLength = 0;
369  BOOL UseCustomPath = TRUE;
370  HKEY hKey = NULL;
371  LONG rc;
372 
373  /* Get custom path */
374  Length = ComboBox_GetTextLength(hwndCombo) + 1;
375  CustomPath = HeapAlloc(GetProcessHeap(), 0, Length * sizeof(WCHAR));
376  if (!CustomPath)
377  {
378  TRACE("HeapAlloc() failed\n");
379  goto cleanup;
380  }
381  CustomPathLength = GetWindowTextW(hwndCombo, CustomPath, Length) + 1;
382 
383  /* Calculate length of the buffer */
384  ItemsCount = ComboBox_GetCount(hwndCombo);
385  if (ItemsCount == CB_ERR)
386  {
387  TRACE("ComboBox_GetCount() failed\n");
388  goto cleanup;
389  }
390  for (i = 0; i < ItemsCount; i++)
391  {
392  Length = ComboBox_GetLBTextLen(hwndCombo, i);
393  if (Length == CB_ERR)
394  {
395  TRACE("ComboBox_GetLBTextLen() failed\n");
396  goto cleanup;
397  }
398  TotalLength += Length + 1;
399  }
400  TotalLength++; /* Final NULL char */
401 
402  /* Allocate buffer */
403  Buffer = HeapAlloc(GetProcessHeap(), 0, (CustomPathLength + TotalLength + 1) * sizeof(WCHAR));
404  if (!Buffer)
405  {
406  TRACE("HeapAlloc() failed\n");
407  goto cleanup;
408  }
409 
410  /* Fill the buffer */
411  pBuffer = &Buffer[CustomPathLength];
412  for (i = 0; i < ItemsCount; i++)
413  {
414  Length = ComboBox_GetLBText(hwndCombo, i, pBuffer);
415  if (Length == CB_ERR)
416  {
417  TRACE("ComboBox_GetLBText() failed\n");
418  goto cleanup;
419  }
420  else if (UseCustomPath && _wcsicmp(CustomPath, pBuffer) == 0)
421  UseCustomPath = FALSE;
422  pBuffer += 1 + Length;
423  }
424  *pBuffer = '\0'; /* Add final NULL char */
425 
426  if (!UseCustomPath)
427  {
428  /* Nothing to save to registry */
429  goto cleanup;
430  }
431 
432  TotalLength += CustomPathLength;
433  wcscpy(Buffer, CustomPath);
434 
435  /* Save the buffer */
436  /* RegSetKeyValue would have been better... */
437  rc = RegOpenKeyEx(
440  0,
442  &hKey);
443  if (rc != ERROR_SUCCESS)
444  {
445  TRACE("RegOpenKeyEx() failed with error 0x%lx\n", rc);
446  goto cleanup;
447  }
448  rc = RegSetValueExW(
449  hKey,
450  L"Installation Sources",
451  0,
452  REG_MULTI_SZ,
453  (const BYTE*)Buffer,
454  TotalLength * sizeof(WCHAR));
455  if (rc != ERROR_SUCCESS)
456  {
457  TRACE("RegSetValueEx() failed with error 0x%lx\n", rc);
458  goto cleanup;
459  }
460 
461 cleanup:
462  if (hKey != NULL)
463  RegCloseKey(hKey);
464  HeapFree(GetProcessHeap(), 0, CustomPath);
466 }
467 
468 static INT_PTR CALLBACK
470  IN HWND hwndDlg,
471  IN UINT uMsg,
472  IN WPARAM wParam,
473  IN LPARAM lParam)
474 {
475  PDEVINSTDATA DevInstData;
477 
478  /* Retrieve pointer to the global setup data */
479  DevInstData = (PDEVINSTDATA)GetWindowLongPtr(hwndDlg, GWLP_USERDATA);
480 
481  switch (uMsg)
482  {
483  case WM_INITDIALOG:
484  {
485  HWND hwndControl;
486  DWORD dwStyle;
487 
488  /* Get pointer to the global setup data */
489  DevInstData = (PDEVINSTDATA)((LPPROPSHEETPAGE)lParam)->lParam;
490  SetWindowLongPtr(hwndDlg, GWLP_USERDATA, (DWORD_PTR)DevInstData);
491 
492  hwndControl = GetParent(hwndDlg);
493 
494  /* Center the wizard window */
495  CenterWindow(hwndControl);
496 
497  /* Hide the system menu */
498  dwStyle = GetWindowLongPtr(hwndControl, GWL_STYLE);
499  SetWindowLongPtr(hwndControl, GWL_STYLE, dwStyle & ~WS_SYSMENU);
500 
501  /* Set title font */
503  hwndDlg,
505  WM_SETFONT,
506  (WPARAM)DevInstData->hTitleFont,
507  (LPARAM)TRUE);
508 
510  hwndDlg,
511  IDC_DEVICE,
512  WM_SETTEXT,
513  0,
514  (LPARAM)DevInstData->buffer);
515 
517  hwndDlg,
519  BM_SETCHECK,
520  (WPARAM)TRUE,
521  (LPARAM)0);
522 
523  if (!DevInstData->bUpdate)
524  {
525  SetFailedInstall(DevInstData->hDevInfo,
526  &DevInstData->devInfoData,
527  TRUE);
528  }
529  break;
530  }
531 
532  case WM_NOTIFY:
533  {
534  LPNMHDR lpnm = (LPNMHDR)lParam;
535 
536  switch (lpnm->code)
537  {
538  case PSN_SETACTIVE:
539  /* Enable the Next button */
541  break;
542 
543  case PSN_WIZNEXT:
544  /* Handle a Next button click, if necessary */
546  {
547  if (PrepareFoldersToScan(DevInstData, TRUE, FALSE, NULL))
549  else
551  }
552  return TRUE;
553 
554  default:
555  break;
556  }
557  break;
558  }
559 
560  default:
561  break;
562  }
563 
564  return FALSE;
565 }
566 
567 static void
569 {
572 }
573 
574 static void
576 {
580 }
581 
582 static INT_PTR CALLBACK
584  IN HWND hwndDlg,
585  IN UINT uMsg,
586  IN WPARAM wParam,
587  IN LPARAM lParam)
588 {
589  PDEVINSTDATA DevInstData;
590 
591  /* Retrieve pointer to the global setup data */
592  DevInstData = (PDEVINSTDATA)GetWindowLongPtr(hwndDlg, GWLP_USERDATA);
593 
594  switch (uMsg)
595  {
596  case WM_INITDIALOG:
597  {
598  HWND hwndControl, hwndCombo;
599  DWORD dwStyle;
600  COMBOBOXINFO info = { sizeof(info) };
601 
602  /* Get pointer to the global setup data */
603  DevInstData = (PDEVINSTDATA)((LPPROPSHEETPAGE)lParam)->lParam;
604  SetWindowLongPtr(hwndDlg, GWLP_USERDATA, (DWORD_PTR)DevInstData);
605 
606  hwndControl = GetParent(hwndDlg);
607 
608  /* Center the wizard window */
609  CenterWindow(hwndControl);
610 
611  /* Hide the system menu */
612  dwStyle = GetWindowLongPtr(hwndControl, GWL_STYLE);
613  SetWindowLongPtr(hwndControl, GWL_STYLE, dwStyle & ~WS_SYSMENU);
614 
615  hwndCombo = GetDlgItem(hwndDlg, IDC_COMBO_PATH);
616  PopulateCustomPathCombo(hwndCombo);
617 
618  GetComboBoxInfo(hwndCombo, &info);
620 
622  hwndDlg,
624  BM_SETCHECK,
625  (WPARAM)TRUE,
626  (LPARAM)0);
627  AutoDriver(hwndDlg, TRUE);
628  IncludePath(hwndDlg, FALSE);
629 
630  /* Disable manual driver choice for now */
632 
633  break;
634  }
635 
636  case WM_COMMAND:
637  {
638  switch (LOWORD(wParam))
639  {
641  AutoDriver(hwndDlg, TRUE);
642  return TRUE;
643 
644  case IDC_RADIO_CHOOSE:
645  AutoDriver(hwndDlg, FALSE);
646  return TRUE;
647 
648  case IDC_CHECK_PATH:
649  IncludePath(hwndDlg, IsDlgButtonChecked(hwndDlg, IDC_CHECK_PATH));
650  return TRUE;
651 
652  case IDC_BROWSE:
653  {
654  BROWSEINFO bi = { 0 };
655  LPITEMIDLIST pidl;
658 
659  bi.hwndOwner = hwndDlg;
661  bi.lpszTitle = Title;
662  pidl = SHBrowseForFolder(&bi);
663  if (pidl)
664  {
666  IMalloc* malloc;
667 
668  if (SHGetPathFromIDListW(pidl, Directory))
669  {
670  /* Set the IDC_COMBO_PATH text */
672  }
673 
674  /* Free memory, if possible */
676  {
677  IMalloc_Free(malloc, pidl);
678  IMalloc_Release(malloc);
679  }
680  return TRUE;
681  }
682  break;
683  }
684  }
685  break;
686  }
687 
688  case WM_NOTIFY:
689  {
690  LPNMHDR lpnm = (LPNMHDR)lParam;
691 
692  switch (lpnm->code)
693  {
694  case PSN_SETACTIVE:
695  /* Enable the Next and Back buttons */
697  break;
698 
699  case PSN_WIZNEXT:
700  /* Handle a Next button click, if necessary */
702  {
704  HeapFree(GetProcessHeap(), 0, DevInstData->CustomSearchPath);
705  DevInstData->CustomSearchPath = NULL;
707  DevInstData,
710  GetDlgItem(hwndDlg, IDC_COMBO_PATH)))
711  {
713  }
714  else
715  {
717  }
718  }
719  else
720  {
721  /* FIXME */;
722  }
723  return TRUE;
724 
725  default:
726  break;
727  }
728  break;
729  }
730 
731  default:
732  break;
733  }
734 
735  return FALSE;
736 }
737 
738 static INT_PTR CALLBACK
740  IN HWND hwndDlg,
741  IN UINT uMsg,
742  IN WPARAM wParam,
743  IN LPARAM lParam)
744 {
745  PDEVINSTDATA DevInstData;
747 
748  /* Retrieve pointer to the global setup data */
749  DevInstData = (PDEVINSTDATA)GetWindowLongPtr(hwndDlg, GWLP_USERDATA);
750 
751  switch (uMsg)
752  {
753  case WM_INITDIALOG:
754  {
755  HWND hwndControl;
756  DWORD dwStyle;
757 
758  /* Get pointer to the global setup data */
759  DevInstData = (PDEVINSTDATA)((LPPROPSHEETPAGE)lParam)->lParam;
760  SetWindowLongPtr(hwndDlg, GWLP_USERDATA, (DWORD_PTR)DevInstData);
761 
762  DevInstData->hDialog = hwndDlg;
763  hwndControl = GetParent(hwndDlg);
764 
765  /* Center the wizard window */
766  CenterWindow(hwndControl);
767 
769  hwndDlg,
770  IDC_DEVICE,
771  WM_SETTEXT,
772  0,
773  (LPARAM)DevInstData->buffer);
774 
775  /* Hide the system menu */
776  dwStyle = GetWindowLongPtr(hwndControl, GWL_STYLE);
777  SetWindowLongPtr(hwndControl, GWL_STYLE, dwStyle & ~WS_SYSMENU);
778  break;
779  }
780 
781  case WM_SEARCH_FINISHED:
782  {
784  hThread = 0;
785  if (wParam == 0)
787  else
789  break;
790  }
791 
792  case WM_NOTIFY:
793  {
794  LPNMHDR lpnm = (LPNMHDR)lParam;
795 
796  switch (lpnm->code)
797  {
798  case PSN_SETACTIVE:
800  /* Yes, we can safely ignore the problem (if any) */
802  DevInstData->hDevInfo,
803  &DevInstData->devInfoData,
805  hThread = CreateThread(NULL, 0, FindDriverProc, DevInstData, 0, &dwThreadId);
806  break;
807 
808  case PSN_KILLACTIVE:
809  if (hThread != 0)
810  {
812  return TRUE;
813  }
814  break;
815 
816  case PSN_WIZNEXT:
817  /* Handle a Next button click, if necessary */
818  break;
819 
820  default:
821  break;
822  }
823  break;
824  }
825 
826  default:
827  break;
828  }
829 
830  return FALSE;
831 }
832 
833 static INT_PTR CALLBACK
835  IN HWND hwndDlg,
836  IN UINT uMsg,
837  IN WPARAM wParam,
838  IN LPARAM lParam)
839 {
840  PDEVINSTDATA DevInstData;
842 
843  /* Retrieve pointer to the global setup data */
844  DevInstData = (PDEVINSTDATA)GetWindowLongPtr(hwndDlg, GWLP_USERDATA);
845 
846  switch (uMsg)
847  {
848  case WM_INITDIALOG:
849  {
850  HWND hwndControl;
851  DWORD dwStyle;
852 
853  /* Get pointer to the global setup data */
854  DevInstData = (PDEVINSTDATA)((LPPROPSHEETPAGE)lParam)->lParam;
855  SetWindowLongPtr(hwndDlg, GWLP_USERDATA, (DWORD_PTR)DevInstData);
856 
857  DevInstData->hDialog = hwndDlg;
858  hwndControl = GetParent(hwndDlg);
859 
860  /* Center the wizard window */
861  CenterWindow(hwndControl);
862 
864  hwndDlg,
865  IDC_DEVICE,
866  WM_SETTEXT,
867  0,
868  (LPARAM)DevInstData->drvInfoData.Description);
869 
870  /* Hide the system menu */
871  dwStyle = GetWindowLongPtr(hwndControl, GWL_STYLE);
872  SetWindowLongPtr(hwndControl, GWL_STYLE, dwStyle & ~WS_SYSMENU);
873  break;
874  }
875 
876  case WM_INSTALL_FINISHED:
877  {
879  hThread = 0;
880  if (wParam == 0)
881  {
882  SP_DEVINSTALL_PARAMS installParams;
883 
884  SetFailedInstall(DevInstData->hDevInfo,
885  &DevInstData->devInfoData,
886  FALSE);
887 
888  /* Should we reboot? */
889  installParams.cbSize = sizeof(SP_DEVINSTALL_PARAMS);
891  DevInstData->hDevInfo,
892  &DevInstData->devInfoData,
893  &installParams))
894  {
895  if (installParams.Flags & (DI_NEEDRESTART | DI_NEEDREBOOT))
896  {
898  }
899  else
901  break;
902  }
903  }
905  break;
906  }
907 
908  case WM_NOTIFY:
909  {
910  LPNMHDR lpnm = (LPNMHDR)lParam;
911 
912  switch (lpnm->code)
913  {
914  case PSN_SETACTIVE:
916  hThread = CreateThread(NULL, 0, InstallDriverProc, DevInstData, 0, &dwThreadId);
917  break;
918 
919  case PSN_KILLACTIVE:
920  if (hThread != 0)
921  {
923  return TRUE;
924  }
925  break;
926 
927  case PSN_WIZNEXT:
928  /* Handle a Next button click, if necessary */
929  break;
930 
931  default:
932  break;
933  }
934  break;
935  }
936 
937  default:
938  break;
939  }
940 
941  return FALSE;
942 }
943 
944 static INT_PTR CALLBACK
946  IN HWND hwndDlg,
947  IN UINT uMsg,
948  IN WPARAM wParam,
949  IN LPARAM lParam)
950 {
951  PDEVINSTDATA DevInstData;
952  HWND hwndControl;
953 
955 
956  /* Get pointer to the global setup data */
957  DevInstData = (PDEVINSTDATA)GetWindowLongPtr(hwndDlg, GWLP_USERDATA);
958 
959  switch (uMsg)
960  {
961  case WM_INITDIALOG:
962  {
963  BOOL DisableableDevice = FALSE;
964 
965  /* Get pointer to the global setup data */
966  DevInstData = (PDEVINSTDATA)((LPPROPSHEETPAGE)lParam)->lParam;
967  SetWindowLongPtr(hwndDlg, GWLP_USERDATA, (DWORD_PTR)DevInstData);
968 
969  /* Center the wizard window */
970  CenterWindow(GetParent(hwndDlg));
971 
972  hwndControl = GetDlgItem(GetParent(hwndDlg), IDCANCEL);
973  ShowWindow(hwndControl, SW_HIDE);
974  EnableWindow(hwndControl, FALSE);
975 
976  /* Set title font */
978  hwndDlg,
980  WM_SETFONT,
981  (WPARAM)DevInstData->hTitleFont,
982  (LPARAM)TRUE);
983 
984  /* disable the "do not show this dialog anymore" checkbox
985  if the device cannot be disabled */
987  DevInstData->devInfoData.DevInst,
988  NULL,
989  &DisableableDevice);
990  EnableWindow(
991  GetDlgItem(hwndDlg, IDC_DONOTSHOWDLG),
992  DisableableDevice);
993  break;
994  }
995 
996  case WM_NOTIFY:
997  {
998  LPNMHDR lpnm = (LPNMHDR)lParam;
999 
1000  switch (lpnm->code)
1001  {
1002  case PSN_SETACTIVE:
1003  /* Enable the correct buttons on for the active page */
1005  break;
1006 
1007  case PSN_WIZBACK:
1008  /* Handle a Back button click, if necessary */
1009  hwndControl = GetDlgItem(GetParent(hwndDlg), IDCANCEL);
1010  ShowWindow(hwndControl, SW_SHOW);
1011  EnableWindow(hwndControl, TRUE);
1013  return TRUE;
1014 
1015  case PSN_WIZFINISH:
1016  {
1017  BOOL DisableableDevice = FALSE;
1018  BOOL IsStarted = FALSE;
1019 
1020  if (CanDisableDevice(DevInstData->devInfoData.DevInst,
1021  NULL,
1022  &DisableableDevice) &&
1023  DisableableDevice &&
1025  DevInstData->devInfoData.DevInst,
1026  NULL,
1027  &IsStarted) &&
1028  !IsStarted &&
1030  hwndDlg,
1032  BM_GETCHECK,
1033  (WPARAM)0, (LPARAM)0) == BST_CHECKED)
1034  {
1035  /* disable the device */
1036  StartDevice(
1037  DevInstData->hDevInfo,
1038  &DevInstData->devInfoData,
1039  FALSE,
1040  0,
1041  NULL);
1042  }
1043  else
1044  {
1045  SetFailedInstall(DevInstData->hDevInfo,
1046  &DevInstData->devInfoData,
1047  FALSE);
1048  }
1049  break;
1050  }
1051 
1052  default:
1053  break;
1054  }
1055  break;
1056  }
1057 
1058  default:
1059  break;
1060  }
1061 
1062  return FALSE;
1063 }
1064 
1065 static INT_PTR CALLBACK
1067  IN HWND hwndDlg,
1068  IN UINT uMsg,
1069  IN WPARAM wParam,
1070  IN LPARAM lParam)
1071 {
1072  PDEVINSTDATA DevInstData;
1074 
1075  /* Retrieve pointer to the global setup data */
1076  DevInstData = (PDEVINSTDATA)GetWindowLongPtr(hwndDlg, GWLP_USERDATA);
1077 
1078  switch (uMsg)
1079  {
1080  case WM_INITDIALOG:
1081  {
1082  HWND hwndControl;
1083 
1084  /* Get pointer to the global setup data */
1085  DevInstData = (PDEVINSTDATA)((LPPROPSHEETPAGE)lParam)->lParam;
1086  SetWindowLongPtr(hwndDlg, GWLP_USERDATA, (DWORD_PTR)DevInstData);
1087 
1088  /* Center the wizard window */
1089  CenterWindow(GetParent(hwndDlg));
1090 
1091  hwndControl = GetDlgItem(GetParent(hwndDlg), IDCANCEL);
1092  ShowWindow(hwndControl, SW_HIDE);
1093  EnableWindow(hwndControl, FALSE);
1094 
1096  hwndDlg,
1097  IDC_DEVICE,
1098  WM_SETTEXT,
1099  0,
1100  (LPARAM)DevInstData->drvInfoData.Description);
1101 
1102  /* Set title font */
1104  hwndDlg,
1106  WM_SETFONT,
1107  (WPARAM)DevInstData->hTitleFont,
1108  (LPARAM)TRUE);
1109  break;
1110  }
1111 
1112  case WM_NOTIFY:
1113  {
1114  LPNMHDR lpnm = (LPNMHDR)lParam;
1115 
1116  switch (lpnm->code)
1117  {
1118  case PSN_SETACTIVE:
1119  /* Enable the correct buttons on for the active page */
1121  break;
1122 
1123  case PSN_WIZBACK:
1124  /* Handle a Back button click, if necessary */
1125  break;
1126 
1127  case PSN_WIZFINISH:
1128  /* Handle a Finish button click, if necessary */
1129  break;
1130 
1131  default:
1132  break;
1133  }
1134  break;
1135  }
1136 
1137  default:
1138  break;
1139  }
1140 
1141  return FALSE;
1142 }
1143 
1144 static INT_PTR CALLBACK
1146  IN HWND hwndDlg,
1147  IN UINT uMsg,
1148  IN WPARAM wParam,
1149  IN LPARAM lParam)
1150 {
1151  PDEVINSTDATA DevInstData;
1153 
1154  /* Retrieve pointer to the global setup data */
1155  DevInstData = (PDEVINSTDATA)GetWindowLongPtr(hwndDlg, GWLP_USERDATA);
1156 
1157  switch (uMsg)
1158  {
1159  case WM_INITDIALOG:
1160  {
1161  HWND hwndControl;
1162 
1163  /* Get pointer to the global setup data */
1164  DevInstData = (PDEVINSTDATA)((LPPROPSHEETPAGE)lParam)->lParam;
1165  SetWindowLongPtr(hwndDlg, GWLP_USERDATA, (DWORD_PTR)DevInstData);
1166 
1167  /* Center the wizard window */
1168  CenterWindow(GetParent(hwndDlg));
1169 
1170  hwndControl = GetDlgItem(GetParent(hwndDlg), IDCANCEL);
1171  ShowWindow(hwndControl, SW_HIDE);
1172  EnableWindow(hwndControl, FALSE);
1173 
1175  hwndDlg,
1176  IDC_DEVICE,
1177  WM_SETTEXT,
1178  0,
1179  (LPARAM)DevInstData->drvInfoData.Description);
1180 
1181  /* Set title font */
1183  hwndDlg,
1185  WM_SETFONT,
1186  (WPARAM)DevInstData->hTitleFont,
1187  (LPARAM)TRUE);
1188  break;
1189  }
1190 
1191  case WM_NOTIFY:
1192  {
1193  LPNMHDR lpnm = (LPNMHDR)lParam;
1194 
1195  switch (lpnm->code)
1196  {
1197  case PSN_SETACTIVE:
1198  /* Enable the correct buttons on for the active page */
1200  break;
1201 
1202  case PSN_WIZBACK:
1203  /* Handle a Back button click, if necessary */
1204  break;
1205 
1206  case PSN_WIZFINISH:
1207  /* Handle a Finish button click, if necessary */
1208  break;
1209 
1210  default:
1211  break;
1212  }
1213  break;
1214  }
1215 
1216  default:
1217  break;
1218  }
1219 
1220  return FALSE;
1221 }
1222 
1223 static INT_PTR CALLBACK
1225  IN HWND hwndDlg,
1226  IN UINT uMsg,
1227  IN WPARAM wParam,
1228  IN LPARAM lParam)
1229 {
1230  PDEVINSTDATA DevInstData;
1232 
1233  /* Retrieve pointer to the global setup data */
1234  DevInstData = (PDEVINSTDATA)GetWindowLongPtr(hwndDlg, GWLP_USERDATA);
1235 
1236  switch (uMsg)
1237  {
1238  case WM_INITDIALOG:
1239  {
1240  HWND hwndControl;
1241 
1242  /* Get pointer to the global setup data */
1243  DevInstData = (PDEVINSTDATA)((LPPROPSHEETPAGE)lParam)->lParam;
1244  SetWindowLongPtr(hwndDlg, GWLP_USERDATA, (DWORD_PTR)DevInstData);
1245 
1246  /* Center the wizard window */
1247  CenterWindow(GetParent(hwndDlg));
1248 
1249  hwndControl = GetDlgItem(GetParent(hwndDlg), IDCANCEL);
1250  ShowWindow(hwndControl, SW_HIDE);
1251  EnableWindow(hwndControl, FALSE);
1252 
1254  hwndDlg,
1255  IDC_DEVICE,
1256  WM_SETTEXT,
1257  0,
1258  (LPARAM)DevInstData->drvInfoData.Description);
1259 
1260  /* Set title font */
1262  hwndDlg,
1264  WM_SETFONT,
1265  (WPARAM)DevInstData->hTitleFont,
1266  (LPARAM)TRUE);
1267  break;
1268  }
1269 
1270  case WM_NOTIFY:
1271  {
1272  LPNMHDR lpnm = (LPNMHDR)lParam;
1273 
1274  switch (lpnm->code)
1275  {
1276  case PSN_SETACTIVE:
1277  /* Enable the correct buttons on for the active page */
1279  break;
1280 
1281  case PSN_WIZBACK:
1282  /* Handle a Back button click, if necessary */
1283  break;
1284 
1285  case PSN_WIZFINISH:
1286  /* Handle a Finish button click, if necessary */
1287  break;
1288 
1289  default:
1290  break;
1291  }
1292  break;
1293  }
1294 
1295  default:
1296  break;
1297  }
1298 
1299  return FALSE;
1300 }
1301 
1302 static HFONT
1304 {
1305  NONCLIENTMETRICSW ncm;
1306  LOGFONTW LogFont;
1307  HDC hdc;
1308  INT FontSize;
1309  HFONT hFont;
1310 
1311  ncm.cbSize = sizeof(NONCLIENTMETRICSW);
1312  SystemParametersInfo(SPI_GETNONCLIENTMETRICS, 0, &ncm, 0);
1313 
1314  LogFont = ncm.lfMessageFont;
1315  LogFont.lfWeight = FW_BOLD;
1316  wcscpy(LogFont.lfFaceName, L"MS Shell Dlg");
1317 
1318  hdc = GetDC(NULL);
1319  FontSize = 12;
1320  LogFont.lfHeight = 0 - GetDeviceCaps (hdc, LOGPIXELSY) * FontSize / 72;
1321  hFont = CreateFontIndirectW(&LogFont);
1322  ReleaseDC(NULL, hdc);
1323 
1324  return hFont;
1325 }
1326 
1327 BOOL
1329  IN PDEVINSTDATA DevInstData,
1330  IN HWND hwndParent,
1331  IN UINT startPage)
1332 {
1333  PROPSHEETHEADER psh = {0};
1334  HPROPSHEETPAGE ahpsp[IDD_MAXIMUMPAGE + 1];
1335  PROPSHEETPAGE psp = {0};
1336  HRESULT hr = CoInitialize(NULL); /* for SHAutoComplete */
1337 
1338  /* zero based index */
1339  startPage -= IDD_FIRSTPAGE;
1340 
1341  /* Create the Welcome page */
1342  ZeroMemory(&psp, sizeof(PROPSHEETPAGE));
1343  psp.dwSize = sizeof(PROPSHEETPAGE);
1344  psp.dwFlags = PSP_DEFAULT | PSP_HIDEHEADER | PSP_USETITLE;
1345  psp.hInstance = hDllInstance;
1346  psp.lParam = (LPARAM)DevInstData;
1347  psp.pszTitle = MAKEINTRESOURCE(DevInstData->bUpdate ? IDS_UPDATEWIZARDTITLE : IDS_INSTALLWIZARDTITLE);
1348  psp.pfnDlgProc = WelcomeDlgProc;
1349  psp.pszTemplate = MAKEINTRESOURCE(IDD_WELCOMEPAGE);
1351 
1352  /* Create the Select Source page */
1353  psp.dwFlags = PSP_DEFAULT | PSP_USEHEADERTITLE | PSP_USETITLE;
1354  psp.pszHeaderTitle = MAKEINTRESOURCE(IDS_CHSOURCE_TITLE);
1355  psp.pfnDlgProc = CHSourceDlgProc;
1356  psp.pszTemplate = MAKEINTRESOURCE(IDD_CHSOURCE);
1358 
1359  /* Create the Search driver page */
1360  psp.dwFlags = PSP_DEFAULT | PSP_USEHEADERTITLE | PSP_USETITLE;
1361  psp.pszHeaderTitle = MAKEINTRESOURCE(IDS_SEARCHDRV_TITLE);
1362  psp.pfnDlgProc = SearchDrvDlgProc;
1363  psp.pszTemplate = MAKEINTRESOURCE(IDD_SEARCHDRV);
1365 
1366  /* Create the Install driver page */
1367  psp.dwFlags = PSP_DEFAULT | PSP_USEHEADERTITLE | PSP_USETITLE;
1368  psp.pszHeaderTitle = MAKEINTRESOURCE(IDS_INSTALLDRV_TITLE);
1369  psp.pfnDlgProc = InstallDrvDlgProc;
1370  psp.pszTemplate = MAKEINTRESOURCE(IDD_INSTALLDRV);
1372 
1373  /* Create the No driver page */
1374  psp.dwFlags = PSP_DEFAULT | PSP_HIDEHEADER | PSP_USETITLE;
1375  psp.pfnDlgProc = NoDriverDlgProc;
1376  psp.pszTemplate = MAKEINTRESOURCE(IDD_NODRIVER);
1378 
1379  /* Create the Install failed page */
1380  psp.dwFlags = PSP_DEFAULT | PSP_HIDEHEADER | PSP_USETITLE;
1381  psp.pfnDlgProc = InstallFailedDlgProc;
1382  psp.pszTemplate = MAKEINTRESOURCE(IDD_INSTALLFAILED);
1384 
1385  /* Create the Need reboot page */
1386  psp.dwFlags = PSP_DEFAULT | PSP_HIDEHEADER | PSP_USETITLE;
1387  psp.pfnDlgProc = NeedRebootDlgProc;
1388  psp.pszTemplate = MAKEINTRESOURCE(IDD_NEEDREBOOT);
1390 
1391  /* Create the Finish page */
1392  psp.dwFlags = PSP_DEFAULT | PSP_HIDEHEADER | PSP_USETITLE;
1393  psp.pfnDlgProc = FinishDlgProc;
1394  psp.pszTemplate = MAKEINTRESOURCE(IDD_FINISHPAGE);
1396 
1397  /* Create the property sheet */
1398  psh.dwSize = sizeof(PROPSHEETHEADER);
1399  psh.dwFlags = PSH_WIZARD97 | PSH_WATERMARK | PSH_HEADER;
1400  psh.hInstance = hDllInstance;
1401  psh.hwndParent = hwndParent;
1402  psh.nPages = IDD_MAXIMUMPAGE + 1;
1403  psh.nStartPage = startPage;
1404  psh.phpage = ahpsp;
1405  psh.pszbmWatermark = MAKEINTRESOURCE(IDB_WATERMARK);
1406  psh.pszbmHeader = MAKEINTRESOURCE(IDB_HEADER);
1407 
1408  /* Create title font */
1409  DevInstData->hTitleFont = CreateTitleFont();
1410 
1411  /* Display the wizard */
1412  PropertySheet(&psh);
1413 
1414  DeleteObject(DevInstData->hTitleFont);
1415 
1416  if (SUCCEEDED(hr))
1417  CoUninitialize();
1418  return TRUE;
1419 }
#define IDC_DEVICE
Definition: resource.h:8
#define IDC_CHECK_MEDIA
Definition: resource.h:14
static VOID CenterWindow(IN HWND hWnd)
Definition: wizard.c:31
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:3592
#define MAKEINTRESOURCE
Definition: winuser.h:591
#define IN
Definition: typedefs.h:39
SP_DEVINFO_DATA devInfoData
#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:834
#define CloseHandle
Definition: compat.h:598
_In_ ULONG _In_ ULONG _In_ ULONG Length
Definition: ntddpcm.h:101
struct png_info_def **typedef void(__cdecl typeof(png_destroy_read_struct))(struct png_struct_def **
Definition: typeof.h:49
#define IDC_RADIO_AUTO
Definition: resource.h:9
#define ComboBox_AddString(hwndCtl, lpsz)
Definition: windowsx.h:16
#define ERROR_SUCCESS
Definition: deptool.c:10
HRESULT hr
Definition: shlfolder.c:183
#define KEY_SET_VALUE
Definition: nt_native.h:1017
GLuint64EXT * result
Definition: glext.h:11304
const WCHAR * LPCWSTR
Definition: xmlstorage.h:185
#define ComboBox_GetLBText(hwndCtl, index, lpszBuffer)
Definition: windowsx.h:31
#define DI_NEEDREBOOT
Definition: setupapi.h:54
HDC WINAPI GetDC(_In_opt_ HWND)
#define TRUE
Definition: types.h:120
#define UNREFERENCED_PARAMETER(P)
Definition: ntbasedef.h:317
#define SW_HIDE
Definition: winuser.h:762
#define IDC_BROWSE
Definition: resource.h:21
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:7748
#define SetupDiGetDeviceInstallParams
Definition: setupapi.h:2599
static VOID PopulateCustomPathCombo(IN HWND hwndCombo)
Definition: wizard.c:284
LONG lfHeight
Definition: dimm.idl:59
BOOL WINAPI SHGetPathFromIDListW(LPCITEMIDLIST pidl, LPWSTR pszPath)
Definition: pidl.c:1294
static HDC
Definition: imagelist.c:92
static VOID SaveCustomPath(IN HWND hwndCombo)
Definition: wizard.c:359
#define CALLBACK
Definition: compat.h:35
#define IDS_BROWSE_FOR_FOLDER_TITLE
Definition: resource.h:37
HWND hWnd
Definition: settings.c:17
#define SystemParametersInfo
Definition: winuser.h:5838
#define IDS_INSTALLWIZARDTITLE
Definition: resource.h:32
LONG top
Definition: windef.h:307
#define PSWIZB_NEXT
Definition: prsht.h:154
#define IDD_NEEDREBOOT
Definition: resource.h:27
HRESULT WINAPI SHGetMalloc(LPMALLOC *lpmal)
Definition: shellole.c:285
#define DN_DISABLEABLE
Definition: cfg.h:131
#define IDS_INSTALLDRV_TITLE
Definition: resource.h:36
static void IncludePath(HWND Dlg, BOOL Enabled)
Definition: wizard.c:568
DWORD WINAPI GetLastError(VOID)
Definition: except.c:1040
#define ZeroMemory
Definition: winbase.h:1667
BOOL WINAPI DeleteObject(_In_ HGDIOBJ)
#define HWND_TOP
Definition: winuser.h:1197
BOOL DisplayWizard(IN PDEVINSTDATA DevInstData, IN HWND hwndParent, IN UINT startPage)
Definition: wizard.c:1328
#define IDD_SEARCHDRV
Definition: resource.h:23
#define SetupDiGetDeviceRegistryProperty
Definition: setupapi.h:2603
LPWSTR CustomSearchPath
#define IDD_NODRIVER
Definition: resource.h:25
BOOL WINAPI SetWindowTextW(_In_ HWND, _In_opt_ LPCWSTR)
#define IDS_UPDATEWIZARDTITLE
Definition: resource.h:33
UINT_PTR WPARAM
Definition: windef.h:207
#define BIF_NONEWFOLDERBUTTON
Definition: shlobj.h:1154
BOOL WINAPI SetupDiCallClassInstaller(DI_FUNCTION InstallFunction, HDEVINFO DeviceInfoSet, PSP_DEVINFO_DATA DeviceInfoData)
Definition: devinst.c:4024
#define SendDlgItemMessage
Definition: winuser.h:5822
LONG left
Definition: windef.h:306
BOOL WINAPI ShowWindow(_In_ HWND, _In_ int)
#define DIF_PROPERTYCHANGE
Definition: setupapi.h:137
int32_t INT_PTR
Definition: typedefs.h:64
_In_ ULONG TotalLength
Definition: usbdlib.h:158
#define ComboBox_GetTextLength(hwndCtl)
Definition: windowsx.h:34
#define DICS_ENABLE
Definition: setupapi.h:112
LONG right
Definition: windef.h:308
#define BROWSEINFO
Definition: shlobj.h:1137
#define IDB_HEADER
Definition: resource.h:30
#define PSN_SETACTIVE
Definition: prsht.h:115
int WINAPI LoadStringW(_In_opt_ HINSTANCE hInstance, _In_ UINT uID, _Out_writes_to_(cchBufferMax, return+1) LPWSTR lpBuffer, _In_ int cchBufferMax)
int32_t INT
Definition: typedefs.h:58
#define IDC_RADIO_CHOOSE
Definition: resource.h:13
#define SetWindowLongPtr
Definition: treelist.c:70
WPARAM wParam
Definition: combotst.c:138
#define IDC_DONOTSHOWDLG
Definition: resource.h:11
static INT_PTR CALLBACK NoDriverDlgProc(IN HWND hwndDlg, IN UINT uMsg, IN WPARAM wParam, IN LPARAM lParam)
Definition: wizard.c:945
HFONT hFont
Definition: main.c:53
#define DWLP_MSGRESULT
Definition: winuser.h:864
struct tagNMHDR * LPNMHDR
static BOOL Set
Definition: pageheap.c:10
#define SPDRP_CLASSGUID
Definition: setupapi.h:515
static BOOL IsDeviceStarted(IN DEVINST DevInst, IN HMACHINE hMachine, OUT BOOL *IsEnabled)
Definition: wizard.c:148
UINT code
Definition: winuser.h:3139
#define CM_SET_DEVNODE_PROBLEM_OVERRIDE
Definition: cfgmgr32.h:807
#define WM_INSTALL_FINISHED
static DWORD WINAPI InstallDriverProc(IN LPVOID lpParam)
Definition: wizard.c:271
#define L(x)
Definition: ntvdm.h:50
unsigned char * LPBYTE
Definition: typedefs.h:53
#define PSN_KILLACTIVE
Definition: prsht.h:116
#define FALSE
Definition: types.h:117
#define UNICODE_NULL
#define PSN_WIZFINISH
Definition: prsht.h:122
unsigned int BOOL
Definition: ntddk_ex.h:94
long LONG
Definition: pedump.c:60
static struct _test_info info[]
Definition: SetCursorPos.c:19
if SUCCEEDED(hr)
#define DICS_DISABLE
Definition: setupapi.h:114
#define REG_MULTI_SZ
Definition: nt_native.h:1501
struct _PSP * HPROPSHEETPAGE
Definition: mstask.idl:90
#define IDD_CHSOURCE
Definition: resource.h:22
int WINAPI ReleaseDC(_In_opt_ HWND, _In_ HDC)
#define IDD_FIRSTPAGE
Definition: resource.h:29
#define CR_SUCCESS
Definition: cfgmgr32.h:842
#define GWLP_USERDATA
Definition: treelist.c:63
unsigned char BOOLEAN
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:137
#define LPPROPSHEETPAGE
Definition: prsht.h:390
HFONT WINAPI CreateFontIndirectW(_In_ const LOGFONTW *)
PVOID pBuffer
HWND WINAPI GetDesktopWindow(void)
Definition: window.c:656
#define PROPSHEETHEADER
Definition: prsht.h:392
static HWND hwndParent
Definition: cryptui.c:300
#define PSN_WIZNEXT
Definition: prsht.h:121
LONG_PTR LPARAM
Definition: windef.h:208
#define BM_GETCHECK
Definition: winuser.h:1905
Definition: bufpool.h:45
#define SPDIT_COMPATDRIVER
Definition: setupapi.h:506
#define SW_SHOW
Definition: winuser.h:769
#define PropSheet_SetWizButtons(d, f)
Definition: prsht.h:357
static INT_PTR CALLBACK SearchDrvDlgProc(IN HWND hwndDlg, IN UINT uMsg, IN WPARAM wParam, IN LPARAM lParam)
Definition: wizard.c:739
#define WM_SETTEXT
Definition: winuser.h:1604
UINT WINAPI IsDlgButtonChecked(_In_ HWND, _In_ int)
#define CB_ERR
Definition: winuser.h:2415
#define IDD_WELCOMEPAGE
Definition: resource.h:21
#define CreatePropertySheetPage
Definition: prsht.h:399
#define SHBrowseForFolder
Definition: shlobj.h:1180
HRESULT WINAPI SHAutoComplete(HWND hwndEdit, DWORD dwFlags)
Definition: autocomp.cpp:191
#define PostMessage
Definition: winuser.h:5812
static HINSTANCE hDllInstance
Definition: clb.c:30
#define IDC_FINISHTITLE
Definition: resource.h:60
#define PSWIZB_FINISH
Definition: prsht.h:155
Status
Definition: gdiplustypes.h:24
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:4899
SP_CLASSINSTALL_HEADER ClassInstallHeader
Definition: setupapi.h:916
#define PSP_DEFAULT
Definition: prsht.h:22
#define BM_SETCHECK
Definition: winuser.h:1908
#define ComboBox_GetCount(hwndCtl)
Definition: windowsx.h:23
#define TRACE(s)
Definition: solgame.cpp:4
#define BIF_STATUSTEXT
Definition: shlobj.h:1146
static const WCHAR Title[]
Definition: oid.c:1259
#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:4120
HWND WINAPI GetDlgItem(_In_opt_ HWND, _In_ int)
__wchar_t WCHAR
Definition: xmlstorage.h:180
#define PSWIZB_BACK
Definition: prsht.h:153
LONG HRESULT
Definition: typedefs.h:79
#define DICS_FLAG_CONFIGSPECIFIC
Definition: setupapi.h:115
#define _countof(array)
Definition: sndvol32.h:68
#define MAX_PATH
Definition: compat.h:34
#define WINAPI
Definition: msvc.h:6
static INT_PTR CALLBACK InstallFailedDlgProc(IN HWND hwndDlg, IN UINT uMsg, IN WPARAM wParam, IN LPARAM lParam)
Definition: wizard.c:1066
unsigned long DWORD
Definition: ntddk_ex.h:95
static HFONT CreateTitleFont(VOID)
Definition: wizard.c:1303
SP_DEVINSTALL_PARAMS_A SP_DEVINSTALL_PARAMS
Definition: setupapi.h:1155
#define SetLastError(x)
Definition: compat.h:611
#define SetupDiSetDeviceRegistryProperty
Definition: setupapi.h:2620
return pProvider IsEnabled(ProviderControl)
#define BIF_USENEWUI
Definition: shlobj.h:1151
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:173
#define REGSTR_KEY_SETUP
Definition: regstr.h:105
HDEVINFO hDevInfo
static INT_PTR CALLBACK NeedRebootDlgProc(IN HWND hwndDlg, IN UINT uMsg, IN WPARAM wParam, IN LPARAM lParam)
Definition: wizard.c:1145
DWORD dwThreadId
Definition: fdebug.c:31
#define PropSheet_SetCurSelByID(d, i)
Definition: prsht.h:354
_CRTIMP wchar_t *__cdecl wcscpy(_Out_writes_z_(_String_length_(_Source)+1) wchar_t *_Dest, _In_z_ const wchar_t *_Source)
#define SPDRP_CLASS
Definition: setupapi.h:514
#define IDC_RADIO_SEARCHHERE
Definition: resource.h:12
HDC hdc
Definition: main.c:9
_In_ PCCERT_CONTEXT _In_ DWORD dwFlags
Definition: wincrypt.h:1175
int WINAPI GetDeviceCaps(_In_opt_ HDC, _In_ int)
BOOL InstallCurrentDriver(IN PDEVINSTDATA DevInstData)
Definition: newdev.c:521
#define IDD_FINISHPAGE
Definition: resource.h:34
#define IDS_CHSOURCE_TITLE
Definition: resource.h:34
#define WM_COMMAND
Definition: winuser.h:1727
#define IDD_INSTALLFAILED
Definition: resource.h:26
#define ComboBox_GetLBTextLen(hwndCtl, index)
Definition: windowsx.h:32
uint32_t DWORD_PTR
Definition: typedefs.h:65
#define PSP_USETITLE
Definition: prsht.h:26
unsigned char BYTE
Definition: xxhash.c:193
#define ComboBox_SetCurSel(hwndCtl, index)
Definition: windowsx.h:41
BOOL WINAPI EnableWindow(_In_ HWND, _In_ BOOL)
#define IDC_WELCOMETITLE
Definition: resource.h:16
#define IDS_SEARCHDRV_TITLE
Definition: resource.h:35
#define SWP_NOSIZE
Definition: winuser.h:1235
#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
#define SPDRP_CONFIGFLAGS
Definition: setupapi.h:517
HWND WINAPI GetParent(_In_ HWND)
#define RegOpenKeyEx
Definition: winreg.h:520
#define DICS_FLAG_GLOBAL
Definition: setupapi.h:113
#define IDC_CHECK_PATH
Definition: resource.h:15
PRTL_UNICODE_STRING_BUFFER Path
#define ComboBox_ResetContent(hwndCtl)
Definition: windowsx.h:38
_In_ BOOL bEnable
Definition: winddi.h:3426
DWORD DEVINST
Definition: cfgmgr32.h:76
#define FW_BOLD
Definition: wingdi.h:378
#define BIF_RETURNONLYFSDIRS
Definition: shlobj.h:1144
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
void WINAPI DECLSPEC_HOTPATCH CoUninitialize(void)
Definition: compobj.c:2067
#define KEY_QUERY_VALUE
Definition: nt_native.h:1016
#define IDB_WATERMARK
Definition: resource.h:4
unsigned int UINT
Definition: ndis.h:50
#define NULL
Definition: types.h:112
static BOOL SetFailedInstall(IN HDEVINFO DeviceInfoSet, IN PSP_DEVINFO_DATA DevInfoData OPTIONAL, IN BOOLEAN Set)
Definition: wizard.c:63
HANDLE hThread
Definition: wizard.c:28
RETURN_TYPE CONFIGRET
Definition: cfgmgr32.h:74
_CRTIMP size_t __cdecl wcslen(_In_z_ const wchar_t *_Str)
#define BST_CHECKED
Definition: winuser.h:197
#define WM_SETFONT
Definition: winuser.h:1637
#define CM_PROB_FAILED_INSTALL
Definition: cfg.h:58
#define PSN_WIZBACK
Definition: prsht.h:120
static DWORD *static HFONT(WINAPI *pCreateFontIndirectExA)(const ENUMLOGFONTEXDVA *)
HRESULT WINAPI CoInitialize(LPVOID lpReserved)
Definition: compobj.c:1964
static void AutoDriver(HWND Dlg, BOOL Enabled)
Definition: wizard.c:575
struct _SP_CLASSINSTALL_HEADER SP_CLASSINSTALL_HEADER
#define DN_STARTED
Definition: cfg.h:121
#define OUT
Definition: typedefs.h:40
#define PropertySheet
Definition: prsht.h:400
GLuint res
Definition: glext.h:9613
BOOL WINAPI SetupDiSetDeviceRegistryPropertyW(HDEVINFO DeviceInfoSet, PSP_DEVINFO_DATA DeviceInfoData, DWORD Property, const BYTE *PropertyBuffer, DWORD PropertyBufferSize)
Definition: devinst.c:3452
WCHAR lfFaceName[LF_FACESIZE]
Definition: dimm.idl:72
unsigned int ULONG
Definition: retypes.h:1
base for all directory entries
Definition: entries.h:138
LONG bottom
Definition: windef.h:309
static INT_PTR CALLBACK WelcomeDlgProc(IN HWND hwndDlg, IN UINT uMsg, IN WPARAM wParam, IN LPARAM lParam)
Definition: wizard.c:469
char * cleanup(char *str)
Definition: wpickclick.c:99
#define WM_SEARCH_FINISHED
BOOL PrepareFoldersToScan(IN PDEVINSTDATA DevInstData, IN BOOL IncludeRemovableDevices, IN BOOL IncludeCustomPath, IN HWND hwndCombo OPTIONAL)
Definition: newdev.c:447
#define LOGPIXELSY
Definition: wingdi.h:719
#define malloc
Definition: debug_ros.c:4
BOOL WINAPI GetWindowRect(_In_ HWND, _Out_ LPRECT)
static INT_PTR CALLBACK CHSourceDlgProc(IN HWND hwndDlg, IN UINT uMsg, IN WPARAM wParam, IN LPARAM lParam)
Definition: wizard.c:583
BOOL WINAPI SetWindowPos(_In_ HWND, _In_opt_ HWND, _In_ int, _In_ int, _In_ int, _In_ int, _In_ UINT)
#define IDC_COMBO_PATH
Definition: resource.h:18
#define DI_NEEDRESTART
Definition: setupapi.h:53
#define GetWindowLongPtr
Definition: treelist.c:73
#define SetupDiSetClassInstallParams
Definition: setupapi.h:2617
LONG lfWeight
Definition: dimm.idl:63
#define REGSTR_PATH_SETUP
Definition: regstr.h:23
static BOOL CanDisableDevice(IN DEVINST DevInst, IN HMACHINE hMachine, OUT BOOL *CanDisable)
Definition: wizard.c:124
WCHAR * LPWSTR
Definition: xmlstorage.h:184
#define IDCANCEL
Definition: winuser.h:825
#define IDD_MAXIMUMPAGE
Definition: resource.h:30
#define WS_SYSMENU
Definition: pedump.c:629
static INT_PTR CALLBACK FinishDlgProc(IN HWND hwndDlg, IN UINT uMsg, IN WPARAM wParam, IN LPARAM lParam)
Definition: wizard.c:1224
ITEMIDLIST UNALIGNED * LPITEMIDLIST
Definition: shtypes.idl:41
BOOL ScanFoldersForDriver(IN PDEVINSTDATA DevInstData)
Definition: newdev.c:412
BYTE * PBYTE
Definition: pedump.c:66
#define WM_INITDIALOG
Definition: winuser.h:1726
LPARAM lParam
Definition: combotst.c:139
static DWORD WINAPI FindDriverProc(IN LPVOID lpParam)
Definition: wizard.c:242
struct _DEVINSTDATA * PDEVINSTDATA
#define LOWORD(l)
Definition: pedump.c:82
#define HeapFree(x, y, z)
Definition: compat.h:594
#define RegCloseKey(hKey)
Definition: registry.h:47
PSDBQUERYRESULT_VISTA PVOID DWORD * dwSize
Definition: env.c:56
_Check_return_ _CRTIMP int __cdecl _wcsicmp(_In_z_ const wchar_t *_Str1, _In_z_ const wchar_t *_Str2)
#define PROPSHEETPAGE
Definition: prsht.h:389
#define CONFIGFLAG_FAILEDINSTALL
Definition: regstr.h:396
#define WM_NOTIFY
Definition: richedit.h:61
BOOL WINAPI GetComboBoxInfo(_In_ HWND, _Inout_ PCOMBOBOXINFO)
DI_FUNCTION InstallFunction
Definition: setupapi.h:904
#define SHACF_FILESYS_DIRS
Definition: shlwapi.h:1918
#define HKEY_LOCAL_MACHINE
Definition: winreg.h:12
PULONG MinorVersion OPTIONAL
Definition: CrossNt.h:68