[Kernel32]Test for Bug 21292: Createfile creating with illegal char in name

Uwe Bonnes bon at elektron.ikp.physik.tu-darmstadt.de
Sun Jan 17 06:20:26 CST 2010


---
 dlls/kernel32/tests/file.c |   10 ++++++++++
 1 files changed, 10 insertions(+), 0 deletions(-)

diff --git a/dlls/kernel32/tests/file.c b/dlls/kernel32/tests/file.c
index 3493ff3..e579417 100644
--- a/dlls/kernel32/tests/file.c
+++ b/dlls/kernel32/tests/file.c
@@ -878,6 +878,16 @@ static void test_CreateFileA(void)
     ret = RemoveDirectoryA(dirname);
     ok(ret, "RemoveDirectoryA: error %d\n", GetLastError());
 
+    /* test creating with invalid chars in name
+       Only Wine (at least until Jan 2010) and NT4 succeed
+    */
+    hFile = CreateFileA( "test/", GENERIC_READ, FILE_SHARE_READ | FILE_SHARE_WRITE,
+			 NULL, OPEN_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL);
+    todo_wine{
+      ok((hFile ==  INVALID_HANDLE_VALUE && GetLastError() == ERROR_INVALID_NAME) ||
+		 broken(hFile !=  INVALID_HANDLE_VALUE),
+	 "CreateFile with illegal char should nor succeed(Bug 21292)\n");
+    }
 
     /* test opening directory as a directory */
     hFile = CreateFileA( temp_path, GENERIC_READ,
-- 
1.6.4.2




More information about the wine-patches mailing list