winehq.org
Sign In
Sign Up
Sign In
Sign Up
Manage this list
×
Keyboard Shortcuts
Thread View
j
: Next unread message
k
: Previous unread message
j a
: Jump to all threads
j l
: Jump to MailingList overview
2025
February
January
2024
December
November
October
September
August
July
June
May
April
March
February
January
2023
December
November
October
September
August
July
June
May
April
March
February
January
2022
December
November
October
September
August
July
June
May
April
March
February
January
2021
December
November
October
September
August
July
June
May
April
March
February
January
2020
December
November
October
September
August
July
June
May
April
March
February
January
2019
December
November
October
September
August
July
June
May
April
March
February
January
2018
December
November
October
September
August
July
June
May
April
March
February
January
2017
December
November
October
September
August
July
June
May
April
March
February
January
2016
December
November
October
September
August
July
June
May
April
March
February
January
2015
December
November
October
September
August
July
June
May
April
March
February
January
2014
December
November
October
September
August
July
June
May
April
March
February
January
2013
December
November
October
September
August
July
June
May
April
March
February
January
2012
December
November
October
September
August
July
June
May
April
March
February
January
2011
December
November
October
September
August
July
June
May
April
March
February
January
2010
December
November
October
September
August
July
June
May
April
March
February
January
2009
December
November
October
September
August
July
June
May
April
March
February
January
2008
December
November
October
September
August
July
June
May
April
March
February
January
2007
December
November
October
September
August
July
June
May
April
March
February
January
2006
December
November
October
September
August
July
June
May
April
March
February
January
2005
December
November
October
September
August
July
June
May
April
March
February
January
2004
December
November
October
September
August
July
June
May
April
March
February
January
2003
December
November
October
September
August
July
June
May
April
March
February
January
2002
December
November
October
September
August
July
June
May
April
March
February
January
2001
December
November
October
September
August
July
June
May
April
March
February
List overview
wine-commits
October 2022
----- 2025 -----
February 2025
January 2025
----- 2024 -----
December 2024
November 2024
October 2024
September 2024
August 2024
July 2024
June 2024
May 2024
April 2024
March 2024
February 2024
January 2024
----- 2023 -----
December 2023
November 2023
October 2023
September 2023
August 2023
July 2023
June 2023
May 2023
April 2023
March 2023
February 2023
January 2023
----- 2022 -----
December 2022
November 2022
October 2022
September 2022
August 2022
July 2022
June 2022
May 2022
April 2022
March 2022
February 2022
January 2022
----- 2021 -----
December 2021
November 2021
October 2021
September 2021
August 2021
July 2021
June 2021
May 2021
April 2021
March 2021
February 2021
January 2021
----- 2020 -----
December 2020
November 2020
October 2020
September 2020
August 2020
July 2020
June 2020
May 2020
April 2020
March 2020
February 2020
January 2020
----- 2019 -----
December 2019
November 2019
October 2019
September 2019
August 2019
July 2019
June 2019
May 2019
April 2019
March 2019
February 2019
January 2019
----- 2018 -----
December 2018
November 2018
October 2018
September 2018
August 2018
July 2018
June 2018
May 2018
April 2018
March 2018
February 2018
January 2018
----- 2017 -----
December 2017
November 2017
October 2017
September 2017
August 2017
July 2017
June 2017
May 2017
April 2017
March 2017
February 2017
January 2017
----- 2016 -----
December 2016
November 2016
October 2016
September 2016
August 2016
July 2016
June 2016
May 2016
April 2016
March 2016
February 2016
January 2016
----- 2015 -----
December 2015
November 2015
October 2015
September 2015
August 2015
July 2015
June 2015
May 2015
April 2015
March 2015
February 2015
January 2015
----- 2014 -----
December 2014
November 2014
October 2014
September 2014
August 2014
July 2014
June 2014
May 2014
April 2014
March 2014
February 2014
January 2014
----- 2013 -----
December 2013
November 2013
October 2013
September 2013
August 2013
July 2013
June 2013
May 2013
April 2013
March 2013
February 2013
January 2013
----- 2012 -----
December 2012
November 2012
October 2012
September 2012
August 2012
July 2012
June 2012
May 2012
April 2012
March 2012
February 2012
January 2012
----- 2011 -----
December 2011
November 2011
October 2011
September 2011
August 2011
July 2011
June 2011
May 2011
April 2011
March 2011
February 2011
January 2011
----- 2010 -----
December 2010
November 2010
October 2010
September 2010
August 2010
July 2010
June 2010
May 2010
April 2010
March 2010
February 2010
January 2010
----- 2009 -----
December 2009
November 2009
October 2009
September 2009
August 2009
July 2009
June 2009
May 2009
April 2009
March 2009
February 2009
January 2009
----- 2008 -----
December 2008
November 2008
October 2008
September 2008
August 2008
July 2008
June 2008
May 2008
April 2008
March 2008
February 2008
January 2008
----- 2007 -----
December 2007
November 2007
October 2007
September 2007
August 2007
July 2007
June 2007
May 2007
April 2007
March 2007
February 2007
January 2007
----- 2006 -----
December 2006
November 2006
October 2006
September 2006
August 2006
July 2006
June 2006
May 2006
April 2006
March 2006
February 2006
January 2006
----- 2005 -----
December 2005
November 2005
October 2005
September 2005
August 2005
July 2005
June 2005
May 2005
April 2005
March 2005
February 2005
January 2005
----- 2004 -----
December 2004
November 2004
October 2004
September 2004
August 2004
July 2004
June 2004
May 2004
April 2004
March 2004
February 2004
January 2004
----- 2003 -----
December 2003
November 2003
October 2003
September 2003
August 2003
July 2003
June 2003
May 2003
April 2003
March 2003
February 2003
January 2003
----- 2002 -----
December 2002
November 2002
October 2002
September 2002
August 2002
July 2002
June 2002
May 2002
April 2002
March 2002
February 2002
January 2002
----- 2001 -----
December 2001
November 2001
October 2001
September 2001
August 2001
July 2001
June 2001
May 2001
April 2001
March 2001
February 2001
wine-commits@winehq.org
1 participants
537 discussions
Start a n
N
ew thread
Brendan Shanks : ntdll: Set native thread names on Linux when set with SetThreadDescription().
by Alexandre Julliard
26 Oct '22
26 Oct '22
Module: wine Branch: master Commit: c68f75e34e3383c90462a4b01dd20f3511353453 URL:
https://gitlab.winehq.org/wine/wine/-/commit/c68f75e34e3383c90462a4b01dd20f…
Author: Brendan Shanks <bshanks(a)codeweavers.com> Date: Wed Dec 8 16:10:05 2021 -0800 ntdll: Set native thread names on Linux when set with SetThreadDescription(). --- dlls/ntdll/unix/thread.c | 46 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) diff --git a/dlls/ntdll/unix/thread.c b/dlls/ntdll/unix/thread.c index bb8c1c2936b..3a737044407 100644 --- a/dlls/ntdll/unix/thread.c +++ b/dlls/ntdll/unix/thread.c @@ -26,6 +26,7 @@ #include <assert.h> #include <errno.h> +#include <fcntl.h> #include <limits.h> #include <stdarg.h> #include <stdio.h> @@ -1828,6 +1829,48 @@ BOOL get_thread_times(int unix_pid, int unix_tid, LARGE_INTEGER *kernel_time, LA #endif } +static void set_native_thread_name( HANDLE handle, const UNICODE_STRING *name ) +{ +#ifdef linux + NTSTATUS status; + char path[64], nameA[64]; + int unix_pid, unix_tid, len, fd; + + SERVER_START_REQ( get_thread_times ) + { + req->handle = wine_server_obj_handle( handle ); + status = wine_server_call( req ); + if (status == STATUS_SUCCESS) + { + unix_pid = reply->unix_pid; + unix_tid = reply->unix_tid; + } + } + SERVER_END_REQ; + + if (status != STATUS_SUCCESS || unix_pid == -1 || unix_tid == -1) + return; + + if (unix_pid != getpid()) + { + static int once; + if (!once++) FIXME("cross-process native thread naming not supported\n"); + return; + } + + len = ntdll_wcstoumbs( name->Buffer, name->Length / sizeof(WCHAR), nameA, sizeof(nameA), FALSE ); + sprintf(path, "/proc/%u/task/%u/comm", unix_pid, unix_tid); + if ((fd = open( path, O_WRONLY )) != -1) + { + write( fd, nameA, len ); + close( fd ); + } +#else + static int once; + if (!once++) FIXME("not implemented on this platform\n"); +#endif +} + #ifndef _WIN64 static BOOL is_process_wow64( const CLIENT_ID *id ) { @@ -2254,6 +2297,9 @@ NTSTATUS WINAPI NtSetInformationThread( HANDLE handle, THREADINFOCLASS class, status = wine_server_call( req ); } SERVER_END_REQ; + + set_native_thread_name( handle, &info->ThreadName ); + return status; }
1
0
0
0
Eric Pouech : kernel32/tests: Workaround some broken Windows behavior in console tests.
by Alexandre Julliard
26 Oct '22
26 Oct '22
Module: wine Branch: master Commit: 35c65edcb92557e34c424c2026614adfff21b500 URL:
https://gitlab.winehq.org/wine/wine/-/commit/35c65edcb92557e34c424c2026614a…
Author: Eric Pouech <eric.pouech(a)gmail.com> Date: Tue Oct 25 16:36:32 2022 +0200 kernel32/tests: Workaround some broken Windows behavior in console tests. Wine-Bug:
https://bugs.winehq.org/show_bug.cgi?id=48105
Signed-off-by: Eric Pouech <eric.pouech(a)gmail.com> --- dlls/kernel32/tests/console.c | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/dlls/kernel32/tests/console.c b/dlls/kernel32/tests/console.c index c2b7eb63a1e..1f285faf1e2 100644 --- a/dlls/kernel32/tests/console.c +++ b/dlls/kernel32/tests/console.c @@ -925,10 +925,16 @@ static void testScreenBuffer(HANDLE hConOut) SetConsoleCursorPosition(hConOutRW, c); ret = WriteConsoleA(hConOutRW, test_cp866, lstrlenA(test_cp866), &len, NULL); ok(ret && len == lstrlenA(test_cp866), "WriteConsoleA failed\n"); - ret = ReadConsoleOutputCharacterW(hConOutRW, str_wbuf, lstrlenA(test_cp866), c, &len); - ok(ret && len == lstrlenA(test_cp866), "ReadConsoleOutputCharacterW failed\n"); - str_wbuf[lstrlenA(test_cp866)] = 0; - ok(!lstrcmpW(str_wbuf, test_unicode), "string does not match the pattern\n"); + ret = ReadConsoleOutputCharacterW(hConOutRW, str_wbuf, lstrlenW(test_unicode), c, &len); + /* Work around some broken results under Windows with some locale (ja, cn, ko...) + * Looks like a real bug in Win10 (at least). + */ + if (ret && broken(len == lstrlenW(test_unicode) / sizeof(WCHAR))) + ret = ReadConsoleOutputCharacterW(hConOutRW, str_wbuf, lstrlenW(test_unicode) * sizeof(WCHAR), c, &len); + ok(ret, "ReadConsoleOutputCharacterW failed\n"); + ok(len == lstrlenW(test_unicode), "unexpected len %lu %u\n", len, lstrlenW(test_unicode)); + ok(!memcmp(str_wbuf, test_unicode, lstrlenW(test_unicode) * sizeof(WCHAR)), + "string does not match the pattern\n"); /* * cp866 is OK, let's switch to cp1251.
1
0
0
0
Hans Leidekker : wbemprox: WQL string comparisons are case insensitive.
by Alexandre Julliard
26 Oct '22
26 Oct '22
Module: wine Branch: master Commit: 7bfa058a0b89e6a4f24dd43db9a0ea5c1a304b71 URL:
https://gitlab.winehq.org/wine/wine/-/commit/7bfa058a0b89e6a4f24dd43db9a0ea…
Author: Hans Leidekker <hans(a)codeweavers.com> Date: Tue Oct 25 11:21:28 2022 +0200 wbemprox: WQL string comparisons are case insensitive. Wine-Bug:
https://bugs.winehq.org/show_bug.cgi?id=53832
--- dlls/wbemprox/query.c | 12 ++++++------ dlls/wbemprox/tests/query.c | 22 ++++++++++++++++++++++ 2 files changed, 28 insertions(+), 6 deletions(-) diff --git a/dlls/wbemprox/query.c b/dlls/wbemprox/query.c index 8233d35878d..1b79523d66f 100644 --- a/dlls/wbemprox/query.c +++ b/dlls/wbemprox/query.c @@ -118,22 +118,22 @@ static HRESULT eval_strcmp( UINT op, const WCHAR *lstr, const WCHAR *rstr, LONGL switch (op) { case OP_EQ: - *val = !wcscmp( lstr, rstr ); + *val = !wcsicmp( lstr, rstr ); break; case OP_GT: - *val = wcscmp( lstr, rstr ) > 0; + *val = wcsicmp( lstr, rstr ) > 0; break; case OP_LT: - *val = wcscmp( lstr, rstr ) < 0; + *val = wcsicmp( lstr, rstr ) < 0; break; case OP_LE: - *val = wcscmp( lstr, rstr ) <= 0; + *val = wcsicmp( lstr, rstr ) <= 0; break; case OP_GE: - *val = wcscmp( lstr, rstr ) >= 0; + *val = wcsicmp( lstr, rstr ) >= 0; break; case OP_NE: - *val = wcscmp( lstr, rstr ); + *val = wcsicmp( lstr, rstr ); break; case OP_LIKE: *val = eval_like( lstr, rstr ); diff --git a/dlls/wbemprox/tests/query.c b/dlls/wbemprox/tests/query.c index 12bc42d249c..e86f7fd5b62 100644 --- a/dlls/wbemprox/tests/query.c +++ b/dlls/wbemprox/tests/query.c @@ -2141,6 +2141,28 @@ static void test_Win32_LogicalDisk( IWbemServices *services ) IWbemClassObject_Release( obj ); } + IEnumWbemClassObject_Release( result ); + SysFreeString( query ); + + query = SysAllocString( L"SELECT * FROM Win32_LogicalDisk WHERE DeviceID > 'b:' AND DeviceID < 'd:'" ); + hr = IWbemServices_ExecQuery( services, wql, query, 0, NULL, &result ); + ok( hr == S_OK, "got %#lx\n", hr ); + count = 0; + hr = IEnumWbemClassObject_Next( result, 10000, 1, &obj, &count ); + ok( hr == S_OK, "got %#lx\n", hr ); + ok( count == 1, "got %lu\n", count ); + IWbemClassObject_Release( obj ); + SysFreeString( query ); + + query = SysAllocString( L"SELECT * FROM Win32_LogicalDisk WHERE DeviceID = 'C:'" ); + hr = IWbemServices_ExecQuery( services, wql, query, 0, NULL, &result ); + ok( hr == S_OK, "got %#lx\n", hr ); + count = 0; + hr = IEnumWbemClassObject_Next( result, 10000, 1, &obj, &count ); + ok( hr == S_OK, "got %#lx\n", hr ); + ok( count == 1, "got %lu\n", count ); + IWbemClassObject_Release( obj ); + SysFreeString( query ); IEnumWbemClassObject_Release( result ); SysFreeString( query ); SysFreeString( wql );
1
0
0
0
Jinoh Kang : ntdll/tests: Add more tests for \Device\NamedPipe and \Device\NamedPipe\.
by Alexandre Julliard
26 Oct '22
26 Oct '22
Module: wine Branch: master Commit: dd5ce0295b998ad99262d1e1a6fb60dc3908a50d URL:
https://gitlab.winehq.org/wine/wine/-/commit/dd5ce0295b998ad99262d1e1a6fb60…
Author: Jinoh Kang <jinoh.kang.kr(a)gmail.com> Date: Sat Oct 15 21:28:46 2022 +0900 ntdll/tests: Add more tests for \Device\NamedPipe and \Device\NamedPipe\. --- dlls/ntdll/tests/pipe.c | 95 +++++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 93 insertions(+), 2 deletions(-) diff --git a/dlls/ntdll/tests/pipe.c b/dlls/ntdll/tests/pipe.c index 6ee3f569e79..6f26655b118 100644 --- a/dlls/ntdll/tests/pipe.c +++ b/dlls/ntdll/tests/pipe.c @@ -2608,6 +2608,93 @@ static void test_security_info(void) HeapFree(GetProcessHeap(), 0, local_sid); } +static void subtest_empty_name_pipe_operations(HANDLE handle) +{ + static const struct fsctl_test { + const char *name; + ULONG code; + NTSTATUS status; + NTSTATUS status_broken; + } fsctl_tests[] = { +#define FSCTL_TEST(code, ...) { #code, code, __VA_ARGS__ } + FSCTL_TEST(FSCTL_PIPE_ASSIGN_EVENT, STATUS_NOT_SUPPORTED), + FSCTL_TEST(FSCTL_PIPE_DISCONNECT, STATUS_PIPE_DISCONNECTED), + FSCTL_TEST(FSCTL_PIPE_LISTEN, STATUS_ILLEGAL_FUNCTION), + FSCTL_TEST(FSCTL_PIPE_QUERY_EVENT, STATUS_NOT_SUPPORTED), + FSCTL_TEST(FSCTL_PIPE_TRANSCEIVE, STATUS_PIPE_DISCONNECTED), + FSCTL_TEST(FSCTL_PIPE_IMPERSONATE, STATUS_ILLEGAL_FUNCTION), + FSCTL_TEST(FSCTL_PIPE_SET_CLIENT_PROCESS, STATUS_NOT_SUPPORTED), + FSCTL_TEST(FSCTL_PIPE_QUERY_CLIENT_PROCESS, STATUS_INVALID_PARAMETER, /* win10 1507 */ STATUS_PIPE_DISCONNECTED), +#undef FSCTL_TEST + }; + FILE_PIPE_PEEK_BUFFER peek_buf; + OBJECT_ATTRIBUTES attr; + IO_STATUS_BLOCK io; + char buffer[1024]; + NTSTATUS status; + ULONG peer_pid; + HANDLE event; + size_t i; + + event = NULL; + InitializeObjectAttributes(&attr, NULL, 0, 0, NULL); + status = NtCreateEvent(&event, GENERIC_ALL, &attr, NotificationEvent, FALSE); + ok(status == STATUS_SUCCESS, "NtCreateEvent returned %#lx\n", status); + + status = NtReadFile(handle, event, NULL, NULL, &io, buffer, sizeof(buffer), NULL, NULL); + todo_wine + ok(status == STATUS_INVALID_PARAMETER, "NtReadFile on \\Device\\NamedPipe: got %#lx\n", status); + + status = NtWriteFile(handle, event, NULL, NULL, &io, buffer, sizeof(buffer), NULL, NULL); + todo_wine + ok(status == STATUS_INVALID_PARAMETER, "NtWriteFile on \\Device\\NamedPipe: got %#lx\n", status); + + status = NtFsControlFile(handle, event, NULL, NULL, &io, FSCTL_PIPE_PEEK, NULL, 0, &peek_buf, sizeof(peek_buf)); + if (status == STATUS_PENDING) + { + WaitForSingleObject(event, INFINITE); + status = io.Status; + } + todo_wine + ok(status == STATUS_INVALID_PARAMETER, "FSCTL_PIPE_PEEK on \\Device\\NamedPipe: got %lx\n", status); + + status = NtFsControlFile(handle, event, NULL, NULL, &io, FSCTL_PIPE_GET_CONNECTION_ATTRIBUTE, (void *)"ClientProcessId", sizeof("ClientProcessId"), &peer_pid, sizeof(peer_pid)); + if (status == STATUS_PENDING) + { + WaitForSingleObject(event, INFINITE); + status = io.Status; + } + todo_wine + ok(status == STATUS_INVALID_PARAMETER, "FSCTL_PIPE_GET_CONNECTION_ATTRIBUTE ClientProcessId on \\Device\\NamedPipe: got %lx\n", status); + + status = NtFsControlFile(handle, event, NULL, NULL, &io, FSCTL_PIPE_GET_CONNECTION_ATTRIBUTE, (void *)"ServerProcessId", sizeof("ServerProcessId"), &peer_pid, sizeof(peer_pid)); + if (status == STATUS_PENDING) + { + WaitForSingleObject(event, INFINITE); + status = io.Status; + } + todo_wine + ok(status == STATUS_INVALID_PARAMETER, "FSCTL_PIPE_GET_CONNECTION_ATTRIBUTE ServerProcessId on \\Device\\NamedPipe: got %lx\n", status); + + for (i = 0; i < ARRAY_SIZE(fsctl_tests); i++) + { + const struct fsctl_test *ft = &fsctl_tests[i]; + + status = NtFsControlFile(handle, event, NULL, NULL, &io, ft->code, 0, 0, 0, 0); + if (status == STATUS_PENDING) + { + WaitForSingleObject(event, INFINITE); + status = io.Status; + } + todo_wine_if(ft->status != STATUS_NOT_SUPPORTED) + ok(status == ft->status || (ft->status_broken && broken(status == ft->status_broken)), + "NtFsControlFile(%s) on \\Device\\NamedPipe: expected %#lx, got %#lx\n", + ft->name, ft->status, status); + } + + NtClose(event); +} + static void test_empty_name(void) { static const LARGE_INTEGER zero_timeout = {{ 0 }}; @@ -2637,7 +2724,7 @@ static void test_empty_name(void) attr.RootDirectory = 0; attr.ObjectName = &name; - status = NtCreateFile(&hdirectory, GENERIC_READ | SYNCHRONIZE, &attr, &io, NULL, 0, + status = NtCreateFile(&hdirectory, GENERIC_READ | GENERIC_WRITE | SYNCHRONIZE, &attr, &io, NULL, 0, FILE_SHARE_READ|FILE_SHARE_WRITE, FILE_OPEN, 0, NULL, 0 ); ok(!status, "Got unexpected status %#lx.\n", status); @@ -2645,6 +2732,8 @@ static void test_empty_name(void) status = wait_pipe(hdirectory, &name, &zero_timeout); todo_wine ok(status == STATUS_ILLEGAL_FUNCTION, "unexpected status for FSCTL_PIPE_WAIT on \\Device\\NamedPipe: %#lx\n", status); + subtest_empty_name_pipe_operations(hdirectory); + name.Buffer = NULL; name.Length = 0; name.MaximumLength = 0; @@ -2677,7 +2766,7 @@ static void test_empty_name(void) status = pNtCreateDirectoryObject(&hdirectory, GENERIC_READ | SYNCHRONIZE, &attr); todo_wine ok(status == STATUS_OBJECT_TYPE_MISMATCH, "Got unexpected status %#lx.\n", status); - status = NtCreateFile(&hdirectory, GENERIC_READ | SYNCHRONIZE, &attr, &io, NULL, 0, + status = NtCreateFile(&hdirectory, GENERIC_READ | GENERIC_WRITE | SYNCHRONIZE, &attr, &io, NULL, 0, FILE_SHARE_READ|FILE_SHARE_WRITE, FILE_OPEN, 0, NULL, 0 ); ok(!status, "Got unexpected status %#lx.\n", status); @@ -2685,6 +2774,8 @@ static void test_empty_name(void) status = wait_pipe(hdirectory, &name, &zero_timeout); ok(status == STATUS_OBJECT_NAME_NOT_FOUND, "unexpected status for FSCTL_PIPE_WAIT on \\Device\\NamedPipe\\: %#lx\n", status); + subtest_empty_name_pipe_operations(hdirectory); + name.Buffer = NULL; name.Length = 0; name.MaximumLength = 0;
1
0
0
0
Jinoh Kang : ntdll/tests: Add tests for pipe names.
by Alexandre Julliard
26 Oct '22
26 Oct '22
Module: wine Branch: master Commit: 71959b68879ee56ed4ef851b6177b6b192b49a7f URL:
https://gitlab.winehq.org/wine/wine/-/commit/71959b68879ee56ed4ef851b6177b6…
Author: Jinoh Kang <jinoh.kang.kr(a)gmail.com> Date: Sat Oct 15 20:01:31 2022 +0900 ntdll/tests: Add tests for pipe names. --- dlls/ntdll/tests/pipe.c | 89 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 89 insertions(+) diff --git a/dlls/ntdll/tests/pipe.c b/dlls/ntdll/tests/pipe.c index 569de22b013..6ee3f569e79 100644 --- a/dlls/ntdll/tests/pipe.c +++ b/dlls/ntdll/tests/pipe.c @@ -2795,6 +2795,94 @@ static void test_empty_name(void) CloseHandle(hdirectory); } +struct pipe_name_test { + const WCHAR *name; + NTSTATUS status; + BOOL todo; + const WCHAR *no_open_name; +}; + +static void subtest_pipe_name(const struct pipe_name_test *pnt) +{ + OBJECT_ATTRIBUTES attr; + LARGE_INTEGER timeout; + IO_STATUS_BLOCK iosb; + HANDLE pipe, client; + UNICODE_STRING name; + NTSTATUS status; + + pRtlInitUnicodeString(&name, pnt->name); + InitializeObjectAttributes(&attr, &name, OBJ_CASE_INSENSITIVE, NULL, NULL); + timeout.QuadPart = -100000000; + pipe = NULL; + status = pNtCreateNamedPipeFile(&pipe, + GENERIC_READ | FILE_WRITE_ATTRIBUTES | SYNCHRONIZE, + &attr, &iosb, FILE_SHARE_READ | FILE_SHARE_WRITE, + FILE_CREATE, FILE_SYNCHRONOUS_IO_NONALERT, + 0, 0, 0, 3, 4096, 4096, &timeout); + todo_wine_if(pnt->todo) + ok(status == pnt->status, "Expected status %#lx, got %#lx\n", pnt->status, status); + + if (!NT_SUCCESS(status)) + { + ok(pipe == NULL, "expected NULL handle, got %p\n", pipe); + return; + } + + ok(pipe != NULL, "expected non-NULL handle, got %p\n", client); + + client = NULL; + status = NtCreateFile(&client, SYNCHRONIZE, &attr, &iosb, NULL, 0, + FILE_SHARE_READ | FILE_SHARE_WRITE, FILE_OPEN, 0, NULL, 0); + ok(status == STATUS_SUCCESS, "Expected success, got %#lx\n", status); + ok(client != NULL, "expected non-NULL handle, got %p\n", client); + NtClose(client); + + if (pnt->no_open_name) + { + OBJECT_ATTRIBUTES no_open_attr; + UNICODE_STRING no_open_name; + + pRtlInitUnicodeString(&no_open_name, pnt->no_open_name); + InitializeObjectAttributes(&no_open_attr, &no_open_name, OBJ_CASE_INSENSITIVE, NULL, NULL); + client = NULL; + status = NtCreateFile(&client, SYNCHRONIZE, &no_open_attr, &iosb, NULL, 0, + FILE_SHARE_READ | FILE_SHARE_WRITE, FILE_OPEN, 0, NULL, 0); + ok(status == STATUS_OBJECT_NAME_NOT_FOUND, + "Expected STATUS_OBJECT_NAME_NOT_FOUND opening %s, got %#lx\n", + debugstr_wn(no_open_name.Buffer, no_open_name.Length / sizeof(WCHAR)), status); + ok(client == NULL, "expected NULL handle, got %p\n", client); + } + + NtClose(pipe); +} + +static void test_pipe_names(void) +{ + static const struct pipe_name_test tests[] = { + { L"\\Device\\NamedPipe" , STATUS_OBJECT_NAME_INVALID, TRUE }, + { L"\\Device\\NamedPipe\\" , STATUS_OBJECT_NAME_INVALID, TRUE }, + { L"\\Device\\NamedPipe\\\\" , STATUS_SUCCESS }, + { L"\\Device\\NamedPipe\\wine-test\\" , STATUS_SUCCESS, 0, L"\\Device\\NamedPipe\\wine-test" }, + { L"\\Device\\NamedPipe\\wine/test" , STATUS_SUCCESS, 0, L"\\Device\\NamedPipe\\wine\\test" }, + { L"\\Device\\NamedPipe\\wine:test" , STATUS_SUCCESS }, + { L"\\Device\\NamedPipe\\wine\\.\\test" , STATUS_SUCCESS, 0, L"\\Device\\NamedPipe\\wine\\test" }, + { L"\\Device\\NamedPipe\\wine\\..\\test" , STATUS_SUCCESS, 0, L"\\Device\\NamedPipe\\test" }, + { L"\\Device\\NamedPipe\\..\\wine-test" , STATUS_SUCCESS }, + { L"\\Device\\NamedPipe\\!\"#$%&'()*+,-./:;<=>?@[\\]^_`{|}~", STATUS_SUCCESS }, + }; + size_t i; + + for (i = 0; i < ARRAY_SIZE(tests); i++) + { + const struct pipe_name_test *pnt = &tests[i]; + + winetest_push_context("test %Iu: %s", i, debugstr_w(pnt->name)); + subtest_pipe_name(pnt); + winetest_pop_context(); + } +} + START_TEST(pipe) { if (!init_func_ptrs()) @@ -2854,6 +2942,7 @@ START_TEST(pipe) test_file_info(); test_security_info(); test_empty_name(); + test_pipe_names(); pipe_for_each_state(create_pipe_server, connect_pipe, test_pipe_state); pipe_for_each_state(create_pipe_server, connect_and_write_pipe, test_pipe_with_data_state);
1
0
0
0
Jinoh Kang : kernel32/tests: Add test for pipe name with a trailing backslash.
by Alexandre Julliard
26 Oct '22
26 Oct '22
Module: wine Branch: master Commit: ea9c9fe5bdbf4cacbda093759780ccac1ef386b4 URL:
https://gitlab.winehq.org/wine/wine/-/commit/ea9c9fe5bdbf4cacbda093759780cc…
Author: Jinoh Kang <jinoh.kang.kr(a)gmail.com> Date: Sat Oct 15 20:02:57 2022 +0900 kernel32/tests: Add test for pipe name with a trailing backslash. --- dlls/kernel32/tests/pipe.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/dlls/kernel32/tests/pipe.c b/dlls/kernel32/tests/pipe.c index 9481835b49b..797e7e0031b 100644 --- a/dlls/kernel32/tests/pipe.c +++ b/dlls/kernel32/tests/pipe.c @@ -682,6 +682,17 @@ static void test_CreateNamedPipe(int pipemode) CloseHandle(hFile); CloseHandle(hnp); + hnp = CreateNamedPipeA("\\\\.\\pipe\\trailingslash\\", PIPE_ACCESS_DUPLEX, + PIPE_TYPE_BYTE, 1, 1024, 1024, NMPWAIT_USE_DEFAULT_WAIT, NULL); + ok(hnp != INVALID_HANDLE_VALUE, "failed to create pipe, error %lu\n", GetLastError()); + hFile = CreateFileA("\\\\.\\pipe\\trailingslash", 0, 0, NULL, OPEN_EXISTING, 0, 0); + ok(hFile == INVALID_HANDLE_VALUE, "expected opening pipe to fail\n"); + ok(GetLastError() == ERROR_FILE_NOT_FOUND, "expected ERROR_FILE_NOT_FOUND, got %lu\n", GetLastError()); + hFile = CreateFileA("\\\\.\\pipe\\trailingslash\\", 0, 0, NULL, OPEN_EXISTING, 0, 0); + ok(hFile != INVALID_HANDLE_VALUE, "failed to open pipe, error %lu\n", GetLastError()); + CloseHandle(hFile); + CloseHandle(hnp); + if (winetest_debug > 1) trace("test_CreateNamedPipe returning\n"); }
1
0
0
0
Piotr Caban : comctl32: Add support for adding extra data in CreatePropertySheetPage.
by Alexandre Julliard
26 Oct '22
26 Oct '22
Module: wine Branch: master Commit: ebe35f6f0a629b49524aa03eebbbdac7e948f387 URL:
https://gitlab.winehq.org/wine/wine/-/commit/ebe35f6f0a629b49524aa03eebbbda…
Author: Piotr Caban <piotr(a)codeweavers.com> Date: Mon Sep 26 17:23:21 2022 +0200 comctl32: Add support for adding extra data in CreatePropertySheetPage. --- dlls/comctl32/propsheet.c | 9 +++++---- dlls/comctl32/tests/propsheet.c | 4 ++-- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/dlls/comctl32/propsheet.c b/dlls/comctl32/propsheet.c index 10361d280e1..43192771300 100644 --- a/dlls/comctl32/propsheet.c +++ b/dlls/comctl32/propsheet.c @@ -103,6 +103,7 @@ struct _PSP { PROPSHEETPAGEA pspA; PROPSHEETPAGEW pspW; + BYTE data[1]; }; }; @@ -3076,10 +3077,10 @@ HPROPSHEETPAGE WINAPI CreatePropertySheetPageA( if (lpPropSheetPage->dwSize < PROPSHEETPAGEA_V1_SIZE) return NULL; - ret = Alloc(sizeof(*ret)); + ret = Alloc(FIELD_OFFSET(struct _PSP, data[lpPropSheetPage->dwSize])); ret->magic = HPROPSHEETPAGE_MAGIC; ppsp = &ret->pspA; - memcpy(ppsp, lpPropSheetPage, min(lpPropSheetPage->dwSize, sizeof(PROPSHEETPAGEA))); + memcpy(ppsp, lpPropSheetPage, lpPropSheetPage->dwSize); if ( !(ppsp->dwFlags & PSP_DLGINDIRECT) ) { @@ -3131,11 +3132,11 @@ HPROPSHEETPAGE WINAPI CreatePropertySheetPageW(LPCPROPSHEETPAGEW lpPropSheetPage if (lpPropSheetPage->dwSize < PROPSHEETPAGEW_V1_SIZE) return NULL; - ret = Alloc(sizeof(*ret)); + ret = Alloc(FIELD_OFFSET(struct _PSP, data[lpPropSheetPage->dwSize])); ret->magic = HPROPSHEETPAGE_MAGIC; ret->unicode = TRUE; ppsp = &ret->pspW; - memcpy(ppsp, lpPropSheetPage, min(lpPropSheetPage->dwSize, sizeof(PROPSHEETPAGEW))); + memcpy(ppsp, lpPropSheetPage, lpPropSheetPage->dwSize); if ( !(ppsp->dwFlags & PSP_DLGINDIRECT) ) { diff --git a/dlls/comctl32/tests/propsheet.c b/dlls/comctl32/tests/propsheet.c index 70f46c83d85..7c0d5f81642 100644 --- a/dlls/comctl32/tests/propsheet.c +++ b/dlls/comctl32/tests/propsheet.c @@ -1058,7 +1058,7 @@ static UINT CALLBACK proppage_callback_a(HWND hwnd, UINT msg, PROPSHEETPAGEA *ps if (psp->dwSize >= FIELD_OFFSET(struct custom_proppage, addref_called)) { struct custom_proppage *extra_data = (struct custom_proppage *)psp; - todo_wine ok(extra_data->extra_data == 0x1234, "Expected extra_data to be preserved, got %lx\n", + ok(extra_data->extra_data == 0x1234, "Expected extra_data to be preserved, got %lx\n", extra_data->extra_data); } @@ -1092,7 +1092,7 @@ static UINT CALLBACK proppage_callback_w(HWND hwnd, UINT msg, PROPSHEETPAGEW *ps if (psp->dwSize >= FIELD_OFFSET(struct custom_proppage, addref_called)) { struct custom_proppage *extra_data = (struct custom_proppage *)psp; - todo_wine ok(extra_data->extra_data == 0x4321, "Expected extra_data to be preserved, got %lx\n", + ok(extra_data->extra_data == 0x4321, "Expected extra_data to be preserved, got %lx\n", extra_data->extra_data); }
1
0
0
0
Piotr Caban : comctl32: Fix PROPSHEETPAGE[AW] structure content in messages and callbacks.
by Alexandre Julliard
26 Oct '22
26 Oct '22
Module: wine Branch: master Commit: cae20edb0ba0cfb65db10021277061405d8a58ee URL:
https://gitlab.winehq.org/wine/wine/-/commit/cae20edb0ba0cfb65db10021277061…
Author: Piotr Caban <piotr(a)codeweavers.com> Date: Mon Sep 26 17:06:07 2022 +0200 comctl32: Fix PROPSHEETPAGE[AW] structure content in messages and callbacks. --- dlls/comctl32/propsheet.c | 370 +++++++++++++++++++++++----------------- dlls/comctl32/tests/propsheet.c | 4 +- 2 files changed, 220 insertions(+), 154 deletions(-)
1
0
0
0
Piotr Caban : comctl32: Don't use PROPSHEETPAGE structure to store internal HPROPSHEETPAGE data.
by Alexandre Julliard
26 Oct '22
26 Oct '22
Module: wine Branch: master Commit: eb5a4f216079a4ea056611c8e658478a74ef4fd4 URL:
https://gitlab.winehq.org/wine/wine/-/commit/eb5a4f216079a4ea056611c8e65847…
Author: Piotr Caban <piotr(a)codeweavers.com> Date: Mon Sep 26 13:11:56 2022 +0200 comctl32: Don't use PROPSHEETPAGE structure to store internal HPROPSHEETPAGE data. --- dlls/comctl32/propsheet.c | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/dlls/comctl32/propsheet.c b/dlls/comctl32/propsheet.c index 95b464934dc..3d9ed5b961a 100644 --- a/dlls/comctl32/propsheet.c +++ b/dlls/comctl32/propsheet.c @@ -97,7 +97,8 @@ typedef struct struct _PSP { - ULONG_PTR magic; + DWORD magic; + BOOL unicode; PROPSHEETPAGEW psp; PROPSHEETPAGEW callback_psp; }; @@ -149,8 +150,6 @@ typedef struct static const WCHAR PropSheetInfoStr[] = L"PropertySheetInfo"; -#define PSP_INTERNAL_UNICODE 0x80000000 - #define MAX_CAPTION_LENGTH 255 #define MAX_TABTEXT_LENGTH 255 #define MAX_BUTTONTEXT_LENGTH 64 @@ -361,7 +360,7 @@ static const DLGTEMPLATE* HPSP_load_template(HPROPSHEETPAGE hpsp, DWORD *size) return hpsp->psp.u.pResource; } - if (hpsp->psp.dwFlags & PSP_INTERNAL_UNICODE) + if (hpsp->unicode) { res = FindResourceW(hpsp->psp.hInstance, hpsp->psp.u.pszTemplate, (LPWSTR)RT_DIALOG); @@ -428,7 +427,7 @@ static HWND HPSP_create_page(HPROPSHEETPAGE hpsp, DLGTEMPLATE *template, HWND pa { HWND hwnd; - if(hpsp->psp.dwFlags & PSP_INTERNAL_UNICODE) + if (hpsp->unicode) { hwnd = CreateDialogIndirectParamW(hpsp->psp.hInstance, template, parent, hpsp->psp.pfnDlgProc, (LPARAM)&hpsp->psp); @@ -3017,8 +3016,6 @@ HPROPSHEETPAGE WINAPI CreatePropertySheetPageA( min(lpPropSheetPage->dwSize, sizeof(PROPSHEETPAGEA))); } - ppsp->dwFlags &= ~PSP_INTERNAL_UNICODE; - if ( !(ppsp->dwFlags & PSP_DLGINDIRECT) ) { if (!IS_INTRESOURCE( ppsp->u.pszTemplate )) @@ -3088,6 +3085,7 @@ HPROPSHEETPAGE WINAPI CreatePropertySheetPageW(LPCPROPSHEETPAGEW lpPropSheetPage ret = Alloc(sizeof(*ret)); ret->magic = HPROPSHEETPAGE_MAGIC; + ret->unicode = TRUE; ppsp = &ret->psp; memcpy(ppsp, lpPropSheetPage, min(lpPropSheetPage->dwSize, sizeof(PROPSHEETPAGEW))); /* original data is used for callback notifications */ @@ -3097,8 +3095,6 @@ HPROPSHEETPAGE WINAPI CreatePropertySheetPageW(LPCPROPSHEETPAGEW lpPropSheetPage min(lpPropSheetPage->dwSize, sizeof(PROPSHEETPAGEW))); } - ppsp->dwFlags |= PSP_INTERNAL_UNICODE; - if ( !(ppsp->dwFlags & PSP_DLGINDIRECT) ) { if (!IS_INTRESOURCE( ppsp->u.pszTemplate ))
1
0
0
0
Piotr Caban : comctl32: Create page if PROPSHEETPAGE was passed as HPROPSHEETPAGE to PropertySheetAW or PSM_INSERTPAGE.
by Alexandre Julliard
26 Oct '22
26 Oct '22
Module: wine Branch: master Commit: fc767fd589c8544b59ad0508089636bde23b2059 URL:
https://gitlab.winehq.org/wine/wine/-/commit/fc767fd589c8544b59ad0508089636…
Author: Piotr Caban <piotr(a)codeweavers.com> Date: Mon Sep 26 13:07:12 2022 +0200 comctl32: Create page if PROPSHEETPAGE was passed as HPROPSHEETPAGE to PropertySheetAW or PSM_INSERTPAGE. --- dlls/comctl32/propsheet.c | 39 +++++++++++++++++++++++++++++++++++++-- dlls/comctl32/tests/propsheet.c | 4 ++-- 2 files changed, 39 insertions(+), 4 deletions(-) diff --git a/dlls/comctl32/propsheet.c b/dlls/comctl32/propsheet.c index e043e34a6cd..95b464934dc 100644 --- a/dlls/comctl32/propsheet.c +++ b/dlls/comctl32/propsheet.c @@ -66,6 +66,8 @@ #include "wine/debug.h" +#define HPROPSHEETPAGE_MAGIC 0x5A9234E3 + /****************************************************************************** * Data structures */ @@ -95,6 +97,7 @@ typedef struct struct _PSP { + ULONG_PTR magic; PROPSHEETPAGEW psp; PROPSHEETPAGEW callback_psp; }; @@ -2302,6 +2305,14 @@ static BOOL PROPSHEET_InsertPage(HWND hwndDlg, HPROPSHEETPAGE hpageInsertAfter, if (!ppi) return FALSE; + if (hpage && hpage->magic != HPROPSHEETPAGE_MAGIC) + { + if (psInfo->unicode) + hpage = CreatePropertySheetPageW((const PROPSHEETPAGEW *)hpage); + else + hpage = CreatePropertySheetPageA((const PROPSHEETPAGEA *)hpage); + } + /* * Fill in a new PropPageInfo entry. */ @@ -2855,7 +2866,18 @@ INT_PTR WINAPI PropertySheetA(LPCPROPSHEETHEADERA lppsh) for (n = i = 0; i < lppsh->nPages; i++, n++) { if (!psInfo->usePropPage) - psInfo->proppage[n].hpage = psInfo->ppshheader.u3.phpage[i]; + { + if (psInfo->ppshheader.u3.phpage[i] && + psInfo->ppshheader.u3.phpage[i]->magic == HPROPSHEETPAGE_MAGIC) + { + psInfo->proppage[n].hpage = psInfo->ppshheader.u3.phpage[i]; + } + else + { + psInfo->proppage[n].hpage = CreatePropertySheetPageA( + (const PROPSHEETPAGEA *)psInfo->ppshheader.u3.phpage[i]); + } + } else { psInfo->proppage[n].hpage = CreatePropertySheetPageA((LPCPROPSHEETPAGEA)pByte); @@ -2895,7 +2917,18 @@ INT_PTR WINAPI PropertySheetW(LPCPROPSHEETHEADERW lppsh) for (n = i = 0; i < lppsh->nPages; i++, n++) { if (!psInfo->usePropPage) - psInfo->proppage[n].hpage = psInfo->ppshheader.u3.phpage[i]; + { + if (psInfo->ppshheader.u3.phpage[i] && + psInfo->ppshheader.u3.phpage[i]->magic == HPROPSHEETPAGE_MAGIC) + { + psInfo->proppage[n].hpage = psInfo->ppshheader.u3.phpage[i]; + } + else + { + psInfo->proppage[n].hpage = CreatePropertySheetPageW( + (const PROPSHEETPAGEW *)psInfo->ppshheader.u3.phpage[i]); + } + } else { psInfo->proppage[n].hpage = CreatePropertySheetPageW((LPCPROPSHEETPAGEW)pByte); @@ -2974,6 +3007,7 @@ HPROPSHEETPAGE WINAPI CreatePropertySheetPageA( return NULL; ret = Alloc(sizeof(*ret)); + ret->magic = HPROPSHEETPAGE_MAGIC; ppsp = &ret->psp; memcpy(ppsp, lpPropSheetPage, min(lpPropSheetPage->dwSize, sizeof(PROPSHEETPAGEA))); /* original data is used for callback notifications */ @@ -3053,6 +3087,7 @@ HPROPSHEETPAGE WINAPI CreatePropertySheetPageW(LPCPROPSHEETPAGEW lpPropSheetPage return NULL; ret = Alloc(sizeof(*ret)); + ret->magic = HPROPSHEETPAGE_MAGIC; ppsp = &ret->psp; memcpy(ppsp, lpPropSheetPage, min(lpPropSheetPage->dwSize, sizeof(PROPSHEETPAGEW))); /* original data is used for callback notifications */ diff --git a/dlls/comctl32/tests/propsheet.c b/dlls/comctl32/tests/propsheet.c index 7e0e7087f67..cf435703d1e 100644 --- a/dlls/comctl32/tests/propsheet.c +++ b/dlls/comctl32/tests/propsheet.c @@ -1343,7 +1343,7 @@ static void test_invalid_hpropsheetpage(void) ret = SendMessageA(hdlg, PSM_INDEXTOPAGE, 0, 0); ok(ret, "page was not created\n"); - todo_wine ok((HPROPSHEETPAGE)ret != hpsp[0], "invalid HPROPSHEETPAGE was preserved\n"); + ok((HPROPSHEETPAGE)ret != hpsp[0], "invalid HPROPSHEETPAGE was preserved\n"); DestroyWindow(hdlg); memset(pspW, 0, sizeof(*pspW)); @@ -1383,7 +1383,7 @@ static void test_invalid_hpropsheetpage(void) ok(hdlg != INVALID_HANDLE_VALUE, "got invalid handle value %p\n", hdlg); ret = SendMessageA(hdlg, PSM_INDEXTOPAGE, 0, 0); - todo_wine ok(ret, "page was not created\n"); + ok(ret, "page was not created\n"); ok((HPROPSHEETPAGE)ret != hpsp[0], "invalid HPROPSHEETPAGE was preserved\n"); DestroyWindow(hdlg); }
1
0
0
0
← Newer
1
...
6
7
8
9
10
11
12
...
54
Older →
Jump to page:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
Results per page:
10
25
50
100
200