Steps for an application to query a driver's version

P

Polaris

Hi:

I'm new to driver development, just wonder what should be the steps to
implement this: On WinXP, a Windows application needs to query the version
of a running driver (a network device driver). What are the steps to
implement in the drver side (IOCTL?) and what needs to be done in the
application side? Just roughly steps should be good enough for me to start.

Thanks in Advance !
Polaris
 
R

Robert Marquardt

Polaris said:
Hi:

I'm new to driver development, just wonder what should be the steps to
implement this: On WinXP, a Windows application needs to query the version
of a running driver (a network device driver). What are the steps to
implement in the drver side (IOCTL?) and what needs to be done in the
application side? Just roughly steps should be good enough for me to start.

Thanks in Advance !
Polaris

A WDM driver is simply a kernel DLL. Read the version information of the
driver just as you would do it for a user space DLL.
 
P

Polaris

but how can a user mode application directly "talk" with kernel mode .sys
driver ?
 
S

Stephan Wolf [MVP]

In order to get the driver version from an already started (running)
network interface card (NIC) driver, query its
OID_GEN_VENDOR_DRIVER_VERSION. This can be done in several ways, e.g.
via IOCTL or WMI, see

http://www.ndis.com/faq/QA10290101.htm

http://msdn.microsoft.com/library/
-> "Win32 and COM Development"
-> "Driver Development Kit"
-> "Network Devices and Protocols"
From here see both:

-> "Design Guide"
-> "Miniport Drivers"
-> "Obtaining and Setting Miniport Driver Information and NDIS
Support for WMI"
-> "NDIS Support for WMI"

...and:

-> "Reference"
-> "NDIS Objects"
-> "General Objects"
-> "General Operational Characteristics"
-> "OID_GEN_VENDOR_DRIVER_VERSION"

Stephan
---
 
S

Soumik Sarkar

You don't have to "talk" to the driver. Look at the GetFileVersionInfo,
GetFileVersionInfoSize and VerQueryValue functions in the Win32 SDK.

Soumik.
 
P

Polaris

Thanks Mr. Wolf!
Polaris
Stephan Wolf said:
In order to get the driver version from an already started (running)
network interface card (NIC) driver, query its
OID_GEN_VENDOR_DRIVER_VERSION. This can be done in several ways, e.g.
via IOCTL or WMI, see

http://www.ndis.com/faq/QA10290101.htm

http://msdn.microsoft.com/library/
-> "Win32 and COM Development"
-> "Driver Development Kit"
-> "Network Devices and Protocols"


-> "Design Guide"
-> "Miniport Drivers"
-> "Obtaining and Setting Miniport Driver Information and NDIS
Support for WMI"
-> "NDIS Support for WMI"

..and:

-> "Reference"
-> "NDIS Objects"
-> "General Objects"
-> "General Operational Characteristics"
-> "OID_GEN_VENDOR_DRIVER_VERSION"

Stephan
 
R

Ray Trent

Polaris said:
I think that does not guarantee to get the version of the running (loaded)
driver.

No, but neither does any method you can possibly use. Filters can be
injected on anything, the OS can be hooked, the driver itself can be
arbitrarily edited by malicious code to produce a different answer,
etc., etc.

If you look up the image path in the services key and then check the
version info on that file, you're close to as good as you can get, but
with a lot less effort.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top