116 questions
0
votes
0
answers
75
views
Windows Setup API, is there a way to get the interface instances from a device instance?
Say I want to iterate through all of the devices on a system, and for each device, iterate through its interfaces.
Given the information available from an SP_DEVINFO_DATA object, how can I iterate ...
0
votes
0
answers
33
views
why use SetupDiGetDeviceRegistryProperty get SPDRP_CLASSGUID always return the same id
I use the following demo to simultaneously obtain the instanceId and guid of the device, but on my computer, all devices obtain the same SPDRP_CLASSGUID value. Why is this?
int main()
{
HDEVINFO ...
1
vote
0
answers
102
views
Windows test if BLE device is currenlty connected using SetupAPI in C
I'm trying to discover if a Bluetooth Low Energy (BLE) device, that has been paired previously, is currently enabled using setupAPI in a C program with minGW compiler. At the moment I'm trying to use ...
0
votes
0
answers
28
views
Obtaining the Location paths attribute of usb device using the device instance path [duplicate]
I am currently working on a C# program that is responsible for monitoring COM ports. In case of an error condition, the connected device should be restarted. For this purpose, all relevant devices are ...
0
votes
0
answers
245
views
WinAPI: Cannot (re)install a device
I have this C++ WinAPI program. If we assume that the following source code is compiled into devctrl.exe, running
devctrl.exe <DEVICE_GUID>
uninstalls the device with GUID class <DEVICE_GUID&...
0
votes
1
answer
203
views
A Windows program cannot obtain a SP_DEVINFO_DATA for a device
Now I have this non-working (minimum?) example:
#pragma comment (lib, "Setupapi.lib")
#pragma comment (lib, "newdev.lib")
#include <windows.h>
#include <newdev.h>
#...
1
vote
1
answer
2k
views
Open and read from device using HID API
I'm writing a low level input system with the HID API.
I've gotten to the point where I can enumerate all of the devices on a system, and open them with CreateFile.
The problem I'm running into now is ...
1
vote
1
answer
1k
views
Should I use SetupApi or CfgMgr32 in 2022?
I have a lot of experience with libusb, libudev, and SetupAPI for writing Windows drivers, but it's totally unclear to me what CfgMgr32 offers over SetupAPI for Windows USB applications. Microsoft ...
2
votes
1
answer
572
views
How to get "Last Arrival Date" of a USB device using setupapi/cfmgr apis
There is a property "Last Arrival Date" that is present for my USB device in the Device Manager UI.
screenshot (device-manager/properties/details)
How can I programmatically retrieve that ...
0
votes
0
answers
827
views
Using cfgmgr32 to get device ids/instances that support a given interface class
I'm trying to port code from SetupAPI to cfgmgr32, since Microsoft now recommends this, and I do the following query:
SetupDiGetClassDevsExA(&GUID_DEVINTERFACE_COMPORT, nullptr, nullptr, ...
3
votes
1
answer
2k
views
Can I use SetupDiEnumDeviceInterfaces to get a DevicePath from SetupDiGetDeviceInterfaceDetail when no InterfaceClassGUID is known?
Overview...
I have read How to get device interface GUID for a device? and How to open a handle to a device using its Device Instance ID?, but I'm still confused about how I am to (or whether I should ...
2
votes
3
answers
3k
views
How to query the serial number of a UVC camera?
I have two UVC cameras in a stereoscopic setup, controlled with a C++ MediaFoundation app. I need to uniquely identify them in order to assign left and right to each physical device. This camera model ...
1
vote
0
answers
2k
views
C++ SetupApi SetupDiGetDeviceRegistryProperty SPDRP_DEVTYPE fails
I have C++ code (works well with VS6 up to VS2017) that enumerates USB devices and retrieves several properties. I recently added SPDRP_DEVTYPE:
SetupDiGetDeviceRegistryProperty(hDevInfo, &DevData,...
2
votes
0
answers
600
views
How to force a generic Microsoft driver programmatically (RNDIS) with setupapi DiInstallDevice if it fails with ERROR_INVALID_PARAMETER?
When I plug a USB RNDIS device (Linux gadget) to a Windows PC, is seen as 'RNDIS' device, without driver. To make it work I go to Device Manager, and manually select the Microsoft Generic Remote RNDIS ...
1
vote
1
answer
382
views
SetupDiGetDriverInfoDetail fails. Size of SP_DRVINFO_DETAIL_DATA too small?
I'm calling the Setup API function SetupDiGetDriverInfoDetail like this:
SP_DRVINFO_DETAIL_DATA_W driverDetailData = SP_DRVINFO_DETAIL_DATA_W();
driverDetailData.cbSize = sizeof(...