ObReferenceObjectByHandle ?

Hi all:

Even though I have been a member of this list for a long time,
this is the first time I am actually using it, so please be patient with me.

I am creating several system threads by calling the PsCreateSystemThread
API.
Each time after returning from this API I call ObReferenceObjectByHandle to
reference object by handle,
and close the handle immediately by calling ZwClose… Is it OK to close the
handle at this time
or should I do it at later time after I dereference the object by calling
ObDereferenceObject API???
The documentation is not specific about it!

Thanks,

Ilya.

Ilya Levin
File System Developer
Senior Software Engineer
xxxxx@softricity.com mailto:xxxxx

Softricity, Inc.
332 Congress Street
Boston, MA 02210
617.695.0336 x168
fax 617.338.7769
http://www.softricity.com/ - Powering Software as a Service


You are currently subscribed to ntfsd as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntfsd-$subst(‘Recip.MemberIDChar’)@lists.osr.com</mailto:xxxxx>

Yes this is fine.
Each create should be matched by a close, each reference should be
matched by a dereference some time.


This posting is provided “AS IS” with no warranties, and confers no
rights. You assume all risk for your use.

-----Original Message-----
From: Ilya Levin [mailto:xxxxx@softricity.com]
Sent: Tuesday, January 08, 2002 3:42 PM
To: File Systems Developers
Subject: [ntfsd] ObReferenceObjectByHandle ?

Hi all:

Even though I have been a member of this list for a long time, this is
the first time I am actually using it, so please be patient with me.

I am creating several system threads by calling the PsCreateSystemThread
API. Each time after returning from this API I call
ObReferenceObjectByHandle to reference object by handle, and close the
handle immediately by calling ZwClose… Is it OK to close the handle at
this time or should I do it at later time after I dereference the object
by calling ObDereferenceObject API??? The documentation is not specific
about it!

Thanks,

Ilya.

Ilya Levin
File System Developer
Senior Software Engineer
xxxxx@softricity.com mailto:xxxxx

Softricity, Inc.
332 Congress Street
Boston, MA 02210
617.695.0336 x168
fax 617.338.7769
http://www.softricity.com/ - Powering Software as a Service


You are currently subscribed to ntfsd as: xxxxx@windows.microsoft.com
To unsubscribe send a blank email to leave-ntfsd-$subst(‘Recip.MemberIDChar’)@lists.osr.com


You are currently subscribed to ntfsd as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntfsd-$subst(‘Recip.MemberIDChar’)@lists.osr.com</mailto:xxxxx>

> or should I do it at later time after I dereference the object by calling

ObDereferenceObject API???

Surely if you have referenced the object, you must deref it.

Max


You are currently subscribed to ntfsd as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntfsd-$subst(‘Recip.MemberIDChar’)@lists.osr.com