Piotr Caban : user32: Test GetIconInfo on other process cursor.

Alexandre Julliard julliard at wine.codeweavers.com
Thu Jul 30 17:10:04 CDT 2015


Module: wine
Branch: master
Commit: 888ffb1134846c67032c04ab7c91b8d2476a6e00
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=888ffb1134846c67032c04ab7c91b8d2476a6e00

Author: Piotr Caban <piotr at codeweavers.com>
Date:   Thu Jul 30 09:36:52 2015 +0200

user32: Test GetIconInfo on other process cursor.

---

 dlls/user32/tests/cursoricon.c | 20 ++++++++++++++++----
 1 file changed, 16 insertions(+), 4 deletions(-)

diff --git a/dlls/user32/tests/cursoricon.c b/dlls/user32/tests/cursoricon.c
index 54d7963..4b6b792 100644
--- a/dlls/user32/tests/cursoricon.c
+++ b/dlls/user32/tests/cursoricon.c
@@ -308,21 +308,33 @@ static const BOOL is_win64 = (sizeof(void *) > sizeof(int));
 
 static LRESULT CALLBACK callback_child(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
 {
-    BOOL ret;
-    DWORD error;
-
     switch (msg)
     {
         /* Destroy the cursor. */
         case WM_USER+1:
+        {
+            HCURSOR cursor = (HCURSOR)lParam;
+            ICONINFO info;
+            BOOL ret;
+            DWORD error;
+
+            memset(&info, 0, sizeof(info));
+            ret = GetIconInfo(cursor, &info);
+            todo_wine ok(ret, "GetIconInfoEx failed with error %u\n", GetLastError());
+            todo_wine ok(info.hbmColor != NULL, "info.hmbColor was not set\n");
+            todo_wine ok(info.hbmMask != NULL, "info.hmbColor was not set\n");
+            DeleteObject(info.hbmColor);
+            DeleteObject(info.hbmMask);
+
             SetLastError(0xdeadbeef);
-            ret = DestroyCursor((HCURSOR) lParam);
+            ret = DestroyCursor(cursor);
             error = GetLastError();
             ok(!ret || broken(ret) /* win9x */, "DestroyCursor on the active cursor succeeded.\n");
             ok(error == ERROR_DESTROY_OBJECT_OF_OTHER_THREAD ||
                error == 0xdeadbeef,  /* vista */
                 "Last error: %u\n", error);
             return TRUE;
+        }
         case WM_DESTROY:
             PostQuitMessage(0);
             return 0;




More information about the wine-cvs mailing list