NDIS add parameter to configuration registry

Hi,
I want to add a entry to ndis driver configuration in registry.
Then i want to update this entry from client application and read the entry from driver.
Is it possible?
If yes then how do i get the registry key for drivers configuration in application and also in driver?

xxxxx@gmail.com wrote:

Hi,
I want to add a entry to ndis driver configuration in registry.
Then i want to update this entry from client application and read the entry from driver.
Is it possible?
If yes then how do i get the registry key for drivers configuration in application and also in driver?

Well, as there’s no replies from the NDIS gurus,
and I could not find a ready recipe on ndis.com or pcausa.com

In the application: First, you need to locate your ndis driver instance:

call SetupDiGetClassDevs with the GUID of “net” class
{4D36E972-E325-11CE-BFC1-08002bE10318}
Then call SetupDiOpenDevRegKey (with some intermediate steps)
to open the registry key of that instance - This is located under
HKLM\SYSTEM\CurrentControlSet\Control\Class{net GUID}\nnnn

From the values of this key you can find your device.
Use SetupDiSetDeviceRegistryProperty or read directly from the registry.

Once you’ve found your device’s reg. key, make your changes
and restart the device, or tell the driver (by a private
ioctl, or OID or whatever) to re-read the parameters.

Ndis miniport reads it’s parameters with NdisOpenConfiguration(Ex),
NdisReadConfiguration etc.

–pa

> Once you’ve found your device’s reg. key, make your changes

and restart the device, or tell the driver (by a private
ioctl, or OID or whatever) to re-read the parameters.

IIRC the INetCfg interface also allows this, and can send ProtocolPnPEvent/Reconfigure to the protocol automatically to re-read the parameters.

Probably (forgot the details) this support is for protocols only.


Maxim S. Shatskih
Windows DDK MVP
xxxxx@storagecraft.com
http://www.storagecraft.com

Do you really mean “Driver Configuration” or do you mean “Device
Configuration”.

The distinction is that with “Driver Configuration” the configuration is
global to the driver overall and with “Device Configuration” the
configuration is ‘per-device instance’.

In NDIS, there are really two types of ‘instances’ depending on the driver
type. For a protocol, the ‘instance’ is a protocol-to-adapter binding.
For an adapter, it is the adapter PnP device instance.

If would be helpful to know what sort of driver you are building and which
configuration (global, per-instance) you are trying to access.

Good Luck,
Dave Cattley

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of
xxxxx@gmail.com
Sent: Friday, July 24, 2009 3:09 PM
To: Windows System Software Devs Interest List
Subject: [ntdev] NDIS add parameter to configuration registry

Hi,
I want to add a entry to ndis driver configuration in registry.
Then i want to update this entry from client application and read the entry
from driver.
Is it possible?
If yes then how do i get the registry key for drivers configuration in
application and also in driver?


NTDEV is sponsored by OSR

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

In our NDIS IM driver we get updated Registry configurations in 3 different ways:
1.) After an install/boot read the Registry suppling defaults for values not listed.
2.) The Property Page via the Notify Object sends a NetEventReconfigure PnP event which causes a read of the Registry for values not covered by the Property Page.
3.) An User application sets the Registry value then sends an I/O Control call to the driver telling it to read the Registry.

Larry C