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
1
vote
1 answer

How to Get Driver Install Date?

How do you get the install date of a driver using the Setup API? (This is pretty much the same as this question, except that I'm looking for a solution with the Setup API, not WMI.) The data I need is located in a value in a key like this: …
user541686
  • 205,094
  • 128
  • 528
  • 886
1
vote
2 answers

How to open a handle to a device using its Device Instance ID?

I am updating my question to better reflect what I was actually going after. To state a fact about my original confusion quickly, it is incorrect to say that there is a 1-to-1 relationship between "Device Interface Class GUID" and the Device…
Code Doggo
  • 2,146
  • 6
  • 33
  • 58
1
vote
1 answer

Get information about device using SetupAPI

I have a printer connected with USB port and I want to get some information about it. I am using SetupDiEnumDeviceInfo function from setupapi to get information. I am doing everything as it is described in MSDN. #include #include…
Gor Asatryan
  • 904
  • 7
  • 24
1
vote
0 answers

DiUninstallDriver returns wrong NeedReboot

I am using DiUninstallDriver for uninstalling a driver. The syntax is: BOOL DiUninstallDriverW( HWND hwndParent, LPCWSTR InfPath, DWORD Flags, PBOOL NeedReboot ); The NeedRebbot parameter is explained: A pointer to a value of type…
RK Coder
  • 398
  • 2
  • 14
1
vote
1 answer

Windows XP custom USB class driver, pre-install without WHQL signing?

I'm working on a Windows driver for a USB device and the installation has to override the built-in class driver from Microsoft, so that the device uses my driver. The driver is self-signed but not WHQL signed. Installation is not a problem on Vista…
msp
  • 11
  • 3
1
vote
1 answer

windows: detect same device on both bluetooth api and setupapi

I'm currently creating a program that's divided in two parts, one where I detect nearby bluetooth devices and connect them to the pc if the name match and the other where I search for the device with setupapi and get an handle for HID…
Davide Mor
  • 83
  • 7
1
vote
0 answers

How to determine what enumerator(s) to use in enumerating Windows disk devices via SetupDiGetClassDevs

I am attempting to write C++/Win32 code that can determine if a given file path refers to a fixed disk. (I absolutely may not use WMI for this task.) My best bet - at least from this thread -- appear to be the SetupDiXXXX functions. So that's what…
Joe
  • 5,394
  • 3
  • 23
  • 54
1
vote
1 answer

SetupAPI in IoTCore?

Can I use SetupApi Functions in windows10 IoTCore? I writed only one line : HDEVINFO Handle = SetupDiGetClassDevs(NULL,NULL,NULL,DIGCF_ALLCLASSES); But Handle = 0xfff... GetlastError = 127 means "The specified procedure could not be found."
1
vote
2 answers

Find out the active graphics driver using SetupAPI

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…
Christoph
  • 1,964
  • 2
  • 27
  • 44
1
vote
2 answers

Can the key of a line in an .inf file be retrieved using the SetupAPI?

I'm using the function SetupGetLineText ( http://msdn.microsoft.com/en-us/library/aa377388(v=VS.85).aspx ) from the Setup API to read a line from a section in an inf file. Lines are in the format: key=value SetupGetLineText appears to return the…
Scott Langham
  • 58,735
  • 39
  • 131
  • 204
1
vote
1 answer

Use Windows SetupAPI to get USB Device Descriptor

I was wondering if it is possible to get the USB device descriptor with the SetupAPI functions (like SetupDiGetDeviceRegistryProperty)? Thank you! EDIT So far I am only able to receive the windows friendly…
tzippy
  • 6,458
  • 30
  • 82
  • 151
1
vote
1 answer

Marshalling SetupGetInfInformation from C++ to C#

I'm trying to marshal the SetupGetInfInformation function from Windows' SetupAPI to C#. I've defined the (marshalled) structures necessary as follows: internal const uint INFINFO_INF_NAME_IS_ABSOLUTE = 2; …
Justin Shidell
  • 588
  • 1
  • 5
  • 16
1
vote
2 answers

My SetupDiEnumDeviceInfo returns ERROR_NO_MORE_ITEMS for certain devices (C#)

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,…
1
vote
1 answer

How to detect two USB devices connected to same USB hub in c#

I am working on a .NET 4.5 C# project and I need to find out if my USB devices are connected to the same USB hub. I googled and tried to explore structure of many ManagementObjectCollection like Win32_USBHub and Win32_PnPEntity but I could not find…
1
vote
1 answer

Change installed device driver

I am trying to change the installed driver for a device using SetupAPI. The driver is already present on the PC, just not currently selected. More specifically, I am trying undo the installation of a third-party driver for a USB composite device,…
Timbo
  • 27,472
  • 11
  • 50
  • 75