Signed-off-by: Gabriel Ivăncescu <gabrielopcode(a)gmail.com>
---
v2: Add broken() check to fix w10pro64_ar testbot results.
dlls/user32/tests/msg.c | 90 +++++++++++++++++++++++++++++++++++++++++
1 file changed, 90 insertions(+)
diff --git a/dlls/user32/tests/msg.c b/dlls/user32/tests/msg.c
index 2705914..ce931d2 100644
--- a/dlls/user32/tests/msg.c
+++ b/dlls/user32/tests/msg.c
@@ -18521,6 +18521,12 @@ static void test_SendMessage_other_thread(int thread_n)
CloseHandle(wnd_event.stop_event);
}
+static void CALLBACK msg_callback_nested( HWND hwnd, UINT msg, ULONG_PTR arg, LRESULT result )
+{
+ ok( msg == WM_USER + 10, "wrong msg %x\n", msg );
+ ok( result == 0, "wrong result %Ix\n", result );
+}
+
static LRESULT CALLBACK insendmessage_wnd_proc( HWND hwnd, UINT msg, WPARAM wp, LPARAM lp )
{
DWORD flags = InSendMessageEx( NULL );
@@ -18561,6 +18567,80 @@ static LRESULT CALLBACK insendmessage_wnd_proc( HWND hwnd, UINT msg, WPARAM wp,
ret = ReplyMessage( msg );
ok( !ret, "ReplyMessage succeeded\n" );
break;
+ case WM_USER + 4:
+ ok( flags == ISMEX_SEND, "wrong flags %lx\n", flags );
+ ok( InSendMessage(), "InSendMessage returned false\n" );
+ SendMessageCallbackA( hwnd, WM_USER + 10, 0, 0, msg_callback_nested, 0 );
+ flags = InSendMessageEx( NULL );
+ ok( flags == (ISMEX_SEND | ISMEX_REPLIED) || broken(flags == (ISMEX_NOTIFY | ISMEX_REPLIED)), "wrong flags %lx\n", flags );
+ ret = ReplyMessage( msg );
+ todo_wine
+ ok( !ret, "ReplyMessage returned %u\n", ret );
+ flags = InSendMessageEx( NULL );
+ ok( flags == (ISMEX_SEND | ISMEX_REPLIED) || broken(flags == (ISMEX_NOTIFY | ISMEX_REPLIED)), "wrong flags %lx\n", flags );
+ ok( InSendMessage(), "InSendMessage returned false\n" );
+ break;
+ case WM_USER + 5:
+ ok( flags == ISMEX_NOTIFY, "wrong flags %lx\n", flags );
+ ok( InSendMessage(), "InSendMessage returned false\n" );
+ SendMessageA( hwnd, WM_USER + 11, 0, 0 );
+ flags = InSendMessageEx( NULL );
+ ok( flags == ISMEX_NOTIFY, "wrong flags %lx\n", flags );
+ ret = ReplyMessage( msg );
+ ok( ret, "ReplyMessage failed err %lu\n", GetLastError() );
+ flags = InSendMessageEx( NULL );
+ ok( flags == ISMEX_NOTIFY, "wrong flags %lx\n", flags );
+ ok( InSendMessage(), "InSendMessage returned false\n" );
+ break;
+ case WM_USER + 6:
+ ok( flags == ISMEX_CALLBACK, "wrong flags %lx\n", flags );
+ ok( InSendMessage(), "InSendMessage returned false\n" );
+ SendMessageW( hwnd, WM_USER + 12, 0, 0 );
+ flags = InSendMessageEx( NULL );
+ ok( flags == (ISMEX_CALLBACK | ISMEX_REPLIED) || flags == ISMEX_SEND, "wrong flags %lx\n", flags );
+ ok( InSendMessage(), "InSendMessage returned false\n" );
+ ret = ReplyMessage( msg );
+ todo_wine
+ ok( !ret, "ReplyMessage returned %u\n", ret );
+ flags = InSendMessageEx( NULL );
+ ok( flags == (ISMEX_CALLBACK | ISMEX_REPLIED) || flags == ISMEX_SEND, "wrong flags %lx\n", flags );
+ ok( InSendMessage(), "InSendMessage returned false\n" );
+ break;
+ case WM_USER + 7:
+ ok( flags == ISMEX_NOSEND, "wrong flags %lx\n", flags );
+ ok( !InSendMessage(), "InSendMessage returned true\n" );
+ SendNotifyMessageW( hwnd, WM_USER + 13, 0, 0 );
+ flags = InSendMessageEx( NULL );
+ ok( flags == ISMEX_NOSEND, "wrong flags %lx\n", flags );
+ ok( !InSendMessage(), "InSendMessage returned true\n" );
+ ret = ReplyMessage( msg );
+ ok( !ret, "ReplyMessage succeeded\n" );
+ break;
+
+ case WM_USER + 10:
+ ok( flags == ISMEX_SEND, "wrong flags %lx\n", flags );
+ ok( InSendMessage(), "InSendMessage returned false\n" );
+ ret = ReplyMessage( msg );
+ ok( ret, "ReplyMessage failed err %lu\n", GetLastError() );
+ break;
+ case WM_USER + 11:
+ ok( flags == ISMEX_NOTIFY, "wrong flags %lx\n", flags );
+ ok( InSendMessage(), "InSendMessage returned false\n" );
+ ret = ReplyMessage( msg );
+ ok( ret, "ReplyMessage failed err %lu\n", GetLastError() );
+ break;
+ case WM_USER + 12:
+ ok( flags == ISMEX_CALLBACK, "wrong flags %lx\n", flags );
+ ok( InSendMessage(), "InSendMessage returned false\n" );
+ ret = ReplyMessage( msg );
+ ok( ret, "ReplyMessage failed err %lu\n", GetLastError() );
+ break;
+ case WM_USER + 13:
+ ok( flags == ISMEX_NOSEND, "wrong flags %lx\n", flags );
+ ok( !InSendMessage(), "InSendMessage returned false\n" );
+ ret = ReplyMessage( msg );
+ ok( !ret, "ReplyMessage returned %u\n", ret );
+ break;
}
return DefWindowProcA( hwnd, msg, wp, lp );
@@ -18572,6 +18652,12 @@ static void CALLBACK msg_callback( HWND hwnd, UINT msg, ULONG_PTR arg, LRESULT r
ok( result == WM_USER + 2, "wrong result %Ix\n", result );
}
+static void CALLBACK msg_callback2( HWND hwnd, UINT msg, ULONG_PTR arg, LRESULT result )
+{
+ ok( msg == WM_USER + 6, "wrong msg %x\n", msg );
+ ok( result == WM_USER + 6, "wrong result %Ix\n", result );
+}
+
static DWORD WINAPI send_message_thread( void *arg )
{
HWND win = arg;
@@ -18580,6 +18666,10 @@ static DWORD WINAPI send_message_thread( void *arg )
SendNotifyMessageA( win, WM_USER + 1, 0, 0 );
SendMessageCallbackA( win, WM_USER + 2, 0, 0, msg_callback, 0 );
PostMessageA( win, WM_USER + 3, 0, 0 );
+ SendMessageA( win, WM_USER + 4, 0, 0 );
+ SendNotifyMessageA( win, WM_USER + 5, 0, 0 );
+ SendMessageCallbackA( win, WM_USER + 6, 0, 0, msg_callback2, 0 );
+ PostMessageA( win, WM_USER + 7, 0, 0 );
PostMessageA( win, WM_QUIT, 0, 0 );
return 0;
}
--
2.34.1