RE: Am I missing something? Using notepad to read dat a...

Tehcnicly no. But carefull here. IIRC there is a small bug in
FsRtlAcquireForModWrite (insufficinet validation of existence of FastIo
support) in kernel builds prior 2600, which can lead you into problems.
Unfortunately I cant recall exactly the circumstances when this occurs and
how obscure this is. if you run itno it, just ask for help again. Youll know
if you hit it, youll see this function near the top of stack , referencing a
NULL pointer. Best to my knowledge, this was fixed in XP.

Ciao, Dan

----- Original Message -----
From: “James Dunning”
To: “File Systems Developers”
Sent: Monday, September 09, 2002 2:15 PM
Subject: [ntfsd] RE: Am I missing something? Using notepad to read dat a…

> In order to support Paging IO, and memory mapped files, will i need to add
> FastIO support to my file system driver?
>
>
>
> -----Original Message-----
> From: Tony Mason [mailto:xxxxx@osr.com]
> Sent: 09 September 2002 11:58
> To: File Systems Developers
> Subject: [ntfsd] RE: Am I missing something? Using notepad to read
> data…
>
>
> Notepad uses memory mapping. If it fails, it is probably because you
don’t
> set up FileObject->SectionObjectPointers.
>
> Regards,
>
>
> Tony
>
> Tony Mason
> Consulting Partner
> OSR Open Systems Resources, Inc.
> http://www.osr.com
>
>
> -----Original Message-----
> From: James Dunning [mailto:xxxxx@generaldynamics.uk.com]
> Sent: Monday, September 09, 2002 6:40 AM
> To: File Systems Developers
> Subject: [ntfsd] Am I missing something? Using notepad to read data…
>
> Hi,
>
> I have implemented the IRP_MJ_READ dispatch routine for my file system
> driver, and I am currently in the process of testing the dispatch
handler…
> I have managed to open a small 1k byte text file using Wordpad, however
> notepad fails to read any data from the file and treats it as an empty
file.
>
> Why is this? how does notepad actually read the data from the file?!
>
> Any advice appreciated
> Regards
>
> James
>
>
> General Dynamics United Kingdom Limited
> Registered in England and Wales No. 1911653
> Registered Office: 100 New Bridge Street, London, EC4V 6JA
>
>
> —
> You are currently subscribed to ntfsd as: xxxxx@osr.com
> To unsubscribe send a blank email to %%email.unsub%%
>
> —
> You are currently subscribed to ntfsd as:
> xxxxx@generaldynamics.uk.com
> To unsubscribe send a blank email to %%email.unsub%%
>
>
> General Dynamics United Kingdom Limited
> Registered in England and Wales No. 1911653
> Registered Office: 100 New Bridge Street, London, EC4V 6JA
>
>
> —
> You are currently subscribed to ntfsd as: xxxxx@rdsor.ro
> To unsubscribe send a blank email to %%email.unsub%%
>

You indicate that you provide FastIo support by seting
DriverObject->FastIoDispatch
with a pointer to a table containing supported fast IO handlers. The code
you wanna lookup is in fatinit.c

You indicate that you support MMF files by initializing
FileObject->SectionObjectPointers
with a pointer to a SECTION_OBJECT_POINTERS structure, structure which you
usually want to be in the FCB, since only one is required per file stream.

search create.c for stuff like “FileObject->SectionObjectPointer =” .

Ciao, Dan

----- Original Message -----
From: “James Dunning”
To: “File Systems Developers”
Sent: Monday, September 09, 2002 4:29 PM
Subject: [ntfsd] Re: Am I missing something? Using notepad to read dat a…

> Hi Dan, im kinda stuck here,
>
> Im trying to pinpoint exactly where FastFat initializes support for MMF
and
> paging IO… I am assuming this is all setup from the IRP_MJ_CREATE
dispatch
> handler? reason why i am assuming this, is because, when notepad opens the
> file, the IRP_MJ_READ request is never dispatched to the file system
> driver…
>
> What kernel calls do i need to use in order to intialize support for MMF?
>
> Regards
> James
>
> -----Original Message-----
> From: Dan Partelly [mailto:xxxxx@rdsor.ro]
> Sent: 09 September 2002 11:40
> To: File Systems Developers
> Subject: [ntfsd] Re: Am I missing something? Using notepad to read
> data…
>
>
> >> Why is this? how does notepad actually read the data from the file?!
>
> notepad uses memory maped files. Are you properly suporting paging IO and
> corectly intialize support for MMF ?
>
>
> ----- Original Message -----
> From: “James Dunning”
> To: “File Systems Developers”
> Sent: Monday, September 09, 2002 1:40 PM
> Subject: [ntfsd] Am I missing something? Using notepad to read data…
>
>
> > Hi,
> >
> > I have implemented the IRP_MJ_READ dispatch routine for my file system
> > driver, and I am currently in the process of testing the dispatch
> handler…
> > I have managed to open a small 1k byte text file using Wordpad, however
> > notepad fails to read any data from the file and treats it as an empty
> file.
> >
> > Why is this? how does notepad actually read the data from the file?!
> >
> > Any advice appreciated
> > Regards
> >
> > James
> >
> >
> > General Dynamics United Kingdom Limited
> > Registered in England and Wales No. 1911653
> > Registered Office: 100 New Bridge Street, London, EC4V 6JA
> >
> >
> > —
> > You are currently subscribed to ntfsd as: xxxxx@rdsor.ro
> > To unsubscribe send a blank email to %%email.unsub%%
> >
>
>
>
> —
> You are currently subscribed to ntfsd as:
> xxxxx@generaldynamics.uk.com
> To unsubscribe send a blank email to %%email.unsub%%
>
>
> General Dynamics United Kingdom Limited
> Registered in England and Wales No. 1911653
> Registered Office: 100 New Bridge Street, London, EC4V 6JA
>
>
> —
> You are currently subscribed to ntfsd as: xxxxx@rdsor.ro
> To unsubscribe send a blank email to %%email.unsub%%
>

Dan’s right - it happened to me. To be safe under win2k, you MUST at
least have a table defined, and a pointer to it in your device object.
The table doesn’t have to implement any fast io routines, (it can have all
null entries) but it must exist.

It’s also correct that this bug has been fixed in XP.

FsRtlAcquireForModWrite is the only routine I am aware of that doesn’t
check to see if the table pointer is NULL first, but there might be
others. :wink:

(Thanks Dan!)

Greg

> What kernel calls do i need to use in order to intialize support for
MMF?

Declare SECTION_OBJECT_POINTERS and FSRTL_COMMON_FCB_HEADER as parts
of your FCB.

In CREATE path, set FileObject->FsContext to FSRTL_COMMON_FCB_HEADER
and FileObject->SectionObjectPointer to SECTION_OBJECT_POINTERS. Zero
the 3 pointers in SECTION_OBJECT_POINTERS structure. Do not forget to
initialize the ERESOURCE locks.

Max

But in case we assign FileObject->FsContext to FSRTL_COMMON_FCB_HEADER in
Create path,
should we use FileObject->FsContext2 for FCB then? Please correct me if i am
wrong.

Also, should assigning of Section_Object_Pointers to FileObject occur for
all Successful create?

Regards,
Ram

“Maxim S. Shatskih” wrote in message
news:xxxxx@ntfsd…
>
> > What kernel calls do i need to use in order to intialize support for
> MMF?
>
> Declare SECTION_OBJECT_POINTERS and FSRTL_COMMON_FCB_HEADER as parts
> of your FCB.
>
> In CREATE path, set FileObject->FsContext to FSRTL_COMMON_FCB_HEADER
> and FileObject->SectionObjectPointer to SECTION_OBJECT_POINTERS. Zero
> the 3 pointers in SECTION_OBJECT_POINTERS structure. Do not forget to
> initialize the ERESOURCE locks.
>
> Max
>
>
>
>
>