I’ve got some code that opens a HANDLE to a registry key using ZwCreateKey()
in an arbitrary thread context. I want to be able to use this handle in the
context of other threads to set registry values. The same code that creates
the handle also creates a pointer reference to it using
ObReferenceObjectByHandle.
So, I have a global pointer to the registry key object that I should be able
to use anywhere, BUT, functions like ZwSetValueKey() expect a HANDLE to a
registry key, not a pointer.
Is there any way to convert the pointer into a handle? If not, is there any
way to use the pointer to call ZwSetValueKey() ?
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
You can use ObOpenObjectByPointer().
I’ve got some code that opens a HANDLE to a registry key using
ZwCreateKey()
in an arbitrary thread context. I want to be able to use this handle in
the
context of other threads to set registry values. The same code that
creates
the handle also creates a pointer reference to it using
ObReferenceObjectByHandle.
So, I have a global pointer to the registry key object that I should be
able
to use anywhere, BUT, functions like ZwSetValueKey() expect a HANDLE to a
registry key, not a pointer.
Is there any way to convert the pointer into a handle? If not, is there
any
way to use the pointer to call ZwSetValueKey() ?
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
Thanks Ivan! It worked perfectly - exactly what I needed!
-----Original Message-----
From: Ivan [mailto:xxxxx@softhome.net]
Sent: Monday, March 12, 2001 7:47 PM
To: NT Developers Interest List
Subject: [ntdev] Re: How d’ya get a HANDLE from a pointer?
You can use ObOpenObjectByPointer().
I’ve got some code that opens a HANDLE to a registry key using
ZwCreateKey()
in an arbitrary thread context. I want to be able to use this handle in
the
context of other threads to set registry values. The same code that
creates
the handle also creates a pointer reference to it using
ObReferenceObjectByHandle.
So, I have a global pointer to the registry key object that I should be
able
to use anywhere, BUT, functions like ZwSetValueKey() expect a HANDLE to a
registry key, not a pointer.
Is there any way to convert the pointer into a handle? If not, is there
any
way to use the pointer to call ZwSetValueKey() ?
You are currently subscribed to ntdev as: xxxxx@legato.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
If on W2K, set OBJ_KERNEL_HANDLE in your object attributes. This’ll
associate the returned handle with the kernel handle table, rather than the
handle table for the currently executing process.
-----Original Message-----
From: Nate Bushman [mailto:xxxxx@Legato.com]
Sent: Monday, March 12, 2001 7:37 PM
To: NT Developers Interest List
Subject: [ntdev] How d’ya get a HANDLE from a pointer?
I’ve got some code that opens a HANDLE to a registry key using ZwCreateKey()
in an arbitrary thread context. I want to be able to use this handle in the
context of other threads to set registry values. The same code that creates
the handle also creates a pointer reference to it using
ObReferenceObjectByHandle.
So, I have a global pointer to the registry key object that I should be able
to use anywhere, BUT, functions like ZwSetValueKey() expect a HANDLE to a
registry key, not a pointer.
Is there any way to convert the pointer into a handle? If not, is there any
way to use the pointer to call ZwSetValueKey() ?
You are currently subscribed to ntdev as: xxxxx@timesn.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