CreateDirectory

hi,all:
How can i create a new direcroty in filemon with a kernel fun and i use a ZwCreateDirectoryObject but fail.


Do You Yahoo!?
×¢²áÊÀ½çÒ»Á÷Æ·ÖʵÄÑÅ»¢Ãâ·ÑµçÓÊ

Try ZwCreateFile() with flag FILE_DIRECTORY_OBJECT

ZwCreateDirectoryObject() create directory not in FS. This is
directory for named objects (see winobj.exe from sysinternals)
----- Original Message -----
From: xinling zhang
To: Windows File Systems Devs Interest List
Sent: Tuesday, January 04, 2005 3:57 AM
Subject: [ntfsd] CreateDirectory

hi,all:
How can i create a new direcroty in filemon with a kernel fun and i use a ZwCreateDirectoryObject but fail.


Do You Yahoo!?
ע???һ??Ʒ?ʵ??Ż???ѵ??? — Questions? First check the IFS FAQ at https://www.osronline.com/article.cfm?id=17 You are currently subscribed to ntfsd as: xxxxx@secureol.com To unsubscribe send a blank email to xxxxx@lists.osr.com

my mistake, I mean FILE_DIRECTORY_FILE
and not FILE_DIRECTORY_OBJECT
----- Original Message -----
From: xinling zhang
To: Windows File Systems Devs Interest List
Sent: Tuesday, January 04, 2005 3:57 AM
Subject: [ntfsd] CreateDirectory

hi,all:
How can i create a new direcroty in filemon with a kernel fun and i use a ZwCreateDirectoryObject but fail.


Do You Yahoo!?
ע???һ??Ʒ?ʵ??Ż???ѵ??? — Questions? First check the IFS FAQ at https://www.osronline.com/article.cfm?id=17 You are currently subscribed to ntfsd as: xxxxx@secureol.com To unsubscribe send a blank email to xxxxx@lists.osr.com

thank you!
I tried with FILE_DIRECTORY_OBJECT but fail and i will try again.
and i have a question:
i use ZwWriteFile write a buffer to a disk and in win2000 it is normal,but in xp with sp1 it is false and the return status is 0xc0000022
the open operation is successful and write is false.
the code is following:
strcpy( tempfullPathName,“\??\D:\zxp.dat” );
//RtlInitAnsiString( &fileNameAnsiString,g_pPointer.filename );
RtlInitAnsiString( &fileNameAnsiString,tempfullPathName );
RtlAnsiStringToUnicodeString( &fileNameUnicodeString,&fileNameAnsiString,TRUE );
InitializeObjectAttributes( &objectAttributes, &fileNameUnicodeString,
OBJ_CASE_INSENSITIVE, NULL, NULL );
ntStatus = ZwCreateFile( &ntFileHandle, SYNCHRONIZE|FILE_ANY_ACCESS,
&objectAttributes, &ioStatus, NULL, 0,FILE_SHARE_WRITE,
FILE_OPEN,
FILE_NON_DIRECTORY_FILE |
FILE_RANDOM_ACCESS |
FILE_NO_INTERMEDIATE_BUFFERING |
FILE_SYNCHRONOUS_IO_NONALERT,
NULL, 0 );
if( !NT_SUCCESS( ntStatus ) ) {
DbgPrint((“IRP_MJ_WRITE— Could not open %s\n”, ntStatus ));
}
memset((char *)&OffSet,0,sizeof(LARGE_INTEGER));
DbgPrint((“Debug— Buffer %s %d \n”, g_pPointer.pBuffer,g_pPointer.dwLen ));
ntStatus = ZwWriteFile(ntFileHandle,
NULL,
NULL,
NULL,
&ioStatus,
tempBuffer,
strlen(tempBuffer),
&OffSet,
NULL
);
if( !NT_SUCCESS( ntStatus ) ) {
DbgPrint((“IRP_MJ_WRITE— Could not WRITE %s\n”, ntStatus ));
//return FALSE;
}

Maxim wrote:
Try ZwCreateFile() with flag FILE_DIRECTORY_OBJECT

ZwCreateDirectoryObject() create directory not in FS. This is
directory for named objects (see winobj.exe from sysinternals)
----- Original Message -----
From: xinling zhang
To: Windows File Systems Devs Interest List
Sent: Tuesday, January 04, 2005 3:57 AM
Subject: [ntfsd] CreateDirectory

hi,all:
How can i create a new direcroty in filemon with a kernel fun and i use a ZwCreateDirectoryObject but fail.

---------------------------------
Do You Yahoo!?
×¢²áÊÀ½çÒ»Á÷Æ·ÖʵÄÑÅ»¢Ãâ·ÑµçÓÊ — Questions? First check the IFS FAQ at https://www.osronline.com/article.cfm?id=17 You are currently subscribed to ntfsd as: xxxxx@secureol.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: unknown lmsubst tag argument: ‘’
To unsubscribe send a blank email to xxxxx@lists.osr.com

---------------------------------
Do You Yahoo!?
×¢²áÊÀ½çÒ»Á÷Æ·ÖʵÄÑÅ»¢Ãâ·ÑµçÓÊ

> i use ZwWriteFile write a buffer to a disk

and in win2000 it is normal,but in xp with
sp1 it is false and the return status is 0xc0000022
the open operation is successful and write is false.
the code is following:

Well, If I understand it well, the code is STATUS_ACCESS_DENIED.
Try to find why (my personal guess is that FILE_ANY_ACCESS
can not be used with ZwCreateFile.

L.

thanks
i will try again!

Ladislav Zezula wrote:
> i use ZwWriteFile write a buffer to a disk
> and in win2000 it is normal,but in xp with
> sp1 it is false and the return status is 0xc0000022
> the open operation is successful and write is false.
> the code is following:

Well, If I understand it well, the code is STATUS_ACCESS_DENIED.
Try to find why (my personal guess is that FILE_ANY_ACCESS
can not be used with ZwCreateFile.

L.


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

You are currently subscribed to ntfsd as: unknown lmsubst tag argument: ‘’
To unsubscribe send a blank email to xxxxx@lists.osr.com

---------------------------------
Do You Yahoo!?
×¢²áÊÀ½çÒ»Á÷Æ·ÖʵÄÑÅ»¢Ãâ·ÑµçÓÊ