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() ?

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 1.18 million developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.