On 07/29/2010 10:48 AM, Alexandre Julliard wrote:
Andrew Nguyenanguyen@codeweavers.com writes:
@@ -1092,7 +1092,7 @@ static BOOL INT21_CreateFile( CONTEXT86 *context, winMode, winAttributes, 0 ); /* DOS allows to open files on a CDROM R/W */ if( winHandle == INVALID_HANDLE_VALUE&&
GetLastError()== ERROR_WRITE_PROTECT) {
GetLastError() == ERROR_ACCESS_DENIED) {
You should keep the old error too.
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.