Is there device specific information, as opposed to driver? I realize that we can put whatever we want in the registry, but I was wondering if there
is an equivalent location to the RegistryPath/Parameters that one gets in the DriverEntry for individual devices?
Thanks, Michael
Michael Wade wrote:
Is there device specific information, as opposed to driver? I realize that we can put whatever we want in the registry, but I was wondering if there
is an equivalent location to the RegistryPath/Parameters that one gets in the DriverEntry for individual devices?
Sure there is. Device-specific stuff goes in the Enum subtree. This is
where HKR entries go when you have AddReg entries in your INF in an
[xxxx.HW] section.
Use IoOpenDeviceRegistryKey, with PLUGPLAY_REGKEY_DEVICE.
–
Tim Roberts, xxxxx@probo.com
Providenza & Boekelheide, Inc.
to be clear, there is a device specific key for pnp devices. control / legacy style devices do not have such a key. in KMDF, the appropriate DDI is WdfDeviceOpenRegistryKey
d
Thanks. Just to make sure that I understand here, so this is where I should store device specific information? For example, let’s say that I have
two cards, both are identical but are condifigured slightly different. For the sake of brevity let’s say that each needs a number from the registry
that is unique to each card, say a ULONG MapVer. So at some point in the processing after DeviceAdd I should call WdfDeviceOpenRegistryKey with the
WdfDevice, correct? This will give me a unique key for the device (if my driver is TapDrv then I would get one for TapDrv0, TapDrv1…) right?
And also, if I want to go further down the tree to another branch, say “Parameters”, how does one do that? I don’t see the full path for the registry
key (unless I missed it, which I could easily have done).
Thanks,
Michael
On Tue, 4 Jan 2011 12:20:18 -0800, Tim Roberts wrote:
>Michael Wade wrote:
>> Is there device specific information, as opposed to driver? I realize that we can put whatever we want in the registry, but I was wondering if there
>> is an equivalent location to the RegistryPath/Parameters that one gets in the DriverEntry for individual devices?
>
>Sure there is. Device-specific stuff goes in the Enum subtree. This is
>where HKR entries go when you have AddReg entries in your INF in an
>[xxxx.HW] section.
>
>Use IoOpenDeviceRegistryKey, with PLUGPLAY_REGKEY_DEVICE.
you can create your own subkey if you want, just call WdfRegistryCreateKey create to create a subkey or WdfRegistryOpenKey to open it. the path to the device specific reg key is intentionally obfuscated, it is an implementation detail. the contract is that you will always get the same key back for the same instance of the device (ie it does not move slots). the unique key is not based on the driver or device name (so, no, it is not TapDrv0, TapDrv1, etc), it is based on the pnp identify of the device stack.
d