19 } bmiData = {{
sizeof(
BITMAPINFOHEADER), 8, 1, 1, 1,
BI_RGB, 0, 10, 10, 2,0}, {0, 0xFFFFFF}};
22 PUCHAR pjBitsDst, pjBitsSrc, pjBitsMsk;
43 ret =
MaskBlt(
hdcDst, 0, 0, 8, 1,
hdcSrc, 0, 0, hbmMsk, 0, 0,
MAKEROP4(
SRCCOPY, 0xAA0000));
45 ok(
ret == 1,
"MaskBlt failed (%d)\n",
ret);
46 ok(pjBitsDst[0] == 0xCA,
"pjBitsDst[0] == 0x%x\n", pjBitsDst[0]);
52 ret =
MaskBlt(
hdcDst, 0, 0, 8, 1,
hdcSrc, 0, 0, hbmMsk, 0, 0,
MAKEROP4(
SRCCOPY, 0xAA0000));
54 ok(
ret == 1,
"MaskBlt failed (%d)\n",
ret);
55 ok(pjBitsDst[0] == 0xF0,
"pjBitsDst[0] == 0x%x\n", pjBitsDst[0]);
63 ret =
MaskBlt(
hdcDst, 0, 0, 8, 1,
hdcSrc, 0, 0, hbmMsk, 0, 0,
MAKEROP4(
NOTSRCERASE,
SRCINVERT));
65 ok(
ret == 1,
"MaskBlt failed (%d)\n",
ret);
66 ok(pjBitsDst[0] == 0x16,
"pjBitsDst[0] == 0x%x\n", pjBitsDst[0]);
73 ret =
MaskBlt(
hdcDst, 0, 0, 8, 1,
hdcSrc, 0, 0, hbmMsk, 0, 0,
MAKEROP4(
MERGEPAINT, 0x990000));
75 ok(
ret == 1,
"MaskBlt failed (%d)\n",
ret);
76 ok(pjBitsDst[0] == 0xE3,
"pjBitsDst[0] == 0x%x\n", pjBitsDst[0]);
80 ret =
MaskBlt(
hdcDst, 0, 0, 8, 1,
hdcSrc, 0, 0,
NULL, 0, 0,
MAKEROP4(
SRCCOPY, 0xAA0000));
82 ok(
ret == 1,
"MaskBlt failed (%d)\n",
ret);
83 ok(pjBitsDst[0] == 0xCC,
"pjBitsDst[0] == 0x%x\n", pjBitsDst[0]);
87 ret =
MaskBlt(
hdcDst, 0, 0, 8, 1,
hdcSrc, 0, 0, (
HBITMAP)0x123456, 0, 0,
MAKEROP4(
SRCCOPY, 0xAA0000));
89 ok(
ret == 0,
"MaskBlt should fail, but succeeded (%d)\n",
ret);
94 ret =
MaskBlt(
hdcDst, 0, 0, 8, 1,
hdcSrc, 0, 0,
ghbmp24, 0, 0,
MAKEROP4(
SRCCOPY, 0xAA0000));
96 ok(
ret == 0,
"MaskBlt should fail, but succeeded (%d)\n",
ret);
100 ret =
MaskBlt(
hdcDst, 0, 0, 8, 1,
hdcSrc, 0, 0, (
HBITMAP)0x123456, 0, 0,
MAKEROP4(
SRCCOPY,
SRCCOPY));
102 ok(
ret == 1,
"MaskBlt failed (%d)\n",
ret);
106 ret =
MaskBlt(
hdcDst, 0, 0, 8, 1,
NULL, 0, 0,
NULL, 0, 0,
MAKEROP4(
PATCOPY, 0xAA0000));
108 ok(
ret == 0,
"MaskBlt should fail, but succeeded (%d)\n",
ret);
121 ret =
MaskBlt(
hdcDst, 0, 0, 5, 1,
hdcSrc, 0, 0, hbmMsk, 0, 0,
MAKEROP4(
SRCCOPY, 0xAA0000));
123 ok(
ret == 0,
"MaskBlt should fail, but succeeded (%d)\n",
ret);
126 ret =
MaskBlt(
hdcDst, 0, 0, 4, 1,
hdcSrc, 0, 0, hbmMsk, 1, 0,
MAKEROP4(
SRCCOPY, 0xAA0000));
128 ok(
ret == 0,
"MaskBlt should fail, but succeeded (%d)\n",
ret);
131 ret =
MaskBlt(
hdcDst, 0, 0, 4, 1,
hdcSrc, 0, 0, hbmMsk, 0, 1,
MAKEROP4(
SRCCOPY, 0xAA0000));
133 ok(
ret == 0,
"MaskBlt should fail, but succeeded (%d)\n",
ret);
136 ret =
MaskBlt(
hdcDst, 0, 0, 4, 1,
hdcSrc, 0, 0, hbmMsk, 0, 0,
MAKEROP4(
SRCCOPY, 0xAA0000));
138 ok(
ret == 1,
"MaskBlt failed (%d)\n",
ret);
139 ok(pjBitsDst[0] == 0x8A,
"pjBitsDst[0] == 0x%x\n", pjBitsDst[0]);
145 BITMAPINFO bmi1 = {{
sizeof(
BITMAPINFOHEADER), 8, 1, 1, 1,
BI_RGB, 0, 10, 10, 0,0}};
146 BITMAPINFO bmi32 = {{
sizeof(
BITMAPINFOHEADER), 8, 1, 1, 16,
BI_RGB, 0, 10, 10, 0,0}};
147 HBITMAP hbmDst, hbmSrc, hbmMsk;
149 PUSHORT pusBitsDst, pusBitsSrc;
165 ok(hbmMsk != 0,
"CreateDIBSection failed\n");
168 pusBitsDst[0] = 0x1234;
169 pusBitsDst[1] = 0x5678;
170 pusBitsSrc[0] = 0x4321;
171 pusBitsSrc[1] = 0x8765;
174 ret =
MaskBlt(
hdcDst, 0, 0, 8, 1,
hdcSrc, 0, 0, hbmMsk, 0, 0,
MAKEROP4(
SRCCOPY, 0xAA0000));
176 ok(
ret == 1,
"MaskBlt failed (%d)\n",
ret);
177 ok (pusBitsDst[0] == 0x4321,
"pusBitsDst[0] == 0x%x\n", pusBitsDst[0]);
178 ok (pusBitsDst[1] == 0x5678,
"pusBitsDst[0] == 0x%x\n", pusBitsDst[1]);
180 pusBitsDst[0] = 0x1234;
181 pusBitsDst[1] = 0x5678;
183 ret =
MaskBlt(
hdcDst, 0, 0, 8, 1,
hdcSrc, 0, 0, hbmMsk, 0, 0,
MAKEROP4(
SRCPAINT,
MERGEPAINT));
185 ok(
ret == 1,
"MaskBlt failed (%d)\n",
ret);
186 ok (pusBitsDst[0] == 0x5335,
"pusBitsDst[0] == 0x%x\n", pusBitsDst[0]);
187 ok (pusBitsDst[1] == 0x7efa,
"pusBitsDst[0] == 0x%x\n", pusBitsDst[1]);
193 BITMAPINFO bmi1 = {{
sizeof(
BITMAPINFOHEADER), 8, 1, 1, 1,
BI_RGB, 0, 10, 10, 0,0}};
194 BITMAPINFO bmi32 = {{
sizeof(
BITMAPINFOHEADER), 8, 1, 1, 32,
BI_RGB, 0, 10, 10, 0,0}};
195 HBITMAP hbmDst, hbmSrc, hbmMsk;
197 PULONG pulBitsDst, pulBitsSrc;
213 ok(hbmMsk != 0,
"CreateDIBSection failed\n");
216 pulBitsDst[0] = 0x12345678;
217 pulBitsDst[1] = 0x9abcdef0;
218 pulBitsSrc[0] = 0x87684321;
219 pulBitsSrc[1] = 0x0fedcba9;
222 ret =
MaskBlt(
hdcDst, 0, 0, 8, 1,
hdcSrc, 0, 0, hbmMsk, 0, 0,
MAKEROP4(
SRCCOPY, 0xAA0000));
224 ok(
ret == 1,
"MaskBlt failed (%d)\n",
ret);
225 ok (pulBitsDst[0] == 0x87684321,
"pulBitsDst[0] == 0x%lx\n", pulBitsDst[0]);
226 ok (pulBitsDst[1] == 0x9abcdef0,
"pulBitsDst[0] == 0x%lx\n", pulBitsDst[1]);
228 pulBitsDst[0] = 0x12345678;
229 pulBitsDst[1] = 0x9abcdef0;
231 ret =
MaskBlt(
hdcDst, 0, 0, 8, 1,
hdcSrc, 0, 0, hbmMsk, 0, 0,
MAKEROP4(
SRCPAINT,
MERGEPAINT));
233 ok(
ret == 1,
"MaskBlt failed (%d)\n",
ret);
234 ok (pulBitsDst[0] == 0x977c5779,
"pulBitsDst[0] == 0x%lx\n", pulBitsDst[0]);
235 ok (pulBitsDst[1] == 0xfabefef6,
"pulBitsDst[0] == 0x%lx\n", pulBitsDst[1]);
245 } bmiData = {{
sizeof(
BITMAPINFOHEADER), 16, 16, 1, 1,
BI_RGB, 0, 10, 10, 2,0}, {0, 0xFFFFFF}};
247 HBITMAP hbmDst, hbmSrc, hbmMsk;
248 PULONG pulBitsDst, pulBitsSrc, pulBitsMsk;
263 ok(hbr != 0,
"failed to create brush\n");
267 pulBitsDst[0] = 0x00000000;
268 pulBitsSrc[0] = 0xFFFFFFFF;
270 ret =
MaskBlt(
hdcDst, 0, 0, 8, 1,
hdcSrc, 0, 0,
NULL, 0, 0,
MAKEROP4(
SRCCOPY, 0xAA0000));
272 ok(
ret == 1,
"MaskBlt failed (%d)\n",
ret);
273 ok(pulBitsDst[0] == 0,
"pulBitsDst[0] == 0x%lx\n", pulBitsDst[0]);
278 ok(hbmMsk != 0,
"CreateDIBSection failed\n");
280 ok(hbr != 0,
"CreatePatternBrush failed\n");
284 pulBitsDst[0] = 0x00000000;
285 pulBitsSrc[0] = 0xFFFFFFFF;
286 pulBitsMsk[0] = 0xCCAAFF00;
288 ret =
MaskBlt(
hdcDst, 0, 0, 16, 1,
hdcSrc, 0, 0,
NULL, 0, 0,
MAKEROP4(
SRCCOPY, 0xAA0000));
290 ok(
ret == 1,
"MaskBlt failed (%d)\n",
ret);
291 ok(pulBitsDst[0] == 0,
"pulBitsDst[0] == 0x%lx\n", pulBitsDst[0]);
#define ERROR_INVALID_PARAMETER
#define ERROR_INVALID_HANDLE
void Test_MaskBlt_32bpp()
void Test_MaskBlt_16bpp()
void Test_MaskBlt_Brush()
_In_ HBITMAP _In_ UINT _In_ UINT _Inout_ LPBITMAPINFO pbmi
BITMAPINFOHEADER bmiHeader
HBITMAP WINAPI CreateDIBSection(HDC hDC, CONST BITMAPINFO *BitmapInfo, UINT Usage, VOID **Bits, HANDLE hSection, DWORD dwOffset)
HBRUSH WINAPI CreateHatchBrush(_In_ int, _In_ COLORREF)
HGDIOBJ WINAPI SelectObject(_In_ HDC, _In_ HGDIOBJ)
BOOL WINAPI MaskBlt(_In_ HDC, _In_ int, _In_ int, _In_ int, _In_ int, _In_ HDC, _In_ int, _In_ int, _In_ HBITMAP, _In_ int, _In_ int, _In_ DWORD)
HDC WINAPI CreateCompatibleDC(_In_opt_ HDC hdc)
struct tagBITMAPINFO * PBITMAPINFO
HBRUSH WINAPI CreatePatternBrush(_In_ HBITMAP)