RE: Registry Question - ZwSetValueKey Vs. RtlWriteRegistr yValue

Well, I stepped into the ZwSetValueKey and saw that the function tries to
de-reference the ValueName I passed it. No check is done to the parameter.
Since in the documentation it says that this parameter CAN be NULL I pass it
a NULL parameter. RtlWriteRegistryValue behaves in a more expected way - if
you do not supply a name it gives a default one instead - “(default)”.

G.

-----Original Message-----
From: Gilad Ben-Zeev [mailto:xxxxx@appstream.com]
Sent: Sun, May 19, 2002 5:46 PM
To: NT Developers Interest List
Subject: [ntdev] Registry Question - ZwSetValueKey Vs. RtlWriteRegistryValue

Hi,
In some kernel driver I am writing I tried to write a value to the registry.
Since I am used to use the ZwXXX functions I used the ZwSetValueKey to set
the value on a freshly created registry key. But then I got Bugcheck code 51
with a very scary “analysis” - “Something has gone really bad with the
registry” or something to the same effect. After I searched my code for the
cause of this BSOD I replaced the implementation of the value setting to use
RtlWriteRegistryValue. To my surprise it worked. Nothing else has changed.
Does anyone have a clue why the first failed with a BSOD and the second is
working?
G.
“Now, my good man, this is no time for making enemies.”
Voltair On His Deathbed In Response To A Priest Asking That He Renounce
Satan

You are currently subscribed to ntdev as: xxxxx@appstream.com
To unsubscribe send a blank email to %%email.unsub%%