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
11
votes
2 answers

Does SetupDiGetClassDevs work with device instance IDs as documented?

According to MSDN documentation, SetupDiGetClassDevs can be passed a device instance ID to obtain a device information set for a specific device: To return only a specific device, set the DIFCF_DEVICEINTERFACE flag and use the Enumerator…
Judge Maygarden
  • 26,961
  • 9
  • 82
  • 99
9
votes
2 answers

Why is the SetupDiCallClassInstaller function restricted to 64 bit programs?

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.
nathan
  • 4,612
  • 6
  • 32
  • 33
6
votes
4 answers

dpinst / DifX won't install signed driver silently

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…
Ilya
  • 5,533
  • 2
  • 29
  • 57
6
votes
1 answer

SetupAPI (setupdi functions) don't link

I want a function to enumerate serial (COM) ports on Windows. For this purpose I mostly copied code from…
Andrey Pro
  • 501
  • 1
  • 10
  • 22
5
votes
1 answer

Can the setup api be used to tell if a device is enabled

I know how to use the Setup API to enable and disable devices. What I need to know is, can I use this same API to determine if a device is enabled/disabled? I think the real question is how to use it thusly because Microsoft's devcon uses the…
Andrew Falanga
  • 2,274
  • 4
  • 26
  • 51
5
votes
1 answer

How to know if a device has been explicitly been disabled by user?

Using device manager a user can explicitly enable/disable a device, as can be seen in the following image. For a given device I want to know if it's currently in a user disabled/enabled state. I have tried the following…
Sahil Singh
  • 3,352
  • 39
  • 62
5
votes
1 answer

How do I obtain USB_DEVICE_DESCRIPTOR given a device path

I have been able to enumerate USB devices using the SetupAPI, and I've looked at the usbview application from the WDK, but I still can't figure out how to get the USB_DEVICE_DESCRIPTOR. I would rather avoid using WMI. DeviceIoControl is what the…
Malaise
  • 705
  • 3
  • 8
  • 20
4
votes
1 answer

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

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…
nathan
  • 4,612
  • 6
  • 32
  • 33
4
votes
0 answers

SetupDiGetClassDevsEx errors with "This function is not supported on this system." when using it against a remote PC

I am using MSVC++ and the SetupAPI(.h) and trying to call SetupDiGetClassDevsEx targeting a remote PC, which is failing with the error, "This function is not supported on this system." Importantly to note, this call (when not providing a remote PC…
Justin Shidell
  • 588
  • 1
  • 5
  • 16
4
votes
1 answer

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

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…
Andrew Falanga
  • 2,274
  • 4
  • 26
  • 51
4
votes
1 answer

Correct Windows API to find CurrentControlSet\Control\MediaProperties?

I'm looking to support a custom joystick device, and due to project requirements I can no longer use the DirectInput API. I've switched to using the "classic" Windows multimedia API (e.g. joyGetDevCaps and family), and it all works with one…
holtavolt
  • 4,378
  • 1
  • 26
  • 40
3
votes
1 answer

Installing a specific driver for a specific device programmatically (and when pre-install fails)

I have a signed driver and I need to install it programmatically for a specific USB device using C# (targeting Vista and 7 64-bit). I found very easy the use of the DriverPackagePreinstall function within the DIFx API (here is how to P/Invoke it):…
Mauro Ganswer
  • 1,379
  • 1
  • 19
  • 33
3
votes
1 answer

WinUSB driver installation failing on XP (works fine on Win7)

I'm having difficulty installing a WinUSB driver on Windows XP (x86, service pack 3). I've followed the Microsoft WinUSB guidelines to create a signed driver package using an inf file, signed cat file (made using Inf2cat), and relevant WinUSB…
Tom Davies
  • 2,386
  • 3
  • 27
  • 44
3
votes
1 answer

Getting hardware GUID for video adapter in C#

I'm developing a launcher application for a 3D game on Windows. The configuration "ini" file requires the user to specify the hardware GUID for the desired device, as in, the Device Identifier GUID returned by dxdiag.exe. I'm trying to list the…
alaska.alex
  • 183
  • 1
  • 8
3
votes
1 answer

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 even) use SetupDiEnumDeviceInterfaces paired…
Ben
  • 314
  • 2
  • 11
1
2 3 4 5 6 7 8