memory mapped v/s cache manager support

Hi,

I have written a simple FSD, with out supporting FastIO and CacheManager.
But Now I want to support memory mapped files for notepad and executables.
Where shall I start from and what are absolutely necessary amongst Cc and
FastIO?

I know that firstly, we need to point FileObject->SectionObjectPointer to
Fcb->SectionObject.
But does CacheManager support and/or FastIO compulsory for memory mapped
files.

Please suggest.

Thanks & Regards,
Ram

> I have written a simple FSD, with out supporting FastIO and
CacheManager.

But Now I want to support memory mapped files for notepad and
executables.
Where shall I start from and what are absolutely necessary amongst
Cc and
FastIO?

FastIo is not necessary at all, except the locking routines, and even
they are IIRC not necessary - FsRtl will fallback to some sane default
locking schemes without them.
Cc support is also not necessary.

I know that firstly, we need to point
FileObject->SectionObjectPointer to
Fcb->SectionObject.

Yes, and also FileObject->FsContext to FSRTL_COMMON_FCB_HEADER.

Also you must support MJ_QUERY_INFORMATION for file size.

If all is done correctly, MmCreateSection will succeed and you will
start to receive paging IOs. Handle them. Then your EXEs will run.

Max

Thanks a ton!

Yes, and also FileObject->FsContext to FSRTL_COMMON_FCB_HEADER.

I provide FileObject->FsContext with my FCB. I suppose, I can add
FSRTL_COMMON_FCB_HEADER inside the FCB structure and equate FCB to
FsContext. Shouldn’t this still work…, will definitely try it out.

With this, now able to receive the Paging IOs but on the second time a
request comes, things are erratic and system restarts.
I guess, some memory mishandling is taking place.
Also I noticed that for paging requests, IRP_CLOSE is not getting called
after IRP_CLEANUP. Has this got to do something with this? Please help.

Thanks & Regards,
Ram

“Maxim S. Shatskih” wrote in message
news:xxxxx@ntfsd…
>
> > I have written a simple FSD, with out supporting FastIO and
> CacheManager.
> > But Now I want to support memory mapped files for notepad and
> executables.
> > Where shall I start from and what are absolutely necessary amongst
> Cc and
> > FastIO?
>
> FastIo is not necessary at all, except the locking routines, and even
> they are IIRC not necessary - FsRtl will fallback to some sane default
> locking schemes without them.
> Cc support is also not necessary.
>
> > I know that firstly, we need to point
> FileObject->SectionObjectPointer to
> > Fcb->SectionObject.
>
> Yes, and also FileObject->FsContext to FSRTL_COMMON_FCB_HEADER.
>
> Also you must support MJ_QUERY_INFORMATION for file size.
>
> If all is done correctly, MmCreateSection will succeed and you will
> start to receive paging IOs. Handle them. Then your EXEs will run.
>
> Max
>
>
>
>