Hi Max,
I think I have better solution than your workaround.
PREFACE:
In NTIFS.H is prototype of OB_PARSE_METHOD and
OBJECT_TYPE_INITIALIZER. Here is prototype of OBJECT_TYPE :
typedef struct _OBJECT_TYPE {
ERESOURCE Mutex;
LIST_ENTRY TypeList;
UNICODE_STRING Name;
LONG DefaultObject;
ULONG Index;
ULONG TotalNumberOfObjects;
ULONG TotalNumberOfHandles;
ULONG HighWaterNumberOfObjects;
ULONG HighWaterNumberOfHandles;
OBJECT_TYPE_INITIALIZER TypeInfo;
ULONG Key;
} OBJECT_TYPE, *POBJECT_TYPE;
NTOSKRNL exports IoFileObjectType.
WORKAROUND:
Your driver should change the
(*IoFileObjectType)->TypeInfo.ParseProcedure
to your routine (can be in paged code), which should look like this:
(IopParseFile is your internal variable containing original value from
file object type)
NTSTATUS
MyParseFile (
IN PVOID ParseObject,
IN PVOID ObjectType,
IN OUT PACCESS_STATE AccessState,
IN KPROCESSOR_MODE AccessMode,
IN ULONG Attributes,
IN OUT PUNICODE_STRING CompleteName,
IN OUT PUNICODE_STRING RemainingName,
IN OUT PVOID Context OPTIONAL,
IN PSECURITY_QUALITY_OF_SERVICE SecurityQos OPTIONAL,
OUT PVOID *Object
)
{
NTSTATUS Status;
Status = IopParseFile(ParseObject, …, Object);
if (Status == STATUS_REPARSE)
{
//Now you should zero RelatedFileObject in OPEN_PACKET (+14h)
}
return Status;
}
Is more cleaner than stack traversing because of:
- offset to OBJECT_TYPE.TypeInfo.ParseProcedure is constant from
NT 3.1 to W2K and probably will remain valid forever (!)
- IoFileObjectType will probably remain exported forever
Additionally you can do this workaround only when detecting all below
W2K.
For all these versions compatibility is already ensured (and always
will).
Paul
-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com]On Behalf Of Maxim S. Shatskih
Sent: Monday, October 23, 2000 8:08 PM
To: File Systems Developers
Subject: [ntfsd] STATUS_REPARSE on relative CREATE
Hi all,
sorry for sending an attachment here, but looks like the problem
described in the subject line is too serious. Looks like the NT4 bug.
The attachment is the detailed description of it.
Have anybody worked the problem around without doing things like
stack
traversing and then patching?
Max