Questions tagged [setupapi]

SetupAPI is a Win32API that is used for installing device drivers and in enumerating existing devices on a Windows computer.

SetupAPI is a Win32API that is used for installing device drivers and in enumerating existing devices on a Windows computer.

116 questions
2
votes
0 answers

Implementing SetupAPI in C# (WinForms) to read physical screen size

I'm trying to read the physical size of my two monitor, for learning purpouses... I'm doing this because I need to know exactly the distance that the mouse travels along the screen (in centimeters). I have tried the option of the DPI, but scren…
z3nth10n
  • 2,341
  • 2
  • 25
  • 49
2
votes
1 answer

Getting error 87, incorrect parameter for SetupDiGetDeviceInterfaceDetail

I keep getting the Windows error 87 while calling the SetupDiGetDeviceInterfaceDetail (https://msdn.microsoft.com/en-us/library/ff551120.aspx), I keep getting the error even when I switch all the optional parameters to NULL, but I use the two first…
sh5164
  • 276
  • 2
  • 15
2
votes
2 answers

How to detect USB speed on Windows

I use setup API functions to find a USB device then use createfile to communicate with it. i.e. using SetupDiGetClassDevs, SetupDiEnumDeviceInterfaces, SetupDiGetDeviceInterfaceDetail, etc. I would like to be able to determine if the device is…
MrMoDoJoJr
  • 390
  • 3
  • 9
2
votes
1 answer

SetupDiGetDeviceRegistryProperty: "The data area passed to a system call is too small" error

I have a code that enumerates USB devices on Windows XP using SetupAPI: HDEVINFO hDevInfo = SetupDiGetClassDevs( &_DEVINTERFACE_USB_DEVICE, 0, 0, DIGCF_DEVICEINTERFACE | DIGCF_PRESENT); for (DWORD i = 0; ; ++i) { SP_DEVINFO_DATA…
Violet Giraffe
  • 32,368
  • 48
  • 194
  • 335
2
votes
2 answers

DeviceAttached message never comes

I am trying to develop a C# application that can communicate with a USB HID. I have overriden my WndProc method so that is catches all of the WM_DEVICECHANGE events and passes the DeviceChange method to a method OnDeviceChange (this code is actually…
PICyourBrain
  • 9,976
  • 26
  • 91
  • 136
2
votes
1 answer

Programmatic driver install via .inf causing reboot

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…
conectionist
  • 2,694
  • 6
  • 28
  • 50
2
votes
0 answers

Equivalent API of SetupDiCallClassInstaller to uninstall my modem

I used SetupDiCallClassInstaller with DIF_REMOVE as parameter to uninstall my modem. But when I tested my application in "Windows 7" "64-Bit" machine I got error 0xE0000235, But I couldnt found a solution to solve this. Some of the SO links which…
2vision2
  • 4,933
  • 16
  • 83
  • 164
2
votes
1 answer

SetupDiGetClassDescription returns FALSE, sets error 0xE0000206

I've been playing with the SetupApi on Windows 2003 over the last couple of days, and I'm seeing a bunch of errors I'm not expecting. For example, if I pass GUID_NULL to SetupDiGetClassDescription, it returns FALSE and GetLastError() returns…
Roger Lipscombe
  • 89,048
  • 55
  • 235
  • 380
1
vote
1 answer

Marshalling dynamic structures in 32 and 64 bit runtimes

I'm calling SetupDiGetDeviceInterfaceDetail() here and the SP_DEVICE_INTERFACE_DETAIL_DATA structure is not marshaling correctly. The structures definition can be found here. I've tried using the definition for this structure from PInvoke.net,…
Andrew Falanga
  • 2,274
  • 4
  • 26
  • 51
1
vote
1 answer

When will SetupUninstallOEMInf return ERROR_NO_MORE_ITEMS?

Under what circumstances does SetupAPI's SetupUninstallOEMInf function set the ERROR_NO_MORE_ITEMS error code? The MSDN documentation does not detail this.
Ilya
  • 5,533
  • 2
  • 29
  • 57
1
vote
1 answer

SetupDiGetClassDevs causing error on XP, app built in VS2010, on Win7

I'm writing a WPF app that uses PINVOKE to make calls to a dll that I'm also writing. In one of the exported functions in the dll, the SetupDiGetClassDevs is called. At this point, when running the app on XP, I get an error, first of all a dialog…
Tom Davies
  • 2,386
  • 3
  • 27
  • 44
1
vote
1 answer

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 how to manage reading from them, there doesn't…
1
vote
3 answers

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 has a unique serial number in the USB…
1
vote
0 answers

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, SPDRP_DEVTYPE, 0L, (BYTE*) &dwData, 4, 0); The…
user3677092
  • 31
  • 1
  • 4
1
vote
1 answer

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(SP_DRVINFO_DETAIL_DATA_W); DWORD reqSize = 0; ok =…
Boris
  • 8,551
  • 25
  • 67
  • 120