Skip to content

Commit 1c04786

Browse files
committed
[WS2_32_WINETEST] Sync with Wine Staging 1.9.18.
svn path=/trunk/; revision=72617
1 parent bca9ea7 commit 1c04786

File tree

1 file changed

+23
-0
lines changed
  • rostests/winetests/ws2_32

1 file changed

+23
-0
lines changed

rostests/winetests/ws2_32/sock.c

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8513,6 +8513,22 @@ static HWND create_async_message_window(void)
85138513
return hWnd;
85148514
}
85158515

8516+
static void wait_for_async_message(HWND hwnd, HANDLE handle)
8517+
{
8518+
BOOL ret;
8519+
MSG msg;
8520+
8521+
while ((ret = GetMessageA(&msg, 0, 0, 0)) &&
8522+
!(msg.hwnd == hwnd && msg.message == WM_ASYNCCOMPLETE))
8523+
{
8524+
TranslateMessage(&msg);
8525+
DispatchMessageA(&msg);
8526+
}
8527+
8528+
ok(ret, "did not expect WM_QUIT message\n");
8529+
ok(msg.wParam == (WPARAM)handle, "expected wParam = %p, got %lx\n", handle, msg.wParam);
8530+
}
8531+
85168532
static void test_WSAAsyncGetServByPort(void)
85178533
{
85188534
HWND hwnd = create_async_message_window();
@@ -8530,12 +8546,15 @@ static void test_WSAAsyncGetServByPort(void)
85308546

85318547
ret = WSAAsyncGetServByPort(hwnd, WM_ASYNCCOMPLETE, 0, NULL, NULL, 0);
85328548
ok(ret != NULL, "WSAAsyncGetServByPort returned NULL\n");
8549+
wait_for_async_message(hwnd, ret);
85338550

85348551
ret = WSAAsyncGetServByPort(hwnd, WM_ASYNCCOMPLETE, htons(80), NULL, NULL, 0);
85358552
ok(ret != NULL, "WSAAsyncGetServByPort returned NULL\n");
8553+
wait_for_async_message(hwnd, ret);
85368554

85378555
ret = WSAAsyncGetServByPort(hwnd, WM_ASYNCCOMPLETE, htons(80), NULL, buffer, MAXGETHOSTSTRUCT);
85388556
ok(ret != NULL, "WSAAsyncGetServByPort returned NULL\n");
8557+
wait_for_async_message(hwnd, ret);
85398558

85408559
DestroyWindow(hwnd);
85418560
}
@@ -8554,15 +8573,19 @@ static void test_WSAAsyncGetServByName(void)
85548573
/* Parameters are not checked when initiating the asynchronous operation. */
85558574
ret = WSAAsyncGetServByName(hwnd, WM_ASYNCCOMPLETE, "", NULL, NULL, 0);
85568575
ok(ret != NULL, "WSAAsyncGetServByName returned NULL\n");
8576+
wait_for_async_message(hwnd, ret);
85578577

85588578
ret = WSAAsyncGetServByName(hwnd, WM_ASYNCCOMPLETE, "", "", buffer, MAXGETHOSTSTRUCT);
85598579
ok(ret != NULL, "WSAAsyncGetServByName returned NULL\n");
8580+
wait_for_async_message(hwnd, ret);
85608581

85618582
ret = WSAAsyncGetServByName(hwnd, WM_ASYNCCOMPLETE, "http", NULL, NULL, 0);
85628583
ok(ret != NULL, "WSAAsyncGetServByName returned NULL\n");
8584+
wait_for_async_message(hwnd, ret);
85638585

85648586
ret = WSAAsyncGetServByName(hwnd, WM_ASYNCCOMPLETE, "http", "tcp", buffer, MAXGETHOSTSTRUCT);
85658587
ok(ret != NULL, "WSAAsyncGetServByName returned NULL\n");
8588+
wait_for_async_message(hwnd, ret);
85668589

85678590
DestroyWindow(hwnd);
85688591
}

0 commit comments

Comments
 (0)