Hi Friends Please help about function ReadFile.

Hi friends I am in big trouble. Please help me for following issue.

I am trying to format the drive, for that I have written the program.

I am formatting the drive by calling exe Format exe in system32 folder.


For that I have written createprocess method. As NTFS format is not supported on windows XP I have to handle the error for the same as error return by the createprocess method.


For that I have written createpipe method to get the error message as a result for format process.

For that I am using ReadFile method to read the string from the buffer.

When I am debugging the same the function runs successfully but when I delete all the break points the function is not running successfully.

I have put some log in log file and found that the function ReadFile get failed as per the log, means it throws an exception (Maybe).
I don't understand the possible cause for the same.

Can anyone tell me what is happening when I put debugging point and if I remove the same results with different manner.

I hope I have explained problem clearly.

Your help will be more appreciable and I am also Igor to know such cause of behavior.

Thanks
As NTFS format is not supported on windows XP

??? This is so incorrect I don't know where to begin.

WaitForSingleObject(): http://msdn.microsoft.com/en-us/library/ms687032(VS.85).aspx
To wait for the process you called to finish

Then

GetExitCodeProcess(): http://msdn.microsoft.com/en-us/library/ms683189(VS.85).aspx
Use this instead of a pipe.

My first guess is that "ReadFile()" is failing because it is trying to get the data before it is there.
Thanks for your reply.

Some how I am able to manage to read from the buffer through buffer by creating Duplicate Handle and using the same, but still I am getting incomplete message from the buffer.

the link provided by you is really helpful.

Thank u very much

Topic archived. No new replies allowed.