Test for return value from CreateDirectory("c:")

Vitaliy Margolen wine-patch at kievinfo.com
Sat Oct 22 15:18:53 CDT 2005



Vitaliy Margolen

changelog:
  kernel/test/path.c
  - Test for return value from CreateDirectory("c:")
-------------- next part --------------
Index: dlls/kernel/tests/path.c
===================================================================
RCS file: /home/wine/wine/dlls/kernel/tests/path.c,v
retrieving revision 1.29
diff -u -p -r1.29 path.c
--- dlls/kernel/tests/path.c	31 May 2005 09:30:45 -0000	1.29
+++ dlls/kernel/tests/path.c	22 Oct 2005 20:17:42 -0000
@@ -305,6 +305,7 @@ static void test_InitPathA(CHAR *newdir,
   DWORD len,len1,drives;
   INT id;
   HANDLE hndl;
+  BOOL bRes;
 
   *curDrive = *otherDrive = NOT_A_VALID_DRIVE;
 
@@ -362,6 +363,12 @@ static void test_InitPathA(CHAR *newdir,
   ok(CreateDirectoryA(tmpstr,NULL),"CreateDirectoryA failed\n");
   sprintf(tmpstr,"%s\\%s",newdir,LONGDIR);
   ok(CreateDirectoryA(tmpstr,NULL),"CreateDirectoryA failed\n");
+  bRes = CreateDirectoryA("c:",NULL);
+  ok(!bRes && GetLastError() == ERROR_ACCESS_DENIED,
+     "CreateDirectoryA(\"c:\" should have failed (%ld)\n", GetLastError());
+  bRes = CreateDirectoryA("c:\\",NULL);
+  ok(!bRes && GetLastError() == ERROR_ACCESS_DENIED,
+     "CreateDirectoryA(\"c:\\\" should have failed (%ld)\n", GetLastError());
   sprintf(tmpstr,"%s\\%s\\%s",newdir,SHORTDIR,SHORTFILE);
   hndl=CreateFileA(tmpstr,GENERIC_WRITE,0,NULL,
                    CREATE_NEW,FILE_ATTRIBUTE_NORMAL,NULL);


More information about the wine-patches mailing list