setupapi

unresolved external symbol _DEVPKEY_Device_BusReportedDeviceDesc

别说谁变了你拦得住时间么 提交于 2020-06-16 05:07:48
问题 For devices attached to my machine I want to retrieve device-property Bus Reported Device Description . For this purpose I use function SetupDiGetDeviceProperty of Setup API. In devpkey.h I found the defintion DEVPKEY_Device_BusReportedDeviceDesc . But if I use DEVPKEY_Device_BusReportedDeviceDesc I receive unresolved external symbol _DEVPKEY_Device_BusReportedDeviceDesc while linking. Here is my code (only included minimal code to reproduce issue): #include "stdafx.h" #include <Windows.h>

dpinst / DifX won't install signed driver silently

我们两清 提交于 2019-12-30 03:24:04
问题 When installing a signed driver (i.e. with a properly signed .CAB) on Windows 7 through DpInst, unless it's a WHQL-signed driver, you cannot install it silently. If you run DpInst in the non-silent mode, it'll prompt you to trust the "publisher". If you run DpInst in silent mode, it would fail with a signing-related error code (something like 0x800b0109 -- check your setupapi.app.log). 回答1: While ilya's answer is good, the solution on Windows 7 is even easier. The command below deploys the

SetupDiCallClassInstaller throws ERROR_IN_WOW64 when compiled for 32 bit on a 64 bit machine.

放肆的年华 提交于 2019-12-29 08:59:08
问题 Calling SetupDiCallClassInstaller on a 64 bit machine when compiled for 32 bit returns false. GetLastError() == ERROR_IN_WOW64 All the other function calls work fine under 32bit, just this one is giving me problems. I'm wondering if anyone knows what I am doing wrong here. 回答1: As Hans Passant pointed as a comment to the question, you cannot call that function from a 32-bit process on a 64-bit Windows platform. When you try to do so anyway, you get an ERROR_IN_WOW64. The reason why you can't

UpdateDriverForPlugAndPlayDevices error is telling me I'm *not* doing something that I am

余生长醉 提交于 2019-12-21 21:12:28
问题 I'm working on a means of installing a driver. Because of the multiple platforms on which this must work, I'm shelling-out to both devcon and dpinst to do the work of driver install/update/removal when needed. While testing, I'm having problems with the shelling out to devcon. To isolate, I wrote a small app to do what devcon does in update see here, using the devcon source from the WinDDK for reference. I'm having some problems with UpdateDriverForPlugAndPlayDevices() from Setup API

Why is the SetupDiCallClassInstaller function restricted to 64 bit programs?

岁酱吖の 提交于 2019-12-19 06:25:05
问题 Attempting to call SetupDiCallClassInstaller from a program compiled in 32 bit mode fails on 64 bit Windows. Apparently this is by design, but I'd like to know the reason. 回答1: According to MSDN: Device Installations on 64-Bit Systems: The 32-bit version of the application must check the value returned by UpdateDriverForPlugAndPlayDevices. If the return value is ERROR_IN_WOW64, the 32-bit application is executing on a 64-bit platform and cannot update inbox drivers. Instead, it must call

My SetupDiEnumDeviceInfo returns ERROR_NO_MORE_ITEMS for certain devices (C#)

十年热恋 提交于 2019-12-13 03:45:55
问题 I am trying to fetch power data for my devices(cm_power_data_s). I am using the SetupDiGetDeviceRegistryProperty API to do so. While this works fine for some devices, it doesn't work for others. The data returned by SetupDiEnumDeviceInfo is null , and without this, I can't use SetupDiGetDeviceRegistryProperty . I tried manually filling sp_devinfo_data by making a wmi query to get the class GUID , but SetupDiGetDeviceRegistryProperty doesn't return the buffer size with it (same as passing null

What do I pass as the last value to the function SetupAPI.DLL.SetupDiEnumDeviceInterfaces()?

谁说我不能喝 提交于 2019-12-12 03:56:40
问题 I'm working in Python trying to create a simple program that reads and write from and to a fairly simple USB device. The problem I'm having is that since PyWinUSB and PyUSB don't seem to have what I need (trying to write to the device makes things explode), I have to work from scratch using the ctypes python module and the raw dll functions in WinUSB and SetupAPI. I've been able to get my question answered about how to define the structure that I'm passing to the function, but the problem

Getting device path for CreateFile while enumerating devices with SetupDiEnumDeviceInfo

本小妞迷上赌 提交于 2019-12-11 12:20:07
问题 I need to get info about all connected usb mass storage devices. For now I'm using this code to do the job HDEVINFO deviceInfoList; deviceInfoList = SetupDiGetClassDevs(NULL, _T("USBSTOR"), NULL, DIGCF_ALLCLASSES | DIGCF_PRESENT); if (deviceInfoList != INVALID_HANDLE_VALUE) { SP_DEVINFO_DATA deviceInfoData; deviceInfoData.cbSize = sizeof(SP_DEVINFO_DATA); for (DWORD i = 0; SetupDiEnumDeviceInfo(deviceInfoList, i, &deviceInfoData); i++) { LPTSTR buffer = NULL; DWORD buffersize = 0; while (

Find out the active graphics driver using SetupAPI

≡放荡痞女 提交于 2019-12-11 06:05:41
问题 I try to find out the version of the currently active graphics driver on Windows using C++ and SetupAPI. The solution roughly looks like Call SetupDiGetClassDevs for GUID_DEVCLASS_DISPLAY . Call SetupDiBuildDriverInfoList for the result set. Call SetupDiEnumDriverInfo for the device set with SPDIT_COMPATDRIVER , which gives me all known drivers compatible with the GPU. The result includes the fallback driver from Microsoft, which I can easily exclute, but it also includes all driver versions

Programmatic driver install via .inf causing reboot

守給你的承諾、 提交于 2019-12-05 05:03:59
问题 I'm trying to install a driver via an inf file using this command: rundll32.exe setupapi,InstallHinfSection DefaultInstall 128 .\my_driver.inf According to MSDN (http://msdn.microsoft.com/en-us/library/aa376957%28v=vs.85%29.aspx), by suplying 128 as the parameter, apart from "Set the default path of the installation to the location of the INF. This is the typical setting", the install should (+0) not ask the user for a reboot. However, in my case, it always does. What am I doing wrong? 回答1: