The compatibility constraints of error codes, episode 2

Raymond Chen

Raymond

A customer reported an incompatibility in Windows 7: If A: is a floppy drive and they call Load­Library("A:\\foo.dll") and there is no disk in the drive, the Load­Library call fails with the error ERROR_NOT_READY. Previous versions of Windows failed with the error ERROR_MOD_NOT_FOUND.
Both error codes are reasonable responses to the situation. “The module couldn’t be found because the drive is not ready.” Programs should treat a failed Load­Library as a failed library load and shouldn’t be sensitive to the precise reason for the error. (They can display a more specific error to the user based on the error code, but overall program logic shouldn’t depend on the error code.)
Fortunately, the customer discovered this discrepancy during their pre-release testing and were able to accommodate this change in their program before ever releasing it. A sigh of relief from the application compatibility team.

Episode 1.

Raymond Chen
Raymond Chen

Follow Raymond   

0 comments

Comments are closed.