I am still having problems trying to find out why my File system driver is
still unable to support memory mapped files.
so I have created a little test application to allow me to monitor the
filesystem activity using the FileMon utility from sysinternals, the
application simply tries to open a text file, maps the file and create a
mapped view of the file…
HANDLE hMapFileHandle = CreateFile( E:\test.txt", … );
HANDLE hMapHandle = CreateFileMapping( hMapFileHandle,
… );
LPVOID MappedPointer = MapViewOfFile(hMapHandle, … );
The first 2 lines return valid handles, however if I try call MapviewOfFile,
it returns null, calling GetLastError, reveals that access was denied…
this code incidentally works successfully on the NTFS filesystem…
During initialisation support is setup for the following FastIo Dispatch
routines,
StFastIoDispatch.SizeOfFastIoDispatch = sizeof(FAST_IO_DISPATCH);
StFastIoDispatch.FastIoCheckIfPossible = StFastIoCheckIfPossible;
StFastIoDispatch.FastIoRead = FsRtlCopyRead;
StFastIoDispatch.FastIoWrite = FsRtlCopyWrite;
StFastIoDispatch.FastIoQueryBasicInfo = StFastQueryBasicInfo;
StFastIoDispatch.FastIoQueryStandardInfo = StFastQueryStdInfo;
StFastIoDispatch.FastIoLock = StFastLock;
StFastIoDispatch.FastIoUnlockSingle =
StFastUnlockSingle;
StFastIoDispatch.FastIoUnlockAll = StFastUnlockAll;
StFastIoDispatch.FastIoUnlockAllByKey = StFastUnlockAllByKey;
I’ve had a look at my IRP_MJ_CREATE dispatch handler to make sure that I
have setup the context and section object pointers,
and by stepping through the code, it does appear that the
SectionObjectPointer is being initialized as shown below… and IRP_MJ_CREATE
is returning STATUS_SUCCESS
StSetFileObject( FileObject,
UserFileOpen,
Fcb,
UnwindCcb = StCreateCcb( IrpContext ));
FileObject->SectionObjectPointer =
&Fcb->NonPaged->SectionObjectPointers;
Iosb.Status = STATUS_SUCCESS;
Iosb.Information = FILE_OPENED;
So I am left confused as to why MMF doesnt seem to be working…
where can I go from here?
Regards
James Dunning
General Dynamics United Kingdom Limited
Registered in England and Wales No. 1911653
Registered Office: 100 New Bridge Street, London, EC4V 6JA