You've already forked wine-staging
mirror of
https://gitlab.winehq.org/wine/wine-staging.git
synced 2025-04-13 14:42:51 -07:00
Rebase against 8dd86823fdd9a5e631cf3173727b6f667ef1b611.
This commit is contained in:
@@ -1,74 +0,0 @@
|
||||
From 42d6405bc17730a5e281f7461891acca7803a8cd Mon Sep 17 00:00:00 2001
|
||||
From: Sebastian Lackner <sebastian@fds-team.de>
|
||||
Date: Thu, 24 Sep 2015 01:56:24 +0200
|
||||
Subject: ntdll/tests: Add tests for calling NtReadFile/NtWriteFile on
|
||||
directory.
|
||||
|
||||
---
|
||||
dlls/ntdll/tests/file.c | 35 +++++++++++++++++++++++++++++++++--
|
||||
1 file changed, 33 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/dlls/ntdll/tests/file.c b/dlls/ntdll/tests/file.c
|
||||
index 1afb9c8..b8f1847 100644
|
||||
--- a/dlls/ntdll/tests/file.c
|
||||
+++ b/dlls/ntdll/tests/file.c
|
||||
@@ -177,6 +177,7 @@ static void create_file_test(void)
|
||||
static const WCHAR pathInvalidNtW[] = {'\\','\\','?','\\',0};
|
||||
static const WCHAR pathInvalidNt2W[] = {'\\','?','?','\\',0};
|
||||
static const WCHAR pathInvalidDosW[] = {'\\','D','o','s','D','e','v','i','c','e','s','\\',0};
|
||||
+ static const char testdata[] = "Hello World";
|
||||
FILE_NETWORK_OPEN_INFORMATION info;
|
||||
NTSTATUS status;
|
||||
HANDLE dir, file;
|
||||
@@ -184,6 +185,9 @@ static void create_file_test(void)
|
||||
OBJECT_ATTRIBUTES attr;
|
||||
IO_STATUS_BLOCK io;
|
||||
UNICODE_STRING nameW;
|
||||
+ LARGE_INTEGER offset;
|
||||
+ char buf[32];
|
||||
+ DWORD ret;
|
||||
|
||||
GetCurrentDirectoryW( MAX_PATH, path );
|
||||
pRtlDosPathNameToNtPathName_U( path, &nameW, NULL, NULL );
|
||||
@@ -195,9 +199,36 @@ static void create_file_test(void)
|
||||
attr.SecurityQualityOfService = NULL;
|
||||
|
||||
/* try various open modes and options on directories */
|
||||
- status = pNtCreateFile( &dir, GENERIC_READ, &attr, &io, NULL, 0, FILE_SHARE_READ|FILE_SHARE_WRITE,
|
||||
- FILE_OPEN, FILE_DIRECTORY_FILE, NULL, 0 );
|
||||
+ status = pNtCreateFile( &dir, GENERIC_READ|GENERIC_WRITE, &attr, &io, NULL, 0,
|
||||
+ FILE_SHARE_READ|FILE_SHARE_WRITE, FILE_OPEN, FILE_DIRECTORY_FILE, NULL, 0 );
|
||||
ok( !status, "open %s failed %x\n", wine_dbgstr_w(nameW.Buffer), status );
|
||||
+
|
||||
+ U(io).Status = 0xdeadbeef;
|
||||
+ offset.QuadPart = 0;
|
||||
+ status = pNtReadFile( dir, NULL, NULL, NULL, &io, buf, sizeof(buf), &offset, NULL );
|
||||
+ todo_wine
|
||||
+ ok( status == STATUS_INVALID_DEVICE_REQUEST || status == STATUS_PENDING, "NtReadFile error %08x\n", status );
|
||||
+ if (status == STATUS_PENDING)
|
||||
+ {
|
||||
+ ret = WaitForSingleObject( dir, 1000 );
|
||||
+ ok( ret == WAIT_OBJECT_0, "WaitForSingleObject error %u\n", ret );
|
||||
+ ok( U(io).Status == STATUS_INVALID_DEVICE_REQUEST,
|
||||
+ "expected STATUS_INVALID_DEVICE_REQUEST, got %08x\n", U(io).Status );
|
||||
+ }
|
||||
+
|
||||
+ U(io).Status = 0xdeadbeef;
|
||||
+ offset.QuadPart = 0;
|
||||
+ status = pNtWriteFile( dir, NULL, NULL, NULL, &io, testdata, sizeof(testdata), &offset, NULL);
|
||||
+ todo_wine
|
||||
+ ok( status == STATUS_INVALID_DEVICE_REQUEST || status == STATUS_PENDING, "NtWriteFile error %08x\n", status );
|
||||
+ if (status == STATUS_PENDING)
|
||||
+ {
|
||||
+ ret = WaitForSingleObject( dir, 1000 );
|
||||
+ ok( ret == WAIT_OBJECT_0, "WaitForSingleObject error %u\n", ret );
|
||||
+ ok( U(io).Status == STATUS_INVALID_DEVICE_REQUEST,
|
||||
+ "expected STATUS_INVALID_DEVICE_REQUEST, got %08x\n", U(io).Status );
|
||||
+ }
|
||||
+
|
||||
CloseHandle( dir );
|
||||
|
||||
status = pNtCreateFile( &dir, GENERIC_READ, &attr, &io, NULL, 0, FILE_SHARE_READ|FILE_SHARE_WRITE,
|
||||
--
|
||||
2.6.0
|
||||
|
Reference in New Issue
Block a user