7 PROCESS_INFORMATION pi
;
12 int argc
= winetest_get_mainargs( &test_argv
);
14 /* Now check its behaviour regarding Shared icons/cursors */
15 handle
= LoadImageW( GetModuleHandle(NULL
), L
"TESTCURSOR", IMAGE_CURSOR
, 0, 0, LR_SHARED
| LR_DEFAULTSIZE
);
16 ok(handle
!= 0, "\n");
26 sscanf (test_argv
[2], "%Iu", (ULONG_PTR
*) &arg
);
28 ok(handle
!= arg
, "Got same handles\n");
31 hCopy
= CopyIcon(arg
);
32 ok(hCopy
!= NULL
, "\n");
33 ok(DestroyIcon(hCopy
), "\n");
35 hCopy
= CopyImage(arg
, IMAGE_CURSOR
, 0, 0, 0);
36 ok(hCopy
!= NULL
, "\n");
37 ok(DestroyIcon(hCopy
), "\n");
38 /* Unlike the original, this one is not shared */
39 ok(!DestroyIcon(hCopy
), "\n");
41 hCopy
= CopyImage(arg
, IMAGE_CURSOR
, 0, 0, LR_COPYFROMRESOURCE
);
42 ok(hCopy
!= NULL
, "\n");
43 ok(DestroyIcon(hCopy
), "\n");
44 /* Unlike the original, this one is not shared */
45 ok(!DestroyIcon(hCopy
), "\n");
47 hCopy
= CopyImage(arg
, IMAGE_CURSOR
, 0, 0, LR_COPYFROMRESOURCE
| LR_SHARED
);
48 ok(hCopy
!= NULL
, "\n");
49 ok(DestroyIcon(hCopy
), "\n");
50 /* This one is shared */
51 ok(DestroyIcon(hCopy
), "\n");
53 hCopy
= CopyImage(arg
, IMAGE_CURSOR
, 0, 0, LR_SHARED
);
54 ok(hCopy
!= NULL
, "\n");
55 ok(DestroyIcon(hCopy
), "\n");
56 /* This one is shared */
57 ok(DestroyIcon(hCopy
), "\n");
59 /* Try various usual functions */
60 hdcScreen
= CreateDCW(L
"DISPLAY", NULL
, NULL
, NULL
);
61 ok(hdcScreen
!= NULL
, "\n");
62 hdc
= CreateCompatibleDC(hdcScreen
);
63 ok(hdc
!= NULL
, "\n");
64 hbmp
= CreateCompatibleBitmap(hdcScreen
, 64, 64);
65 ok(hbmp
!= NULL
, "\n");
66 hbmp
= SelectObject(hdc
, hbmp
);
67 ok(hbmp
!= NULL
, "\n");
69 ok(DrawIcon(hdc
, 0, 0, arg
), "\n");
70 hbmp
= SelectObject(hdc
, hbmp
);
75 ok(GetIconInfo(arg
, &ii
), "\n");
76 ok(ii
.hbmMask
!= NULL
, "\n");
77 DeleteObject(ii
.hbmMask
);
78 if(ii
.hbmColor
) DeleteObject(ii
.hbmColor
);
83 /* Start child process */
84 sprintf( path
, "%s LoadImage %Iu", test_argv
[0], (ULONG_PTR
)handle
);
85 memset( &si
, 0, sizeof(si
) );
87 CreateProcessA( NULL
, path
, NULL
, NULL
, TRUE
, 0, NULL
, NULL
, &si
, &pi
);
88 WaitForSingleObject (pi
.hProcess
, INFINITE
);