> I think so, yes - I think it shows that the message is the > same no matter what ReadFile() is being used for. > > I assume this occurs for you if you use CreateFile() with > OPEN_EXISTING and a filename that actually doesn't exist, > then try and use ReadFile()? Or does it occur under other conditions?
Actually, in that scenarion, CreateFile( ) fails with this error, not the ReadFile( ) call. CreateFile( ) will also return NULL, so if you pass *that* NULL handle to ReadFile( ), I'd expect you'd get an "invalid handle value" error (forgot the symbolic name for it, you can look them all up in WinError.h). Try SetLastError( 0 ); just before the ReadFile( ) call to make sure the error GetLastError( ) returns is really set by ReadFile( ). If you continue to get this error, then if there is a way to intentionally make the device unable to respond for a period of time, you can try that procedure, and see if ReadFile( ) is returning this error in this artificial situation that you're sure is causing a timeout. Hope this makes a bit sense. Ehsan
