124{
128 UINT32 *dstBuffer, *srcBuffer;
132
141
145
148
151
152
153 srcBuffer[0] = 0xCAFED00D, srcBuffer[1] = 0xFEEDFACE;
154 srcBuffer[16] = 0xFEDCBA98, srcBuffer[17] = 0x76543210;
155
160 0, 0, 2, 2, 0, 0, 2, 2,
expected, __LINE__);
161
165 0, 0, 1, 1, 0, 0, 1, 1,
expected, __LINE__);
166
170 0, 0, 2, 2, 0, 0, 1, 1,
expected, __LINE__);
171
172
176 0, 0, 1, 1, 0, 0, 2, 2,
expected, __LINE__);
177
181 1, 1, -2, -2, 1, 1, -2, -2,
expected, __LINE__);
182
186
188 1, 1, 2, 2, 0, 0, 2, 2,
expected, __LINE__);
189
190
192 srcBuffer[0] = 0x0000ff00, srcBuffer[1] = 0x0000f0f0, srcBuffer[2] = 0x0000cccc, srcBuffer[3] = 0x0000aaaa;
193 srcBuffer[16] = 0xFEDCBA98, srcBuffer[17] = 0x76543210;
194
198 0, 0, 1, 1, 0, 0, 2, 1,
expected, __LINE__);
199
200
204 0, 0, 1, 1, 0, 0, 1, 2,
expected, __LINE__);
205
206
210
212
215
216
218 srcBuffer[0] = 0xCAFED00D, srcBuffer[1] = 0xFEEDFACE;
219 srcBuffer[16] = 0xFEDCBA98, srcBuffer[17] = 0x76543210;
220
224
226
230 0, 0, 2, 2, 0, 0, 2, 2,
expected, __LINE__);
231
234
235
238 srcBuffer[224] = 0xCAFED00D, srcBuffer[225] = 0xFEEDFACE;
239 srcBuffer[240] = 0xFEDCBA98, srcBuffer[241] = 0x76543210;
241
243
247 0, 0, 2, 2, 0, 0, 2, 2,
expected, __LINE__);
248
251
252
256
261 0, 0, 2, 2, 0, 0, 2, 2,
expected, __LINE__);
262
265
270
275 StretchBlt(
hdcSrc, 0, 0, 4, 1,
hdcDst, 0, 0, 4, 1,
SRCCOPY );
276 memset(dstBuffer, 0x55, 4 *
sizeof(*dstBuffer));
277 StretchBlt(
hdcDst, 0, 0, 4, 1,
hdcSrc, 0, 0, 4, 1,
SRCCOPY );
281 "StretchBlt expected { %08X, %08X, %08X, %08X } got { %08X, %08X, %08X, %08X }\n",
283 dstBuffer[0], dstBuffer[1], dstBuffer[2], dstBuffer[3] );
284
288 memset(dstBuffer, 0x55, 4 *
sizeof(*dstBuffer));
289 StretchBlt(
hdcDst, 0, 0, 4, 1,
hdcSrc, 0, 0, 4, 1,
SRCCOPY );
293 "StretchBlt expected { %08X, %08X, %08X, %08X } got { %08X, %08X, %08X, %08X }\n",
295 dstBuffer[0], dstBuffer[1], dstBuffer[2], dstBuffer[3] );
296
299
303 *((
DWORD *)colors + 0) = 0x123456;
304 *((
DWORD *)colors + 1) = 0x335577;
306 srcBuffer[0] = 0x55555555;
307 memset(dstBuffer, 0xcc, 4 *
sizeof(*dstBuffer));
310 StretchBlt(
hdcDst, 0, 0, 4, 1,
hdcSrc, 0, 0, 4, 1,
SRCCOPY );
314 "StretchBlt expected { %08X, %08X, %08X, %08X } got { %08X, %08X, %08X, %08X }\n",
316 dstBuffer[0], dstBuffer[1], dstBuffer[2], dstBuffer[3] );
317
320
327 memset(dstBuffer, 0xcc, 4 *
sizeof(*dstBuffer));
330 StretchBlt(
hdcDst, 0, 0, 4, 1,
hdcSrc, 0, 0, 4, 1,
SRCCOPY );
334 "StretchBlt expected { %08X, %08X, %08X, %08X } got { %08X, %08X, %08X, %08X }\n",
336 dstBuffer[0], dstBuffer[1], dstBuffer[2], dstBuffer[3] );
337
340
345
347
354
356
361
362 srcBuffer[0] = 0x000000FF;
363 srcBuffer[1] = 0x0000FF00;
364 srcBuffer[2] = 0x00FF0000;
365 srcBuffer[3] = 0xFF000000;
366
371
373 0, 0, 2, 2, 0, 0, 2, 2,
expected, __LINE__);
374
379
381 0, 0, 2, 2, 0, 1, 2, -2,
expected, __LINE__);
382
387
389 0, 0, 2, 2, 1, 0, -2, 2,
expected, __LINE__);
390
395
397 0, 0, 2, 2, 1, 1, -2, -2,
expected, __LINE__);
398
403
405 0, 1, 2, -2, 0, 0, 2, 2,
expected, __LINE__);
406
411
413 0, 2, 2, -2, 0, 2, 2, -2,
expected, __LINE__);
414
419
421 0, 1, 2, -2, 1, 0, -2, 2,
expected, __LINE__);
422
427
429 0, 1, 2, -2, 1, 1, -2, -2,
expected, __LINE__);
430
435
437 1, 0, -2, 2, 0, 0, 2, 2,
expected, __LINE__);
438
443
445 1, 0, -2, 2, 0, 1, 2, -2,
expected, __LINE__);
446
451
453 2, 0, -2, 2, 2, 0, -2, 2,
expected, __LINE__);
454
459
461 1, 0, -2, 2, 1, 1, -2, -2,
expected, __LINE__);
462
467
469 1, 1, -2, -2, 0, 0, 2, 2,
expected, __LINE__);
470
475
477 1, 1, -2, -2, 0, 1, 2, -2,
expected, __LINE__);
478
483
485 1, 1, -2, -2, 1, 0, -2, 2,
expected, __LINE__);
486
491
493 2, 2, -2, -2, 2, 2, -2, -2,
expected, __LINE__);
494
496
500
502}
static void check_StretchBlt_stretch(HDC hdcDst, HDC hdcSrc, BITMAPINFO *dst_info, UINT32 *dstBuffer, UINT32 *srcBuffer, int nXOriginDest, int nYOriginDest, int nWidthDest, int nHeightDest, int nXOriginSrc, int nYOriginSrc, int nWidthSrc, int nHeightSrc, UINT32 *expected, int line)
FORCEINLINE VOID SetPixel(_In_ ULONG Left, _In_ ULONG Top, _In_ UCHAR Color)
#define memcpy(s1, s2, n)
BITMAPINFOHEADER bmiHeader
HBITMAP WINAPI CreateDIBSection(HDC hDC, CONST BITMAPINFO *BitmapInfo, UINT Usage, VOID **Bits, HANDLE hSection, DWORD dwOffset)
int WINAPI SetMapMode(_In_ HDC, _In_ int)
HBITMAP WINAPI CreateBitmap(_In_ INT cx, _In_ INT cy, _In_ UINT cPlanes, _In_ UINT cBitsPerPel, _In_opt_ const VOID *pvBits)
COLORREF WINAPI SetBkColor(_In_ HDC, _In_ COLORREF)
BOOL WINAPI SetViewportExtEx(_In_ HDC, _In_ int, _In_ int, _Out_opt_ LPSIZE)
HGDIOBJ WINAPI SelectObject(_In_ HDC, _In_ HGDIOBJ)
HDC WINAPI CreateCompatibleDC(_In_opt_ HDC hdc)
BOOL WINAPI SetWindowExtEx(_In_ HDC, _In_ int, _In_ int, _Out_opt_ LPSIZE)
UINT WINAPI SetDIBColorTable(_In_ HDC hdc, _In_ UINT iStart, _In_ UINT cEntries, _In_reads_(cEntries) const RGBQUAD *prgbq)
COLORREF WINAPI SetTextColor(_In_ HDC, _In_ COLORREF)
BOOL WINAPI DeleteDC(_In_ HDC)