Andrew Nguyen anguyen@codeweavers.com writes:
Hmm, is there any situation where CreateFile yields a last error of ERROR_WRITE_PROTECT? If an application requests GENERIC_WRITE access on a file residing on a read-only file system, CreateFile on NT platforms seems to always set the last error to ERROR_ACCESS_DENIED and not ERROR_WRITE_PROTECT.
That depends on the error mapping, but there may well be cases where we want to do that, if not today then at some point in the future. There shouldn't be any harm in keeping the current check.