Commit 4e8da470 authored by Stefan Dösinger's avatar Stefan Dösinger Committed by Alexandre Julliard

d3d8/tests: Fix test_cursor().

parent c440168e
...@@ -759,6 +759,7 @@ static void test_cursor(void) ...@@ -759,6 +759,7 @@ static void test_cursor(void)
HCURSOR cur; HCURSOR cur;
HWND window; HWND window;
HRESULT hr; HRESULT hr;
BOOL ret;
pGetCursorInfo = (void *)GetProcAddress(user32_handle, "GetCursorInfo"); pGetCursorInfo = (void *)GetProcAddress(user32_handle, "GetCursorInfo");
if (!pGetCursorInfo) if (!pGetCursorInfo)
...@@ -767,14 +768,19 @@ static void test_cursor(void) ...@@ -767,14 +768,19 @@ static void test_cursor(void)
return; return;
} }
window = CreateWindowA("d3d8_test_wc", "d3d8_test", WS_OVERLAPPEDWINDOW | WS_VISIBLE,
0, 0, 640, 480, NULL, NULL, NULL, NULL);
ok(!!window, "Failed to create a window.\n");
ret = SetCursorPos(50, 50);
ok(ret, "Failed to set cursor position.\n");
flush_events();
memset(&info, 0, sizeof(info)); memset(&info, 0, sizeof(info));
info.cbSize = sizeof(info); info.cbSize = sizeof(info);
ok(pGetCursorInfo(&info), "GetCursorInfo failed\n"); ok(pGetCursorInfo(&info), "GetCursorInfo failed\n");
cur = info.hCursor; cur = info.hCursor;
window = CreateWindowA("d3d8_test_wc", "d3d8_test", WS_OVERLAPPEDWINDOW,
0, 0, 640, 480, NULL, NULL, NULL, NULL);
ok(!!window, "Failed to create a window.\n");
d3d = Direct3DCreate8(D3D_SDK_VERSION); d3d = Direct3DCreate8(D3D_SDK_VERSION);
ok(!!d3d, "Failed to create a D3D object.\n"); ok(!!d3d, "Failed to create a D3D object.\n");
if (!(device = create_device(d3d, window, NULL))) if (!(device = create_device(d3d, window, NULL)))
...@@ -817,12 +823,11 @@ static void test_cursor(void) ...@@ -817,12 +823,11 @@ static void test_cursor(void)
hr = IDirect3DDevice8_ShowCursor(device, TRUE); hr = IDirect3DDevice8_ShowCursor(device, TRUE);
ok(hr == TRUE, "IDirect3DDevice8_ShowCursor returned %#08x\n", hr); ok(hr == TRUE, "IDirect3DDevice8_ShowCursor returned %#08x\n", hr);
/* GDI cursor unchanged */
memset(&info, 0, sizeof(info)); memset(&info, 0, sizeof(info));
info.cbSize = sizeof(info); info.cbSize = sizeof(info);
ok(pGetCursorInfo(&info), "GetCursorInfo failed\n"); ok(pGetCursorInfo(&info), "GetCursorInfo failed\n");
ok(info.flags & CURSOR_SHOWING, "The gdi cursor is hidden (%08x)\n", info.flags); ok(info.flags & CURSOR_SHOWING, "The gdi cursor is hidden (%08x)\n", info.flags);
ok(info.hCursor == cur, "The cursor handle is %p\n", info.hCursor); /* unchanged */ ok(info.hCursor != cur, "The cursor handle is %p\n", info.hCursor);
refcount = IDirect3DDevice8_Release(device); refcount = IDirect3DDevice8_Release(device);
ok(!refcount, "Device has %u references left.\n", refcount); ok(!refcount, "Device has %u references left.\n", refcount);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment