19 HBITMAP hbmp1, hOldBmp1, hbmp2, hOldBmp2;
20 DWORD bytes1[4] = {0x00ff0000, 0x0000ff00, 0x000000ff, 0x00ffffff};
21 DWORD bytes2[4] = {0x00000000, 0x0000000, 0x0000000, 0x00000000};
25 bRet =
NtGdiBitBlt((
HDC)0, 0, 0, 10, 10, (
HDC)0, 10, 10,
SRCCOPY, 0, 0);
31 bRet =
NtGdiBitBlt((
HDC)0x123456, 0, 0, 10, 10, (
HDC)0x123456, 10, 10,
SRCCOPY, 0, 0);
51 ok(hbmp1 !=
NULL,
"hbmp1 was NULL.\n");
52 memcpy(pvDibBits, bytes1,
sizeof(bytes1));
61 ok(hbmp2 !=
NULL,
"hbmp2 was NULL.\n");
62 memcpy(pvDibBits, bytes2,
sizeof(bytes1));
65 bRet =
NtGdiBitBlt(
hdc2, 1, 1, -2, -2,
hdc1, 0, 0,
SRCCOPY, 0, 0);
72 bRet =
NtGdiBitBlt(
hdc2, 1, 1, -2, -2,
hdc1, 1, 1,
SRCCOPY, 0, 0);
81 bRet =
NtGdiBitBlt(
hdc2, 1, 1, -2, -2,
hdc1, 0, 0,
SRCCOPY, 0, 0);
88 bRet =
NtGdiBitBlt(
hdc2, 1, 1, -2, -2,
hdc1, 2, 2,
SRCCOPY, 0, 0);
97 bRet =
NtGdiBitBlt(
hdc2, 2, 2, -2, -2,
hdc1, 2, 2,
SRCCOPY, 0, 0);
109 bRet =
NtGdiBitBlt(
hdc2, 0, 0, 2, 2,
hdc1, 0, 0,
SRCCOPY, 0, 0);
122 ok_eq_bool(
NtGdiBitBlt(
ghdcDDB32, 0, 0, 1, 1,
ghdcDDB1, 0, 0,
SRCCOPY, 0xF0F0F0, 0),
TRUE);
125 ok_eq_bool(
NtGdiBitBlt(
ghdcDDB32, 0, 0, 1, 1,
ghdcDDB1, 0, 0,
SRCCOPY, 0xF0F0F0, 0),
TRUE);
134 ok_eq_bool(
NtGdiBitBlt(
ghdcDDB1, 0, 0, 1, 1,
ghdcDIB1, 0, 0,
SRCCOPY, 0x000000, 0),
TRUE);
136 ok_eq_bool(
NtGdiBitBlt(
ghdcDDB1, 0, 0, 1, 1,
ghdcDIB1, 0, 0,
SRCCOPY, 0xFFFFFF, 0),
TRUE);
138 ok_eq_bool(
NtGdiBitBlt(
ghdcDDB1, 0, 0, 1, 1,
ghdcDIB1, 0, 0,
SRCCOPY,
CLR_INVALID, 0),
TRUE);
141 ok_eq_bool(
NtGdiBitBlt(
ghdcDDB1, 0, 0, 1, 1,
ghdcDIB1, 0, 0,
SRCCOPY, 0x000000, 0),
TRUE);
143 ok_eq_bool(
NtGdiBitBlt(
ghdcDDB1, 0, 0, 1, 1,
ghdcDIB1, 0, 0,
SRCCOPY, 0xFFFFFF, 0),
TRUE);
145 ok_eq_bool(
NtGdiBitBlt(
ghdcDDB1, 0, 0, 1, 1,
ghdcDIB1, 0, 0,
SRCCOPY,
CLR_INVALID, 0),
TRUE);
151 ok_eq_bool(
NtGdiBitBlt(
ghdcDDB1, 0, 0, 1, 1,
ghdcDIB1, 0, 0,
SRCCOPY, 0x000000, 0),
TRUE);
153 ok_eq_bool(
NtGdiBitBlt(
ghdcDDB1, 0, 0, 1, 1,
ghdcDIB1, 0, 0,
SRCCOPY, 0xFFFFFF, 0),
TRUE);
155 ok_eq_bool(
NtGdiBitBlt(
ghdcDDB1, 0, 0, 1, 1,
ghdcDIB1, 0, 0,
SRCCOPY,
CLR_INVALID, 0),
TRUE);
158 ok_eq_bool(
NtGdiBitBlt(
ghdcDDB1, 0, 0, 1, 1,
ghdcDIB1, 0, 0,
SRCCOPY, 0x000000, 0),
TRUE);
160 ok_eq_bool(
NtGdiBitBlt(
ghdcDDB1, 0, 0, 1, 1,
ghdcDIB1, 0, 0,
SRCCOPY, 0xFFFFFF, 0),
TRUE);
162 ok_eq_bool(
NtGdiBitBlt(
ghdcDDB1, 0, 0, 1, 1,
ghdcDIB1, 0, 0,
SRCCOPY,
CLR_INVALID, 0),
TRUE);
192 NtGdiBitBlt(
hdcDst, 1, 0, 1, 1,
hdcSrc, 0, 0,
SRCCOPY,
gbUseCLR_INVALID ?
CLR_INVALID : crSrcBack, 0);
367 printf(
"Testing 1BPP with CLR_INVALID...\n");
370 printf(
"Testing 1BPP without CLR_INVALID...\n");
void Test_NtGdiBitBlt_1BPP(void)
static BOOL gbUseCLR_INVALID
static void Test_NtGdiBitBlt_generic(void)
static COLORREF Do_BitBlt(COLORREF crColor, HDC hdcSrc, COLORREF crSrcBack, COLORREF crSrcText, HDC hdcDst, COLORREF crDstBack, COLORREF crDstText)
#define ok_eq_hex(value, expected)
#define ok_eq_bool(value, expected)
#define ok_long(expression, result)
#define ok_int(expression, result)
#define memcpy(s1, s2, n)
__kernel_entry W32KAPI DWORD APIENTRY NtGdiGetPixel(_In_ HDC hdc, _In_ INT x, _In_ INT y)
__kernel_entry W32KAPI HDC APIENTRY NtGdiCreateCompatibleDC(_In_opt_ HDC hdc)
__kernel_entry W32KAPI BOOL APIENTRY NtGdiBitBlt(_In_ HDC hdcDst, _In_ INT x, _In_ INT y, _In_ INT cx, _In_ INT cy, _In_opt_ HDC hdcSrc, _In_ INT xSrc, _In_ INT ySrc, _In_ DWORD rop4, _In_ DWORD crBackColor, _In_ FLONG fl)
__kernel_entry W32KAPI COLORREF APIENTRY NtGdiSetPixel(_In_ HDC hdcDst, _In_ INT x, _In_ INT y, _In_ COLORREF crColor)
BITMAPINFOHEADER bmiHeader
HBITMAP WINAPI CreateDIBSection(HDC hDC, CONST BITMAPINFO *BitmapInfo, UINT Usage, VOID **Bits, HANDLE hSection, DWORD dwOffset)
DWORD WINAPI GetLastError(void)
COLORREF WINAPI SetBkColor(_In_ HDC, _In_ COLORREF)
HGDIOBJ WINAPI SelectObject(_In_ HDC, _In_ HGDIOBJ)
HDC WINAPI CreateCompatibleDC(_In_opt_ HDC hdc)
COLORREF WINAPI SetTextColor(_In_ HDC, _In_ COLORREF)
BOOL WINAPI DeleteDC(_In_ HDC)