Miniport version information from bus driver

Hi,

I’m writing a bus driver. I want to get the driver versions of the drivers that are loaded for my PDOs. Is there any way to do that?

Since the drivers getting loaded, can be MS inbox drivers, I do not have the option of adding something to those drivers.

Thanks

No standard way to do this. What bigger problem are you trying to solve?

d

Bent from my phone


From: xxxxx@rediff.commailto:xxxxx
Sent: ?1/?2/?2014 7:45 AM
To: Windows System Software Devs Interest Listmailto:xxxxx
Subject: [ntdev] Miniport version information from bus driver

Hi,

I’m writing a bus driver. I want to get the driver versions of the drivers that are loaded for my PDOs. Is there any way to do that?

Since the drivers getting loaded, can be MS inbox drivers, I do not have the option of adding something to those drivers.

Thanks


NTDEV is sponsored by OSR

Visit the list at: http://www.osronline.com/showlists.cfm?list=ntdev

OSR is HIRING!! See http://www.osr.com/careers

For our schedule of WDF, WDM, debugging and other seminars visit:
http://www.osr.com/seminars

To unsubscribe, visit the List Server section of OSR Online at http://www.osronline.com/page.cfm?name=ListServer</mailto:xxxxx></mailto:xxxxx>

Hi Doron,

Actually I want to get the driver version for the loaded drivers because of some management info that I provide to some applications.

One way I thought of is to read the ‘services’ registry for the loaded driver; but I only get the major and minor number there. I need all the ‘xx.xx.xx.xx’ form.

Thanks

How do you even know what driver is loaded on the PDOs you enumerate? It can be any driver the user installs. Not all drivers follow the same version number format. Afaik the service subkey under services doesn’t include version info. Typically version info is embedded in the pe directory in the binary itself , you can use user mode APIs to query for it easily. Doing it in a driver is way too complicated and not an appropriate task for a driver

d

Bent from my phone


From: xxxxx@rediff.commailto:xxxxx
Sent: ?1/?2/?2014 8:08 AM
To: Windows System Software Devs Interest Listmailto:xxxxx
Subject: RE:[ntdev] Miniport version information from bus driver

Hi Doron,

Actually I want to get the driver version for the loaded drivers because of some management info that I provide to some applications.

One way I thought of is to read the ‘services’ registry for the loaded driver; but I only get the major and minor number there. I need all the ‘xx.xx.xx.xx’ form.

Thanks


NTDEV is sponsored by OSR

Visit the list at: http://www.osronline.com/showlists.cfm?list=ntdev

OSR is HIRING!! See http://www.osr.com/careers

For our schedule of WDF, WDM, debugging and other seminars visit:
http://www.osr.com/seminars

To unsubscribe, visit the List Server section of OSR Online at http://www.osronline.com/page.cfm?name=ListServer</mailto:xxxxx></mailto:xxxxx>

When you PDO receives START_DEVICE, the driver registry key will be valid.

Call IoOpenDeviceRegistryKey with PLUGPLAY_REGKEY_DRIVER for your PDO, read DriverVersion value. This value is taken from the INF file when the driver is installed.

Inf version!= file version of the driver

d

Bent from my phone


From: xxxxx@broadcom.commailto:xxxxx
Sent: ?1/?2/?2014 10:03 AM
To: Windows System Software Devs Interest Listmailto:xxxxx
Subject: RE:[ntdev] Miniport version information from bus driver

When you PDO receives START_DEVICE, the driver registry key will be valid.

Call IoOpenDeviceRegistryKey with PLUGPLAY_REGKEY_DRIVER for your PDO, read DriverVersion value. This value is taken from the INF file when the driver is installed.


NTDEV is sponsored by OSR

Visit the list at: http://www.osronline.com/showlists.cfm?list=ntdev

OSR is HIRING!! See http://www.osr.com/careers

For our schedule of WDF, WDM, debugging and other seminars visit:
http://www.osr.com/seminars

To unsubscribe, visit the List Server section of OSR Online at http://www.osronline.com/page.cfm?name=ListServer</mailto:xxxxx></mailto:xxxxx>

xxxxx@rediff.com wrote:

Actually I want to get the driver version for the loaded drivers because of some management info that I provide to some applications.

Applications can certainly get this information. As a general rule, the
device management APIs in user mode are WAY more capable and flexible
than they are in kernel mode.


Tim Roberts, xxxxx@probo.com
Providenza & Boekelheide, Inc.

I’ve done this through the binary resource information before (in kernel mode), but I don’t remember specifically how.

Search around for LdrEnumResources. That’s a good launching point.

Actually a pretty stupid point to start. This is undocumented and changed
at least once, a great way to crash a system.

Don Burn
Windows Filesystem and Driver Consulting
Website: http://www.windrvr.com
Blog: http://msmvps.com/blogs/WinDrvr

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of xxxxx@comcast.net
Sent: Thursday, January 02, 2014 4:29 PM
To: Windows System Software Devs Interest List
Subject: RE:[ntdev] Miniport version information from bus driver

Search around for LdrEnumResources. That’s a good launching point.


NTDEV is sponsored by OSR

Visit the list at: http://www.osronline.com/showlists.cfm?list=ntdev

OSR is HIRING!! See http://www.osr.com/careers

For our schedule of WDF, WDM, debugging and other seminars visit:
http://www.osr.com/seminars

To unsubscribe, visit the List Server section of OSR Online at
http://www.osronline.com/page.cfm?name=ListServer

It’s not stupid place to start if you want to use an undocumented function like LdrEnumResources, is it. I didn’t say that it was a pretty good idea.

xxxxx@comcast.net wrote:

It’s not stupid place to start if you want to use an undocumented function like LdrEnumResources, is it. I didn’t say that it was a pretty good idea.

Well, part of the point here is that you’re guiding him down the wrong
path. It’s a familiar problem here. When someone asks how to put wings
on their pig, the discussion shouldn’t be about which type of glue works
best. The discussion should be about suggesting more appropriate ways
to transport pigs.

The original poster wanted to offer this information to applications.
So, the right way to handle this is to have a user-mode DLL that offers
this information as a service. It’s very easy to troll through the
device tree, find drivers, and extract resource information in user mode.


Tim Roberts, xxxxx@probo.com
Providenza & Boekelheide, Inc.