11 PROCESS_INFORMATION pi
;
16 int argc
= winetest_get_mainargs( &test_argv
);
18 /* Now check its behaviour regarding Shared icons/cursors */
19 handle
= LoadImageW( GetModuleHandle(NULL
), L
"TESTCURSOR", IMAGE_CURSOR
, 0, 0, LR_SHARED
| LR_DEFAULTSIZE
);
20 ok(handle
!= 0, "\n");
30 sscanf (test_argv
[2], "%lu", (ULONG_PTR
*) &arg
);
32 ok(handle
!= arg
, "Got same handles\n");
35 hCopy
= CopyIcon(arg
);
36 ok(hCopy
!= NULL
, "\n");
37 ok(DestroyIcon(hCopy
), "\n");
39 hCopy
= CopyImage(arg
, IMAGE_CURSOR
, 0, 0, 0);
40 ok(hCopy
!= NULL
, "\n");
41 ok(DestroyIcon(hCopy
), "\n");
42 /* Unlike the original, this one is not shared */
43 ok(!DestroyIcon(hCopy
), "\n");
45 hCopy
= CopyImage(arg
, IMAGE_CURSOR
, 0, 0, LR_COPYFROMRESOURCE
);
46 ok(hCopy
!= NULL
, "\n");
47 ok(DestroyIcon(hCopy
), "\n");
48 /* Unlike the original, this one is not shared */
49 ok(!DestroyIcon(hCopy
), "\n");
51 hCopy
= CopyImage(arg
, IMAGE_CURSOR
, 0, 0, LR_COPYFROMRESOURCE
| LR_SHARED
);
52 ok(hCopy
!= NULL
, "\n");
53 ok(DestroyIcon(hCopy
), "\n");
54 /* This one is shared */
55 ok(DestroyIcon(hCopy
), "\n");
57 hCopy
= CopyImage(arg
, IMAGE_CURSOR
, 0, 0, LR_SHARED
);
58 ok(hCopy
!= NULL
, "\n");
59 ok(DestroyIcon(hCopy
), "\n");
60 /* This one is shared */
61 ok(DestroyIcon(hCopy
), "\n");
63 /* Try various usual functions */
64 hdcScreen
= CreateDCW(L
"DISPLAY", NULL
, NULL
, NULL
);
65 ok(hdcScreen
!= NULL
, "\n");
66 hdc
= CreateCompatibleDC(hdcScreen
);
67 ok(hdc
!= NULL
, "\n");
68 hbmp
= CreateCompatibleBitmap(hdcScreen
, 64, 64);
69 ok(hbmp
!= NULL
, "\n");
70 hbmp
= SelectObject(hdc
, hbmp
);
71 ok(hbmp
!= NULL
, "\n");
73 ok(DrawIcon(hdc
, 0, 0, arg
), "\n");
74 hbmp
= SelectObject(hdc
, hbmp
);
79 ok(GetIconInfo(arg
, &ii
), "\n");
80 ok(ii
.hbmMask
!= NULL
, "\n");
81 DeleteObject(ii
.hbmMask
);
82 if(ii
.hbmColor
) DeleteObject(ii
.hbmColor
);
87 /* Start child process */
88 sprintf( path
, "%s LoadImage %lu", test_argv
[0], (ULONG_PTR
)handle
);
89 memset( &si
, 0, sizeof(si
) );
91 CreateProcessA( NULL
, path
, NULL
, NULL
, TRUE
, 0, NULL
, NULL
, &si
, &pi
);
92 WaitForSingleObject (pi
.hProcess
, INFINITE
);