FileObject->FsContext

Hi all,

I want to use the FileObject->FsContext field to point to some of my
driver’s private structures, not FSRTL_COMMON_FCB_HEADER.
Unfortunately, when I do this, the code BSODs.
The BSOD is inside some Mm function which seems to treat the field as
pointer to FSRTL_COMMON_FCB_HEADER.
My code never calls any Cc or section-related Mm functions. It is not a
filesystem.
FileObject->SectionObjectPointer is not initialized by my code too, since I
do not support memory-mapped files.

Using FileObject->FsContext2 for the same purpose leads to good working
code.

My question is:

  • is there any requirement that FileObject->FsContext must not point to
    anything other then FSRTL_COMMON_FCB_HEADER?
  • if yes - then under what conditions it is mandatory and under what
    conditions it can be violated?

What MS’s drivers which are not FSDs, do not use Cc or Mm but do use
per-file contexts do? For instance, what AFD.SYS does? Does it use FsContext
or FsContext2?

Max


You are currently subscribed to ntfsd as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntfsd-$subst(‘Recip.MemberIDChar’)@lists.osr.com

FsContext2 is completely private the FSD. If you are implementing a file
system do what you want with it.
If you are a filter you shouldn’t be touching it.
As for FsContext - we recommend now that file-systems actually use the
FSRTL_ADVANCED_FCB_HEADER - not just the COMMON_FCB_HEADER - to support
per-stream contexts that are available in Windows XP.

-----Original Message-----
From: Maxim S. Shatskih [mailto:xxxxx@storagecraft.com]
Sent: Sunday, September 23, 2001 12:44 PM
To: File Systems Developers
Subject: [ntfsd] FileObject->FsContext

Hi all,

I want to use the FileObject->FsContext field to point to some of my
driver’s private structures, not FSRTL_COMMON_FCB_HEADER. Unfortunately,
when I do this, the code BSODs. The BSOD is inside some Mm function
which seems to treat the field as pointer to FSRTL_COMMON_FCB_HEADER. My
code never calls any Cc or section-related Mm functions. It is not a
filesystem.
FileObject->SectionObjectPointer is not initialized by my code too,
FileObject->since I
do not support memory-mapped files.

Using FileObject->FsContext2 for the same purpose leads to good working
code.

My question is:

  • is there any requirement that FileObject->FsContext must not point to
    anything other then FSRTL_COMMON_FCB_HEADER?
  • if yes - then under what conditions it is mandatory and under what
    conditions it can be violated?

What MS’s drivers which are not FSDs, do not use Cc or Mm but do use
per-file contexts do? For instance, what AFD.SYS does? Does it use
FsContext or FsContext2?

Max


You are currently subscribed to ntfsd as: xxxxx@windows.microsoft.com
To unsubscribe send a blank email to leave-ntfsd-$subst(‘Recip.MemberIDChar’)@lists.osr.com


You are currently subscribed to ntfsd as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntfsd-$subst(‘Recip.MemberIDChar’)@lists.osr.com

>FsContext2 is completely private the FSD. If you are implementing a file

system do what you want with it.
If you are a filter you shouldn’t be touching it.

Thanks, but what I implement is a driver which user per-file contexts.
Am I right that it is better to not touch FsContext in such code?

Max


You are currently subscribed to ntfsd as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntfsd-$subst(‘Recip.MemberIDChar’)@lists.osr.com