krnl386.exe: Fix last error check for DOS compatibility hack.

Andrew Nguyen anguyen at codeweavers.com
Thu Jul 29 11:08:19 CDT 2010


On 07/29/2010 10:48 AM, Alexandre Julliard wrote:
> Andrew Nguyen<anguyen at 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.



More information about the wine-devel mailing list