0

I want to list device drivers as shown in the device drivers(devmgmt.msc) window. SetupDiGetClassDevs() API provides basic informations about the device. But I need more information like driver install date, driver Signer.

Asesh
  • 3,186
  • 2
  • 21
  • 31
gajapathy p
  • 113
  • 1
  • 13
  • WMI - you can access it with `wmic` or powershell `Get-WMIObject` – Ben May 17 '18 at 08:38
  • Yes, I have tried `win32_pnpsigneddriver`wmi class. But it is not providing information such as `ProblemCode` and most of the time `installDate` returns null. So, is there any other class or any other API available for retrieving driver details – gajapathy p May 17 '18 at 08:45
  • That is a completely different question. "What WMI class can I use to find out..." whatever it is you want to know. What do you actually want to know? Driver signer is there. What do you mean by "Install date" - what are you going to use it for? – Ben May 17 '18 at 08:55
  • *"I need more information like [...]"* - That's not a useful statement. We cannot guess what you need. You need to tell us. – IInspectable May 17 '18 at 09:31
  • 1
    https://learn.microsoft.com/en-us/windows-hardware/drivers/install/retrieving-the-status-and-problem-code-for-a-device-instance – Hans Passant May 17 '18 at 10:12
  • you can try this [Detailed PCI-E information, Windows](https://stackoverflow.com/a/47854075/2521214) to obtain specific details about HW ... just querry the stuff you want (in table you got listing of possible options) however I see no driver info (does not mean it is not hidden there somwhere) – Spektre May 17 '18 at 11:06

1 Answers1

0

You can interrogate just about every aspect of the system configuration or running state using WMI - Windows Management Instrumentation.

There is a command-line tool, wmic, which will do this, and also a PowerShell cmdlet, Get-WmiObject.

E.g. to list devices:

Get-WmiObject -Class CIM_LogicalDevice

Accessing WMI from C++:

Ben
  • 34,935
  • 6
  • 74
  • 113