I am trying to write down a Win32 program that recovers corrupted files on CDs and DVDs.

I used ReadFile() function to read the corrupted file. ReadFile() is supposed to return ERROR_READ_FAULT value whenever any read error occurs.

Unfortunately, the program stucks at the ReadFile() function when there exist a read error, instead of returning ERROR_READ_FAULT value.

Is there any alternative API function for ReadFile() ?

Recommended Answers

All 2 Replies

There is fopen fom the C stdio library and open from the C++ iostream lib.

all file i/o functions on MS-DOS computers eventually call the win32 api functions such as ReadFile(), WriteFile(), CreateFile() etc.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.