Re: WriteFile( ) function. Error
- From: "Maxim S. Shatskih" <maxim@xxxxxxxxxxxxxxxx>
- Date: Tue, 7 Aug 2007 21:28:56 +0400
Call FSCTL_ALLOW_EXTENDED_DASD_IO after CreateFile and before writes.
--
Maxim Shatskih, Windows DDK MVP
StorageCraft Corporation
maxim@xxxxxxxxxxxxxxxx
http://www.storagecraft.com
"hitesh" <hitesh.ughreja@xxxxxxxxx> wrote in message
news:1186489820.733563.195730@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Hello All,
I am writing a format application where i found a strange problem.
I have to write some data in last 512 bytes of partition.
Now the problem is i am able to write data at anyplace except this
location.
when i call the function
bRet = WriteFile(hFile,lpBuffer,length,(LPDWORD)&byteswritten,NULL);
i am getting byteswritten=0 and bRet=TRUE.
It is strange, though no data is written on disk, still it returns
TRUE.
Now if i am running the same application second time, it is executing
successfully.
So i guess it is because of the driver. Because first time when i
format there is NTFS driver which is already running. And during the
first time half of data is written in disk and partition table is
corrupted so driver is unmounted. and second time it is running
successfully.
Then i am calling FSCTL_DISMOUNT_VOLUME for unloading the driver,
still i am facing the same problem,
Can anybody help me please?
thanks,
Hitesh
.
- Follow-Ups:
- Re: WriteFile( ) function. Error
- From: hitesh
- Re: WriteFile( ) function. Error
- References:
- WriteFile( ) function. Error
- From: hitesh
- WriteFile( ) function. Error
- Prev by Date: Re: Is local variable of driver dispatch routine paged or nonpaged?
- Next by Date: Bugcheck 10D if MmUnmapLockedPages is called between an ISR and a
- Previous by thread: WriteFile( ) function. Error
- Next by thread: Re: WriteFile( ) function. Error
- Index(es):
Relevant Pages
|