Thank you very much for responding to my question… I appreciate
everyone’s input.
I converted my code from the Reg…() function to the Zw…() functions,
but I ran into the same problems I started with. When I try to use the
ZwOpenKey() function, I get an error code of 0xc0000034
(STATUS_OBJECT_NAME_NOT_FOUND). I went through some sample code in the
DDK to see what I was doing wrong. I noticed that all the examples were
calling IoOpenDeviceRegistryKey() before anything else, but that opens a
device-specific area of the registry…
Here is my code, boiled down:
const WCHAR c_szMyDrvReg =
L"\Registry\HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\M
yDriver";
NTSTATUS Status;
HANDLE hMyDrvLink;
UNICODE_STRING TempUnicodeString;
OBJECT_ATTRIBUTES Object;
RtlInitUnicodeString(&TempUnicodeString, c_szMyDrvReg);
InitializeObjectAttributes(&Object, &TempUnicodeString,
OBJ_CASE_INSENSITIVE, NULL, (PSECURITY_DESCRIPTOR) NULL);
Status = ZwOpenKey(&hMyDrvLink, KEY_ALL_ACCESS, &Object);
Status ends up being 0xc0000034, even if I cut out the \MyDriver part
of the c_szMyDrvReg string…
Any idea how to approach this?
Thanks,
John
-----Original Message-----
From: Vodicka, Michal [mailto:xxxxx@rkk.cz]
Sent: Tuesday, April 17, 2001 2:17 PM
To: NT Developers Interest List
Subject: [ntdev] RE: quick question
Use ZwXxx equivalents, some are documented in the DDK. To use them in
NDIS
driver, you have to #define BINARY_COMPATIBLE 0 before including ndis.h.
ntddk.h will be included in ndis.h and you can use any NT specific
function.
As a result you’ll lose binary compatibility with w9x and WHQL (who
cares?).
Best regards,
Michal Vodicka
Veridicom
(RKK - Skytale)
[WWW: http://www.veridicom.com , http://www.skytale.com]
From: John Hirschi[SMTP:xxxxx@SonicWALL.com]
Reply To: NT Developers Interest List
Sent: Monday, April 16, 2001 7:36 PM
To: NT Developers Interest List
Subject: [ntdev] quick question
I want to use RegOpenKeyEx() and other various Reg…() functions from
within my intermediate NDIS driver. Is this possible? For the life
of
me, I can’t figure out the header file to include to get these
functions
available. Since this is an NDIS driver, I tried finding equivalent
registry functions in the list of NDIS functions, but I couldn’t find
anything that didn’t pertain to a certain miniport instance. The
registry settings I want to access are under
HKEY_LOCAL_MACHINE/SYSTEM/CurrentControlSet/Services/MyDriver. But
the
NDIS functions I found only let me get into the individual adapters’
registry settings.
Help anyone?
Thanks,
John
You are currently subscribed to ntdev as: xxxxx@rkk.cz
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com
You are currently subscribed to ntdev as: xxxxx@sonicwall.com
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com
You are currently subscribed to ntdev as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com