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
March 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
2 participants
1138 discussions
Start a n
N
ew thread
Daniel Lehman : kernel32/tests: Add test for FileTimeToSystemTime.
by Alexandre Julliard
16 Mar '22
16 Mar '22
Module: wine Branch: master Commit: a4a7ab8e3b5e88125cfb859d5cb7e81422de38c8 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=a4a7ab8e3b5e88125cfb859d…
Author: Daniel Lehman <dlehman(a)esri.com> Date: Tue Mar 15 10:12:01 2022 -0700 kernel32/tests: Add test for FileTimeToSystemTime. Signed-off-by: Daniel Lehman <dlehman(a)esri.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/kernel32/tests/time.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/dlls/kernel32/tests/time.c b/dlls/kernel32/tests/time.c index b1e14b1b8c4..fdef78a4466 100644 --- a/dlls/kernel32/tests/time.c +++ b/dlls/kernel32/tests/time.c @@ -395,6 +395,16 @@ static void test_FileTimeToSystemTime(void) "Got Year %4d Month %2d Day %2d Hour %2d Min %2d Sec %2d mSec %3d\n", st.wYear, st.wMonth, st.wDay, st.wHour, st.wMinute, st.wSecond, st.wMilliseconds); + + ft.dwHighDateTime = -1; + ft.dwLowDateTime = -1; + SetLastError(0xdeadbeef); + ret = FileTimeToSystemTime(&ft, &st); + todo_wine { + ok(!ret, "expected failure\n"); + ok(GetLastError() == ERROR_INVALID_PARAMETER, + "expected ERROR_INVALID_PARAMETER, got %ld\n", GetLastError()); + } } static void test_FileTimeToLocalFileTime(void)
1
0
0
0
Jacek Caban : win32u: Move KillSystemTimer implementation from user32.
by Alexandre Julliard
16 Mar '22
16 Mar '22
Module: wine Branch: master Commit: a23ad9819a9e5dd7ebd7f83fdc77b2964131f985 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=a23ad9819a9e5dd7ebd7f83f…
Author: Jacek Caban <jacek(a)codeweavers.com> Date: Wed Mar 16 15:36:42 2022 +0100 win32u: Move KillSystemTimer implementation from user32. Signed-off-by: Jacek Caban <jacek(a)codeweavers.com> Signed-off-by: Huw Davies <huw(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/user32/message.c | 12 +----------- dlls/win32u/message.c | 16 ++++++++++++++++ dlls/win32u/win32u_private.h | 1 + dlls/win32u/window.c | 2 ++ include/ntuser.h | 1 + 5 files changed, 21 insertions(+), 11 deletions(-) diff --git a/dlls/user32/message.c b/dlls/user32/message.c index 7fe9df68508..365f703c56e 100644 --- a/dlls/user32/message.c +++ b/dlls/user32/message.c @@ -4422,17 +4422,7 @@ UINT_PTR WINAPI SetTimer( HWND hwnd, UINT_PTR id, UINT timeout, TIMERPROC proc ) */ BOOL WINAPI KillSystemTimer( HWND hwnd, UINT_PTR id ) { - BOOL ret; - - SERVER_START_REQ( kill_win_timer ) - { - req->win = wine_server_user_handle( hwnd ); - req->msg = WM_SYSTIMER; - req->id = id; - ret = !wine_server_call_err( req ); - } - SERVER_END_REQ; - return ret; + return NtUserCallHwndParam( hwnd, id, NtUserKillSystemTimer ); } diff --git a/dlls/win32u/message.c b/dlls/win32u/message.c index d70984dbe2b..d00178e6aa4 100644 --- a/dlls/win32u/message.c +++ b/dlls/win32u/message.c @@ -210,6 +210,22 @@ BOOL WINAPI NtUserKillTimer( HWND hwnd, UINT_PTR id ) return ret; } +/* see KillSystemTimer */ +BOOL kill_system_timer( HWND hwnd, UINT_PTR id ) +{ + BOOL ret; + + SERVER_START_REQ( kill_win_timer ) + { + req->win = wine_server_user_handle( hwnd ); + req->msg = WM_SYSTIMER; + req->id = id; + ret = !wine_server_call_err( req ); + } + SERVER_END_REQ; + return ret; +} + /* see SendMessageW */ LRESULT send_message( HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam ) { diff --git a/dlls/win32u/win32u_private.h b/dlls/win32u/win32u_private.h index c943089c462..0c4e3b82f0f 100644 --- a/dlls/win32u/win32u_private.h +++ b/dlls/win32u/win32u_private.h @@ -313,6 +313,7 @@ extern BOOL set_capture_window( HWND hwnd, UINT gui_flags, HWND *prev_ret ) DECL extern BOOL set_foreground_window( HWND hwnd, BOOL mouse ) DECLSPEC_HIDDEN; /* message.c */ +extern BOOL kill_system_timer( HWND hwnd, UINT_PTR id ) DECLSPEC_HIDDEN; extern LRESULT post_message( HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam ) DECLSPEC_HIDDEN; extern LRESULT send_message( HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam ) DECLSPEC_HIDDEN; diff --git a/dlls/win32u/window.c b/dlls/win32u/window.c index 2700df862ca..079b4b0695f 100644 --- a/dlls/win32u/window.c +++ b/dlls/win32u/window.c @@ -3332,6 +3332,8 @@ ULONG_PTR WINAPI NtUserCallHwndParam( HWND hwnd, DWORD_PTR param, DWORD code ) return get_window_word( hwnd, param ); case NtUserIsChild: return is_child( hwnd, UlongToHandle(param) ); + case NtUserKillSystemTimer: + return kill_system_timer( hwnd, param ); case NtUserMonitorFromWindow: return HandleToUlong( monitor_from_window( hwnd, param, NtUserMonitorFromWindow )); case NtUserSetCaptureWindow: diff --git a/include/ntuser.h b/include/ntuser.h index 3352a63e1ea..5e79083aa01 100644 --- a/include/ntuser.h +++ b/include/ntuser.h @@ -178,6 +178,7 @@ enum NtUserGetWindowThread, NtUserGetWindowWord, NtUserIsChild, + NtUserKillSystemTimer, NtUserMonitorFromWindow, NtUserSetCaptureWindow, NtUserSetForegroundWindow,
1
0
0
0
Jacek Caban : win32u: Move NtUserKillTimer implementation from user32.
by Alexandre Julliard
16 Mar '22
16 Mar '22
Module: wine Branch: master Commit: e520e29ca4a0d03125e82a8654596a4b212d1ab4 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=e520e29ca4a0d03125e82a86…
Author: Jacek Caban <jacek(a)codeweavers.com> Date: Wed Mar 16 15:36:30 2022 +0100 win32u: Move NtUserKillTimer implementation from user32. Signed-off-by: Jacek Caban <jacek(a)codeweavers.com> Signed-off-by: Huw Davies <huw(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/user32/edit.c | 2 +- dlls/user32/message.c | 19 ------------------- dlls/user32/user32.spec | 2 +- dlls/win32u/message.c | 18 ++++++++++++++++++ dlls/win32u/syscall.c | 1 + dlls/win32u/win32u.spec | 2 +- dlls/wow64win/syscall.h | 1 + dlls/wow64win/user.c | 8 ++++++++ include/ntuser.h | 1 + 9 files changed, 32 insertions(+), 22 deletions(-) diff --git a/dlls/user32/edit.c b/dlls/user32/edit.c index 9bbfa2727b2..28d93b98b83 100644 --- a/dlls/user32/edit.c +++ b/dlls/user32/edit.c @@ -3633,7 +3633,7 @@ static LRESULT EDIT_WM_LButtonDown(EDITSTATE *es, DWORD keys, INT x, INT y) static LRESULT EDIT_WM_LButtonUp(EDITSTATE *es) { if (es->bCaptureState) { - KillTimer(es->hwndSelf, 0); + NtUserKillTimer(es->hwndSelf, 0); if (GetCapture() == es->hwndSelf) ReleaseCapture(); } es->bCaptureState = FALSE; diff --git a/dlls/user32/message.c b/dlls/user32/message.c index eee4759513a..7fe9df68508 100644 --- a/dlls/user32/message.c +++ b/dlls/user32/message.c @@ -4417,25 +4417,6 @@ UINT_PTR WINAPI SetTimer( HWND hwnd, UINT_PTR id, UINT timeout, TIMERPROC proc ) } -/*********************************************************************** - * KillTimer (USER32.@) - */ -BOOL WINAPI KillTimer( HWND hwnd, UINT_PTR id ) -{ - BOOL ret; - - SERVER_START_REQ( kill_win_timer ) - { - req->win = wine_server_user_handle( hwnd ); - req->msg = WM_TIMER; - req->id = id; - ret = !wine_server_call_err( req ); - } - SERVER_END_REQ; - return ret; -} - - /*********************************************************************** * KillSystemTimer (USER32.@) */ diff --git a/dlls/user32/user32.spec b/dlls/user32/user32.spec index c5ea5e6c4c0..7c27d9400db 100644 --- a/dlls/user32/user32.spec +++ b/dlls/user32/user32.spec @@ -484,7 +484,7 @@ @ stdcall IsWindowVisible(long) @ stdcall IsZoomed(long) @ stdcall KillSystemTimer(long long) -@ stdcall KillTimer(long long) +@ stdcall KillTimer(long long) NtUserKillTimer @ stdcall LoadAcceleratorsA(long str) @ stdcall LoadAcceleratorsW(long wstr) @ stdcall LoadBitmapA(long str) diff --git a/dlls/win32u/message.c b/dlls/win32u/message.c index 5fb238566f3..d70984dbe2b 100644 --- a/dlls/win32u/message.c +++ b/dlls/win32u/message.c @@ -192,6 +192,24 @@ UINT_PTR WINAPI NtUserSetSystemTimer( HWND hwnd, UINT_PTR id, UINT timeout, TIME return ret; } +/*********************************************************************** + * NtUserKillTimer (win32u.@) + */ +BOOL WINAPI NtUserKillTimer( HWND hwnd, UINT_PTR id ) +{ + BOOL ret; + + SERVER_START_REQ( kill_win_timer ) + { + req->win = wine_server_user_handle( hwnd ); + req->msg = WM_TIMER; + req->id = id; + ret = !wine_server_call_err( req ); + } + SERVER_END_REQ; + return ret; +} + /* see SendMessageW */ LRESULT send_message( HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam ) { diff --git a/dlls/win32u/syscall.c b/dlls/win32u/syscall.c index 5dbf6f43ac6..2be2cfce3bf 100644 --- a/dlls/win32u/syscall.c +++ b/dlls/win32u/syscall.c @@ -142,6 +142,7 @@ static void * const syscalls[] = NtUserGetWindowRgnEx, NtUserInitializeClientPfnArrays, NtUserInternalGetWindowText, + NtUserKillTimer, NtUserNotifyWinEvent, NtUserOpenDesktop, NtUserOpenInputDesktop, diff --git a/dlls/win32u/win32u.spec b/dlls/win32u/win32u.spec index 9c6103b84f8..96d8d4833b0 100644 --- a/dlls/win32u/win32u.spec +++ b/dlls/win32u/win32u.spec @@ -1059,7 +1059,7 @@ @ stub NtUserIsTouchWindow @ stub NtUserIsWindowBroadcastingDpiToChildren @ stub NtUserIsWindowGDIScaledDpiMessageEnabled -@ stub NtUserKillTimer +@ stdcall -syscall NtUserKillTimer(long long) @ stub NtUserLayoutCompleted @ stub NtUserLinkDpiCursor @ stub NtUserLoadKeyboardLayoutEx diff --git a/dlls/wow64win/syscall.h b/dlls/wow64win/syscall.h index 4b181ecba89..7b6bbb5eda6 100644 --- a/dlls/wow64win/syscall.h +++ b/dlls/wow64win/syscall.h @@ -127,6 +127,7 @@ SYSCALL_ENTRY( NtUserGetWindowRgnEx ) \ SYSCALL_ENTRY( NtUserInitializeClientPfnArrays ) \ SYSCALL_ENTRY( NtUserInternalGetWindowText ) \ + SYSCALL_ENTRY( NtUserKillTimer ) \ SYSCALL_ENTRY( NtUserNotifyWinEvent ) \ SYSCALL_ENTRY( NtUserOpenDesktop ) \ SYSCALL_ENTRY( NtUserOpenInputDesktop ) \ diff --git a/dlls/wow64win/user.c b/dlls/wow64win/user.c index 2af7f9a3115..1a43b4793fb 100644 --- a/dlls/wow64win/user.c +++ b/dlls/wow64win/user.c @@ -554,6 +554,14 @@ NTSTATUS WINAPI wow64_NtUserSetTimer( UINT *args ) return NtUserSetTimer( hwnd, id, timeout, proc, tolerance ); } +NTSTATUS WINAPI wow64_NtUserKillTimer( UINT *args ) +{ + HWND hwnd = get_handle( &args ); + UINT_PTR id = get_ulong( &args ); + + return NtUserKillTimer( hwnd, id ); +} + NTSTATUS WINAPI wow64_NtUserCopyAcceleratorTable( UINT *args ) { HACCEL src = get_handle( &args ); diff --git a/include/ntuser.h b/include/ntuser.h index afa4d0d561f..3352a63e1ea 100644 --- a/include/ntuser.h +++ b/include/ntuser.h @@ -365,6 +365,7 @@ NTSTATUS WINAPI NtUserInitializeClientPfnArrays( const struct user_client_procs const void *client_workers, HINSTANCE user_module ); INT WINAPI NtUserInternalGetWindowText( HWND hwnd, WCHAR *text, INT count ); BOOL WINAPI NtUserIsClipboardFormatAvailable( UINT format ); +BOOL WINAPI NtUserKillTimer( HWND hwnd, UINT_PTR id ); UINT WINAPI NtUserMapVirtualKeyEx( UINT code, UINT type, HKL layout ); BOOL WINAPI NtUserMessageCall( HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam, ULONG_PTR result_info, DWORD type, BOOL ansi );
1
0
0
0
Jacek Caban : win32u: Move NtUserSetSystemTimer implementation from user32.
by Alexandre Julliard
16 Mar '22
16 Mar '22
Module: wine Branch: master Commit: ce9a782a4f4c4db38badb40751c91302ab747858 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=ce9a782a4f4c4db38badb407…
Author: Jacek Caban <jacek(a)codeweavers.com> Date: Wed Mar 16 15:36:18 2022 +0100 win32u: Move NtUserSetSystemTimer implementation from user32. Signed-off-by: Jacek Caban <jacek(a)codeweavers.com> Signed-off-by: Huw Davies <huw(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/user32/caret.c | 4 ++-- dlls/user32/input.c | 3 ++- dlls/user32/listbox.c | 2 +- dlls/user32/message.c | 33 --------------------------------- dlls/user32/scroll.c | 16 ++++++++-------- dlls/user32/user32.spec | 2 +- dlls/user32/user_private.h | 4 ---- dlls/user32/winproc.c | 2 +- dlls/win32u/message.c | 32 ++++++++++++++++++++++++++++++++ dlls/win32u/ntuser_private.h | 3 +++ dlls/win32u/syscall.c | 1 + dlls/win32u/win32u.spec | 2 +- dlls/wow64win/syscall.h | 1 + dlls/wow64win/user.c | 10 ++++++++++ include/ntuser.h | 1 + 15 files changed, 64 insertions(+), 52 deletions(-) Diff:
https://source.winehq.org/git/wine.git/?a=commitdiff;h=ce9a782a4f4c4db38bad…
1
0
0
0
Jacek Caban : win32u: Move NtUserSetTimer implementation from user32.
by Alexandre Julliard
16 Mar '22
16 Mar '22
Module: wine Branch: master Commit: ac8e0ce2554b17aea03043b974ab3bad11ae549f URL:
https://source.winehq.org/git/wine.git/?a=commit;h=ac8e0ce2554b17aea03043b9…
Author: Jacek Caban <jacek(a)codeweavers.com> Date: Wed Mar 16 15:35:55 2022 +0100 win32u: Move NtUserSetTimer implementation from user32. Signed-off-by: Jacek Caban <jacek(a)codeweavers.com> Signed-off-by: Huw Davies <huw(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/user32/message.c | 35 +---------------------------------- dlls/user32/user32.spec | 2 +- dlls/win32u/message.c | 32 ++++++++++++++++++++++++++++++++ dlls/win32u/syscall.c | 1 + dlls/win32u/win32u.spec | 2 +- dlls/wow64win/syscall.h | 1 + dlls/wow64win/user.c | 11 +++++++++++ include/ntuser.h | 1 + 8 files changed, 49 insertions(+), 36 deletions(-) diff --git a/dlls/user32/message.c b/dlls/user32/message.c index c5bdc0efccc..da0abef9469 100644 --- a/dlls/user32/message.c +++ b/dlls/user32/message.c @@ -4408,45 +4408,12 @@ BOOL WINAPI MessageBeep( UINT i ) } -/*********************************************************************** - * SetCoalescableTimer (USER32.@) - */ -UINT_PTR WINAPI SetCoalescableTimer( HWND hwnd, UINT_PTR id, UINT timeout, TIMERPROC proc, ULONG tolerance ) -{ - UINT_PTR ret; - WNDPROC winproc = 0; - - if (proc) winproc = WINPROC_AllocProc( (WNDPROC)proc, FALSE ); - - timeout = min( max( USER_TIMER_MINIMUM, timeout ), USER_TIMER_MAXIMUM ); - - SERVER_START_REQ( set_win_timer ) - { - req->win = wine_server_user_handle( hwnd ); - req->msg = WM_TIMER; - req->id = id; - req->rate = timeout; - req->lparam = (ULONG_PTR)winproc; - if (!wine_server_call_err( req )) - { - ret = reply->id; - if (!ret) ret = TRUE; - } - else ret = 0; - } - SERVER_END_REQ; - - TRACE("Added %p %lx %p timeout %d\n", hwnd, id, winproc, timeout ); - return ret; -} - - /****************************************************************** * SetTimer (USER32.@) */ UINT_PTR WINAPI SetTimer( HWND hwnd, UINT_PTR id, UINT timeout, TIMERPROC proc ) { - return SetCoalescableTimer( hwnd, id, timeout, proc, TIMERV_DEFAULT_COALESCING ); + return NtUserSetTimer( hwnd, id, timeout, proc, TIMERV_DEFAULT_COALESCING ); } diff --git a/dlls/user32/user32.spec b/dlls/user32/user32.spec index a70ac8605d7..7f27a0731a2 100644 --- a/dlls/user32/user32.spec +++ b/dlls/user32/user32.spec @@ -655,7 +655,7 @@ @ stdcall SetClassWord(long long long) NtUserSetClassWord @ stdcall SetClipboardData(long long) @ stdcall SetClipboardViewer(long) -@ stdcall SetCoalescableTimer(long long long ptr long) +@ stdcall SetCoalescableTimer(long long long ptr long) NtUserSetTimer # @ stub SetConsoleReserveKeys @ stdcall -import SetCursor(long) NtUserSetCursor @ stub SetCursorContents diff --git a/dlls/win32u/message.c b/dlls/win32u/message.c index c28114668b8..e895f65c652 100644 --- a/dlls/win32u/message.c +++ b/dlls/win32u/message.c @@ -128,6 +128,38 @@ BOOL WINAPI NtUserGetGUIThreadInfo( DWORD id, GUITHREADINFO *info ) return ret; } +/*********************************************************************** + * NtUserSetTimer (win32u.@) + */ +UINT_PTR WINAPI NtUserSetTimer( HWND hwnd, UINT_PTR id, UINT timeout, TIMERPROC proc, ULONG tolerance ) +{ + UINT_PTR ret; + WNDPROC winproc = 0; + + if (proc) winproc = alloc_winproc( (WNDPROC)proc, TRUE ); + + timeout = min( max( USER_TIMER_MINIMUM, timeout ), USER_TIMER_MAXIMUM ); + + SERVER_START_REQ( set_win_timer ) + { + req->win = wine_server_user_handle( hwnd ); + req->msg = WM_TIMER; + req->id = id; + req->rate = timeout; + req->lparam = (ULONG_PTR)winproc; + if (!wine_server_call_err( req )) + { + ret = reply->id; + if (!ret) ret = TRUE; + } + else ret = 0; + } + SERVER_END_REQ; + + TRACE( "Added %p %lx %p timeout %d\n", hwnd, id, winproc, timeout ); + return ret; +} + /* see SendMessageW */ LRESULT send_message( HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam ) { diff --git a/dlls/win32u/syscall.c b/dlls/win32u/syscall.c index abe32b8d70c..b167ecc9680 100644 --- a/dlls/win32u/syscall.c +++ b/dlls/win32u/syscall.c @@ -154,6 +154,7 @@ static void * const syscalls[] = NtUserSetProcessWindowStation, NtUserSetProp, NtUserSetThreadDesktop, + NtUserSetTimer, NtUserSetWinEventHook, NtUserSetWindowsHookEx, NtUserUnhookWinEvent, diff --git a/dlls/win32u/win32u.spec b/dlls/win32u/win32u.spec index 2b5e4d71461..7d4599f0241 100644 --- a/dlls/win32u/win32u.spec +++ b/dlls/win32u/win32u.spec @@ -1236,7 +1236,7 @@ @ stub NtUserSetThreadInputBlocked @ stub NtUserSetThreadLayoutHandles @ stub NtUserSetThreadState -@ stub NtUserSetTimer +@ stdcall -syscall NtUserSetTimer(long long long ptr long) @ stdcall -syscall NtUserSetWinEventHook(long long long ptr ptr long long long) @ stub NtUserSetWindowArrangement @ stub NtUserSetWindowBand diff --git a/dlls/wow64win/syscall.h b/dlls/wow64win/syscall.h index b6cdf5edfb2..3ded58962b8 100644 --- a/dlls/wow64win/syscall.h +++ b/dlls/wow64win/syscall.h @@ -139,6 +139,7 @@ SYSCALL_ENTRY( NtUserSetProcessWindowStation ) \ SYSCALL_ENTRY( NtUserSetProp ) \ SYSCALL_ENTRY( NtUserSetThreadDesktop ) \ + SYSCALL_ENTRY( NtUserSetTimer ) \ SYSCALL_ENTRY( NtUserSetWinEventHook ) \ SYSCALL_ENTRY( NtUserSetWindowsHookEx ) \ SYSCALL_ENTRY( NtUserUnhookWinEvent ) \ diff --git a/dlls/wow64win/user.c b/dlls/wow64win/user.c index b8c4a86a352..c9f81d86672 100644 --- a/dlls/wow64win/user.c +++ b/dlls/wow64win/user.c @@ -533,6 +533,17 @@ NTSTATUS WINAPI wow64_NtUserGetGUIThreadInfo( UINT *args ) return TRUE; } +NTSTATUS WINAPI wow64_NtUserSetTimer( UINT *args ) +{ + HWND hwnd = get_handle( &args ); + UINT_PTR id = get_ulong( &args ); + UINT timeout = get_ulong( &args ); + TIMERPROC proc = get_ptr( &args ); + ULONG tolerance = get_ulong( &args ); + + return NtUserSetTimer( hwnd, id, timeout, proc, tolerance ); +} + NTSTATUS WINAPI wow64_NtUserCopyAcceleratorTable( UINT *args ) { HACCEL src = get_handle( &args ); diff --git a/include/ntuser.h b/include/ntuser.h index 4ca4c063ef8..a055aa47905 100644 --- a/include/ntuser.h +++ b/include/ntuser.h @@ -403,6 +403,7 @@ BOOL WINAPI NtUserSetProcessWindowStation( HWINSTA handle ); BOOL WINAPI NtUserSetProp( HWND hwnd, const WCHAR *str, HANDLE handle ); BOOL WINAPI NtUserSetSysColors( INT count, const INT *colors, const COLORREF *values ); BOOL WINAPI NtUserSetThreadDesktop( HDESK handle ); +UINT_PTR WINAPI NtUserSetTimer( HWND hwnd, UINT_PTR id, UINT timeout, TIMERPROC proc, ULONG tolerance ); LONG WINAPI NtUserSetWindowLong( HWND hwnd, INT offset, LONG newval, BOOL ansi ); LONG_PTR WINAPI NtUserSetWindowLongPtr( HWND hwnd, INT offset, LONG_PTR newval, BOOL ansi ); BOOL WINAPI NtUserSetWindowPos( HWND hwnd, HWND after, INT x, INT y, INT cx, INT cy, UINT flags );
1
0
0
0
Jacek Caban : win32u: Move __wine_set_pixel_format implementation from user32.
by Alexandre Julliard
16 Mar '22
16 Mar '22
Module: wine Branch: master Commit: ea764fbd3e21b53efd969ca1bc1745d2e3166d49 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=ea764fbd3e21b53efd969ca1…
Author: Jacek Caban <jacek(a)codeweavers.com> Date: Wed Mar 16 15:35:35 2022 +0100 win32u: Move __wine_set_pixel_format implementation from user32. Signed-off-by: Jacek Caban <jacek(a)codeweavers.com> Signed-off-by: Huw Davies <huw(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/user32/win.c | 39 +-------------------------------------- dlls/win32u/window.c | 18 ++++++++++++++++++ include/ntuser.h | 1 + 3 files changed, 20 insertions(+), 38 deletions(-) diff --git a/dlls/user32/win.c b/dlls/user32/win.c index 2c241aad7d2..a21bdc62ed5 100644 --- a/dlls/user32/win.c +++ b/dlls/user32/win.c @@ -258,32 +258,6 @@ static void send_parent_notify( HWND hwnd, UINT msg ) } -/******************************************************************* - * update_window_state - * - * Trigger an update of the window's driver state and surface. - */ -static void update_window_state( HWND hwnd ) -{ - DPI_AWARENESS_CONTEXT context; - RECT window_rect, client_rect, valid_rects[2]; - - if (!WIN_IsCurrentThread( hwnd )) - { - PostMessageW( hwnd, WM_WINE_UPDATEWINDOWSTATE, 0, 0 ); - return; - } - - context = SetThreadDpiAwarenessContext( GetWindowDpiAwarenessContext( hwnd )); - WIN_GetRectangles( hwnd, COORDS_PARENT, &window_rect, &client_rect ); - valid_rects[0] = valid_rects[1] = client_rect; - set_window_pos( hwnd, 0, SWP_NOSIZE | SWP_NOMOVE | SWP_NOCLIENTSIZE | SWP_NOCLIENTMOVE | - SWP_NOZORDER | SWP_NOACTIVATE | SWP_NOREDRAW, - &window_rect, &client_rect, valid_rects ); - SetThreadDpiAwarenessContext( context ); -} - - /******************************************************************* * get_hwnd_message_parent * @@ -2726,18 +2700,7 @@ BOOL WINAPI SwitchDesktop( HDESK hDesktop) */ BOOL CDECL __wine_set_pixel_format( HWND hwnd, int format ) { - WND *win = WIN_GetPtr( hwnd ); - - if (!win || win == WND_DESKTOP || win == WND_OTHER_PROCESS) - { - WARN( "setting format %d on win %p not supported\n", format, hwnd ); - return FALSE; - } - win->pixel_format = format; - WIN_ReleasePtr( win ); - - update_window_state( hwnd ); - return TRUE; + return NtUserCallHwndParam( hwnd, format, NtUserSetWindowPixelFormat ); } diff --git a/dlls/win32u/window.c b/dlls/win32u/window.c index e4311b49608..2700df862ca 100644 --- a/dlls/win32u/window.c +++ b/dlls/win32u/window.c @@ -1421,6 +1421,22 @@ LONG_PTR WINAPI NtUserSetWindowLongPtr( HWND hwnd, INT offset, LONG_PTR newval, return set_window_long( hwnd, offset, sizeof(LONG_PTR), newval, ansi ); } +static BOOL set_window_pixel_format( HWND hwnd, int format ) +{ + WND *win = get_win_ptr( hwnd ); + + if (!win || win == WND_DESKTOP || win == WND_OTHER_PROCESS) + { + WARN( "setting format %d on win %p not supported\n", format, hwnd ); + return FALSE; + } + win->pixel_format = format; + release_win_ptr( win ); + + update_window_state( hwnd ); + return TRUE; +} + /*********************************************************************** * NtUserGetProp (win32u.@) * @@ -3322,6 +3338,8 @@ ULONG_PTR WINAPI NtUserCallHwndParam( HWND hwnd, DWORD_PTR param, DWORD code ) return set_capture_window( hwnd, param, NULL ); case NtUserSetForegroundWindow: return set_foreground_window( hwnd, param ); + case NtUserSetWindowPixelFormat: + return set_window_pixel_format( hwnd, param ); /* temporary exports */ case NtUserIsWindowDrawable: return is_window_drawable( hwnd, param ); diff --git a/include/ntuser.h b/include/ntuser.h index 0e48aea0f9c..4ca4c063ef8 100644 --- a/include/ntuser.h +++ b/include/ntuser.h @@ -181,6 +181,7 @@ enum NtUserMonitorFromWindow, NtUserSetCaptureWindow, NtUserSetForegroundWindow, + NtUserSetWindowPixelFormat, /* temporary exports */ NtUserIsWindowDrawable, NtUserSetWindowStyle,
1
0
0
0
Jacek Caban : win32u: Move NtUsetSetWindowLong implementation from user32.
by Alexandre Julliard
16 Mar '22
16 Mar '22
Module: wine Branch: master Commit: 1b847dff822bb3f43d3a82b1c08e97192372c431 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=1b847dff822bb3f43d3a82b1…
Author: Jacek Caban <jacek(a)codeweavers.com> Date: Wed Mar 16 15:35:25 2022 +0100 win32u: Move NtUsetSetWindowLong implementation from user32. Signed-off-by: Jacek Caban <jacek(a)codeweavers.com> Signed-off-by: Huw Davies <huw(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/user32/driver.c | 7 +- dlls/user32/message.c | 2 - dlls/user32/user32.spec | 2 +- dlls/user32/win.c | 307 +---------------------------------------- dlls/user32/win.h | 1 - dlls/win32u/class.c | 11 ++ dlls/win32u/gdiobj.c | 3 + dlls/win32u/message.c | 2 + dlls/win32u/ntuser_private.h | 1 + dlls/win32u/win32u.spec | 6 +- dlls/win32u/win32u_private.h | 5 + dlls/win32u/window.c | 317 +++++++++++++++++++++++++++++++++++++++++++ dlls/win32u/wrappers.c | 18 +++ include/ntuser.h | 3 + 14 files changed, 369 insertions(+), 316 deletions(-) Diff:
https://source.winehq.org/git/wine.git/?a=commitdiff;h=1b847dff822bb3f43d3a…
1
0
0
0
Jacek Caban : win32u: Move set_window_style implementation from user32.
by Alexandre Julliard
16 Mar '22
16 Mar '22
Module: wine Branch: master Commit: 895ef97bc0c662c6a006b7a7285ba3a191dec796 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=895ef97bc0c662c6a006b7a7…
Author: Jacek Caban <jacek(a)codeweavers.com> Date: Wed Mar 16 15:34:55 2022 +0100 win32u: Move set_window_style implementation from user32. Signed-off-by: Jacek Caban <jacek(a)codeweavers.com> Signed-off-by: Huw Davies <huw(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/user32/message.c | 3 --- dlls/user32/win.c | 49 +++--------------------------------- dlls/win32u/driver.c | 1 + dlls/win32u/message.c | 3 +++ dlls/win32u/win32u_private.h | 1 + dlls/win32u/window.c | 59 ++++++++++++++++++++++++++++++++++++++++++++ include/ntuser.h | 1 + 7 files changed, 69 insertions(+), 48 deletions(-) diff --git a/dlls/user32/message.c b/dlls/user32/message.c index 27a83dc662b..5867b6b4009 100644 --- a/dlls/user32/message.c +++ b/dlls/user32/message.c @@ -1866,9 +1866,6 @@ LRESULT handle_internal_message( HWND hwnd, UINT msg, WPARAM wparam, LPARAM lpar return ShowWindow( hwnd, wparam ); case WM_WINE_SETWINDOWLONG: return WIN_SetWindowLong( hwnd, (short)LOWORD(wparam), HIWORD(wparam), lparam, TRUE ); - case WM_WINE_SETSTYLE: - if (is_desktop_window( hwnd )) return 0; - return WIN_SetStyle(hwnd, wparam, lparam); default: { MSG m; diff --git a/dlls/user32/win.c b/dlls/user32/win.c index ca4697713d6..bb6df478b1b 100644 --- a/dlls/user32/win.c +++ b/dlls/user32/win.c @@ -668,51 +668,10 @@ static HWND WIN_SetOwner( HWND hwnd, HWND owner ) */ ULONG WIN_SetStyle( HWND hwnd, ULONG set_bits, ULONG clear_bits ) { - BOOL ok, made_visible = FALSE; - STYLESTRUCT style; - WND *win = WIN_GetPtr( hwnd ); - - if (!win || win == WND_DESKTOP) return 0; - if (win == WND_OTHER_PROCESS) - { - if (IsWindow(hwnd)) - return SendMessageW(hwnd, WM_WINE_SETSTYLE, set_bits, clear_bits); - return 0; - } - style.styleOld = win->dwStyle; - style.styleNew = (win->dwStyle | set_bits) & ~clear_bits; - if (style.styleNew == style.styleOld) - { - WIN_ReleasePtr( win ); - return style.styleNew; - } - SERVER_START_REQ( set_window_info ) - { - req->handle = wine_server_user_handle( hwnd ); - req->flags = SET_WIN_STYLE; - req->style = style.styleNew; - req->extra_offset = -1; - if ((ok = !wine_server_call( req ))) - { - style.styleOld = reply->old_style; - win->dwStyle = style.styleNew; - } - } - SERVER_END_REQ; - - if (ok && ((style.styleOld ^ style.styleNew) & WS_VISIBLE)) - { - made_visible = (style.styleNew & WS_VISIBLE) != 0; - invalidate_dce( win, NULL ); - } - WIN_ReleasePtr( win ); - - if (!ok) return 0; - - USER_Driver->pSetWindowStyle( hwnd, GWL_STYLE, &style ); - if (made_visible) update_window_state( hwnd ); - - return style.styleOld; + /* FIXME: Use SetWindowLong or move callers to win32u instead. + * We use STYLESTRUCT to pass params, but meaning of its field does not match our usage. */ + STYLESTRUCT style = { .styleNew = set_bits, .styleOld = clear_bits }; + return NtUserCallHwndParam( hwnd, (UINT_PTR)&style, NtUserSetWindowStyle ); } diff --git a/dlls/win32u/driver.c b/dlls/win32u/driver.c index 56fce1c6496..afe44e1c4a3 100644 --- a/dlls/win32u/driver.c +++ b/dlls/win32u/driver.c @@ -1196,6 +1196,7 @@ static const struct user_driver_funcs lazy_load_driver = .pSetLayeredWindowAttributes = loaderdrv_SetLayeredWindowAttributes, .pSetParent = nulldrv_SetParent, .pSetWindowRgn = loaderdrv_SetWindowRgn, + .pSetWindowStyle = nulldrv_SetWindowStyle, .pMsgWaitForMultipleObjectsEx = nulldrv_MsgWaitForMultipleObjectsEx, .pReleaseDC = nulldrv_ReleaseDC, .pScrollDC = nulldrv_ScrollDC, diff --git a/dlls/win32u/message.c b/dlls/win32u/message.c index 5582f627166..1f0d6e6c297 100644 --- a/dlls/win32u/message.c +++ b/dlls/win32u/message.c @@ -47,6 +47,9 @@ LRESULT handle_internal_message( HWND hwnd, UINT msg, WPARAM wparam, LPARAM lpar case WM_WINE_SETPARENT: if (is_desktop_window( hwnd )) return 0; return HandleToUlong( NtUserSetParent( hwnd, UlongToHandle(wparam) )); + case WM_WINE_SETSTYLE: + if (is_desktop_window( hwnd )) return 0; + return set_window_style( hwnd, wparam, lparam ); case WM_WINE_SETACTIVEWINDOW: if (!wparam && NtUserGetForegroundWindow() == hwnd) return 0; return (LRESULT)NtUserSetActiveWindow( (HWND)wparam ); diff --git a/dlls/win32u/win32u_private.h b/dlls/win32u/win32u_private.h index ac40daa5d35..67df4490bf3 100644 --- a/dlls/win32u/win32u_private.h +++ b/dlls/win32u/win32u_private.h @@ -361,6 +361,7 @@ extern int map_window_points( HWND hwnd_from, HWND hwnd_to, POINT *points, UINT UINT dpi ) DECLSPEC_HIDDEN; extern void map_window_region( HWND from, HWND to, HRGN hrgn ) DECLSPEC_HIDDEN; extern BOOL set_window_pos( WINDOWPOS *winpos, int parent_x, int parent_y ) DECLSPEC_HIDDEN; +extern ULONG set_window_style( HWND hwnd, ULONG set_bits, ULONG clear_bits ) DECLSPEC_HIDDEN; extern void update_window_state( HWND hwnd ) DECLSPEC_HIDDEN; /* to release pointers retrieved by win_get_ptr */ diff --git a/dlls/win32u/window.c b/dlls/win32u/window.c index c3da53d08e4..01b1f15d158 100644 --- a/dlls/win32u/window.c +++ b/dlls/win32u/window.c @@ -1050,6 +1050,60 @@ static WORD get_window_word( HWND hwnd, INT offset ) return get_window_long_size( hwnd, offset, sizeof(WORD), TRUE ); } +/*********************************************************************** + * set_window_style + * + * Change the style of a window. + */ +ULONG set_window_style( HWND hwnd, ULONG set_bits, ULONG clear_bits ) +{ + BOOL ok, made_visible = FALSE; + STYLESTRUCT style; + WND *win = get_win_ptr( hwnd ); + + if (!win || win == WND_DESKTOP) return 0; + if (win == WND_OTHER_PROCESS) + { + if (is_window(hwnd)) + return send_message( hwnd, WM_WINE_SETSTYLE, set_bits, clear_bits ); + return 0; + } + style.styleOld = win->dwStyle; + style.styleNew = (win->dwStyle | set_bits) & ~clear_bits; + if (style.styleNew == style.styleOld) + { + release_win_ptr( win ); + return style.styleNew; + } + SERVER_START_REQ( set_window_info ) + { + req->handle = wine_server_user_handle( hwnd ); + req->flags = SET_WIN_STYLE; + req->style = style.styleNew; + req->extra_offset = -1; + if ((ok = !wine_server_call( req ))) + { + style.styleOld = reply->old_style; + win->dwStyle = style.styleNew; + } + } + SERVER_END_REQ; + + if (ok && ((style.styleOld ^ style.styleNew) & WS_VISIBLE)) + { + made_visible = (style.styleNew & WS_VISIBLE) != 0; + invalidate_dce( win, NULL ); + } + release_win_ptr( win ); + + if (!ok) return 0; + + user_driver->pSetWindowStyle( hwnd, GWL_STYLE, &style ); + if (made_visible) update_window_state( hwnd ); + + return style.styleOld; +} + /*********************************************************************** * NtUserGetProp (win32u.@) * @@ -2954,6 +3008,11 @@ ULONG_PTR WINAPI NtUserCallHwndParam( HWND hwnd, DWORD_PTR param, DWORD code ) /* temporary exports */ case NtUserIsWindowDrawable: return is_window_drawable( hwnd, param ); + case NtUserSetWindowStyle: + { + STYLESTRUCT *style = (void *)param; + return set_window_style( hwnd, style->styleNew, style->styleOld ); + } default: FIXME( "invalid code %u\n", code ); return 0; diff --git a/include/ntuser.h b/include/ntuser.h index f68f5481f90..96f61d2a07a 100644 --- a/include/ntuser.h +++ b/include/ntuser.h @@ -183,6 +183,7 @@ enum NtUserSetForegroundWindow, /* temporary exports */ NtUserIsWindowDrawable, + NtUserSetWindowStyle, }; /* NtUserMessageCall codes */
1
0
0
0
Piotr Caban : msvcr110: Make sure we don't hang in _Condition_variable::notify* functions.
by Alexandre Julliard
16 Mar '22
16 Mar '22
Module: wine Branch: master Commit: 746df92dba928c8f5bfbff44c2b7156ab5bcf195 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=746df92dba928c8f5bfbff44…
Author: Piotr Caban <piotr(a)codeweavers.com> Date: Wed Mar 16 14:38:02 2022 +0100 msvcr110: Make sure we don't hang in _Condition_variable::notify* functions. Signed-off-by: Piotr Caban <piotr(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/msvcrt/concurrency.c | 31 +++++++++++++++++++------------ 1 file changed, 19 insertions(+), 12 deletions(-) diff --git a/dlls/msvcrt/concurrency.c b/dlls/msvcrt/concurrency.c index 18138901594..54b2c49db99 100644 --- a/dlls/msvcrt/concurrency.c +++ b/dlls/msvcrt/concurrency.c @@ -261,6 +261,7 @@ typedef struct } event; #if _MSVCR_VER >= 110 +#define CV_WAKE (void*)1 typedef struct cv_queue { struct cv_queue *next; LONG expired; @@ -2299,18 +2300,20 @@ void __thiscall _Condition_variable_dtor(_Condition_variable *this) DEFINE_THISCALL_WRAPPER(_Condition_variable_wait, 8) void __thiscall _Condition_variable_wait(_Condition_variable *this, critical_section *cs) { - cv_queue q; + cv_queue q, *next; TRACE("(%p, %p)\n", this, cs); critical_section_lock(&this->lock); q.next = this->queue; q.expired = FALSE; + next = q.next; this->queue = &q; critical_section_unlock(&this->lock); critical_section_unlock(cs); - NtWaitForKeyedEvent(keyed_event, &q, 0, NULL); + while (q.next != CV_WAKE) + RtlWaitOnAddress(&q.next, &next, sizeof(next), NULL); critical_section_lock(cs); } @@ -2323,7 +2326,7 @@ bool __thiscall _Condition_variable_wait_for(_Condition_variable *this, LARGE_INTEGER to; NTSTATUS status; FILETIME ft; - cv_queue *q; + cv_queue *q, *next; TRACE("(%p %p %d)\n", this, cs, timeout); @@ -2331,6 +2334,7 @@ bool __thiscall _Condition_variable_wait_for(_Condition_variable *this, critical_section_lock(&this->lock); q->next = this->queue; q->expired = FALSE; + next = q->next; this->queue = q; critical_section_unlock(&this->lock); @@ -2339,14 +2343,15 @@ bool __thiscall _Condition_variable_wait_for(_Condition_variable *this, GetSystemTimeAsFileTime(&ft); to.QuadPart = ((LONGLONG)ft.dwHighDateTime << 32) + ft.dwLowDateTime + (LONGLONG)timeout * 10000; - status = NtWaitForKeyedEvent(keyed_event, q, 0, &to); - if(status == STATUS_TIMEOUT) { - if(!InterlockedExchange(&q->expired, TRUE)) { - critical_section_lock(cs); - return FALSE; + while (q->next != CV_WAKE) { + status = RtlWaitOnAddress(&q->next, &next, sizeof(next), &to); + if(status == STATUS_TIMEOUT) { + if(!InterlockedExchange(&q->expired, TRUE)) { + critical_section_lock(cs); + return FALSE; + } + break; } - else - NtWaitForKeyedEvent(keyed_event, q, 0, 0); } operator_delete(q); @@ -2376,8 +2381,9 @@ void __thiscall _Condition_variable_notify_one(_Condition_variable *this) this->queue = node->next; critical_section_unlock(&this->lock); + node->next = CV_WAKE; if(!InterlockedExchange(&node->expired, TRUE)) { - NtReleaseKeyedEvent(keyed_event, node, 0, NULL); + RtlWakeAddressSingle(&node->next); return; } else { HeapFree(GetProcessHeap(), 0, node); @@ -2405,8 +2411,9 @@ void __thiscall _Condition_variable_notify_all(_Condition_variable *this) while(ptr) { cv_queue *next = ptr->next; + ptr->next = CV_WAKE; if(!InterlockedExchange(&ptr->expired, TRUE)) - NtReleaseKeyedEvent(keyed_event, ptr, 0, NULL); + RtlWakeAddressSingle(&ptr->next); else HeapFree(GetProcessHeap(), 0, ptr); ptr = next;
1
0
0
0
Dmitry Timoshkov : combase: Execute dllhost.exe for correct architecture in a WoW64 setup.
by Alexandre Julliard
16 Mar '22
16 Mar '22
Module: wine Branch: master Commit: 13064f991408ea5fa5e999705b13bda7bbd50e5b URL:
https://source.winehq.org/git/wine.git/?a=commit;h=13064f991408ea5fa5e99970…
Author: Dmitry Timoshkov <dmitry(a)baikal.ru> Date: Wed Mar 16 13:14:47 2022 +0300 combase: Execute dllhost.exe for correct architecture in a WoW64 setup. Signed-off-by: Dmitry Timoshkov <dmitry(a)baikal.ru> Signed-off-by: Huw Davies <huw(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/combase/rpc.c | 48 +++++++++++++++++++++++++++++++++++----------- programs/dllhost/dllhost.c | 2 ++ 2 files changed, 39 insertions(+), 11 deletions(-) diff --git a/dlls/combase/rpc.c b/dlls/combase/rpc.c index 40f900175dd..f620339f19e 100644 --- a/dlls/combase/rpc.c +++ b/dlls/combase/rpc.c @@ -526,18 +526,24 @@ static HRESULT create_surrogate_server(REFCLSID rclsid, HANDLE *process) { static const WCHAR processidW[] = L" /PROCESSID:"; HKEY key; + int arch = (sizeof(void *) > sizeof(int)) ? 64 : 32; + REGSAM opposite = (arch == 64) ? KEY_WOW64_32KEY : KEY_WOW64_64KEY; + BOOL is_wow64 = FALSE; HRESULT hr; WCHAR command[MAX_PATH + ARRAY_SIZE(processidW) + CHARS_IN_GUID]; DWORD size; - STARTUPINFOW sinfo; - PROCESS_INFORMATION pinfo; + STARTUPINFOW si; + PROCESS_INFORMATION pi; LONG ret; TRACE("Attempting to start surrogate server for %s\n", debugstr_guid(rclsid)); hr = open_appidkey_from_clsid(rclsid, KEY_READ, &key); - if (FAILED(hr)) - return hr; + if (FAILED(hr) && (arch == 64 || (IsWow64Process(GetCurrentProcess(), &is_wow64) && is_wow64))) + { + hr = open_appidkey_from_clsid(rclsid, opposite | KEY_READ, &key); + if (FAILED(hr)) return hr; + } size = (MAX_PATH + 1) * sizeof(WCHAR); ret = RegQueryValueExW(key, L"DllSurrogate", NULL, NULL, (LPBYTE)command, &size); @@ -545,25 +551,45 @@ static HRESULT create_surrogate_server(REFCLSID rclsid, HANDLE *process) if (ret || !size || !command[0]) { TRACE("No value for DllSurrogate key\n"); - wcscpy(command, L"dllhost.exe"); + + if ((sizeof(void *) == 8 || is_wow64) && opposite == KEY_WOW64_32KEY) + GetSystemWow64DirectoryW(command, MAX_PATH - ARRAY_SIZE(L"\\dllhost.exe")); + else + GetSystemDirectoryW(command, MAX_PATH - ARRAY_SIZE(L"\\dllhost.exe")); + + wcscat(command, L"\\dllhost.exe"); } /* Surrogate EXE servers are started with the /PROCESSID:{GUID} switch. */ wcscat(command, processidW); StringFromGUID2(rclsid, command + wcslen(command), CHARS_IN_GUID); - memset(&sinfo, 0, sizeof(sinfo)); - sinfo.cb = sizeof(sinfo); + memset(&si, 0, sizeof(si)); + si.cb = sizeof(si); TRACE("Activating surrogate local server %s\n", debugstr_w(command)); - if (!CreateProcessW(NULL, command, NULL, NULL, FALSE, DETACHED_PROCESS, NULL, NULL, &sinfo, &pinfo)) + if (is_wow64 && arch == 64) + { + void *cookie; + Wow64DisableWow64FsRedirection(&cookie); + if (!CreateProcessW(NULL, command, NULL, NULL, FALSE, DETACHED_PROCESS, NULL, NULL, &si, &pi)) + { + WARN("failed to run surrogate local server %s\n", debugstr_w(command)); + hr = HRESULT_FROM_WIN32(GetLastError()); + } + Wow64RevertWow64FsRedirection(cookie); + } + else if (!CreateProcessW(NULL, command, NULL, NULL, FALSE, DETACHED_PROCESS, NULL, NULL, &si, &pi)) { WARN("failed to run surrogate local server %s\n", debugstr_w(command)); - return HRESULT_FROM_WIN32(GetLastError()); + hr = HRESULT_FROM_WIN32(GetLastError()); } - *process = pinfo.hProcess; - CloseHandle(pinfo.hThread); + + if (FAILED(hr)) return hr; + + *process = pi.hProcess; + CloseHandle(pi.hThread); return S_OK; } diff --git a/programs/dllhost/dllhost.c b/programs/dllhost/dllhost.c index dc89c978510..83700826f8b 100644 --- a/programs/dllhost/dllhost.c +++ b/programs/dllhost/dllhost.c @@ -327,6 +327,8 @@ int WINAPI wWinMain(HINSTANCE hinst, HINSTANCE previnst, LPWSTR cmdline, int sho CLSID clsid; struct surrogate surrogate; + TRACE("Running as %u-bit\n", (int)sizeof(void *) * 8); + if (wcsnicmp(cmdline, L"/PROCESSID:", 11)) return 0;
1
0
0
0
← Newer
1
...
47
48
49
50
51
52
53
...
114
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
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
Results per page:
10
25
50
100
200