Yes, the latest one tells you to specify this when creating files etc.
if you are not in the system process context.
By the way - performance implications or otherwise, this flag WILL have
to be specified for private driver handles, or you’d be leaving a huge
hole in the driver where the app under whose process context you are
creating the handle, can merrily access and bugcheck your machine - or
even worse get access to privileged data at will in another thread.
-----Original Message-----
From: Fuller, Rob [mailto:xxxxx@inin.com]
Sent: Tuesday, May 14, 2002 3:08 PM
To: File Systems Developers
Subject: [ntfsd] RE: Does ZwClose bugcheck in NT4?
OBJ_KERNEL_HANDLE is missing from the documentation for
InitializeObjectAttributes in the W2K DDK, although it does appear in
ntdef.h. Is it documented in the XP DDK?
-----Original Message-----
From: Ravisankar Pudipeddi [mailto:xxxxx@windows.microsoft.com]
Sent: Tuesday, May 14, 2002 4:49 PM
To: File Systems Developers
Subject: [ntfsd] RE: Does ZwClose bugcheck in NT4?
Drivers should specify OBJ_KERNEL_HANDLE for the Attributes when opening
a handle in arbitrary process contexts. This ensures that the handle
table that is used is the system process handle table - and prevents
apps from being able to access or close these handles. Using worker
threads is totally unnecessary in this case.
Ravi
This posting is provided “AS IS” with no warranties, and confers no
rights.
-----Original Message-----
From: Fuller, Rob [mailto:xxxxx@inin.com]
Sent: Tuesday, May 14, 2002 2:37 PM
To: File Systems Developers
Subject: [ntfsd] RE: Does ZwClose bugcheck in NT4?
How do you know using a worker thread is too expensive? Did you measure
this? Many components of the operating system use worker threads,
especially in the realm of file systems. -----Original Message-----
From: Kelley, Jerry [mailto:xxxxx@nsisoftware.com]
Sent: Tuesday, May 14, 2002 10:28 AM
To: File Systems Developers
Subject: [ntfsd] RE: Does ZwClose bugcheck in NT4?
Ah yes, but if it were that simple.
It’s not always convenient,
quick, or efficient to be in the system process context. For this case,
it’s in an arbitrary context. Attaching to the system process would be
too expensive and queuing it to a worker would add undesirable delays.
-----Original Message-----
From: Fuller, Rob [mailto:xxxxx@inin.com]
Sent: Tuesday, May 14, 2002 9:30 AM
To: File Systems Developers
Subject: [ntfsd] RE: Does ZwClose bugcheck in NT4?
If your driver creates its handles in the system process’s context,
you’re safe from this problem.
Another solution would be to have the application close the handle,
rather than your driver. This is easy if it’s your application. It’s
still possible using APC’s, even if it’s not your application, but I
don’t recommend that. -----Original Message-----
From: Kelley, Jerry [mailto:xxxxx@nsisoftware.com]
Sent: Tuesday, May 14, 2002 8:15 AM
To: File Systems Developers
Subject: [ntfsd] Does ZwClose bugcheck in NT4?
I know that ZwClose will bugcheck in W2K if the handle is invalid. I’m
assuming this is case for NT4 as well. Does anyone know for sure that it
does?
And on that subject, does anyone else agree that bugchecking on the
close of an invalid handle is a rather harsh action to take? IMHO,
ZwClose should just return STATUS_INVALID_HANDLE instead of bringing the
whole system down. Now, I’m not saying that we should be sloppy with
handles. A driver should still carefully manage them and be responsible
for their state. However, I have seen cases where errant applications
have closed handles at will and inadvertently closed one that a driver
was using and was carefully tracking. Then when the driver correctly
called ZwClose - bugcheck.
The race conditions where this has happened have been tight and hard to
duplicate, but it can be done.
Jerry
You are currently subscribed to ntfsd as: xxxxx@inin.com To
unsubscribe send a blank email to %%email.unsub%%
You are currently subscribed to ntfsd as: xxxxx@windows.microsoft.com
To unsubscribe send a blank email to %%email.unsub%%