53 BOOL FoundHardwareId, FoundAtLeastOneDevice =
FALSE;
58 TRACE(
"UpdateDriverForPlugAndPlayDevicesW(%p %s %s 0x%x %p)\n",
109 TRACE(
"SetupDiGetDeviceRegistryPropertyW() failed with error 0x%x\n",
GetLastError());
126 FoundHardwareId =
FALSE;
127 for (CurrentHardwareId =
Buffer; *CurrentHardwareId !=
UNICODE_NULL; CurrentHardwareId +=
wcslen(CurrentHardwareId) + 1)
129 if (
wcscmp(CurrentHardwareId, HardwareId) == 0)
131 FoundHardwareId =
TRUE;
135 if (!FoundHardwareId)
182 FoundAtLeastOneDevice =
TRUE;
185 if (FoundAtLeastOneDevice)
263 TRACE(
"SetupDiGetDeviceInstallParams() failed with error 0x%x\n",
GetLastError());
275 DevInstallParams.
Flags &= ~DI_ENUMSINGLEINF;
280 DevInstallParams.
Flags &= ~DI_ENUMSINGLEINF;
285 DevInstData->hDevInfo,
286 &DevInstData->devInfoData,
290 TRACE(
"SetupDiSetDeviceInstallParams() failed with error 0x%x\n",
GetLastError());
295 DevInstData->hDevInfo,
296 &DevInstData->devInfoData,
306 DevInstData->hDevInfo,
307 &DevInstData->devInfoData,
310 &DevInstData->drvInfoData);
358 if (DirPath[
wcslen(DirPath) - 1] !=
'\\')
361 wcscpy(PathWithPattern, DirPath);
376 wcscpy(FullPath, DirPath);
388 if ((
_wcsicmp(pszExtension,
L".inf") == 0) && (
wcscmp(LastDirPath, DirPath) != 0))
390 wcscpy(LastDirPath, DirPath);
428 if (DevInstData->CustomSearchPath)
457 IN BOOL IncludeRemovableDevices,
458 IN BOOL IncludeCustomPath,
465 DWORD CustomTextLength = 0;
470 if (IncludeRemovableDevices)
485 if (IncludeCustomPath)
499 TRACE(
"HeapAlloc() failed\n");
505 if (IncludeRemovableDevices)
519 if (IncludeCustomPath)
534 TRACE(
"Installing driver %s: %s\n",
536 debugstr_w(DevInstData->drvInfoData.Description));
540 DevInstData->hDevInfo,
541 &DevInstData->devInfoData);
544 TRACE(
"SetupDiCallClassInstaller(DIF_SELECTBESTCOMPATDRV) failed with error 0x%x\n",
GetLastError());
550 DevInstData->hDevInfo,
551 &DevInstData->devInfoData);
554 TRACE(
"SetupDiCallClassInstaller(DIF_ALLOW_INSTALL) failed with error 0x%x\n",
GetLastError());
560 DevInstData->hDevInfo,
561 &DevInstData->devInfoData);
564 TRACE(
"SetupDiCallClassInstaller(DIF_NEWDEVICEWIZARD_PREANALYZE) failed with error 0x%x\n",
GetLastError());
570 DevInstData->hDevInfo,
571 &DevInstData->devInfoData);
574 TRACE(
"SetupDiCallClassInstaller(DIF_NEWDEVICEWIZARD_POSTANALYZE) failed with error 0x%x\n",
GetLastError());
580 DevInstData->hDevInfo,
581 &DevInstData->devInfoData);
584 TRACE(
"SetupDiCallClassInstaller(DIF_INSTALLDEVICEFILES) failed with error 0x%x\n",
GetLastError());
590 DevInstData->hDevInfo,
591 &DevInstData->devInfoData);
594 TRACE(
"SetupDiCallClassInstaller(DIF_REGISTER_COINSTALLERS) failed with error 0x%x\n",
GetLastError());
600 DevInstData->hDevInfo,
601 &DevInstData->devInfoData);
604 TRACE(
"SetupDiCallClassInstaller(DIF_INSTALLINTERFACES) failed with error 0x%x\n",
GetLastError());
610 DevInstData->hDevInfo,
611 &DevInstData->devInfoData);
614 TRACE(
"SetupDiCallClassInstaller(DIF_INSTALLDEVICE) failed with error 0x%x\n",
GetLastError());
620 DevInstData->hDevInfo,
621 &DevInstData->devInfoData);
624 TRACE(
"SetupDiCallClassInstaller(DIF_NEWDEVICEWIZARD_FINISHINSTALL) failed with error 0x%x\n",
GetLastError());
630 DevInstData->hDevInfo,
631 &DevInstData->devInfoData);
634 TRACE(
"SetupDiCallClassInstaller(DIF_DESTROYPRIVATEDATA) failed with error 0x%x\n",
GetLastError());
667 TRACE(
"HeapAlloc() failed\n");
680 TRACE(
"SetupDiCreateDeviceInfoListExW() failed with error 0x%x\n",
GetLastError());
693 TRACE(
"SetupDiOpenDeviceInfoW() failed with error 0x%x (InstanceId %s)\n",
713 TRACE(
"HeapAlloc() failed\n");
729 TRACE(
"SetupDiGetDeviceRegistryProperty() failed with error 0x%x (InstanceId %s)\n",
739 (
BYTE *)&config_flags,
740 sizeof(config_flags),
746 TRACE(
"Device is disabled\n");
764 TRACE(
"InstallCurrentDriver() returned %d\n",
retval);
777 TRACE(
"Displaying 'Reboot' wizard page\n");
787 TRACE(
"No wizard\n");
792 TRACE(
"Need to show install wizard\n");
801 TRACE(
"SetupDiDestroyDriverInfoList() failed with error 0x%lx\n",
GetLastError());
806 TRACE(
"SetupDiDestroyDeviceInfoList() failed with error 0x%lx\n",
GetLastError());
829 TRACE(
"InstllDevInstEx(%p, %s, %d, %p, %lx)\n",
835 TRACE(
"HeapAlloc() failed\n");
843 DevInstData->
bUpdate = bUpdate;
849 TRACE(
"SetupDiCreateDeviceInfoListExW() failed with error 0x%x\n",
GetLastError());
862 TRACE(
"SetupDiOpenDeviceInfoW() failed with error 0x%x (InstanceId %s)\n",
882 TRACE(
"HeapAlloc() failed\n");
899 TRACE(
"SetupDiGetDeviceRegistryProperty() failed with error 0x%x (InstanceId %s)\n",
905 TRACE(
"Need to show install wizard\n");
914 TRACE(
"SetupDiDestroyDriverInfoList() failed with error 0x%lx\n",
GetLastError());
919 TRACE(
"SetupDiDestroyDeviceInfoList() failed with error 0x%lx\n",
GetLastError());
1021 TRACE(
"CreateEventW('%ls') failed with error %lu\n", InstallEventName,
GetLastError());
1032 if(InstallEventName)
PRTL_UNICODE_STRING_BUFFER Path
UINT32 void void ** ReturnValue
static DWORD const LPVOID const lpReserved
BOOL WINAPI InitCommonControlsEx(const INITCOMMONCONTROLSEX *lpInitCtrls)
#define ERROR_NOT_ENOUGH_MEMORY
#define ERROR_INSUFFICIENT_BUFFER
#define DLL_PROCESS_ATTACH
#define ReadFile(a, b, c, d, e)
#define INVALID_HANDLE_VALUE
#define ERROR_NO_MORE_ITEMS
#define HeapFree(x, y, z)
#define FILE_ATTRIBUTE_NORMAL
#define MultiByteToWideChar
#define ERROR_ACCESS_DENIED
static void cleanup(void)
UINT WINAPI GetDriveTypeW(IN LPCWSTR lpRootPathName)
HANDLE WINAPI FindFirstFileW(IN LPCWSTR lpFileName, OUT LPWIN32_FIND_DATAW lpFindFileData)
BOOL WINAPI FindClose(HANDLE hFindFile)
BOOL WINAPI FindNextFileW(IN HANDLE hFindFile, OUT LPWIN32_FIND_DATAW lpFindFileData)
BOOL WINAPI DisableThreadLibraryCalls(IN HMODULE hLibModule)
VOID WINAPI ExitProcess(IN UINT uExitCode)
HDEVINFO WINAPI SetupDiCreateDeviceInfoListExW(const GUID *ClassGuid, HWND hwndParent, PCWSTR MachineName, PVOID Reserved)
BOOL WINAPI SetupDiSetDeviceInstallParamsW(IN HDEVINFO DeviceInfoSet, IN PSP_DEVINFO_DATA DeviceInfoData OPTIONAL, IN PSP_DEVINSTALL_PARAMS_W DeviceInstallParams)
BOOL WINAPI SetupDiEnumDeviceInfo(HDEVINFO devinfo, DWORD index, PSP_DEVINFO_DATA info)
BOOL WINAPI SetupDiGetDeviceInstallParamsW(IN HDEVINFO DeviceInfoSet, IN PSP_DEVINFO_DATA DeviceInfoData OPTIONAL, OUT PSP_DEVINSTALL_PARAMS_W DeviceInstallParams)
BOOL WINAPI SetupDiCallClassInstaller(DI_FUNCTION InstallFunction, HDEVINFO DeviceInfoSet, PSP_DEVINFO_DATA DeviceInfoData)
BOOL WINAPI SetupDiGetDeviceRegistryPropertyW(HDEVINFO DeviceInfoSet, PSP_DEVINFO_DATA DeviceInfoData, DWORD Property, PDWORD PropertyRegDataType, PBYTE PropertyBuffer, DWORD PropertyBufferSize, PDWORD RequiredSize)
HDEVINFO WINAPI SetupDiGetClassDevsW(CONST GUID *class, LPCWSTR enumstr, HWND parent, DWORD flags)
BOOL WINAPI SetupDiOpenDeviceInfoW(IN HDEVINFO DeviceInfoSet, IN PCWSTR DeviceInstanceId, IN HWND hwndParent OPTIONAL, IN DWORD OpenFlags, OUT PSP_DEVINFO_DATA DeviceInfoData OPTIONAL)
BOOL WINAPI SetupDiGetDeviceInstanceIdW(HDEVINFO DeviceInfoSet, PSP_DEVINFO_DATA DeviceInfoData, PWSTR DeviceInstanceId, DWORD DeviceInstanceIdSize, PDWORD RequiredSize)
BOOL WINAPI SetupDiDestroyDeviceInfoList(HDEVINFO devinfo)
BOOL WINAPI SetupDiBuildDriverInfoList(IN HDEVINFO DeviceInfoSet, IN OUT PSP_DEVINFO_DATA DeviceInfoData OPTIONAL, IN DWORD DriverType)
BOOL WINAPI SetupDiEnumDriverInfoW(IN HDEVINFO DeviceInfoSet, IN PSP_DEVINFO_DATA DeviceInfoData OPTIONAL, IN DWORD DriverType, IN DWORD MemberIndex, OUT PSP_DRVINFO_DATA_W DriverInfoData)
BOOL WINAPI SetupDiDestroyDriverInfoList(IN HDEVINFO DeviceInfoSet, IN PSP_DEVINFO_DATA DeviceInfoData OPTIONAL, IN DWORD DriverType)
static const WCHAR DeviceInstance[]
_Must_inspect_result_ _In_ PFILE_OBJECT _In_ SECURITY_INFORMATION _In_ ULONG _Out_opt_ PULONG LengthNeeded
_Must_inspect_result_ _In_opt_ PVOID _In_opt_ PVOID InstanceId
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
_CRTIMP size_t __cdecl wcslen(_In_z_ const wchar_t *_Str)
#define ERROR_FILE_NOT_FOUND
static VOID InitControls(HWND hwnd)
static BOOL IsUserAdmin(VOID)
BOOL WINAPI DevInstallW(IN HWND hWndParent, IN HINSTANCE hInstance, IN LPCWSTR InstanceId, IN INT Show)
BOOL ScanFoldersForDriver(IN PDEVINSTDATA DevInstData)
BOOL PrepareFoldersToScan(IN PDEVINSTDATA DevInstData, IN BOOL IncludeRemovableDevices, IN BOOL IncludeCustomPath, IN HWND hwndCombo OPTIONAL)
BOOL WINAPI ClientSideInstallW(IN HWND hWndOwner, IN HINSTANCE hInstance, IN LPWSTR lpNamedPipeName, IN INT Show)
BOOL WINAPI InstallDevInstEx(IN HWND hWndParent, IN LPCWSTR InstanceId, IN BOOL bUpdate, OUT LPDWORD lpReboot, IN DWORD Unknown)
BOOL WINAPI UpdateDriverForPlugAndPlayDevicesA(IN HWND hwndParent, IN LPCSTR HardwareId, IN LPCSTR FullInfPath, IN DWORD InstallFlags, OUT PBOOL bRebootRequired OPTIONAL)
static BOOL IsDots(IN LPCWSTR str)
static BOOL SearchDriver(IN PDEVINSTDATA DevInstData, IN LPCWSTR Directory OPTIONAL, IN LPCWSTR InfFile OPTIONAL)
static BOOL SearchDriverRecursive(IN PDEVINSTDATA DevInstData, IN LPCWSTR Path)
BOOL WINAPI DllMain(IN HINSTANCE hInstance, IN DWORD dwReason, IN LPVOID lpReserved)
BOOL InstallCurrentDriver(IN PDEVINSTDATA DevInstData)
static LPCWSTR GetFileExt(IN LPWSTR FileName)
BOOL WINAPI InstallDevInst(IN HWND hWndParent, IN LPCWSTR InstanceId, IN BOOL bUpdate, OUT LPDWORD lpReboot)
BOOL WINAPI UpdateDriverForPlugAndPlayDevicesW(IN HWND hwndParent, IN LPCWSTR HardwareId, IN LPCWSTR FullInfPath, IN DWORD InstallFlags, OUT PBOOL bRebootRequired OPTIONAL)
BOOL CheckBestDriver(_In_ PDEVINSTDATA DevInstData, _In_ PCWSTR pszDir)
#define INSTALLFLAG_NONINTERACTIVE
#define INSTALLFLAG_FORCE
#define INSTALLFLAG_READONLY
BOOL DisplayWizard(IN PDEVINSTDATA DevInstData, IN HWND hwndParent, IN UINT startPage)
#define FILE_ATTRIBUTE_DIRECTORY
struct tagINITCOMMONCONTROLSEX INITCOMMONCONTROLSEX
#define ICC_PROGRESS_CLASS
#define CONFIGFLAG_FAILEDINSTALL
_Check_return_ _CRTIMP int __cdecl _wcsicmp(_In_z_ const wchar_t *_Str1, _In_z_ const wchar_t *_Str2)
_Check_return_ _CRTIMP int __cdecl wcscmp(_In_z_ const wchar_t *_Str1, _In_z_ const wchar_t *_Str2)
#define DIF_INSTALLDEVICEFILES
#define SetupDiGetDeviceInstallParams
SP_DEVINSTALL_PARAMS_A SP_DEVINSTALL_PARAMS
#define ERROR_NO_SUCH_DEVINST
#define SetupDiGetDeviceRegistryProperty
SP_DRVINFO_DATA_V2 SP_DRVINFO_DATA
#define DIF_REGISTER_COINSTALLERS
#define DIF_INSTALLINTERFACES
struct _SP_DEVINSTALL_PARAMS_W SP_DEVINSTALL_PARAMS_W
#define DIF_NEWDEVICEWIZARD_PREANALYZE
#define DIF_INSTALLDEVICE
#define DIF_ALLOW_INSTALL
#define DIF_DESTROYPRIVATEDATA
struct _SP_DEVINFO_DATA SP_DEVINFO_DATA
#define DI_FLAGSEX_ALLOWEXCLUDEDDRVS
#define DIF_SELECTBESTCOMPATDRV
#define SPDRP_CONFIGFLAGS
#define DIF_NEWDEVICEWIZARD_POSTANALYZE
#define SPDIT_COMPATDRIVER
#define DIF_NEWDEVICEWIZARD_FINISHINSTALL
PULONG MinorVersion OPTIONAL
base for all directory entries
SP_DEVINFO_DATA devInfoData
WCHAR DriverPath[MAX_PATH]
HANDLE WINAPI DECLSPEC_HOTPATCH CreateEventW(IN LPSECURITY_ATTRIBUTES lpEventAttributes OPTIONAL, IN BOOL bManualReset, IN BOOL bInitialState, IN LPCWSTR lpName OPTIONAL)
BOOL WINAPI DECLSPEC_HOTPATCH SetEvent(IN HANDLE hEvent)
_Must_inspect_result_ _In_ WDFIOTARGET _In_opt_ WDFREQUEST _In_opt_ PWDF_MEMORY_DESCRIPTOR _In_opt_ PLONGLONG _In_opt_ PWDF_REQUEST_SEND_OPTIONS _Out_opt_ PULONG_PTR BytesRead
_In_ WDFMEMORY _Out_opt_ size_t * BufferSize
_Must_inspect_result_ _In_ WDFKEY _In_ PCUNICODE_STRING _Out_opt_ PUSHORT _Inout_opt_ PUNICODE_STRING Value
int WINAPI GetWindowTextW(HWND hWnd, LPWSTR lpString, int nMaxCount)
DWORD WINAPI GetLastError(void)
DWORD WINAPI GetLogicalDrives(void)
#define ComboBox_GetTextLength(hwndCtl)
#define ERROR_GEN_FAILURE
#define ERROR_INVALID_FLAGS
#define ERROR_PRIVILEGE_NOT_HELD
#define SW_SHOWNOACTIVATE
_At_(*)(_In_ PWSK_CLIENT Client, _In_opt_ PUNICODE_STRING NodeName, _In_opt_ PUNICODE_STRING ServiceName, _In_opt_ ULONG NameSpace, _In_opt_ GUID *Provider, _In_opt_ PADDRINFOEXW Hints, _Outptr_ PADDRINFOEXW *Result, _In_opt_ PEPROCESS OwningProcess, _In_opt_ PETHREAD OwningThread, _Inout_ PIRP Irp Result)(Mem)) NTSTATUS(WSKAPI *PFN_WSK_GET_ADDRESS_INFO