Q:

What does ERROR_INVALID_DATA (13) mean from ReadFile?

Our application is failing on some WinCE device. The log indicates, that ReadFile failed for some (read-only, working in desktop build) file and GetLastError returns 13, which is ERROR_INVALID_DATA. What could that mean in this context? I only saw this error mentioned for Heap32Next.

A:

Never had such error, possible cause: 
http://support.microsoft.com/kb/967335
"In Windows CE 5.0, the SD bus driver incorrectly calculates the memory capacity of Secure Digital (SD) cards as less than the actual memory capacity. Therefore, functions that read data from files whose positions exceed the incorrectly calculated memory capacity may behave incorrectly.
For example, if you use the ReadFile function to read a file that is stored in this area on an SD high capacity (SDHC) card, the ReadFile function returns 0.  Therefore, the GetLastError function returns the following error:
ERROR_INVALID_DATA."

