Commit 43694d95 authored by Rein Klazes's avatar Rein Klazes Committed by Alexandre Julliard

winedos: Open files with write access on read only media.

If the CreateFile in INT21_CreateFile fails with ERROR_WRITE_PROTECT, retry without write access.
parent d82af6f7
......@@ -1090,6 +1090,12 @@ static BOOL INT21_CreateFile( CONTEXT86 *context,
{
winHandle = CreateFileW( pathW, winAccess, winSharing, NULL,
winMode, winAttributes, 0 );
/* DOS allows to open files on a CDROM R/W */
if( winHandle == INVALID_HANDLE_VALUE &&
GetLastError()== ERROR_WRITE_PROTECT) {
winHandle = CreateFileW( pathW, winAccess & ~GENERIC_WRITE,
winSharing, NULL, winMode, winAttributes, 0 );
}
if (winHandle == INVALID_HANDLE_VALUE)
return FALSE;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment