Zebediah Figura : ntoskrnl.exe/tests: Open the test file for synchronous I /O.

Alexandre Julliard julliard at winehq.org
Mon Jan 28 16:17:00 CST 2019


Module: wine
Branch: master
Commit: e07d25c799a528c933031666278ddf5666b94372
URL:    https://source.winehq.org/git/wine.git/?a=commit;h=e07d25c799a528c933031666278ddf5666b94372

Author: Zebediah Figura <z.figura12 at gmail.com>
Date:   Sat Jan 26 12:53:00 2019 -0600

ntoskrnl.exe/tests: Open the test file for synchronous I/O.

Especially to avoid a panic when we close the file before a write has completed.

Signed-off-by: Zebediah Figura <z.figura12 at gmail.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/ntoskrnl.exe/tests/driver.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/dlls/ntoskrnl.exe/tests/driver.c b/dlls/ntoskrnl.exe/tests/driver.c
index 6ab5c3e..5c34b41 100644
--- a/dlls/ntoskrnl.exe/tests/driver.c
+++ b/dlls/ntoskrnl.exe/tests/driver.c
@@ -53,12 +53,10 @@ extern int CDECL _vsnprintf(char *str, size_t len, const char *format, __ms_va_l
 static void kvprintf(const char *format, __ms_va_list ap)
 {
     static char buffer[512];
-    LARGE_INTEGER offset;
     IO_STATUS_BLOCK io;
 
     _vsnprintf(buffer, sizeof(buffer), format, ap);
-    offset.QuadPart = -1;
-    ZwWriteFile(okfile, NULL, NULL, NULL, &io, buffer, strlen(buffer), &offset, NULL);
+    ZwWriteFile(okfile, NULL, NULL, NULL, &io, buffer, strlen(buffer), NULL, NULL);
 }
 
 static void WINAPIV kprintf(const char *format, ...)
@@ -522,7 +520,7 @@ static NTSTATUS main_test(IRP *irp, IO_STACK_LOCATION *stack, ULONG_PTR *info)
     winetest_report_success = test_input->winetest_report_success;
     attr.ObjectName = &pathU;
     attr.Attributes = OBJ_KERNEL_HANDLE; /* needed to be accessible from system threads */
-    ZwOpenFile(&okfile, FILE_APPEND_DATA, &attr, &io, 0, 0);
+    ZwOpenFile(&okfile, FILE_APPEND_DATA | SYNCHRONIZE, &attr, &io, 0, FILE_SYNCHRONOUS_IO_NONALERT);
 
     test_currentprocess();
     test_mdl_map();




More information about the wine-cvs mailing list