AlbertP321
Programmer
Hi,
I'm porting a win32 program from XP to Vista. The program is doing read and write with hard disk and is sector based. In the very beginning the program does,
Read and write to sector 0, then
Write to very end of the hard disk
Steps are very traditional,
CreateFile
SetFilePointer
WriteFile
A problem happened when I do write to very end. CreateFile returns a valid handle. SetFilePointer ok too. However, WriteFile is always failed and last error is ERROR_FILE_NOT_FOUND. This is weird since CreateFile and SetFilePointer worked. Finally I found out it's a disk delay problem. I have to put a while loop to wait till the WriteFile succeeded. I have tried FILE_FLAG_NO_BUFFERING but not any help.
This problem is not happened on XP. Is there anyone knows why on Vista I have to wait till disk is ready for write?
Appreciate for any reply.
AbertP321
I'm porting a win32 program from XP to Vista. The program is doing read and write with hard disk and is sector based. In the very beginning the program does,
Read and write to sector 0, then
Write to very end of the hard disk
Steps are very traditional,
CreateFile
SetFilePointer
WriteFile
A problem happened when I do write to very end. CreateFile returns a valid handle. SetFilePointer ok too. However, WriteFile is always failed and last error is ERROR_FILE_NOT_FOUND. This is weird since CreateFile and SetFilePointer worked. Finally I found out it's a disk delay problem. I have to put a while loop to wait till the WriteFile succeeded. I have tried FILE_FLAG_NO_BUFFERING but not any help.
This problem is not happened on XP. Is there anyone knows why on Vista I have to wait till disk is ready for write?
Appreciate for any reply.
AbertP321