about write a disk

hi, all:

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 0xc0000022the open operation is successful and write is false.
the code is following:
strcpy( tempfullPathName,“\??\D:\zxp.dat” );
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));
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 ));
}


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