Stefan Leichter : ntdll/tests: Test NtCreateFile with an invalid filename.

Alexandre Julliard julliard at winehq.org
Tue Feb 23 11:17:21 CST 2010


Module: wine
Branch: master
Commit: 324984ef0222d7c637cae808753d9f34b16e1f3f
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=324984ef0222d7c637cae808753d9f34b16e1f3f

Author: Stefan Leichter <Stefan.Leichter at camline.com>
Date:   Mon Feb 22 22:37:04 2010 +0100

ntdll/tests: Test NtCreateFile with an invalid filename.

---

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

diff --git a/dlls/ntdll/tests/file.c b/dlls/ntdll/tests/file.c
index 3672b51..3d28d80 100644
--- a/dlls/ntdll/tests/file.c
+++ b/dlls/ntdll/tests/file.c
@@ -155,6 +155,8 @@ static void WINAPI apc( void *arg, IO_STATUS_BLOCK *iosb, ULONG reserved )
 
 static void create_file_test(void)
 {
+    static const WCHAR systemrootW[] = {'\\','S','y','s','t','e','m','R','o','o','t',
+                                        '\\','f','a','i','l','i','n','g',0};
     NTSTATUS status;
     HANDLE dir;
     WCHAR path[MAX_PATH];
@@ -231,6 +233,21 @@ static void create_file_test(void)
         "open %s failed %x\n", wine_dbgstr_w(nameW.Buffer), status );
 
     pRtlFreeUnicodeString( &nameW );
+
+    pRtlInitUnicodeString( &nameW, systemrootW );
+    attr.Length = sizeof(attr);
+    attr.RootDirectory = NULL;
+    attr.ObjectName = &nameW;
+    attr.Attributes = OBJ_CASE_INSENSITIVE;
+    attr.SecurityDescriptor = NULL;
+    attr.SecurityQualityOfService = NULL;
+    dir = NULL;
+    status = pNtCreateFile( &dir, FILE_APPEND_DATA, &attr, &io, NULL, FILE_ATTRIBUTE_NORMAL, 0,
+                            FILE_OPEN_IF, FILE_SYNCHRONOUS_IO_NONALERT, NULL, 0 );
+    todo_wine
+    ok( status == STATUS_INVALID_PARAMETER,
+        "open %s failed %x\n", wine_dbgstr_w(nameW.Buffer), status );
+    pRtlFreeUnicodeString( &nameW );
 }
 
 static void open_file_test(void)




More information about the wine-cvs mailing list