Hi guys.
I have a NDIS miniport driver and I need to be able so save some per-device
configuration parameters (that should survive a reboot or device
insertion/removal). Ndis provides NdisWriteConfiguration() for that, but the
function (as confirmed by some folks here on ntdev) cannot be used outside
the MiniportInitialize handler, as it requires a ConfigurationHandle, which
is obtained thru NdisOpenConfiguration(), which in turns requires the
WrapperConfigurationContext, whose validity is only within the scope of
MiniportInitialize itself.
My questions are
- how do I obtain the reg key name opened by NdisOpenConfiguration()? I
know that this reg key name is hidden by Ndis for a good reason i.e.
insulating the miniport from the OS itself.
- If 1. is not possible, where can I take some unique identifier of the
adapter to save some configuration parameters? I don’t care too much of
doing it in the driver or in user mode. The important thing is that I need
to have a way to uniquely couple the MiniportAdapterHandle with whatever
unique identifier I use in user mode.
I hope i was clear enough…
Have a nice day
GV
You can SetupDiOpenDevRegKey() and look for your component ID, from
usermode. If you need in-flight changes based on information you find
in the registry, it might be easier for you to build a control device
interface and IOCTL the changes directly. That gets you out of
polling and keeps you in WHQL-signable land.
-Steve
On Apr 4, 2007, at 2:44 PM, Gianluca Varenni wrote:
Hi guys.
I have a NDIS miniport driver and I need to be able so save some
per-device
configuration parameters (that should survive a reboot or device
insertion/removal). Ndis provides NdisWriteConfiguration() for
that, but the
function (as confirmed by some folks here on ntdev) cannot be used
outside
the MiniportInitialize handler, as it requires a
ConfigurationHandle, which
is obtained thru NdisOpenConfiguration(), which in turns requires the
WrapperConfigurationContext, whose validity is only within the
scope of
MiniportInitialize itself.
My questions are
- how do I obtain the reg key name opened by NdisOpenConfiguration
()? I
know that this reg key name is hidden by Ndis for a good reason i.e.
insulating the miniport from the OS itself.
- If 1. is not possible, where can I take some unique identifier
of the
adapter to save some configuration parameters? I don’t care too
much of
doing it in the driver or in user mode. The important thing is that
I need
to have a way to uniquely couple the MiniportAdapterHandle with
whatever
unique identifier I use in user mode.
I hope i was clear enough…
Have a nice day
GV
Questions? First check the Kernel Driver FAQ at http://
www.osronline.com/article.cfm?id=256
To unsubscribe, visit the List Server section of OSR Online at
http://www.osronline.com/page.cfm?name=ListServer
----- Original Message -----
From: “Steve Dispensa”
To: “Windows System Software Devs Interest List”
Sent: Thursday, April 05, 2007 7:30 AM
Subject: Re: [ntdev] Saving per adapter configuration parameters in a NDIS
miniport driver
> You can SetupDiOpenDevRegKey() and look for your component ID, from
> usermode. If you need in-flight changes based on information you find in
> the registry, it might be easier for you to build a control device
> interface and IOCTL the changes directly. That gets you out of polling
> and keeps you in WHQL-signable land.
I basically need to change some parameters on the fly (and I use a device
control interface for that, no big deal) but I also need to back them up
into the registry so that at the next reboot they are restored. And it would
be easier if I can save such information in the same registry hive used by
NdisOpenConfiguration. I’ll have a look at SetupDiOpenDevRegKey (in practice
i have never used the setup api, more used to the netcfg stuff
)
Thanks Steve!
GV
>
> -Steve
>
> On Apr 4, 2007, at 2:44 PM, Gianluca Varenni wrote:
>
>> Hi guys.
>>
>> I have a NDIS miniport driver and I need to be able so save some
>> per-device
>> configuration parameters (that should survive a reboot or device
>> insertion/removal). Ndis provides NdisWriteConfiguration() for that, but
>> the
>> function (as confirmed by some folks here on ntdev) cannot be used
>> outside
>> the MiniportInitialize handler, as it requires a ConfigurationHandle,
>> which
>> is obtained thru NdisOpenConfiguration(), which in turns requires the
>> WrapperConfigurationContext, whose validity is only within the scope of
>> MiniportInitialize itself.
>>
>> My questions are
>> 1. how do I obtain the reg key name opened by NdisOpenConfiguration ()? I
>> know that this reg key name is hidden by Ndis for a good reason i.e.
>> insulating the miniport from the OS itself.
>> 2. If 1. is not possible, where can I take some unique identifier of the
>> adapter to save some configuration parameters? I don’t care too much of
>> doing it in the driver or in user mode. The important thing is that I
>> need
>> to have a way to uniquely couple the MiniportAdapterHandle with whatever
>> unique identifier I use in user mode.
>>
>> I hope i was clear enough…
>>
>> Have a nice day
>> GV
>>
>>
>> —
>> Questions? First check the Kernel Driver FAQ at http://
>> www.osronline.com/article.cfm?id=256
>>
>> To unsubscribe, visit the List Server section of OSR Online at
>> http://www.osronline.com/page.cfm?name=ListServer
>
>
> —
> Questions? First check the Kernel Driver FAQ at
> http://www.osronline.com/article.cfm?id=256
>
> To unsubscribe, visit the List Server section of OSR Online at
> http://www.osronline.com/page.cfm?name=ListServer
I suggest that you consider WMI to get the ‘live’ changes into the driver.
A control channel on a miniport driver just to make config changes is
perhaps a bit overkill given that that is exactly what the WMI to custom
GUID mapper in NDIS was created for.
Good luck,
-dave
-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Gianluca Varenni
Sent: Friday, April 06, 2007 11:37 AM
To: Windows System Software Devs Interest List
Subject: Re: [ntdev] Saving per adapter configuration parameters in a NDIS
miniport driver
----- Original Message -----
From: “Steve Dispensa”
To: “Windows System Software Devs Interest List”
Sent: Thursday, April 05, 2007 7:30 AM
Subject: Re: [ntdev] Saving per adapter configuration parameters in a NDIS
miniport driver
> You can SetupDiOpenDevRegKey() and look for your component ID, from
> usermode. If you need in-flight changes based on information you find
> in the registry, it might be easier for you to build a control device
> interface and IOCTL the changes directly. That gets you out of
> polling and keeps you in WHQL-signable land.
I basically need to change some parameters on the fly (and I use a device
control interface for that, no big deal) but I also need to back them up
into the registry so that at the next reboot they are restored. And it would
be easier if I can save such information in the same registry hive used by
NdisOpenConfiguration. I’ll have a look at SetupDiOpenDevRegKey (in practice
i have never used the setup api, more used to the netcfg stuff
)
Thanks Steve!
GV
>
> -Steve
>
> On Apr 4, 2007, at 2:44 PM, Gianluca Varenni wrote:
>
>> Hi guys.
>>
>> I have a NDIS miniport driver and I need to be able so save some
>> per-device configuration parameters (that should survive a reboot or
>> device insertion/removal). Ndis provides NdisWriteConfiguration() for
>> that, but the function (as confirmed by some folks here on ntdev)
>> cannot be used outside the MiniportInitialize handler, as it requires
>> a ConfigurationHandle, which is obtained thru
>> NdisOpenConfiguration(), which in turns requires the
>> WrapperConfigurationContext, whose validity is only within the scope
>> of MiniportInitialize itself.
>>
>> My questions are
>> 1. how do I obtain the reg key name opened by NdisOpenConfiguration
>> ()? I know that this reg key name is hidden by Ndis for a good reason
i.e.
>> insulating the miniport from the OS itself.
>> 2. If 1. is not possible, where can I take some unique identifier of
>> the adapter to save some configuration parameters? I don’t care too
>> much of doing it in the driver or in user mode. The important thing
>> is that I need to have a way to uniquely couple the
>> MiniportAdapterHandle with whatever unique identifier I use in user
>> mode.
>>
>> I hope i was clear enough…
>>
>> Have a nice day
>> GV
>>
>>
>> —
>> Questions? First check the Kernel Driver FAQ at http://
>> www.osronline.com/article.cfm?id=256
>>
>> To unsubscribe, visit the List Server section of OSR Online at
>> http://www.osronline.com/page.cfm?name=ListServer
>
>
> —
> Questions? First check the Kernel Driver FAQ at
> http://www.osronline.com/article.cfm?id=256
>
> To unsubscribe, visit the List Server section of OSR Online at
> http://www.osronline.com/page.cfm?name=ListServer
—
Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256
To unsubscribe, visit the List Server section of OSR Online at
http://www.osronline.com/page.cfm?name=ListServer