CreateDirectoryW improvement

Wolfgang Schwotzer wolfgang.schwotzer at gmx.net
Mon Sep 6 15:32:02 CDT 2004


Description: Return error ERROR_ALREADY_EXISTING if an
     existing drive (e.g. 'C:') without '\\' is specified
ChangeLog: CreateDirectoryW: Return error ERROR_ALREADY_EXISTING e.g. for path 'C:'

-------------- next part --------------
Index: dlls/kernel/path.c
===================================================================
RCS file: /home/wine/wine/dlls/kernel/path.c,v
retrieving revision 1.14
diff -u -r1.14 path.c
--- dlls/kernel/path.c	2 Jun 2004 21:32:55 -0000	1.14
+++ dlls/kernel/path.c	6 Sep 2004 20:20:43 -0000
@@ -1189,6 +1189,11 @@
     }
     else SetLastError( RtlNtStatusToDosError(status) );
 
+    /* If only existing drive (e.g. 'C:') specified return a different error */
+    if (GetLastError() == ERROR_ACCESS_DENIED &&
+       (strlenW(path) == 2 && isalphaW(path[0])) && (path[1] == ':'))
+       SetLastError(ERROR_ALREADY_EXISTS);
+
     RtlFreeUnicodeString( &nt_name );
     return ret;
 }


More information about the wine-patches mailing list