File disposition problem during create IRP

> Hi All

I’m using OSR Windows 2000 filter driver. I’m trapping the IRP_MJ_CREATE
IRPs. While doing so, I’ve observed that for File creation (FILE_CREATE)
the disposition value is 0x00000005 whereas for
Overwrite_if(FILE_OVERWRITE_IF) it is 0x00000002.

But when i create a directory i get the disposition as 0x00000002( create)
and not as 0x00000005

the has defines as found in NT 2000 DDK are
#define FILE_SUPERCEDE 0x00000000
#define FILE_OPEN 0x00000001
#define FILE_CREATE 0x00000002
#define FILE_OPEN_IF 0x00000003
#define FILE_OVERWRITE 0x00000004
#define FILE_OVERWRITE_IF 0x00000005
#define FILE_MAXIMUM_DISPOSTION 0x00000005

seeing the hash defines it is right for directories but not for files
Can some one help me in tracing out the problem .

Thanks in advance .
Sreenivas

Sreenivas,

You cannot overwrite a directory, nor can you supersede it - if the
directory already exists, you cannot create it again. This has to do with
the semantics of directory deletion - a directory MUST be empty before it
can be deleted.

Did you look at the FastFat code? It explicitly demonstrates the specifics
of directory creation logic (disposition must be FILE_CREATE or
FILE_OPEN_IF.) Thus, if your application did manage to send down a request
to overwrite the directory, it would fail!

Regards,

Tony Mason
Consulting Partner
OSR Open Systems Resources, Inc.
http://www.osr.com http:

-----Original Message-----
From: Sreenivas _cv [mailto:xxxxx@Satyam.com]
Sent: Tuesday, August 08, 2000 12:31 AM
To: File Systems Developers
Subject: [ntfsd] File disposition problem during create IRP

Hi All

I’m using OSR Windows 2000 filter driver. I’m trapping the IRP_MJ_CREATE
IRPs. While doing so, I’ve observed that for File creation (FILE_CREATE) the
disposition value is 0x00000005 whereas for Overwrite_if(FILE_OVERWRITE_IF)
it is 0x00000002.

But when i create a directory i get the disposition as 0x00000002( create)
and not as 0x00000005

the has defines as found in NT 2000 DDK are
#define FILE_SUPERCEDE 0x00000000
#define FILE_OPEN 0x00000001
#define FILE_CREATE 0x00000002
#define FILE_OPEN_IF 0x00000003
#define FILE_OVERWRITE 0x00000004
#define FILE_OVERWRITE_IF 0x00000005
#define FILE_MAXIMUM_DISPOSTION 0x00000005

seeing the hash defines it is right for directories but not for files
Can some one help me in tracing out the problem .

Thanks in advance .
Sreenivas</http:>