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 2023
----- 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
702 discussions
Start a n
N
ew thread
Connor McAdams : uiautomationcore: Implement IRawElementProviderFragment::GetEmbeddedFragmentRoots for MSAA providers.
by Alexandre Julliard
30 Oct '23
30 Oct '23
Module: wine Branch: master Commit: a35c77fd33a5ccd938613c09422e0623d084b36c URL:
https://gitlab.winehq.org/wine/wine/-/commit/a35c77fd33a5ccd938613c09422e06…
Author: Connor McAdams <cmcadams(a)codeweavers.com> Date: Mon Oct 30 08:40:52 2023 -0400 uiautomationcore: Implement IRawElementProviderFragment::GetEmbeddedFragmentRoots for MSAA providers. Signed-off-by: Connor McAdams <cmcadams(a)codeweavers.com> --- dlls/uiautomationcore/tests/uiautomation.c | 19 +++++++++++++++++++ dlls/uiautomationcore/uia_provider.c | 4 ++-- 2 files changed, 21 insertions(+), 2 deletions(-) diff --git a/dlls/uiautomationcore/tests/uiautomation.c b/dlls/uiautomationcore/tests/uiautomation.c index 9210583062f..6cb6e56d99b 100644 --- a/dlls/uiautomationcore/tests/uiautomation.c +++ b/dlls/uiautomationcore/tests/uiautomation.c @@ -3836,6 +3836,7 @@ static void test_uia_prov_from_acc_fragment_root(HWND hwnd) IRawElementProviderFragmentRoot *elroot, *elroot2; IRawElementProviderFragment *elfrag, *elfrag2; IRawElementProviderSimple *elprov; + SAFEARRAY *ret_arr; ULONG old_ref; HRESULT hr; @@ -3852,6 +3853,12 @@ static void test_uia_prov_from_acc_fragment_root(HWND hwnd) ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); ok(!!elfrag, "elfrag == NULL\n"); + /* GetEmbeddedFragmentRoots test. */ + ret_arr = (void *)0xdeadbeef; + hr = IRawElementProviderFragment_GetEmbeddedFragmentRoots(elfrag, &ret_arr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); + ok(!ret_arr, "ret_arr != NULL\n"); + /* * get_FragmentRoot does the equivalent of calling * AccessibleObjectFromWindow with OBJID_CLIENT on the HWND associated @@ -4161,6 +4168,12 @@ static void test_uia_prov_from_acc_fragment_root(HWND hwnd) ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); ok(!!elfrag, "elfrag == NULL\n"); + /* GetEmbeddedFragmentRoots test. */ + ret_arr = (void *)0xdeadbeef; + hr = IRawElementProviderFragment_GetEmbeddedFragmentRoots(elfrag, &ret_arr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); + ok(!ret_arr, "ret_arr != NULL\n"); + /* * Simple child element queries HWND as well, does not just return its * parent. @@ -4212,6 +4225,12 @@ static void test_uia_prov_from_acc_fragment_root(HWND hwnd) ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); ok(!!elfrag, "elfrag == NULL\n"); + /* GetEmbeddedFragmentRoots test. */ + ret_arr = (void *)0xdeadbeef; + hr = IRawElementProviderFragment_GetEmbeddedFragmentRoots(elfrag, &ret_arr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); + ok(!ret_arr, "ret_arr != NULL\n"); + /* * Again, same behavior as simple children. It doesn't just retrieve the * parent IAccessible, it queries the HWND. diff --git a/dlls/uiautomationcore/uia_provider.c b/dlls/uiautomationcore/uia_provider.c index 4ecef2a4752..33bed429ec6 100644 --- a/dlls/uiautomationcore/uia_provider.c +++ b/dlls/uiautomationcore/uia_provider.c @@ -1005,9 +1005,9 @@ static HRESULT WINAPI msaa_fragment_get_BoundingRectangle(IRawElementProviderFra static HRESULT WINAPI msaa_fragment_GetEmbeddedFragmentRoots(IRawElementProviderFragment *iface, SAFEARRAY **ret_val) { - FIXME("%p, %p: stub!\n", iface, ret_val); + TRACE("%p, %p\n", iface, ret_val); *ret_val = NULL; - return E_NOTIMPL; + return S_OK; } static HRESULT WINAPI msaa_fragment_SetFocus(IRawElementProviderFragment *iface)
1
0
0
0
Nikolay Sivov : include: Correct ID3D10EffectPool interface uuid.
by Alexandre Julliard
30 Oct '23
30 Oct '23
Module: wine Branch: master Commit: 8935dc73397f6604173979852db99fe552038bdc URL:
https://gitlab.winehq.org/wine/wine/-/commit/8935dc73397f6604173979852db99f…
Author: Nikolay Sivov <nsivov(a)codeweavers.com> Date: Mon Oct 30 12:02:09 2023 +0100 include: Correct ID3D10EffectPool interface uuid. Signed-off-by: Nikolay Sivov <nsivov(a)codeweavers.com> --- include/d3d10effect.idl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/d3d10effect.idl b/include/d3d10effect.idl index d7526927fc5..fe526aaf296 100644 --- a/include/d3d10effect.idl +++ b/include/d3d10effect.idl @@ -448,7 +448,7 @@ interface ID3D10Effect : IUnknown [ local, object, - uuid(95e7ab04-3250-412e-8213-fcd2f8677933), + uuid(9537ab04-3250-412e-8213-fcd2f8677933), ] interface ID3D10EffectPool : IUnknown {
1
0
0
0
Brendan Shanks : localspl: Ensure unixlib function tables and enum stay in sync.
by Alexandre Julliard
30 Oct '23
30 Oct '23
Module: wine Branch: master Commit: c742e3f67bdf05b768f54aa617b6cfc3380fe019 URL:
https://gitlab.winehq.org/wine/wine/-/commit/c742e3f67bdf05b768f54aa617b6cf…
Author: Brendan Shanks <bshanks(a)codeweavers.com> Date: Mon Oct 23 14:52:51 2023 -0500 localspl: Ensure unixlib function tables and enum stay in sync. --- dlls/localspl/cups.c | 4 ++++ dlls/localspl/localspl_private.h | 1 + 2 files changed, 5 insertions(+) diff --git a/dlls/localspl/cups.c b/dlls/localspl/cups.c index b5c26cc2626..620dbc54068 100644 --- a/dlls/localspl/cups.c +++ b/dlls/localspl/cups.c @@ -517,6 +517,8 @@ const unixlib_entry_t __wine_unix_call_funcs[] = end_doc, }; +C_ASSERT( ARRAYSIZE(__wine_unix_call_funcs) == unix_funcs_count ); + #ifdef _WIN64 typedef ULONG PTR32; @@ -569,4 +571,6 @@ const unixlib_entry_t __wine_unix_call_wow64_funcs[] = end_doc, }; +C_ASSERT( ARRAYSIZE(__wine_unix_call_wow64_funcs) == unix_funcs_count ); + #endif /* _WIN64 */ diff --git a/dlls/localspl/localspl_private.h b/dlls/localspl/localspl_private.h index daca09a510d..4717b0dcf6d 100644 --- a/dlls/localspl/localspl_private.h +++ b/dlls/localspl/localspl_private.h @@ -195,6 +195,7 @@ enum cups_funcs unix_start_doc, unix_write_doc, unix_end_doc, + unix_funcs_count }; #endif /* __WINE_LOCALSPL_PRIVATE__ */
1
0
0
0
Hans Leidekker : win32u: Get rid of a special case for non-scalable fonts in NtGdiGetCharABCWidthsW().
by Alexandre Julliard
30 Oct '23
30 Oct '23
Module: wine Branch: master Commit: 863d29ca725e1e149a298fb02d96801e56918620 URL:
https://gitlab.winehq.org/wine/wine/-/commit/863d29ca725e1e149a298fb02d9680…
Author: Hans Leidekker <hans(a)codeweavers.com> Date: Thu Oct 26 21:15:08 2023 +0200 win32u: Get rid of a special case for non-scalable fonts in NtGdiGetCharABCWidthsW(). --- dlls/gdi32/tests/font.c | 2 +- dlls/win32u/font.c | 12 ------------ 2 files changed, 1 insertion(+), 13 deletions(-) diff --git a/dlls/gdi32/tests/font.c b/dlls/gdi32/tests/font.c index 16bfb40392b..69000c8ca66 100644 --- a/dlls/gdi32/tests/font.c +++ b/dlls/gdi32/tests/font.c @@ -1186,7 +1186,7 @@ static void test_GetCharABCWidths(void) ok(!ret, "GetCharABCWidthsW should have failed\n"); ret = GetCharABCWidthsW(hdc, 'a', 'a', abc); - ok(!ret, "GetCharABCWidthsW should have failed\n"); + ok(ret || broken(!ret) /* < win10 */, "GetCharABCWidthsW should have succeeded\n"); ret = GetCharABCWidthsFloatW(NULL, 'a', 'a', abcf); ok(!ret, "GetCharABCWidthsFloatW should have failed\n"); diff --git a/dlls/win32u/font.c b/dlls/win32u/font.c index c21d87c1fbc..85acad68ffa 100644 --- a/dlls/win32u/font.c +++ b/dlls/win32u/font.c @@ -6243,7 +6243,6 @@ BOOL WINAPI NtGdiGetCharABCWidthsW( HDC hdc, UINT first, UINT last, WCHAR *chars PHYSDEV dev; unsigned int i, count = last; BOOL ret; - TEXTMETRICW tm; if (!dc) return FALSE; @@ -6260,17 +6259,6 @@ BOOL WINAPI NtGdiGetCharABCWidthsW( HDC hdc, UINT first, UINT last, WCHAR *chars } else { - if (flags & NTGDI_GETCHARABCWIDTHS_INT) - { - /* unlike float variant, this one is supposed to fail on non-scalable fonts */ - dev = GET_DC_PHYSDEV( dc, pGetTextMetrics ); - if (!dev->funcs->pGetTextMetrics( dev, &tm ) || !(tm.tmPitchAndFamily & TMPF_VECTOR)) - { - release_dc_ptr( dc ); - return FALSE; - } - } - if (!chars) count = last - first + 1; dev = GET_DC_PHYSDEV( dc, pGetCharABCWidths ); ret = dev->funcs->pGetCharABCWidths( dev, first, count, chars, buffer );
1
0
0
0
Hans Leidekker : gdi32/tests: Skip broken Noto Color Emoji font in character width test.
by Alexandre Julliard
30 Oct '23
30 Oct '23
Module: wine Branch: master Commit: 31fd070165215bed3473a6c32d13d1a290076b66 URL:
https://gitlab.winehq.org/wine/wine/-/commit/31fd070165215bed3473a6c32d13d1…
Author: Hans Leidekker <hans(a)codeweavers.com> Date: Thu Oct 26 21:00:01 2023 +0200 gdi32/tests: Skip broken Noto Color Emoji font in character width test. --- dlls/gdi32/tests/font.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/dlls/gdi32/tests/font.c b/dlls/gdi32/tests/font.c index 711c9ca4a32..16bfb40392b 100644 --- a/dlls/gdi32/tests/font.c +++ b/dlls/gdi32/tests/font.c @@ -7573,9 +7573,10 @@ static int CALLBACK get_char_width_proc(const LOGFONTA *lf, ret = GetCharABCWidthsFloatA(dc, c, c, &abcf); ok(ret, "%s: GetCharABCWidths() failed\n", lf->lfFaceName); - if (GetCharABCWidthsA(dc, c, c, &abc)) - ok((float)abc.abcB == abcf.abcfB, "%s: mismatched widths %d/%.8e\n", - lf->lfFaceName, abc.abcB, abcf.abcfB); + if (!strcmp(lf->lfFaceName, "Noto Color Emoji")) + skip("broken Noto Color Emoji font"); + else if (GetCharABCWidthsA(dc, c, c, &abc)) + ok((float)abc.abcB == abcf.abcfB, "%s: mismatched widths %d/%.8e\n", lf->lfFaceName, abc.abcB, abcf.abcfB); ReleaseDC(NULL, dc); DeleteObject(font);
1
0
0
0
Louis Lenders : uxtheme: Add stub for SetPreferredAppMode.
by Alexandre Julliard
30 Oct '23
30 Oct '23
Module: wine Branch: master Commit: 221e88e2ecbfdd8e471fea1b0672dcb77ec6cc63 URL:
https://gitlab.winehq.org/wine/wine/-/commit/221e88e2ecbfdd8e471fea1b0672dc…
Author: Louis Lenders <xerox.xerox2000x(a)gmail.com> Date: Thu Oct 26 00:03:40 2023 +0200 uxtheme: Add stub for SetPreferredAppMode. Wine-Bug:
https://bugs.winehq.org/show_bug.cgi?id=55742
--- dlls/uxtheme/system.c | 10 ++++++++++ dlls/uxtheme/uxtheme.spec | 1 + 2 files changed, 11 insertions(+) diff --git a/dlls/uxtheme/system.c b/dlls/uxtheme/system.c index f1a4d0d5566..6b202bb48a7 100644 --- a/dlls/uxtheme/system.c +++ b/dlls/uxtheme/system.c @@ -1290,3 +1290,13 @@ BOOL WINAPI ShouldAppsUseDarkMode(void) return !light_theme; } + +/********************************************************************** + * SetPreferredAppMode (UXTHEME.135) + * + */ +int WINAPI SetPreferredAppMode(int app_mode) +{ + FIXME("%d: stub\n", app_mode); + return 0; +} diff --git a/dlls/uxtheme/uxtheme.spec b/dlls/uxtheme/uxtheme.spec index d31621e11a7..6bcebffe0a5 100644 --- a/dlls/uxtheme/uxtheme.spec +++ b/dlls/uxtheme/uxtheme.spec @@ -43,6 +43,7 @@ 62 stub -noname ServerClearStockObjects 63 stub -noname MarkSelection 132 stdcall -noname ShouldAppsUseDarkMode() +135 stdcall -noname SetPreferredAppMode(long) 138 stdcall -noname ShouldSystemUseDarkMode() # Standard functions
1
0
0
0
Zhiyi Zhang : win32u: Return ERROR_ACCESS_DENIED for WH_JOURNALRECORD and WH_JOURNALPLAYBACK.
by Alexandre Julliard
30 Oct '23
30 Oct '23
Module: wine Branch: master Commit: e1259ff91a40d7d97fa730235e2b7737b229f708 URL:
https://gitlab.winehq.org/wine/wine/-/commit/e1259ff91a40d7d97fa730235e2b77…
Author: Zhiyi Zhang <zzhang(a)codeweavers.com> Date: Wed Oct 25 15:20:32 2023 -0500 win32u: Return ERROR_ACCESS_DENIED for WH_JOURNALRECORD and WH_JOURNALPLAYBACK. On > XP, settings WH_JOURNALRECORD or WH_JOURNALPLAYBACK hooks report ERROR_ACCESS_DENIED according to tests, even with administrator rights. PCSE_TERM depends on this to not crash. MSDN also says that journaling hooks APIs are unsupported starting in Windows 11. Reject journalling hooks unconditionally here because they have been broken for a long time. --- dlls/user32/tests/msg.c | 3 --- dlls/win32u/hook.c | 5 +++++ 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/dlls/user32/tests/msg.c b/dlls/user32/tests/msg.c index f95e1603e65..90abf9b83a1 100644 --- a/dlls/user32/tests/msg.c +++ b/dlls/user32/tests/msg.c @@ -12271,7 +12271,6 @@ static void test_set_hook(void) SetLastError(0xdeadbeef); hhook = SetWindowsHookExA(WH_JOURNALRECORD, cbt_hook_proc, 0, 0); ok(!hhook, "global hook requires hModule != 0\n"); - todo_wine ok(GetLastError() == ERROR_ACCESS_DENIED, "unexpected error %ld\n", GetLastError()); SetLastError(0xdeadbeef); @@ -12297,9 +12296,7 @@ static void test_set_hook(void) error = GetLastError(); if (i == WH_JOURNALRECORD || i == WH_JOURNALPLAYBACK) { - todo_wine ok(!hhook, "SetWinEventHook succeeded.\n"); - todo_wine ok(error == ERROR_ACCESS_DENIED, "Got unexpected error %ld.\n", GetLastError()); } else diff --git a/dlls/win32u/hook.c b/dlls/win32u/hook.c index 3cd6b1ee1a2..e9b3ae7d70d 100644 --- a/dlls/win32u/hook.c +++ b/dlls/win32u/hook.c @@ -97,6 +97,11 @@ HHOOK WINAPI NtUserSetWindowsHookEx( HINSTANCE inst, UNICODE_STRING *module, DWO } else /* system-global hook */ { + if (id == WH_JOURNALRECORD || id == WH_JOURNALPLAYBACK) + { + RtlSetLastWin32Error( ERROR_ACCESS_DENIED ); + return 0; + } if (id == WH_KEYBOARD_LL || id == WH_MOUSE_LL) inst = 0; else if (!inst) {
1
0
0
0
Zhiyi Zhang : win32u: Return ERROR_GLOBAL_ONLY_HOOK when a thread ID is specified for global hooks.
by Alexandre Julliard
30 Oct '23
30 Oct '23
Module: wine Branch: master Commit: 6dfeab55bd847e4668b0ce2058fa7049f6a233f0 URL:
https://gitlab.winehq.org/wine/wine/-/commit/6dfeab55bd847e4668b0ce2058fa70…
Author: Zhiyi Zhang <zzhang(a)codeweavers.com> Date: Wed Oct 25 14:48:14 2023 -0500 win32u: Return ERROR_GLOBAL_ONLY_HOOK when a thread ID is specified for global hooks. --- dlls/user32/tests/msg.c | 1 - dlls/win32u/hook.c | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/dlls/user32/tests/msg.c b/dlls/user32/tests/msg.c index 57b856faaaa..f95e1603e65 100644 --- a/dlls/user32/tests/msg.c +++ b/dlls/user32/tests/msg.c @@ -12318,7 +12318,6 @@ static void test_set_hook(void) || i == WH_KEYBOARD_LL || i == WH_MOUSE_LL) { ok(!hhook, "SetWinEventHook succeeded.\n"); - todo_wine ok(error == ERROR_GLOBAL_ONLY_HOOK, "Got unexpected error %ld.\n", GetLastError()); } else diff --git a/dlls/win32u/hook.c b/dlls/win32u/hook.c index 062f10c4702..3cd6b1ee1a2 100644 --- a/dlls/win32u/hook.c +++ b/dlls/win32u/hook.c @@ -91,7 +91,7 @@ HHOOK WINAPI NtUserSetWindowsHookEx( HINSTANCE inst, UNICODE_STRING *module, DWO id == WH_SYSMSGFILTER) { /* these can only be global */ - RtlSetLastWin32Error( ERROR_INVALID_PARAMETER ); + RtlSetLastWin32Error( ERROR_GLOBAL_ONLY_HOOK ); return 0; } }
1
0
0
0
Zhiyi Zhang : user32/tests: Add more parameter checks for SetWindowsHookExA().
by Alexandre Julliard
30 Oct '23
30 Oct '23
Module: wine Branch: master Commit: d2284bb6df581ae17c44b8d5d824f9ebfb8e0d67 URL:
https://gitlab.winehq.org/wine/wine/-/commit/d2284bb6df581ae17c44b8d5d824f9…
Author: Zhiyi Zhang <zzhang(a)codeweavers.com> Date: Wed Oct 25 10:45:48 2023 -0500 user32/tests: Add more parameter checks for SetWindowsHookExA(). --- dlls/user32/tests/Makefile.in | 9 +++-- dlls/user32/tests/msg.c | 82 ++++++++++++++++++++++++++++++++++++++++++ dlls/user32/tests/testdll.c | 32 +++++++++++++++++ dlls/user32/tests/testdll.spec | 1 + 4 files changed, 121 insertions(+), 3 deletions(-) diff --git a/dlls/user32/tests/Makefile.in b/dlls/user32/tests/Makefile.in index 33c7f13f12d..bff53de7713 100644 --- a/dlls/user32/tests/Makefile.in +++ b/dlls/user32/tests/Makefile.in @@ -1,7 +1,9 @@ TESTDLL = user32.dll IMPORTS = user32 gdi32 advapi32 hid imm32 setupapi -C_SRCS = \ +testdll_IMPORTS = user32 + +SOURCES = \ broadcast.c \ class.c \ clipboard.c \ @@ -18,13 +20,14 @@ C_SRCS = \ monitor.c \ msg.c \ resource.c \ + resource.rc \ scroll.c \ static.c \ sysparams.c \ + testdll.c \ + testdll.spec \ text.c \ uitools.c \ win.c \ winstation.c \ wsprintf.c - -RC_SRCS = resource.rc diff --git a/dlls/user32/tests/msg.c b/dlls/user32/tests/msg.c index e90999c091b..57b856faaaa 100644 --- a/dlls/user32/tests/msg.c +++ b/dlls/user32/tests/msg.c @@ -12223,11 +12223,41 @@ skip_mouse_ll_hook_test: ok(DestroyWindow(hwnd), "failed to destroy window\n"); } +static char *get_test_dll_path(void) +{ + static const char *dll_name = "testdll.dll"; + static char path[MAX_PATH]; + DWORD written; + HANDLE file; + HRSRC res; + void *ptr; + + GetTempPathA(ARRAY_SIZE(path), path); + strcat(path, dll_name); + + file = CreateFileA(path, GENERIC_READ|GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, 0, 0); + ok(file != INVALID_HANDLE_VALUE, "Failed to create file %s: %lu.\n", debugstr_a(path), GetLastError()); + + res = FindResourceA(NULL, dll_name, "TESTDLL"); + ok(!!res, "Failed to load resource: %lu\n", GetLastError()); + ptr = LockResource(LoadResource(GetModuleHandleA(NULL), res)); + WriteFile(file, ptr, SizeofResource(GetModuleHandleA(NULL), res), &written, NULL); + ok(written == SizeofResource(GetModuleHandleA(NULL), res), "Failed to write resource\n"); + CloseHandle(file); + + return path; +} + static void test_set_hook(void) { + LRESULT (CALLBACK *p_dummy_hook_proc)(int code, WPARAM wp, LPARAM lp); + HMODULE test_dll_module; + char *test_dll_path; + DWORD error; BOOL ret; HHOOK hhook; HWINEVENTHOOK hwinevent_hook; + int i; hhook = SetWindowsHookExA(WH_CBT, cbt_hook_proc, GetModuleHandleA(0), GetCurrentThreadId()); ok(hhook != 0, "local hook does not require hModule set to 0\n"); @@ -12253,6 +12283,58 @@ static void test_set_hook(void) ok(!UnhookWindowsHookEx((HHOOK)0xdeadbeef), "UnhookWindowsHookEx succeeded\n"); ok(GetLastError() == ERROR_INVALID_HOOK_HANDLE, "unexpected error %ld\n", GetLastError()); + test_dll_path = get_test_dll_path(); + test_dll_module = LoadLibraryA(test_dll_path); + p_dummy_hook_proc = (void *)GetProcAddress(test_dll_module, "dummy_hook_proc"); + for (i = WH_MIN; i <= WH_MAX; i++) + { + winetest_push_context("ID %d", i); + + /* Test that setting hooks should succeed for hook procs in a library. But for WH_JOURNALRECORD + * and WH_JOURNALPLAYBACK, ERROR_ACCESS_DENIED is returned, even with administrator rights */ + SetLastError(0xdeadbeef); + hhook = SetWindowsHookExA(i, p_dummy_hook_proc, test_dll_module, 0); + error = GetLastError(); + if (i == WH_JOURNALRECORD || i == WH_JOURNALPLAYBACK) + { + todo_wine + ok(!hhook, "SetWinEventHook succeeded.\n"); + todo_wine + ok(error == ERROR_ACCESS_DENIED, "Got unexpected error %ld.\n", GetLastError()); + } + else + { + ok(!!hhook, "SetWinEventHook failed.\n"); + ok(error == NO_ERROR, "Got unexpected error %ld.\n", GetLastError()); + } + if (hhook) + UnhookWindowsHookEx(hhook); + + /* Test settings global hooks with a thread ID */ + SetLastError(0xdeadbeef); + hhook = SetWindowsHookExA(i, p_dummy_hook_proc, test_dll_module, GetCurrentThreadId()); + error = GetLastError(); + if (i == WH_JOURNALRECORD || i == WH_JOURNALPLAYBACK || i == WH_SYSMSGFILTER + || i == WH_KEYBOARD_LL || i == WH_MOUSE_LL) + { + ok(!hhook, "SetWinEventHook succeeded.\n"); + todo_wine + ok(error == ERROR_GLOBAL_ONLY_HOOK, "Got unexpected error %ld.\n", GetLastError()); + } + else + { + ok(!!hhook, "SetWinEventHook failed.\n"); + ok(error == NO_ERROR, "Got unexpected error %ld.\n", GetLastError()); + } + if (hhook) + UnhookWindowsHookEx(hhook); + + winetest_pop_context(); + } + FreeLibrary(test_dll_module); + ret = DeleteFileA(test_dll_path); + ok(ret, "Failed to remove the test dll, error %ld.\n", GetLastError()); + if (!pSetWinEventHook || !pUnhookWinEvent) return; /* even process local incontext hooks require hmodule */ diff --git a/dlls/user32/tests/testdll.c b/dlls/user32/tests/testdll.c new file mode 100644 index 00000000000..52ca93fc340 --- /dev/null +++ b/dlls/user32/tests/testdll.c @@ -0,0 +1,32 @@ +/* + * Copyright 2023 Zhiyi Zhang for CodeWeavers + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ + +#if 0 +#pragma makedep testdll +#endif + +#include <stdarg.h> + +#include <windef.h> +#include <winbase.h> +#include <winuser.h> + +LRESULT CALLBACK dummy_hook_proc(int code, WPARAM wp, LPARAM lp) +{ + return CallNextHookEx(0, code, wp, lp); +} diff --git a/dlls/user32/tests/testdll.spec b/dlls/user32/tests/testdll.spec new file mode 100644 index 00000000000..80834cbc21a --- /dev/null +++ b/dlls/user32/tests/testdll.spec @@ -0,0 +1 @@ +@ stdcall dummy_hook_proc(long ptr ptr)
1
0
0
0
Alexandre Julliard : user32: Enable a few more hook tests.
by Alexandre Julliard
30 Oct '23
30 Oct '23
Module: wine Branch: master Commit: 6af8b704091473b28b838e6bbaaebb5f2b24c636 URL:
https://gitlab.winehq.org/wine/wine/-/commit/6af8b704091473b28b838e6bbaaebb…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Mon Oct 30 10:59:43 2023 +0100 user32: Enable a few more hook tests. --- dlls/user32/tests/msg.c | 35 ++++++++++++----------------------- 1 file changed, 12 insertions(+), 23 deletions(-) diff --git a/dlls/user32/tests/msg.c b/dlls/user32/tests/msg.c index 07df7d5cb86..e90999c091b 100644 --- a/dlls/user32/tests/msg.c +++ b/dlls/user32/tests/msg.c @@ -12233,27 +12233,25 @@ static void test_set_hook(void) ok(hhook != 0, "local hook does not require hModule set to 0\n"); UnhookWindowsHookEx(hhook); - if (0) - { - /* this test doesn't pass under Win9x: BUG! */ SetLastError(0xdeadbeef); hhook = SetWindowsHookExA(WH_CBT, cbt_hook_proc, 0, 0); ok(!hhook, "global hook requires hModule != 0\n"); ok(GetLastError() == ERROR_HOOK_NEEDS_HMOD, "unexpected error %ld\n", GetLastError()); - } + + SetLastError(0xdeadbeef); + hhook = SetWindowsHookExA(WH_JOURNALRECORD, cbt_hook_proc, 0, 0); + ok(!hhook, "global hook requires hModule != 0\n"); + todo_wine + ok(GetLastError() == ERROR_ACCESS_DENIED, "unexpected error %ld\n", GetLastError()); SetLastError(0xdeadbeef); hhook = SetWindowsHookExA(WH_CBT, 0, GetModuleHandleA(0), GetCurrentThreadId()); ok(!hhook, "SetWinEventHook with invalid proc should fail\n"); - ok(GetLastError() == ERROR_INVALID_FILTER_PROC || /* Win2k */ - GetLastError() == 0xdeadbeef, /* Win9x */ - "unexpected error %ld\n", GetLastError()); + ok(GetLastError() == ERROR_INVALID_FILTER_PROC, "unexpected error %ld\n", GetLastError()); SetLastError(0xdeadbeef); ok(!UnhookWindowsHookEx((HHOOK)0xdeadbeef), "UnhookWindowsHookEx succeeded\n"); - ok(GetLastError() == ERROR_INVALID_HOOK_HANDLE || /* Win2k */ - GetLastError() == 0xdeadbeef, /* Win9x */ - "unexpected error %ld\n", GetLastError()); + ok(GetLastError() == ERROR_INVALID_HOOK_HANDLE, "unexpected error %ld\n", GetLastError()); if (!pSetWinEventHook || !pUnhookWinEvent) return; @@ -12262,22 +12260,15 @@ static void test_set_hook(void) hwinevent_hook = pSetWinEventHook(EVENT_MIN, EVENT_MAX, 0, win_event_proc, GetCurrentProcessId(), 0, WINEVENT_INCONTEXT); ok(!hwinevent_hook, "WINEVENT_INCONTEXT requires hModule != 0\n"); - ok(GetLastError() == ERROR_HOOK_NEEDS_HMOD || /* Win2k */ - GetLastError() == 0xdeadbeef, /* Win9x */ - "unexpected error %ld\n", GetLastError()); + ok(GetLastError() == ERROR_HOOK_NEEDS_HMOD, "unexpected error %ld\n", GetLastError()); /* even thread local incontext hooks require hmodule */ SetLastError(0xdeadbeef); hwinevent_hook = pSetWinEventHook(EVENT_MIN, EVENT_MAX, 0, win_event_proc, GetCurrentProcessId(), GetCurrentThreadId(), WINEVENT_INCONTEXT); ok(!hwinevent_hook, "WINEVENT_INCONTEXT requires hModule != 0\n"); - ok(GetLastError() == ERROR_HOOK_NEEDS_HMOD || /* Win2k */ - GetLastError() == 0xdeadbeef, /* Win9x */ - "unexpected error %ld\n", GetLastError()); + ok(GetLastError() == ERROR_HOOK_NEEDS_HMOD, "unexpected error %ld\n", GetLastError()); - if (0) - { - /* these 3 tests don't pass under Win9x */ SetLastError(0xdeadbeef); hwinevent_hook = pSetWinEventHook(1, 0, 0, win_event_proc, GetCurrentProcessId(), 0, WINEVENT_OUTOFCONTEXT); @@ -12294,8 +12285,8 @@ static void test_set_hook(void) hwinevent_hook = pSetWinEventHook(EVENT_MIN, EVENT_MAX, 0, win_event_proc, 0, 0xdeadbeef, WINEVENT_OUTOFCONTEXT); ok(!hwinevent_hook, "SetWinEventHook with invalid tid should fail\n"); + todo_wine ok(GetLastError() == ERROR_INVALID_THREAD_ID, "unexpected error %ld\n", GetLastError()); - } SetLastError(0xdeadbeef); hwinevent_hook = pSetWinEventHook(0, 0, 0, win_event_proc, @@ -12319,9 +12310,7 @@ todo_wine { SetLastError(0xdeadbeef); ok(!pUnhookWinEvent((HWINEVENTHOOK)0xdeadbeef), "UnhookWinEvent succeeded\n"); - ok(GetLastError() == ERROR_INVALID_HANDLE || /* Win2k */ - GetLastError() == 0xdeadbeef, /* Win9x */ - "unexpected error %ld\n", GetLastError()); + ok(GetLastError() == ERROR_INVALID_HANDLE, "unexpected error %ld\n", GetLastError()); } static HWND hook_hwnd;
1
0
0
0
← Newer
1
...
6
7
8
9
10
11
12
...
71
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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
Results per page:
10
25
50
100
200