memory mapped files; minimal implementation?

I am developing a FSD and right now basic I/O operations work fine. As
is well known to You by looking old postings, the memory mapped files
need special implementation. My question is simply: what is the minimal
amount of FSD functionality with fast i/o, paging i/o and cache manager
api that needs to be implemented, that Notepad.exe succeeds to open a
file on XP?

Is fastIoAcquire + ReleaseFile + cInitializeCacheMap such a minimal
set? And if not what is the required functions? What functions are not
needed?

Cheers,
Jari Ojala
Capacity Networks, Inc.
e-mail: xxxxx@capacitynetworks.com

> Is fastIoAcquire + ReleaseFile + cInitializeCacheMap such a minimal

set? And if not what is the required functions?

CcInitializeCacheMap is NOT a must.

Support for MJ_QUERY_INFORMATION for a file size is a must.

Proper FSRTL_COMMON_FCB_HEADER and SECTION_OBJECT_POINTERS are a must.

Support for paging IO is a must.

Maxim Shatskih, Windows DDK MVP
StorageCraft Corporation
xxxxx@storagecraft.com
http://www.storagecraft.com

See the FAT sources.

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Jari Ojala
Sent: Wednesday, August 18, 2004 6:27 AM
To: Windows File Systems Devs Interest List
Subject: [ntfsd] memory mapped files; minimal implementation?

I am developing a FSD and right now basic I/O operations work fine. As
is well known to You by looking old postings, the memory mapped files
need special implementation. My question is simply: what is the minimal
amount of FSD functionality with fast i/o, paging i/o and cache manager
api that needs to be implemented, that Notepad.exe succeeds to open a
file on XP?

Is fastIoAcquire + ReleaseFile + cInitializeCacheMap such a minimal
set? And if not what is the required functions? What functions are not
needed?

Cheers,
Jari Ojala
Capacity Networks, Inc.
e-mail: xxxxx@capacitynetworks.com


Questions? First check the IFS FAQ at
https://www.osronline.com/article.cfm?id=17

You are currently subscribed to ntfsd as: xxxxx@storagecraft.com
To unsubscribe send a blank email to xxxxx@lists.osr.com

__________ NOD32 1.847 (20040818) Information __________

This message was checked by NOD32 antivirus system.
http://www.nod32.com

  1. How do you define “proper FSRTL_COMMON_FCB_HEADER and
    SECTION_OBJECT_POINTERS” ? And what kind of memory is needed to
    initialize the later? I tried to initialize the section object pointers
    (with zeroes in the struct) with non paged memory; used Notepad.exe to
    create a memory mapped file and bang… I got the white screen of
    debugger death from kernel call with a complaint about badly alligned data.
  2. How do you define “paging IO support”?

Cheers,
Jari O

>Is fastIoAcquire + ReleaseFile + cInitializeCacheMap such a minimal
>set? And if not what is the required functions?
>
>

CcInitializeCacheMap is NOT a must.

Support for MJ_QUERY_INFORMATION for a file size is a must.

Proper FSRTL_COMMON_FCB_HEADER and SECTION_OBJECT_POINTERS are a must.

Support for paging IO is a must.

Maxim Shatskih, Windows DDK MVP
StorageCraft Corporation
xxxxx@storagecraft.com
http://www.storagecraft.com


Questions? First check the IFS FAQ at https://www.osronline.com/article.cfm?id=17

You are currently subscribed to ntfsd as: xxxxx@capacitynetworks.com
To unsubscribe send a blank email to xxxxx@lists.osr.com

Ok now it works:

Minimal memory mapped file support in FSD:

  1. initialize FSRTL_ADVANCED_FCB_HEADER + remember to initialize all
    mutexes and resources too!
  2. initialize section object pointers
  3. implement minimalistic fast i/o where all functions return FALSE
  4. release all resources when not needed
    –> Notepad.exe can open files.

Cheers,
Jari O

Jari Ojala wrote:

  1. How do you define “proper FSRTL_COMMON_FCB_HEADER and
    SECTION_OBJECT_POINTERS” ? And what kind of memory is needed to
    initialize the later? I tried to initialize the section object
    pointers (with zeroes in the struct) with non paged memory; used
    Notepad.exe to create a memory mapped file and bang… I got the white
    screen of debugger death from kernel call with a complaint about badly
    alligned data.
  2. How do you define “paging IO support”?

Cheers,
Jari O

>> Is fastIoAcquire + ReleaseFile + cInitializeCacheMap such a minimal
>> set? And if not what is the required functions?
>
>
> CcInitializeCacheMap is NOT a must.
>
> Support for MJ_QUERY_INFORMATION for a file size is a must.
>
> Proper FSRTL_COMMON_FCB_HEADER and SECTION_OBJECT_POINTERS are a must.
>
> Support for paging IO is a must.
>
> Maxim Shatskih, Windows DDK MVP
> StorageCraft Corporation
> xxxxx@storagecraft.com
> http://www.storagecraft.com
>
>
> —
> Questions? First check the IFS FAQ at
> https://www.osronline.com/article.cfm?id=17
>
> You are currently subscribed to ntfsd as:
> xxxxx@capacitynetworks.com
> To unsubscribe send a blank email to xxxxx@lists.osr.com
>
>
>
>


Questions? First check the IFS FAQ at
https://www.osronline.com/article.cfm?id=17

You are currently subscribed to ntfsd as: xxxxx@capacitynetworks.com
To unsubscribe send a blank email to xxxxx@lists.osr.com

Create your FCB structure. It must contain FSRTL_COMMON_FCB_HEADER and
SECTION_OBJECT_POINTERS in it as fields.

For any file object, FileObject->FsContext must point to FCB’s
FSRTL_COMMON_FCB_HEADER, and FileObject->SectionObjectPointer to FCB’s
SECTION_OBJECT_POINTERS.

The initial state of FSRTL_COMMON_FCB_HEADER must be - sane ERESOURCE
structures and sane file sizes.

The initial state of SECTION_OBJECT_POINTERS must be 3 NULLs.

Maxim Shatskih, Windows DDK MVP
StorageCraft Corporation
xxxxx@storagecraft.com
http://www.storagecraft.com

----- Original Message -----
From: “Jari Ojala”
To: “Windows File Systems Devs Interest List”
Sent: Thursday, August 19, 2004 10:39 AM
Subject: Re: [ntfsd] memory mapped files; minimal implementation?

> 1) How do you define “proper FSRTL_COMMON_FCB_HEADER and
> SECTION_OBJECT_POINTERS” ? And what kind of memory is needed to
> initialize the later? I tried to initialize the section object pointers
> (with zeroes in the struct) with non paged memory; used Notepad.exe to
> create a memory mapped file and bang… I got the white screen of
> debugger death from kernel call with a complaint about badly alligned data.
> 2) How do you define “paging IO support”?
>
> Cheers,
> Jari O
>
> >>Is fastIoAcquire + ReleaseFile + cInitializeCacheMap such a minimal
> >>set? And if not what is the required functions?
> >>
> >>
> >
> >CcInitializeCacheMap is NOT a must.
> >
> >Support for MJ_QUERY_INFORMATION for a file size is a must.
> >
> >Proper FSRTL_COMMON_FCB_HEADER and SECTION_OBJECT_POINTERS are a must.
> >
> >Support for paging IO is a must.
> >
> >Maxim Shatskih, Windows DDK MVP
> >StorageCraft Corporation
> >xxxxx@storagecraft.com
> >http://www.storagecraft.com
> >
> >
> >—
> >Questions? First check the IFS FAQ at
https://www.osronline.com/article.cfm?id=17
> >
> >You are currently subscribed to ntfsd as: xxxxx@capacitynetworks.com
> >To unsubscribe send a blank email to xxxxx@lists.osr.com
> >
> >
> >
> >
>
>
>
>
> —
> Questions? First check the IFS FAQ at
https://www.osronline.com/article.cfm?id=17
>
> You are currently subscribed to ntfsd as: xxxxx@storagecraft.com
> To unsubscribe send a blank email to xxxxx@lists.osr.com

This is a reminder that moving forward; whenever you are implementing a
file system you should use the FSRTL_ADVANCED_FCB_HEADER (not the COMMON
header). Along with this you need to call FsRtlSetupAdvancedHeader
(when you init it) as well as FsRtlTeardownPerStreamContexts (before you
free it). Look at the FAT sources if you have questions of how to do
this.

This will allow filters (as well as the filter manager) to use
PerStreamContexts on your file system.

Jari later specified that he is using the ADVANCED FCB header but I just
wanted to reiterate this to everyone so it will be clear as to what you
should be using.

Neal Christiansen
Microsoft File System Filter Group Lead
This posting is provided “AS IS” with no warranties, and confers no
rights

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Maxim S. Shatskih
Sent: Thursday, August 19, 2004 12:42 PM
To: Windows File Systems Devs Interest List
Subject: Re: [ntfsd] memory mapped files; minimal implementation?

Create your FCB structure. It must contain FSRTL_COMMON_FCB_HEADER
and
SECTION_OBJECT_POINTERS in it as fields.

For any file object, FileObject->FsContext must point to FCB’s
FSRTL_COMMON_FCB_HEADER, and FileObject->SectionObjectPointer to FCB’s
SECTION_OBJECT_POINTERS.

The initial state of FSRTL_COMMON_FCB_HEADER must be - sane
ERESOURCE
structures and sane file sizes.

The initial state of SECTION_OBJECT_POINTERS must be 3 NULLs.

Maxim Shatskih, Windows DDK MVP
StorageCraft Corporation
xxxxx@storagecraft.com
http://www.storagecraft.com

----- Original Message -----
From: “Jari Ojala”
To: “Windows File Systems Devs Interest List”
Sent: Thursday, August 19, 2004 10:39 AM
Subject: Re: [ntfsd] memory mapped files; minimal implementation?

> 1) How do you define “proper FSRTL_COMMON_FCB_HEADER and
> SECTION_OBJECT_POINTERS” ? And what kind of memory is needed to
> initialize the later? I tried to initialize the section object
pointers
> (with zeroes in the struct) with non paged memory; used Notepad.exe to
> create a memory mapped file and bang… I got the white screen of
> debugger death from kernel call with a complaint about badly alligned
data.
> 2) How do you define “paging IO support”?
>
> Cheers,
> Jari O
>
> >>Is fastIoAcquire + ReleaseFile + cInitializeCacheMap such a minimal
> >>set? And if not what is the required functions?
> >>
> >>
> >
> >CcInitializeCacheMap is NOT a must.
> >
> >Support for MJ_QUERY_INFORMATION for a file size is a must.
> >
> >Proper FSRTL_COMMON_FCB_HEADER and SECTION_OBJECT_POINTERS are a
must.
> >
> >Support for paging IO is a must.
> >
> >Maxim Shatskih, Windows DDK MVP
> >StorageCraft Corporation
> >xxxxx@storagecraft.com
> >http://www.storagecraft.com
> >
> >
> >—
> >Questions? First check the IFS FAQ at
https://www.osronline.com/article.cfm?id=17
> >
> >You are currently subscribed to ntfsd as:
xxxxx@capacitynetworks.com
> >To unsubscribe send a blank email to xxxxx@lists.osr.com
> >
> >
> >
> >
>
>
>
>
> —
> Questions? First check the IFS FAQ at
https://www.osronline.com/article.cfm?id=17
>
> You are currently subscribed to ntfsd as: xxxxx@storagecraft.com
> To unsubscribe send a blank email to xxxxx@lists.osr.com


Questions? First check the IFS FAQ at
https://www.osronline.com/article.cfm?id=17

You are currently subscribed to ntfsd as: xxxxx@windows.microsoft.com
To unsubscribe send a blank email to xxxxx@lists.osr.com