650{
655
657
659 {
660
662 }
663
665 if (!DevInstData)
666 {
667 TRACE(
"HeapAlloc() failed\n");
670 }
671
672
675
676
679 {
680 TRACE(
"SetupDiCreateDeviceInfoListExW() failed with error 0x%x\n",
GetLastError());
682 }
683
689 0,
692 {
693 TRACE(
"SetupDiOpenDeviceInfoW() failed with error 0x%x (InstanceId %s)\n",
697 }
698
707
709 {
712 {
713 TRACE(
"HeapAlloc() failed\n");
715 }
716 else
717 {
725 }
726 }
728 {
729 TRACE(
"SetupDiGetDeviceRegistryProperty() failed with error 0x%x (InstanceId %s)\n",
732 }
733
739 (
BYTE *)&config_flags,
740 sizeof(config_flags),
742 {
744 {
745
746 TRACE(
"Device is disabled\n");
749 }
750 }
751
753
754
756 {
759 }
761 {
762
764 TRACE(
"InstallCurrentDriver() returned %d\n", retval);
766 {
767
773 &installParams))
774 {
776 {
777 TRACE(
"Displaying 'Reboot' wizard page\n");
779 }
780 }
781 }
783 }
785 {
786
787 TRACE(
"No wizard\n");
789 }
790
791
792 TRACE(
"Need to show install wizard\n");
794
796 if (DevInstData)
797 {
799 {
801 TRACE(
"SetupDiDestroyDriverInfoList() failed with error 0x%lx\n",
GetLastError());
802 }
804 {
806 TRACE(
"SetupDiDestroyDeviceInfoList() failed with error 0x%lx\n",
GetLastError());
807 }
810 }
811
812 return retval;
813}
#define ERROR_NOT_ENOUGH_MEMORY
#define ERROR_INSUFFICIENT_BUFFER
#define INVALID_HANDLE_VALUE
#define HeapFree(x, y, z)
#define ERROR_ACCESS_DENIED
static void cleanup(void)
VOID WINAPI ExitProcess(IN UINT uExitCode)
HDEVINFO WINAPI SetupDiCreateDeviceInfoListExW(const GUID *ClassGuid, HWND hwndParent, PCWSTR MachineName, PVOID Reserved)
BOOL WINAPI SetupDiGetDeviceRegistryPropertyW(HDEVINFO DeviceInfoSet, PSP_DEVINFO_DATA DeviceInfoData, DWORD Property, PDWORD PropertyRegDataType, PBYTE PropertyBuffer, DWORD PropertyBufferSize, PDWORD RequiredSize)
BOOL WINAPI SetupDiOpenDeviceInfoW(IN HDEVINFO DeviceInfoSet, IN PCWSTR DeviceInstanceId, IN HWND hwndParent OPTIONAL, IN DWORD OpenFlags, OUT PSP_DEVINFO_DATA DeviceInfoData OPTIONAL)
BOOL WINAPI SetupDiDestroyDeviceInfoList(HDEVINFO devinfo)
BOOL WINAPI SetupDiDestroyDriverInfoList(IN HDEVINFO DeviceInfoSet, IN PSP_DEVINFO_DATA DeviceInfoData OPTIONAL, IN DWORD DriverType)
_Must_inspect_result_ _In_opt_ PVOID _In_opt_ PVOID InstanceId
static BOOL IsUserAdmin(VOID)
BOOL ScanFoldersForDriver(IN PDEVINSTDATA DevInstData)
BOOL PrepareFoldersToScan(IN PDEVINSTDATA DevInstData, IN BOOL IncludeRemovableDevices, IN BOOL IncludeCustomPath, IN HWND hwndCombo OPTIONAL)
BOOL InstallCurrentDriver(IN PDEVINSTDATA DevInstData)
BOOL DisplayWizard(IN PDEVINSTDATA DevInstData, IN HWND hwndParent, IN UINT startPage)
#define CONFIGFLAG_FAILEDINSTALL
#define SetupDiGetDeviceInstallParams
SP_DEVINSTALL_PARAMS_A SP_DEVINSTALL_PARAMS
#define SetupDiGetDeviceRegistryProperty
struct _SP_DEVINFO_DATA SP_DEVINFO_DATA
#define SPDRP_CONFIGFLAGS
#define SPDIT_COMPATDRIVER
SP_DEVINFO_DATA devInfoData
DWORD WINAPI GetLastError(void)
#define ERROR_GEN_FAILURE