2 * COPYRIGHT: See COPYING in the top level directory
3 * PROJECT: ReactOS New devices installation
4 * FILE: lib/newdev/newdev.c
5 * PURPOSE: New devices installation
7 * PROGRAMMERS: Hervé Poussineau (hpoussin@reactos.org)
8 * PROGRAMMERS: Christoph von Wittich (Christoph@ActiveVB.de)
16 static BOOL
SearchDriver ( PDEVINSTDATA DevInstData
, LPCTSTR Path
);
17 static BOOL
InstallDriver ( PDEVINSTDATA DevInstData
);
18 static DWORD WINAPI
FindDriverProc( LPVOID lpParam
);
19 static BOOL
FindDriver ( PDEVINSTDATA DevInstData
);
21 static DEVINSTDATA DevInstData
;
22 HINSTANCE hDllInstance
;
29 UpdateDriverForPlugAndPlayDevicesW(
31 IN LPCWSTR HardwareId
,
32 IN LPCWSTR FullInfPath
,
33 IN DWORD InstallFlags
,
34 OUT PBOOL bRebootRequired OPTIONAL
)
37 SetLastError(ERROR_GEN_FAILURE
);
45 UpdateDriverForPlugAndPlayDevicesA(
48 IN LPCSTR FullInfPath
,
49 IN DWORD InstallFlags
,
50 OUT PBOOL bRebootRequired OPTIONAL
)
53 LPWSTR HardwareIdW
= NULL
;
54 LPWSTR FullInfPathW
= NULL
;
56 int len
= MultiByteToWideChar(CP_ACP
, 0, HardwareId
, -1, NULL
, 0);
57 HardwareIdW
= HeapAlloc(GetProcessHeap(), 0, len
* sizeof(WCHAR
));
60 SetLastError(ERROR_GEN_FAILURE
);
63 MultiByteToWideChar(CP_ACP
, 0, HardwareId
, -1, HardwareIdW
, len
);
65 len
= MultiByteToWideChar(CP_ACP
, 0, FullInfPath
, -1, NULL
, 0);
66 FullInfPathW
= HeapAlloc(GetProcessHeap(), 0, len
* sizeof(WCHAR
));
69 SetLastError(ERROR_GEN_FAILURE
);
72 MultiByteToWideChar(CP_ACP
, 0, FullInfPath
, -1, FullInfPathW
, len
);
74 Result
= UpdateDriverForPlugAndPlayDevicesW(hwndParent
,
80 HeapFree(GetProcessHeap(), 0, HardwareIdW
);
81 HeapFree(GetProcessHeap(), 0, FullInfPathW
);
96 ncm
.cbSize
= sizeof(NONCLIENTMETRICS
);
97 SystemParametersInfo(SPI_GETNONCLIENTMETRICS
, 0, &ncm
, 0);
99 LogFont
= ncm
.lfMessageFont
;
100 LogFont
.lfWeight
= FW_BOLD
;
101 _tcscpy(LogFont
.lfFaceName
, _T("MS Shell Dlg"));
105 LogFont
.lfHeight
= 0 - GetDeviceCaps (hdc
, LOGPIXELSY
) * FontSize
/ 72;
106 hFont
= CreateFontIndirect(&LogFont
);
107 ReleaseDC(NULL
, hdc
);
113 CenterWindow(HWND hWnd
)
119 hWndParent
= GetParent(hWnd
);
120 if (hWndParent
== NULL
)
121 hWndParent
= GetDesktopWindow();
123 GetWindowRect(hWndParent
, &rcParent
);
124 GetWindowRect(hWnd
, &rcWindow
);
128 ((rcParent
.right
- rcParent
.left
) - (rcWindow
.right
- rcWindow
.left
)) / 2,
129 ((rcParent
.bottom
- rcParent
.top
) - (rcWindow
.bottom
- rcWindow
.top
)) / 2,
135 static INT_PTR CALLBACK
143 PDEVINSTDATA DevInstData
;
145 /* Retrieve pointer to the global setup data */
146 DevInstData
= (PDEVINSTDATA
)GetWindowLongPtr (hwndDlg
, GWL_USERDATA
);
155 /* Get pointer to the global setup data */
156 DevInstData
= (PDEVINSTDATA
)((LPPROPSHEETPAGE
)lParam
)->lParam
;
157 SetWindowLongPtr(hwndDlg
, GWL_USERDATA
, (DWORD_PTR
)DevInstData
);
159 hwndControl
= GetParent(hwndDlg
);
161 /* Center the wizard window */
162 CenterWindow (hwndControl
);
164 /* Hide the system menu */
165 dwStyle
= GetWindowLong(hwndControl
, GWL_STYLE
);
166 SetWindowLong(hwndControl
, GWL_STYLE
, dwStyle
& ~WS_SYSMENU
);
169 SendDlgItemMessage(hwndDlg
,
172 (WPARAM
)DevInstData
->hTitleFont
,
175 SendDlgItemMessage(hwndDlg
,
179 (LPARAM
) DevInstData
->buffer
);
181 SendDlgItemMessage(hwndDlg
,
194 LPNMHDR lpnm
= (LPNMHDR
)lParam
;
199 /* Enable the Next button */
200 PropSheet_SetWizButtons(GetParent(hwndDlg
), PSWIZB_NEXT
);
204 /* Handle a Next button click, if necessary */
206 if (SendDlgItemMessage(hwndDlg
, IDC_RADIO_AUTO
, BM_GETCHECK
, (WPARAM
) 0, (LPARAM
) 0) == BST_CHECKED
)
207 PropSheet_SetCurSel(GetParent(hwndDlg
), 0, IDD_SEARCHDRV
);
224 static INT_PTR CALLBACK
232 PDEVINSTDATA DevInstData
;
234 /* Retrieve pointer to the global setup data */
235 DevInstData
= (PDEVINSTDATA
)GetWindowLongPtr (hwndDlg
, GWL_USERDATA
);
244 /* Get pointer to the global setup data */
245 DevInstData
= (PDEVINSTDATA
)((LPPROPSHEETPAGE
)lParam
)->lParam
;
246 SetWindowLongPtr(hwndDlg
, GWL_USERDATA
, (DWORD_PTR
)DevInstData
);
248 hwndControl
= GetParent(hwndDlg
);
250 /* Center the wizard window */
251 CenterWindow (hwndControl
);
253 /* Hide the system menu */
254 dwStyle
= GetWindowLong(hwndControl
, GWL_STYLE
);
255 SetWindowLong(hwndControl
, GWL_STYLE
, dwStyle
& ~WS_SYSMENU
);
257 SendDlgItemMessage(hwndDlg
,
258 IDC_RADIO_SEARCHHERE
,
269 LPNMHDR lpnm
= (LPNMHDR
)lParam
;
274 /* Enable the Next and Back buttons */
275 PropSheet_SetWizButtons(GetParent(hwndDlg
), PSWIZB_NEXT
| PSWIZB_BACK
);
279 /* Handle a Next button click, if necessary */
280 PropSheet_SetCurSel(GetParent(hwndDlg
), 0, 4);
296 static INT_PTR CALLBACK
304 PDEVINSTDATA DevInstData
;
307 /* Retrieve pointer to the global setup data */
308 DevInstData
= (PDEVINSTDATA
)GetWindowLongPtr (hwndDlg
, GWL_USERDATA
);
317 /* Get pointer to the global setup data */
318 DevInstData
= (PDEVINSTDATA
)((LPPROPSHEETPAGE
)lParam
)->lParam
;
319 SetWindowLongPtr(hwndDlg
, GWL_USERDATA
, (DWORD_PTR
)DevInstData
);
321 DevInstData
->hDialog
= hwndDlg
;
322 hwndControl
= GetParent(hwndDlg
);
324 /* Center the wizard window */
325 CenterWindow (hwndControl
);
327 SendDlgItemMessage(hwndDlg
,
331 (LPARAM
) DevInstData
->buffer
);
333 /* Hide the system menu */
334 dwStyle
= GetWindowLong(hwndControl
, GWL_STYLE
);
335 SetWindowLong(hwndControl
, GWL_STYLE
, dwStyle
& ~WS_SYSMENU
);
339 case WM_SEARCH_FINISHED
:
341 CloseHandle(hThread
);
344 PropSheet_SetCurSel(GetParent(hwndDlg
), 0, IDD_NODRIVER
);
346 PropSheet_SetCurSel(GetParent(hwndDlg
), 0, IDD_FINISHPAGE
);
351 LPNMHDR lpnm
= (LPNMHDR
)lParam
;
356 PropSheet_SetWizButtons(GetParent(hwndDlg
), !PSWIZB_NEXT
| !PSWIZB_BACK
);
357 hThread
= CreateThread( NULL
, 0, FindDriverProc
, DevInstData
, 0, &dwThreadId
);
363 SetWindowLong ( hwndDlg
, DWL_MSGRESULT
, TRUE
);
368 /* Handle a Next button click, if necessary */
388 TCHAR drive
[] = {'?',':',0};
391 PDEVINSTDATA DevInstData
;
394 DevInstData
= (PDEVINSTDATA
)lpParam
;
396 dwDrives
= GetLogicalDrives();
397 for (drive
[0] = 'A'; drive
[0] <= 'Z'; drive
[0]++)
401 nType
= GetDriveType( drive
);
402 if ((nType
== DRIVE_CDROM
))
403 //if ((nType == DRIVE_CDROM) || (nType == DRIVE_FIXED))
405 /* search for inf file */
406 if (SearchDriver ( DevInstData
, drive
))
408 /* if we found a valid driver inf... */
409 if (FindDriver ( DevInstData
))
411 InstallDriver ( DevInstData
);
412 PostMessage(DevInstData
->hDialog
, WM_SEARCH_FINISHED
, 1, 0);
421 PostMessage(DevInstData
->hDialog
, WM_SEARCH_FINISHED
, 0, 0);
425 static INT_PTR CALLBACK
433 PDEVINSTDATA DevInstData
;
435 /* Retrieve pointer to the global setup data */
436 DevInstData
= (PDEVINSTDATA
)GetWindowLongPtr (hwndDlg
, GWL_USERDATA
);
444 /* Get pointer to the global setup data */
445 DevInstData
= (PDEVINSTDATA
)((LPPROPSHEETPAGE
)lParam
)->lParam
;
446 SetWindowLongPtr(hwndDlg
, GWL_USERDATA
, (DWORD_PTR
)DevInstData
);
448 hwndControl
= GetDlgItem(GetParent(hwndDlg
), IDCANCEL
);
449 ShowWindow (hwndControl
, SW_HIDE
);
450 EnableWindow (hwndControl
, FALSE
);
452 SendDlgItemMessage(hwndDlg
,
456 (LPARAM
) DevInstData
->drvInfoData
.Description
);
459 SendDlgItemMessage(hwndDlg
,
462 (WPARAM
)DevInstData
->hTitleFont
,
469 LPNMHDR lpnm
= (LPNMHDR
)lParam
;
474 /* Enable the correct buttons on for the active page */
475 PropSheet_SetWizButtons(GetParent(hwndDlg
), PSWIZB_FINISH
);
479 /* Handle a Back button click, if necessary */
483 /* Handle a Finish button click, if necessary */
499 static INT_PTR CALLBACK
507 PDEVINSTDATA DevInstData
;
509 /* Get pointer to the global setup data */
510 DevInstData
= (PDEVINSTDATA
)GetWindowLongPtr (hwndDlg
, GWL_USERDATA
);
518 DevInstData
= (PDEVINSTDATA
)((LPPROPSHEETPAGE
)lParam
)->lParam
;
519 SetWindowLongPtr(hwndDlg
, GWL_USERDATA
, (DWORD_PTR
)DevInstData
);
521 hwndControl
= GetDlgItem(GetParent(hwndDlg
), IDCANCEL
);
522 ShowWindow (hwndControl
, SW_HIDE
);
523 EnableWindow (hwndControl
, FALSE
);
526 SendDlgItemMessage(hwndDlg
,
529 (WPARAM
)DevInstData
->hTitleFont
,
536 LPNMHDR lpnm
= (LPNMHDR
)lParam
;
543 /* Enable the correct buttons on for the active page */
544 PropSheet_SetWizButtons(GetParent(hwndDlg
), PSWIZB_BACK
| PSWIZB_FINISH
);
548 PropSheet_SetCurSel(GetParent(hwndDlg
), 0, IDD_WELCOMEPAGE
);
549 /* Handle a Back button click, if necessary */
553 /* Handle a Finish button click, if necessary */
554 if (SendDlgItemMessage(hwndDlg
, IDC_DONOTSHOWDLG
, BM_GETCHECK
, (WPARAM
) 0, (LPARAM
) 0) == BST_CHECKED
)
557 if(SetupDiGetDeviceRegistryProperty(DevInstData
->hDevInfo
,
558 &DevInstData
->devInfoData
,
561 (BYTE
*)&config_flags
,
562 sizeof(config_flags
),
565 config_flags
|= CONFIGFLAG_FAILEDINSTALL
;
566 ret
= SetupDiSetDeviceRegistryProperty(
567 DevInstData
->hDevInfo
,
568 &DevInstData
->devInfoData
,
592 IN PDEVINSTDATA DevInstData
)
597 ret
= SetupDiBuildDriverInfoList(DevInstData
->hDevInfo
, &DevInstData
->devInfoData
, SPDIT_COMPATDRIVER
);
600 DPRINT("SetupDiBuildDriverInfoList() failed with error 0x%lx\n", GetLastError());
604 DevInstData
->drvInfoData
.cbSize
= sizeof(SP_DRVINFO_DATA
);
605 ret
= SetupDiEnumDriverInfo(
606 DevInstData
->hDevInfo
,
607 &DevInstData
->devInfoData
,
610 &DevInstData
->drvInfoData
);
613 if (GetLastError() == ERROR_NO_MORE_ITEMS
)
615 DPRINT("SetupDiEnumDriverInfo() failed with error 0x%lx\n", GetLastError());
618 DPRINT("Installing driver %S: %S\n", DevInstData
->drvInfoData
.MfgName
, DevInstData
->drvInfoData
.Description
);
625 IsDots(IN LPCTSTR str
)
627 if(_tcscmp(str
, _T(".")) && _tcscmp(str
, _T(".."))) return FALSE
;
632 GetFileExt(IN LPTSTR FileName
)
637 int i
= _tcsclen(FileName
);
638 while ((i
>= 0) && (FileName
[i
] != _T('.')))
641 FileName
= _tcslwr(FileName
);
651 IN PDEVINSTDATA DevInstData
,
655 SP_DEVINSTALL_PARAMS DevInstallParams
;
656 TCHAR DirPath
[MAX_PATH
];
657 TCHAR FileName
[MAX_PATH
];
658 TCHAR FullPath
[MAX_PATH
];
659 TCHAR LastDirPath
[MAX_PATH
] = _T("");
660 TCHAR PathWithPattern
[MAX_PATH
];
665 _tcscpy(DirPath
, Path
);
667 if (DirPath
[_tcsclen(DirPath
) - 1] != '\\')
668 _tcscat(DirPath
, _T("\\"));
670 _tcscpy(PathWithPattern
, DirPath
);
671 _tcscat(PathWithPattern
, _T("\\*"));
673 for (hFindFile
= FindFirstFile(PathWithPattern
, &wfd
); ((hFindFile
!= INVALID_HANDLE_VALUE
) && ok
); ok
= FindNextFile(hFindFile
, &wfd
))
676 _tcscpy(FileName
, wfd
.cFileName
);
677 if (IsDots(FileName
)) continue;
679 if((wfd
.dwFileAttributes
& FILE_ATTRIBUTE_DIRECTORY
))
681 _tcscpy(FullPath
, DirPath
);
682 _tcscat(FullPath
, FileName
);
683 if(SearchDriver(DevInstData
, FullPath
))
688 LPCTSTR pszExtension
= GetFileExt(FileName
);
690 if ((_tcscmp(pszExtension
, _T(".inf")) == 0) && (_tcscmp(LastDirPath
, DirPath
) != 0))
692 _tcscpy(LastDirPath
, DirPath
);
693 ZeroMemory (&DevInstallParams
, sizeof(SP_DEVINSTALL_PARAMS
));
694 DevInstallParams
.cbSize
= sizeof(SP_DEVINSTALL_PARAMS
);
696 ret
= SetupDiGetDeviceInstallParams(
697 DevInstData
->hDevInfo
,
698 &DevInstData
->devInfoData
,
701 if (_tcsclen(DirPath
) <= MAX_PATH
)
703 memcpy(DevInstallParams
.DriverPath
, DirPath
, (_tcsclen(DirPath
) + 1) * sizeof(TCHAR
));
706 ret
= SetupDiSetDeviceInstallParams(
707 DevInstData
->hDevInfo
,
708 &DevInstData
->devInfoData
,
711 if ( FindDriver ( DevInstData
) )
713 if (hFindFile
!= INVALID_HANDLE_VALUE
)
714 FindClose(hFindFile
);
722 if (hFindFile
!= INVALID_HANDLE_VALUE
)
723 FindClose(hFindFile
);
730 IN PDEVINSTDATA DevInstData
)
735 ret
= SetupDiCallClassInstaller(
736 DIF_SELECTBESTCOMPATDRV
,
737 DevInstData
->hDevInfo
,
738 &DevInstData
->devInfoData
);
741 DPRINT("SetupDiCallClassInstaller(DIF_SELECTBESTCOMPATDRV) failed with error 0x%lx\n", GetLastError());
745 ret
= SetupDiCallClassInstaller(
747 DevInstData
->hDevInfo
,
748 &DevInstData
->devInfoData
);
751 DPRINT("SetupDiCallClassInstaller(DIF_ALLOW_INSTALL) failed with error 0x%lx\n", GetLastError());
755 ret
= SetupDiCallClassInstaller(
756 DIF_NEWDEVICEWIZARD_PREANALYZE
,
757 DevInstData
->hDevInfo
,
758 &DevInstData
->devInfoData
);
761 DPRINT("SetupDiCallClassInstaller(DIF_NEWDEVICEWIZARD_PREANALYZE) failed with error 0x%lx\n", GetLastError());
765 ret
= SetupDiCallClassInstaller(
766 DIF_NEWDEVICEWIZARD_POSTANALYZE
,
767 DevInstData
->hDevInfo
,
768 &DevInstData
->devInfoData
);
771 DPRINT("SetupDiCallClassInstaller(DIF_NEWDEVICEWIZARD_POSTANALYZE) failed with error 0x%lx\n", GetLastError());
775 ret
= SetupDiCallClassInstaller(
776 DIF_INSTALLDEVICEFILES
,
777 DevInstData
->hDevInfo
,
778 &DevInstData
->devInfoData
);
781 DPRINT("SetupDiCallClassInstaller(DIF_INSTALLDEVICEFILES) failed with error 0x%lx\n", GetLastError());
785 ret
= SetupDiCallClassInstaller(
786 DIF_REGISTER_COINSTALLERS
,
787 DevInstData
->hDevInfo
,
788 &DevInstData
->devInfoData
);
791 DPRINT("SetupDiCallClassInstaller(DIF_REGISTER_COINSTALLERS) failed with error 0x%lx\n", GetLastError());
795 ret
= SetupDiCallClassInstaller(
796 DIF_INSTALLINTERFACES
,
797 DevInstData
->hDevInfo
,
798 &DevInstData
->devInfoData
);
801 DPRINT("SetupDiCallClassInstaller(DIF_INSTALLINTERFACES) failed with error 0x%lx\n", GetLastError());
805 ret
= SetupDiCallClassInstaller(
807 DevInstData
->hDevInfo
,
808 &DevInstData
->devInfoData
);
811 DPRINT("SetupDiCallClassInstaller(DIF_INSTALLDEVICE) failed with error 0x%lx\n", GetLastError());
815 ret
= SetupDiCallClassInstaller(
816 DIF_NEWDEVICEWIZARD_FINISHINSTALL
,
817 DevInstData
->hDevInfo
,
818 &DevInstData
->devInfoData
);
821 DPRINT("SetupDiCallClassInstaller(DIF_NEWDEVICEWIZARD_FINISHINSTALL) failed with error 0x%lx\n", GetLastError());
825 ret
= SetupDiCallClassInstaller(
826 DIF_DESTROYPRIVATEDATA
,
827 DevInstData
->hDevInfo
,
828 &DevInstData
->devInfoData
);
831 DPRINT("SetupDiCallClassInstaller(DIF_DESTROYPRIVATEDATA) failed with error 0x%lx\n", GetLastError());
843 if (DevInstData
.devInfoData
.cbSize
!= 0)
845 if (!SetupDiDestroyDriverInfoList(DevInstData
.hDevInfo
, &DevInstData
.devInfoData
, SPDIT_COMPATDRIVER
))
846 DPRINT("SetupDiDestroyDriverInfoList() failed with error 0x%lx\n", GetLastError());
849 if (DevInstData
.hDevInfo
!= INVALID_HANDLE_VALUE
)
851 if (!SetupDiDestroyDeviceInfoList(DevInstData
.hDevInfo
))
852 DPRINT("SetupDiDestroyDeviceInfoList() failed with error 0x%lx\n", GetLastError());
855 if (DevInstData
.buffer
)
856 HeapFree(GetProcessHeap(), 0, DevInstData
.buffer
);
863 IN HINSTANCE hInstance
,
864 IN LPCWSTR InstanceId
,
869 HPROPSHEETPAGE ahpsp
[5];
875 /* Clear devinst data */
876 ZeroMemory(&DevInstData
, sizeof(DEVINSTDATA
));
877 DevInstData
.devInfoData
.cbSize
= 0; /* Tell if the devInfoData is valid */
880 DevInstData
.hDevInfo
= SetupDiCreateDeviceInfoListExW(NULL
, NULL
, NULL
, NULL
);
881 if (DevInstData
.hDevInfo
== INVALID_HANDLE_VALUE
)
883 DPRINT("SetupDiCreateDeviceInfoListExW() failed with error 0x%lx\n", GetLastError());
888 DevInstData
.devInfoData
.cbSize
= sizeof(SP_DEVINFO_DATA
);
889 ret
= SetupDiOpenDeviceInfoW(
890 DevInstData
.hDevInfo
,
894 &DevInstData
.devInfoData
);
897 DPRINT("SetupDiOpenDeviceInfoW() failed with error 0x%lx (InstanceId %S)\n", GetLastError(), InstanceId
);
898 DevInstData
.devInfoData
.cbSize
= 0;
903 SetLastError(ERROR_GEN_FAILURE
);
904 ret
= SetupDiGetDeviceRegistryProperty(
905 DevInstData
.hDevInfo
,
906 &DevInstData
.devInfoData
,
908 &DevInstData
.regDataType
,
910 &DevInstData
.requiredSize
);
912 if (!ret
&& GetLastError() == ERROR_INSUFFICIENT_BUFFER
&& DevInstData
.regDataType
== REG_SZ
)
914 DevInstData
.buffer
= HeapAlloc(GetProcessHeap(), 0, DevInstData
.requiredSize
);
915 if (!DevInstData
.buffer
)
917 DPRINT("HeapAlloc() failed\n");
918 SetLastError(ERROR_NOT_ENOUGH_MEMORY
);
922 ret
= SetupDiGetDeviceRegistryProperty(
923 DevInstData
.hDevInfo
,
924 &DevInstData
.devInfoData
,
926 &DevInstData
.regDataType
,
927 DevInstData
.buffer
, DevInstData
.requiredSize
,
928 &DevInstData
.requiredSize
);
933 DPRINT("SetupDiGetDeviceRegistryProperty() failed with error 0x%lx (InstanceId %S)\n", GetLastError(), InstanceId
);
938 if(SetupDiGetDeviceRegistryProperty(DevInstData
.hDevInfo
,
939 &DevInstData
.devInfoData
,
942 (BYTE
*)&config_flags
,
943 sizeof(config_flags
),
946 if (config_flags
& CONFIGFLAG_FAILEDINSTALL
)
955 swprintf(buf, _T("%ld"), GetLastError());
956 MessageBox(0,buf,buf,0);
960 DPRINT("Installing %S (%S)\n", DevInstData
.buffer
, InstanceId
);
962 if ((!FindDriver(&DevInstData
)) && (Show
!= SW_HIDE
))
965 /* Create the Welcome page */
966 ZeroMemory (&psp
, sizeof(PROPSHEETPAGE
));
967 psp
.dwSize
= sizeof(PROPSHEETPAGE
);
968 psp
.dwFlags
= PSP_DEFAULT
| PSP_HIDEHEADER
;
969 psp
.hInstance
= hDllInstance
;
970 psp
.lParam
= (LPARAM
)&DevInstData
;
971 psp
.pfnDlgProc
= WelcomeDlgProc
;
972 psp
.pszTemplate
= MAKEINTRESOURCE(IDD_WELCOMEPAGE
);
973 ahpsp
[IDD_WELCOMEPAGE
] = CreatePropertySheetPage(&psp
);
975 /* Create the Select Source page */
976 psp
.dwFlags
= PSP_DEFAULT
| PSP_USEHEADERTITLE
| PSP_USEHEADERSUBTITLE
;
977 psp
.pfnDlgProc
= CHSourceDlgProc
;
978 psp
.pszTemplate
= MAKEINTRESOURCE(IDD_CHSOURCE
);
979 ahpsp
[IDD_CHSOURCE
] = CreatePropertySheetPage(&psp
);
981 /* Create the Search driver page */
982 psp
.dwFlags
= PSP_DEFAULT
| PSP_USEHEADERTITLE
| PSP_USEHEADERSUBTITLE
;
983 psp
.pfnDlgProc
= SearchDrvDlgProc
;
984 psp
.pszTemplate
= MAKEINTRESOURCE(IDD_SEARCHDRV
);
985 ahpsp
[IDD_SEARCHDRV
] = CreatePropertySheetPage(&psp
);
987 /* Create the Finish page */
988 psp
.dwFlags
= PSP_DEFAULT
| PSP_HIDEHEADER
;
989 psp
.pfnDlgProc
= FinishDlgProc
;
990 psp
.pszTemplate
= MAKEINTRESOURCE(IDD_FINISHPAGE
);
991 ahpsp
[IDD_FINISHPAGE
] = CreatePropertySheetPage(&psp
);
993 /* Create the Install failed page */
994 psp
.dwFlags
= PSP_DEFAULT
| PSP_HIDEHEADER
;
995 psp
.pfnDlgProc
= InstFailDlgProc
;
996 psp
.pszTemplate
= MAKEINTRESOURCE(IDD_NODRIVER
);
997 ahpsp
[IDD_NODRIVER
] = CreatePropertySheetPage(&psp
);
999 /* Create the property sheet */
1000 psh
.dwSize
= sizeof(PROPSHEETHEADER
);
1001 psh
.dwFlags
= PSH_WIZARD97
| PSH_WATERMARK
| PSH_HEADER
;
1002 psh
.hInstance
= hDllInstance
;
1003 psh
.hwndParent
= NULL
;
1007 psh
.pszbmWatermark
= MAKEINTRESOURCE(IDB_WATERMARK
);
1008 psh
.pszbmHeader
= MAKEINTRESOURCE(IDB_HEADER
);
1010 /* Create title font */
1011 DevInstData
.hTitleFont
= CreateTitleFont();
1013 /* Display the wizard */
1014 PropertySheet(&psh
);
1016 DeleteObject(DevInstData
.hTitleFont
);
1021 InstallDriver ( &DevInstData
);
1030 IN HINSTANCE hInstance
,
1032 IN LPVOID lpReserved
)
1034 if (dwReason
== DLL_PROCESS_ATTACH
)
1036 INITCOMMONCONTROLSEX InitControls
;
1038 InitControls
.dwSize
= sizeof(INITCOMMONCONTROLSEX
);
1039 InitControls
.dwICC
= ICC_PROGRESS_CLASS
;
1040 InitCommonControlsEx(&InitControls
);
1041 hDllInstance
= hInstance
;