msdos/int21 CREAT special cases

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Volume label creation should fail, not create a regular file.
Similarly for file names ending in a slash (this is actually
needed for PKSFX Version 2.04g to unpack directory trees).

                                                Feri.

Index: msdos/int21.c
===================================================================
RCS file: /home/wine/wine/msdos/int21.c,v
retrieving revision 1.93
diff -u -r1.93 int21.c
--- msdos/int21.c	19 May 2003 21:40:05 -0000	1.93
+++ msdos/int21.c	26 May 2003 10:48:21 -0000
@@ -474,8 +474,18 @@
 }
 static BOOL INT21_CreateFile( CONTEXT86 *context )
 {
-    SET_AX( context, _lcreat16( CTX_SEG_OFF_TO_LIN(context, context->SegDs,
-                                                   context->Edx ), CX_reg(context) ) );
+    LPCSTR path=CTX_SEG_OFF_TO_LIN(context, context->SegDs, context->Edx);
+
+    if (CX_reg(context) == 0x0008) {
+        SetLastError( ERROR_ACCESS_DENIED );
+        return TRUE;
+    }
+    if (path[strlen(path)-1] == '/')
+    {
+        SetLastError( ERROR_FILE_NOT_FOUND );
+        return TRUE;
+    }
+    SET_AX( context, _lcreat16( path, CX_reg(context) ) );
     return (AX_reg(context) == (WORD)HFILE_ERROR16);
 }
 


[Index of Archives]     [Gimp for Windows]     [Red Hat]     [Samba]     [Yosemite Camping]     [Graphics Cards]     [Wine Home]

  Powered by Linux