: Re:[ntfsd] About Read Exclusived File

Thank you for everyboy’s reply,especially Peter Soctt.I have solved the
problem by reading OSR FAQ.Yes,you are right.Bypass all filters are not good idea,so i already give up this idea.

Thanks again.
Ken

Hi,
Can you describe how to “use memory mapped IO” if you could not receive a handle and do not want to use undocumented
Mm* function?
Did you mean the following( i.e. using the Mm* ) ?

MmCreateSection( &Section,
DesiredAccess,
ObjectAttributes,
InputMaximumSize,
SectionPageProtection,
AllocationAttributes,
NULL,// we do not have the file object handle
FileObject// <---- This we can find
) );

MmMapViewOfSection (
Section,
ProcessToMapIn,
PtrCapturedBase,
ZeroBits,
CommitSize,
CapturedOffset,
PtrCapturedViewSize,
InheritDisposition,
AllocationType,
Protect);
?
“Peter Scott” wrote in message news:xxxxx@ntfsd…

A few comments on this.

First, if you are accessing local files, you can open the file for
SYNCHRONIZE access, with full sharing, and then use the returned
fileobject to perform your IO. You will need to create your own Irps for
the IO since you will not have a handle. Remember that access checks are
performed during the open, not during the read, so in kernel mode, using
fileobjects, you can use this approach to access files correctly. For
locked files, you can either use memory mapped IO, see the OSROnline
article in the IFS FAQ about how to access a locked file. I mention this
will only work on local files since for remote files this logic breaks.

Second, you mention that you want to by-pass all filters in the stack.
This is, in general, not a good idea. What if one of the filters in the
stack is an encryption filter? Or maybe a compression filter? If you
by-pass it to read the data from the underlying filesystem the data you
get back will be encrypted or compressed and will be useless to you. There
is a multitude of scenarios that will cause problems when you start using
this type of approach, I would stay away form it.

Pete
Kernel Drivers
Windows Filesystem and Device Driver Consulting
www.KernelDrivers.com
(303)546-0300

From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of xxxxx@lenovo.com
Sent: Thursday, June 08, 2006 5:18 AM
To: Windows File Systems Devs Interest List
Subject: [ntfsd] About Read Exclusived File

Hi All,
I have build my own IRP to send to highest-level device object in the File
System.I can correctly execution.But if the file has been opened with
exclusive method then i could open it.My question is how can i open a file
opened with exclusive?

Thanks
Ken — Questions? First check the IFS FAQ at https://www.osronline.com/article.cfm?id=17 You are currently subscribed to ntfsd as: xxxxx@kerneldrivers.com To
unsubscribe send a blank email to xxxxx@lists.osr.co