Preparatory patch for revival of https://gitlab.winehq.org/wine/wine/-/merge_requests/498.
From: Jinoh Kang jinoh.kang.kr@gmail.com
--- dlls/kernel32/tests/console.c | 22 ++++++++++++++++++++++ server/console.c | 6 ++++++ 2 files changed, 28 insertions(+)
diff --git a/dlls/kernel32/tests/console.c b/dlls/kernel32/tests/console.c index 54d1a80709b..85355437438 100644 --- a/dlls/kernel32/tests/console.c +++ b/dlls/kernel32/tests/console.c @@ -4500,6 +4500,27 @@ static void test_file_info(HANDLE input, HANDLE output) ok(type == FILE_TYPE_CHAR, "GetFileType returned %lu\n", type); }
+static void test_condrv_root_directory(void) +{ + UNICODE_STRING empty_str = RTL_CONSTANT_STRING( L"" ); + OBJECT_ATTRIBUTES attr; + IO_STATUS_BLOCK iosb; + NTSTATUS status; + HANDLE handle, h2; + + handle = CreateFileA("CON", GENERIC_READ, 0, NULL, OPEN_EXISTING, 0, 0); + ok( handle != INVALID_HANDLE_VALUE, "CreateFileA error %lu\n", GetLastError() ); + + InitializeObjectAttributes( &attr, &empty_str, 0, handle, NULL ); + status = NtCreateFile( &h2, SYNCHRONIZE, &attr, &iosb, NULL, 0, + FILE_SHARE_READ | FILE_SHARE_WRITE | FILE_SHARE_DELETE, + FILE_OPEN, 0, NULL, 0 ); + ok(status == STATUS_NOT_FOUND || + broken(status == STATUS_OBJECT_TYPE_MISMATCH), "NtCreateFile returned %#lx\n", status); + + CloseHandle( handle ); +} + static void test_AttachConsole_child(DWORD console_pid) { HANDLE pipe_in, pipe_out; @@ -5552,6 +5573,7 @@ START_TEST(console) test_GetConsoleOriginalTitle(); test_GetConsoleTitleA(); test_GetConsoleTitleW(); + test_condrv_root_directory(); if (!test_current) { test_pseudo_console(); diff --git a/server/console.c b/server/console.c index b64283baf4a..bef48c205ed 100644 --- a/server/console.c +++ b/server/console.c @@ -796,6 +796,12 @@ static struct object *console_lookup_name( struct object *obj, struct unicode_st static const WCHAR connectionW[] = {'C','o','n','n','e','c','t','i','o','n'}; assert( obj->ops == &console_ops );
+ if (!name) + { + set_error( STATUS_NOT_FOUND ); + return NULL; + } + if (name->len == sizeof(connectionW) && !memcmp( name->str, connectionW, name->len )) { name->len = 0;
Hi,
It looks like your patch introduced the new failures shown below. Please investigate and fix them before resubmitting your patch. If they are not new, fixing them anyway would help a lot. Otherwise please ask for the known failures list to be updated.
The tests also ran into some preexisting test failures. If you know how to fix them that would be helpful. See the TestBot job for the details:
The full results can be found at: https://testbot.winehq.org/JobDetails.pl?Key=139860
Your paranoid android.
=== debian11b (64 bit WoW report) ===
Report validation errors: mfmediaengine:mfmediaengine crashed (80000101)