If you want the devnode (ie enum\xxx\xxx\device parameters), then you want to call IoOpenDeviceRegistryKey(Pdo, PLUGPLAY_REGKEY_DEVICE, …). You are opening up device interface keys, of which, an INF cannot know how to get to.
D
This posting is provided “AS IS” with no warranties, and confers no rights
-----Original Message-----
From: xxxxx@lists.osr.com [mailto:xxxxx@lists.osr.com] On Behalf Of Gary G. Little
Sent: Wednesday, September 10, 2003 7:00 PM
To: Windows System Software Devs Interest List
Subject: [ntdev] Re: Problem with ZwOpenKey
My apologies to the Original Poster … I did not mean to abscond with your
thread.
Doron,
Ok, that too is making sense.
What I see for the PnPName returned from IoOpenDeviceInterfaceRegistryKey
is: …\DEVICECLASSES#<hid_class>#0000#, where as !handle is telling
me the directory object opened is:
…\CONTROLSET001\CONTROL\DEVICECLASSES{}##?#ROOT#<hid_device>#0000#
{}#\DEVICE PARAMETERS.
In the registry I see my values in 0000, and not in DEVICE PARAMETERS, in
fact DEVICE PARAMETERS does not exist as a sub-key for that key.
I’m thinking my INF file is not putting my values where I think it should
… I thought that
[PSSCR.Install.NT.HW.AddReg]
HKR, PhysicalDrive,%REG_SZ%,“\DosDevices\PhysicalDrive0”
would create the PhysicalDrive0 value for 0000. That it does … it’s the
DEVICE PARAMETERS in the directory object of the handle that is the problem.
-
Gary G. Little
Seagate Technologies, LLC
“Doron Holan” wrote in message
news:xxxxx@ntdev…
Does the IoOpenDeviceInterfaceRegistryKey return success? If so, you have a
valid key and all of its contents should be there. If you are getting
object not found, I don’t think your value is there (but you say it is there
in start device … does an app place the value there or is it persistent?).
The contents of HKLM…\Control\Class<guid> are not under HKLM\Software and
are loaded at boot time, so anything under these keys should be available
once you have a PDO.
d
-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Gary G. Little
Sent: Wednesday, September 10, 2003 3:47 PM
To: Windows System Software Devs Interest List
Subject: [ntdev] Re: Problem with ZwOpenKey
Doron,
This may explain a problem I am having. While working on an HID class driver
I have encountered the inability of ZwQueryValueKey to find the values
associated with the enumeration in
HKLM…Control\Class<guid><enumeration>. I have registered the interface
and opened it with IoOpenDeviceInterfaceRegistryKey pointing to the PnP
named returned from registration. That gives me a handle I pass to
ZwQueryValueKey, which promptly returns STATUS_OBJECT_NAME_NOT_FOUND. Note
that this is being done in the AddDevice routine.
Now when I look at the PnP name with WinDbg and use !handle on the handle
passed to ZwQueryValueKey, I find the name(s) agree with what I see in the
registry after the driver fails to load. Hypothetically speaking, could this
be because though the registry key can be constructed, the key/values
themselves will not exist until some time after AddDevice; e.g. Start
device?
I can live with moving the code to StartDevice, if that is required.
Donkey shines. (That’s Southern German for "thanks a bunch.)
–
Gary G. Little
Seagate Technologies, LLC
“Doron Holan” wrote in message
news:xxxxx@ntdev…
This is purely a function of when your driver loads with relation to
winlogon. As part of the winlogon start up, the software key under HKLM is
loaded. In your case, I am sure your app is being loaded after winlogon
which is why you can open this key at create time. There is no documented
way to be notified when this key is loaded. If you want to store driver
settings in the registry that are available at start device time, store them
in the device’s devnode (per device settings) or in the driver’s service key
(ie the regpath in DriverEntry) for driver wide settings.
D
This posting is provided “AS IS” with no warranties, and confers no rights
-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Nicolas Mugnier
Sent: Wednesday, September 10, 2003 7:35 AM
To: Windows System Software Developers Interest List
Subject: [ntdev] Re: Problem with ZwOpenKey
I discovered it happens only at driver load time, by example when the driver
receives
IRP_PJ_PNP - IRP_MN_START_DEVICE
Access to registry works when the driver receives IRP_MJ_CREATE and I cannot
explain it.
“Nicolas Mugnier” a ?crit dans le message de
news:xxxxx@ntdev…
>
> Hi,
>
> I have a problem to access to the registry:
>
> RtlInitUnicodeString(&CfgPath,Buffer);
>
>
InitializeObjectAttributes(&KeyAttributes,&CfgPath,OBJ_CASE_INSENSITIVE,NULL
> ,NULL);
> Status = ZwOpenKey(&KeyHandle,KEY_READ,&KeyAttributes);
>
> Buffer contains \Registry\Machine\Software\Microsoft\Windows
> NT\CurrentVersion\Ports
>
> and status is STATUS_OBJECT_NAME_NOT_FOUND (0xC0000034)
>
> I tried also with only \Registry\Machine\Software in Buffer and I get the
> same error
>
> I don’t understand how I should write the path to the registry to access
it.
>
> Thanks for any help.
>
>
>
>
—
Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256
You are currently subscribed to ntdev as: xxxxx@windows.microsoft.com
To unsubscribe send a blank email to xxxxx@lists.osr.com
—
Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256
You are currently subscribed to ntdev as: xxxxx@windows.microsoft.com
To unsubscribe send a blank email to xxxxx@lists.osr.com
—
Questions? First check the Kernel Driver FAQ at http://www.osronline.com/article.cfm?id=256
You are currently subscribed to ntdev as: xxxxx@windows.microsoft.com
To unsubscribe send a blank email to xxxxx@lists.osr.com</hid_device></hid_class>