From c66b27557ddedd71d1b87de20209254c54fee5dc Mon Sep 17 00:00:00 2001 From: Alexandre Julliard Date: Tue, 19 Nov 2024 14:48:17 +0100 Subject: [PATCH] user32: Move PostQuitMessage() implementation to win32u. --- dlls/user32/message.c | 7 +------ dlls/win32u/message.c | 14 ++++++++++++++ dlls/win32u/sysparams.c | 3 +++ dlls/win32u/win32u_private.h | 1 + include/ntuser.h | 6 ++++++ 5 files changed, 25 insertions(+), 6 deletions(-) diff --git a/dlls/user32/message.c b/dlls/user32/message.c index 51e908d4dcd..7374b22d7b4 100644 --- a/dlls/user32/message.c +++ b/dlls/user32/message.c @@ -746,12 +746,7 @@ BOOL WINAPI PostThreadMessageA( DWORD thread, UINT msg, WPARAM wparam, LPARAM lp */ void WINAPI PostQuitMessage( INT exit_code ) { - SERVER_START_REQ( post_quit_message ) - { - req->exit_code = exit_code; - wine_server_call( req ); - } - SERVER_END_REQ; + NtUserPostQuitMessage( exit_code ); } /*********************************************************************** diff --git a/dlls/win32u/message.c b/dlls/win32u/message.c index 044310a2f0e..43650146f8e 100644 --- a/dlls/win32u/message.c +++ b/dlls/win32u/message.c @@ -3649,6 +3649,20 @@ NTSTATUS send_hardware_message( HWND hwnd, UINT flags, const INPUT *input, LPARA return ret; } +/*********************************************************************** + * post_quit_message + */ +BOOL post_quit_message( int exit_code ) +{ + SERVER_START_REQ( post_quit_message ) + { + req->exit_code = exit_code; + wine_server_call( req ); + } + SERVER_END_REQ; + return TRUE; +} + /********************************************************************** * NtUserDispatchMessage (win32u.@) */ diff --git a/dlls/win32u/sysparams.c b/dlls/win32u/sysparams.c index cc27f3dc7f2..2fbc90e27e6 100644 --- a/dlls/win32u/sysparams.c +++ b/dlls/win32u/sysparams.c @@ -7006,6 +7006,9 @@ ULONG_PTR WINAPI NtUserCallOneParam( ULONG_PTR arg, ULONG code ) case NtUserCallOneParam_MessageBeep: return message_beep( arg ); + case NtUserCallOneParam_PostQuitMessage: + return post_quit_message( arg ); + case NtUserCallOneParam_ReplyMessage: return reply_message_result( arg ); diff --git a/dlls/win32u/win32u_private.h b/dlls/win32u/win32u_private.h index ea241bd6aa7..e60ca00e76f 100644 --- a/dlls/win32u/win32u_private.h +++ b/dlls/win32u/win32u_private.h @@ -132,6 +132,7 @@ extern void track_mouse_menu_bar( HWND hwnd, INT ht, int x, int y ); /* message.c */ extern BOOL kill_system_timer( HWND hwnd, UINT_PTR id ); extern BOOL reply_message_result( LRESULT result ); +extern BOOL post_quit_message( int exit_code ); extern NTSTATUS send_hardware_message( HWND hwnd, UINT flags, const INPUT *input, LPARAM lparam ); extern LRESULT send_internal_message_timeout( DWORD dest_pid, DWORD dest_tid, UINT msg, WPARAM wparam, LPARAM lparam, UINT flags, UINT timeout, diff --git a/include/ntuser.h b/include/ntuser.h index a16b013cda6..384729f8157 100644 --- a/include/ntuser.h +++ b/include/ntuser.h @@ -1035,6 +1035,7 @@ enum NtUserCallOneParam_GetSystemMetrics, NtUserCallOneParam_GetVirtualScreenRect, NtUserCallOneParam_MessageBeep, + NtUserCallOneParam_PostQuitMessage, NtUserCallOneParam_RealizePalette, NtUserCallOneParam_ReplyMessage, NtUserCallOneParam_SetCaretBlinkTime, @@ -1141,6 +1142,11 @@ static inline BOOL NtUserMessageBeep( UINT i ) return NtUserCallOneParam( i, NtUserCallOneParam_MessageBeep ); } +static inline void NtUserPostQuitMessage( INT exit_code ) +{ + NtUserCallOneParam( exit_code, NtUserCallOneParam_PostQuitMessage ); +} + static inline UINT NtUserRealizePalette( HDC hdc ) { return NtUserCallOneParam( HandleToUlong(hdc), NtUserCallOneParam_RealizePalette );