[WIN32KNT_APITEST] Improve NtGdiSetBitmapBits testcase more and more (#1307)

CORE-15657
This commit is contained in:
Katayama Hirofumi MZ 2019-01-26 20:28:40 +09:00 committed by GitHub
parent 82c7571e43
commit f9037bd33f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -9,63 +9,91 @@
START_TEST(NtGdiSetBitmapBits) START_TEST(NtGdiSetBitmapBits)
{ {
BYTE Bits[50] = {0,1,2,3,4,5,6,7,8,9}; BYTE Bits[100] = {0,1,2,3,4,5,6,7,8,9};
HBITMAP hBitmap; HBITMAP hBitmap;
HDC hDC; HDC hDC;
BITMAPINFO bmi; BITMAPINFO bmi;
LPVOID pvBits; LPVOID pvBits;
SetLastError(ERROR_SUCCESS); SetLastError(0xDEADFACE);
ok_long(NtGdiSetBitmapBits(0, 0, 0), 0); ok_long(NtGdiSetBitmapBits(0, 0, 0), 0);
ok_long(GetLastError(), ERROR_SUCCESS); ok_long(GetLastError(), 0xDEADFACE);
/* Test NULL bitnap handle */ /* Test NULL bitnap handle */
SetLastError(ERROR_SUCCESS); SetLastError(0xDEADFACE);
ok_long(NtGdiSetBitmapBits(0, 5, Bits), 0); ok_long(NtGdiSetBitmapBits(0, 5, Bits), 0);
ok_long(GetLastError(), ERROR_INVALID_HANDLE); ok_long(GetLastError(), ERROR_INVALID_HANDLE);
/* Test invalid bitmap handle */ /* Test invalid bitmap handle */
hBitmap = (HBITMAP)CreatePen(PS_SOLID, 1, RGB(1,2,3)); hBitmap = (HBITMAP)CreatePen(PS_SOLID, 1, RGB(1,2,3));
SetLastError(ERROR_SUCCESS); SetLastError(0xDEADFACE);
ok_long(NtGdiSetBitmapBits(hBitmap, 5, Bits), 0); ok_long(NtGdiSetBitmapBits(hBitmap, 5, Bits), 0);
ok_long(GetLastError(), ERROR_INVALID_HANDLE); ok_long(GetLastError(), ERROR_INVALID_HANDLE);
DeleteObject(hBitmap); DeleteObject(hBitmap);
hBitmap = CreateBitmap(3, 3, 1, 8, NULL); hBitmap = CreateBitmap(3, 3, 1, 8, NULL);
SetLastError(ERROR_SUCCESS); ok(hBitmap != NULL, "hBitmap was NULL.\n");
/* test NULL pointer and count buffer size != 0 */ /* test NULL pointer and count buffer size != 0 */
SetLastError(0xDEADFACE);
ok_long(NtGdiSetBitmapBits(hBitmap, 5, NULL), 0); ok_long(NtGdiSetBitmapBits(hBitmap, 5, NULL), 0);
ok_long(GetLastError(), 0xDEADFACE);
/* test NULL pointer and buffer size == 0*/ /* test NULL pointer and buffer size == 0*/
SetLastError(0xDEADFACE);
ok_long(NtGdiSetBitmapBits(hBitmap, 0, NULL), 0); ok_long(NtGdiSetBitmapBits(hBitmap, 0, NULL), 0);
ok_long(GetLastError(), 0xDEADFACE);
/* test bad pointer */ /* test bad pointer */
SetLastError(0xDEADFACE);
ok_long(NtGdiSetBitmapBits(hBitmap, 5, (PBYTE)0x500), 0); ok_long(NtGdiSetBitmapBits(hBitmap, 5, (PBYTE)0x500), 0);
ok_long(GetLastError(), 0xDEADFACE);
/* Test if we can set a number of bytes between lines */ /* Test if we can set a number of bytes between lines */
SetLastError(0xDEADFACE);
ok_long(NtGdiSetBitmapBits(hBitmap, 5, Bits), 5); ok_long(NtGdiSetBitmapBits(hBitmap, 5, Bits), 5);
ok_long(GetLastError(), 0xDEADFACE);
/* Test alignment */ /* Test alignment */
SetLastError(0xDEADFACE);
ok_long(NtGdiSetBitmapBits(hBitmap, 4, Bits+1), 4); ok_long(NtGdiSetBitmapBits(hBitmap, 4, Bits+1), 4);
ok_long(GetLastError(), 0xDEADFACE);
/* Test 1 byte too much */ /* Test 1 byte too much */
SetLastError(0xDEADFACE);
ok_long(NtGdiSetBitmapBits(hBitmap, 10, Bits), 10); ok_long(NtGdiSetBitmapBits(hBitmap, 10, Bits), 10);
ok_long(GetLastError(), 0xDEADFACE);
/* Test one row too much */ /* Test one row too much */
SetLastError(0xDEADFACE);
ok_long(NtGdiSetBitmapBits(hBitmap, 12, Bits), 12); ok_long(NtGdiSetBitmapBits(hBitmap, 12, Bits), 12);
ok_long(GetLastError(), 0xDEADFACE);
SetLastError(0xDEADFACE);
ok_long(NtGdiSetBitmapBits(hBitmap, 13, Bits), 12); ok_long(NtGdiSetBitmapBits(hBitmap, 13, Bits), 12);
ok_long(GetLastError(), 0xDEADFACE);
SetLastError(0xDEADFACE);
ok_long(NtGdiSetBitmapBits(hBitmap, 100, Bits), 12); ok_long(NtGdiSetBitmapBits(hBitmap, 100, Bits), 12);
ok_long(GetLastError(), 0xDEADFACE);
/* Test huge bytes count */ /* Test huge bytes count */
SetLastError(0xDEADFACE);
ok_long(NtGdiSetBitmapBits(hBitmap, 12345678, Bits), 0); ok_long(NtGdiSetBitmapBits(hBitmap, 12345678, Bits), 0);
ok_long(GetLastError(), 0xDEADFACE);
SetLastError(0xDEADFACE);
ok_long(NtGdiSetBitmapBits(hBitmap, 0xFFFF, Bits), 0);
ok_long(GetLastError(), 0xDEADFACE);
SetLastError(0xDEADFACE);
ok_long(NtGdiSetBitmapBits(hBitmap, 0x10000, Bits), 0);
ok_long(GetLastError(), 0xDEADFACE);
/* Test negative bytes count */ /* Test negative bytes count */
SetLastError(0xDEADFACE);
ok_long(NtGdiSetBitmapBits(hBitmap, -5, Bits), 0); ok_long(NtGdiSetBitmapBits(hBitmap, -5, Bits), 0);
ok_long(GetLastError(), 0xDEADFACE);
ok_long(GetLastError(), ERROR_SUCCESS);
DeleteObject(hBitmap); DeleteObject(hBitmap);
@ -75,56 +103,83 @@ START_TEST(NtGdiSetBitmapBits)
ok(hBitmap != NULL, "hBitmap was NULL.\n"); ok(hBitmap != NULL, "hBitmap was NULL.\n");
FillMemory(Bits, sizeof(Bits), 0x55); FillMemory(Bits, sizeof(Bits), 0x55);
SetLastError(0xDEADFACE);
ok_long(NtGdiGetBitmapBits(hBitmap, 0, Bits), 0); ok_long(NtGdiGetBitmapBits(hBitmap, 0, Bits), 0);
ok_long(GetLastError(), 0xDEADFACE);
ok_int(Bits[0], 0x55); ok_int(Bits[0], 0x55);
FillMemory(Bits, sizeof(Bits), 0x55); FillMemory(Bits, sizeof(Bits), 0x55);
SetLastError(0xDEADFACE);
ok_long(NtGdiGetBitmapBits(hBitmap, 1, Bits), 1); ok_long(NtGdiGetBitmapBits(hBitmap, 1, Bits), 1);
ok_long(GetLastError(), 0xDEADFACE);
ok_int(Bits[0], 0); ok_int(Bits[0], 0);
ok_int(Bits[1], 0x55); ok_int(Bits[1], 0x55);
FillMemory(Bits, sizeof(Bits), 0x55); FillMemory(Bits, sizeof(Bits), 0x55);
SetLastError(0xDEADFACE);
ok_long(NtGdiGetBitmapBits(hBitmap, 2, Bits), 2); ok_long(NtGdiGetBitmapBits(hBitmap, 2, Bits), 2);
ok_long(GetLastError(), 0xDEADFACE);
ok_int(Bits[0], 0); ok_int(Bits[0], 0);
ok_int(Bits[1], 0); ok_int(Bits[1], 0);
ok_int(Bits[2], 0x55); ok_int(Bits[2], 0x55);
FillMemory(Bits, sizeof(Bits), 0x33); FillMemory(Bits, sizeof(Bits), 0x33);
SetLastError(0xDEADFACE);
ok_long(NtGdiSetBitmapBits(hBitmap, 10, Bits), 10); ok_long(NtGdiSetBitmapBits(hBitmap, 10, Bits), 10);
ok_long(GetLastError(), 0xDEADFACE);
FillMemory(Bits, sizeof(Bits), 0xAA); FillMemory(Bits, sizeof(Bits), 0xAA);
SetLastError(0xDEADFACE);
ok_long(NtGdiSetBitmapBits(hBitmap, 1, Bits), 1); ok_long(NtGdiSetBitmapBits(hBitmap, 1, Bits), 1);
ok_long(GetLastError(), 0xDEADFACE);
FillMemory(Bits, sizeof(Bits), 0x55); FillMemory(Bits, sizeof(Bits), 0x55);
SetLastError(0xDEADFACE);
ok_long(NtGdiGetBitmapBits(hBitmap, 1, Bits), 1); ok_long(NtGdiGetBitmapBits(hBitmap, 1, Bits), 1);
ok_long(GetLastError(), 0xDEADFACE);
ok_int(Bits[0], 0xAA); ok_int(Bits[0], 0xAA);
ok_int(Bits[1], 0x55); ok_int(Bits[1], 0x55);
SetLastError(0xDEADFACE);
ok_long(NtGdiGetBitmapBits(hBitmap, 2, Bits), 2); ok_long(NtGdiGetBitmapBits(hBitmap, 2, Bits), 2);
ok_long(GetLastError(), 0xDEADFACE);
ok_int(Bits[0], 0xAA); ok_int(Bits[0], 0xAA);
ok_int(Bits[1], 0x33); ok_int(Bits[1], 0x33);
ok_int(Bits[2], 0x55); ok_int(Bits[2], 0x55);
FillMemory(Bits, sizeof(Bits), 0xAA); FillMemory(Bits, sizeof(Bits), 0xAA);
SetLastError(0xDEADFACE);
ok_long(NtGdiSetBitmapBits(hBitmap, 2, Bits), 2); ok_long(NtGdiSetBitmapBits(hBitmap, 2, Bits), 2);
ok_long(GetLastError(), 0xDEADFACE);
FillMemory(Bits, sizeof(Bits), 0x55); FillMemory(Bits, sizeof(Bits), 0x55);
SetLastError(0xDEADFACE);
ok_long(NtGdiGetBitmapBits(hBitmap, 2, Bits), 2); ok_long(NtGdiGetBitmapBits(hBitmap, 2, Bits), 2);
ok_long(GetLastError(), 0xDEADFACE);
ok_int(Bits[0], 0xAA); ok_int(Bits[0], 0xAA);
ok_int(Bits[1], 0xAA); ok_int(Bits[1], 0xAA);
ok_int(Bits[2], 0x55); ok_int(Bits[2], 0x55);
SetLastError(0xDEADFACE);
ok_long(NtGdiGetBitmapBits(hBitmap, 3, Bits), 3); ok_long(NtGdiGetBitmapBits(hBitmap, 3, Bits), 3);
ok_long(GetLastError(), 0xDEADFACE);
ok_int(Bits[0], 0xAA); ok_int(Bits[0], 0xAA);
ok_int(Bits[1], 0xAA); ok_int(Bits[1], 0xAA);
ok_int(Bits[2], 0x33); ok_int(Bits[2], 0x33);
ok_int(Bits[3], 0x55); ok_int(Bits[3], 0x55);
FillMemory(Bits, sizeof(Bits), 0xAA); FillMemory(Bits, sizeof(Bits), 0xAA);
SetLastError(0xDEADFACE);
ok_long(NtGdiSetBitmapBits(hBitmap, 3, Bits), 3); ok_long(NtGdiSetBitmapBits(hBitmap, 3, Bits), 3);
ok_long(GetLastError(), 0xDEADFACE);
FillMemory(Bits, sizeof(Bits), 0x55); FillMemory(Bits, sizeof(Bits), 0x55);
SetLastError(0xDEADFACE);
ok_long(NtGdiGetBitmapBits(hBitmap, 3, Bits), 3); ok_long(NtGdiGetBitmapBits(hBitmap, 3, Bits), 3);
ok_long(GetLastError(), 0xDEADFACE);
ok_int(Bits[0], 0xAA); ok_int(Bits[0], 0xAA);
ok_int(Bits[1], 0xAA); ok_int(Bits[1], 0xAA);
ok_int(Bits[2], 0xAA); ok_int(Bits[2], 0xAA);
ok_int(Bits[3], 0x55); ok_int(Bits[3], 0x55);
SetLastError(0xDEADFACE);
ok_long(NtGdiGetBitmapBits(hBitmap, 4, Bits), 4); ok_long(NtGdiGetBitmapBits(hBitmap, 4, Bits), 4);
ok_long(GetLastError(), 0xDEADFACE);
ok_int(Bits[0], 0xAA); ok_int(Bits[0], 0xAA);
ok_int(Bits[1], 0xAA); ok_int(Bits[1], 0xAA);
ok_int(Bits[2], 0xAA); ok_int(Bits[2], 0xAA);
@ -140,63 +195,188 @@ START_TEST(NtGdiSetBitmapBits)
ZeroMemory(&bmi, sizeof(bmi)); ZeroMemory(&bmi, sizeof(bmi));
bmi.bmiHeader.biSize = sizeof(BITMAPINFOHEADER); bmi.bmiHeader.biSize = sizeof(BITMAPINFOHEADER);
bmi.bmiHeader.biWidth = 15; bmi.bmiHeader.biWidth = 15;
bmi.bmiHeader.biHeight = 15; bmi.bmiHeader.biHeight = 15; /* positive */
bmi.bmiHeader.biPlanes = 1; bmi.bmiHeader.biPlanes = 1;
bmi.bmiHeader.biBitCount = 24; bmi.bmiHeader.biBitCount = 24;
hBitmap = CreateDIBSection(hDC, &bmi, DIB_RGB_COLORS, &pvBits, NULL, 0); hBitmap = CreateDIBSection(hDC, &bmi, DIB_RGB_COLORS, &pvBits, NULL, 0);
ok(hBitmap != NULL, "hBitmap was NULL.\n"); ok(hBitmap != NULL, "hBitmap was NULL.\n");
FillMemory(Bits, sizeof(Bits), 0x55); FillMemory(Bits, sizeof(Bits), 0x55);
SetLastError(0xDEADFACE);
ok_long(NtGdiGetBitmapBits(hBitmap, 0, Bits), 0); ok_long(NtGdiGetBitmapBits(hBitmap, 0, Bits), 0);
ok_long(GetLastError(), 0xDEADFACE);
ok_int(Bits[0], 0x55); ok_int(Bits[0], 0x55);
FillMemory(Bits, sizeof(Bits), 0x55); FillMemory(Bits, sizeof(Bits), 0x55);
SetLastError(0xDEADFACE);
ok_long(NtGdiGetBitmapBits(hBitmap, 1, Bits), 1); ok_long(NtGdiGetBitmapBits(hBitmap, 1, Bits), 1);
ok_long(GetLastError(), 0xDEADFACE);
ok_int(Bits[0], 0); ok_int(Bits[0], 0);
ok_int(Bits[1], 0x55); ok_int(Bits[1], 0x55);
FillMemory(Bits, sizeof(Bits), 0x55); FillMemory(Bits, sizeof(Bits), 0x55);
SetLastError(0xDEADFACE);
ok_long(NtGdiGetBitmapBits(hBitmap, 2, Bits), 2); ok_long(NtGdiGetBitmapBits(hBitmap, 2, Bits), 2);
ok_long(GetLastError(), 0xDEADFACE);
ok_int(Bits[0], 0); ok_int(Bits[0], 0);
ok_int(Bits[1], 0); ok_int(Bits[1], 0);
ok_int(Bits[2], 0x55); ok_int(Bits[2], 0x55);
FillMemory(Bits, sizeof(Bits), 0x33); FillMemory(Bits, sizeof(Bits), 0x33);
SetLastError(0xDEADFACE);
ok_long(NtGdiSetBitmapBits(hBitmap, 10, Bits), 10); ok_long(NtGdiSetBitmapBits(hBitmap, 10, Bits), 10);
ok_long(GetLastError(), 0xDEADFACE);
FillMemory(Bits, sizeof(Bits), 0xAA); FillMemory(Bits, sizeof(Bits), 0xAA);
SetLastError(0xDEADFACE);
ok_long(NtGdiSetBitmapBits(hBitmap, 1, Bits), 1); ok_long(NtGdiSetBitmapBits(hBitmap, 1, Bits), 1);
ok_long(GetLastError(), 0xDEADFACE);
FillMemory(Bits, sizeof(Bits), 0x55); FillMemory(Bits, sizeof(Bits), 0x55);
SetLastError(0xDEADFACE);
ok_long(NtGdiGetBitmapBits(hBitmap, 1, Bits), 1); ok_long(NtGdiGetBitmapBits(hBitmap, 1, Bits), 1);
ok_long(GetLastError(), 0xDEADFACE);
ok_int(Bits[0], 0xAA); ok_int(Bits[0], 0xAA);
ok_int(Bits[1], 0x55); ok_int(Bits[1], 0x55);
SetLastError(0xDEADFACE);
ok_long(NtGdiGetBitmapBits(hBitmap, 2, Bits), 2); ok_long(NtGdiGetBitmapBits(hBitmap, 2, Bits), 2);
ok_long(GetLastError(), 0xDEADFACE);
ok_int(Bits[0], 0xAA); ok_int(Bits[0], 0xAA);
ok_int(Bits[1], 0x33); ok_int(Bits[1], 0x33);
ok_int(Bits[2], 0x55); ok_int(Bits[2], 0x55);
FillMemory(Bits, sizeof(Bits), 0xAA); FillMemory(Bits, sizeof(Bits), 0xAA);
SetLastError(0xDEADFACE);
ok_long(NtGdiSetBitmapBits(hBitmap, 2, Bits), 2); ok_long(NtGdiSetBitmapBits(hBitmap, 2, Bits), 2);
ok_long(GetLastError(), 0xDEADFACE);
FillMemory(Bits, sizeof(Bits), 0x55); FillMemory(Bits, sizeof(Bits), 0x55);
SetLastError(0xDEADFACE);
ok_long(NtGdiGetBitmapBits(hBitmap, 2, Bits), 2); ok_long(NtGdiGetBitmapBits(hBitmap, 2, Bits), 2);
ok_long(GetLastError(), 0xDEADFACE);
ok_int(Bits[0], 0xAA); ok_int(Bits[0], 0xAA);
ok_int(Bits[1], 0xAA); ok_int(Bits[1], 0xAA);
ok_int(Bits[2], 0x55); ok_int(Bits[2], 0x55);
SetLastError(0xDEADFACE);
ok_long(NtGdiGetBitmapBits(hBitmap, 3, Bits), 3); ok_long(NtGdiGetBitmapBits(hBitmap, 3, Bits), 3);
ok_long(GetLastError(), 0xDEADFACE);
ok_int(Bits[0], 0xAA); ok_int(Bits[0], 0xAA);
ok_int(Bits[1], 0xAA); ok_int(Bits[1], 0xAA);
ok_int(Bits[2], 0x33); ok_int(Bits[2], 0x33);
ok_int(Bits[3], 0x55); ok_int(Bits[3], 0x55);
FillMemory(Bits, sizeof(Bits), 0xAA); FillMemory(Bits, sizeof(Bits), 0xAA);
SetLastError(0xDEADFACE);
ok_long(NtGdiSetBitmapBits(hBitmap, 3, Bits), 3); ok_long(NtGdiSetBitmapBits(hBitmap, 3, Bits), 3);
ok_long(GetLastError(), 0xDEADFACE);
FillMemory(Bits, sizeof(Bits), 0x55); FillMemory(Bits, sizeof(Bits), 0x55);
SetLastError(0xDEADFACE);
ok_long(NtGdiGetBitmapBits(hBitmap, 3, Bits), 3); ok_long(NtGdiGetBitmapBits(hBitmap, 3, Bits), 3);
ok_long(GetLastError(), 0xDEADFACE);
ok_int(Bits[0], 0xAA); ok_int(Bits[0], 0xAA);
ok_int(Bits[1], 0xAA); ok_int(Bits[1], 0xAA);
ok_int(Bits[2], 0xAA); ok_int(Bits[2], 0xAA);
ok_int(Bits[3], 0x55); ok_int(Bits[3], 0x55);
SetLastError(0xDEADFACE);
ok_long(NtGdiGetBitmapBits(hBitmap, 4, Bits), 4); ok_long(NtGdiGetBitmapBits(hBitmap, 4, Bits), 4);
ok_long(GetLastError(), 0xDEADFACE);
ok_int(Bits[0], 0xAA);
ok_int(Bits[1], 0xAA);
ok_int(Bits[2], 0xAA);
ok_int(Bits[3], 0x33);
ok_int(Bits[4], 0x55);
DeleteObject(hBitmap);
DeleteDC(hDC);
/* ------------------------- */
hDC = CreateCompatibleDC(NULL);
ZeroMemory(&bmi, sizeof(bmi));
bmi.bmiHeader.biSize = sizeof(BITMAPINFOHEADER);
bmi.bmiHeader.biWidth = 15;
bmi.bmiHeader.biHeight = -15; /* negative */
bmi.bmiHeader.biPlanes = 1;
bmi.bmiHeader.biBitCount = 24;
hBitmap = CreateDIBSection(hDC, &bmi, DIB_RGB_COLORS, &pvBits, NULL, 0);
ok(hBitmap != NULL, "hBitmap was NULL.\n");
FillMemory(Bits, sizeof(Bits), 0x55);
SetLastError(0xDEADFACE);
ok_long(NtGdiGetBitmapBits(hBitmap, 0, Bits), 0);
ok_long(GetLastError(), 0xDEADFACE);
ok_int(Bits[0], 0x55);
FillMemory(Bits, sizeof(Bits), 0x55);
SetLastError(0xDEADFACE);
ok_long(NtGdiGetBitmapBits(hBitmap, 1, Bits), 1);
ok_long(GetLastError(), 0xDEADFACE);
ok_int(Bits[0], 0);
ok_int(Bits[1], 0x55);
FillMemory(Bits, sizeof(Bits), 0x55);
SetLastError(0xDEADFACE);
ok_long(NtGdiGetBitmapBits(hBitmap, 2, Bits), 2);
ok_long(GetLastError(), 0xDEADFACE);
ok_int(Bits[0], 0);
ok_int(Bits[1], 0);
ok_int(Bits[2], 0x55);
FillMemory(Bits, sizeof(Bits), 0x33);
SetLastError(0xDEADFACE);
ok_long(NtGdiSetBitmapBits(hBitmap, 10, Bits), 10);
ok_long(GetLastError(), 0xDEADFACE);
FillMemory(Bits, sizeof(Bits), 0xAA);
SetLastError(0xDEADFACE);
ok_long(NtGdiSetBitmapBits(hBitmap, 1, Bits), 1);
ok_long(GetLastError(), 0xDEADFACE);
FillMemory(Bits, sizeof(Bits), 0x55);
SetLastError(0xDEADFACE);
ok_long(NtGdiGetBitmapBits(hBitmap, 1, Bits), 1);
ok_long(GetLastError(), 0xDEADFACE);
ok_int(Bits[0], 0xAA);
ok_int(Bits[1], 0x55);
SetLastError(0xDEADFACE);
ok_long(NtGdiGetBitmapBits(hBitmap, 2, Bits), 2);
ok_long(GetLastError(), 0xDEADFACE);
ok_int(Bits[0], 0xAA);
ok_int(Bits[1], 0x33);
ok_int(Bits[2], 0x55);
FillMemory(Bits, sizeof(Bits), 0xAA);
SetLastError(0xDEADFACE);
ok_long(NtGdiSetBitmapBits(hBitmap, 2, Bits), 2);
ok_long(GetLastError(), 0xDEADFACE);
FillMemory(Bits, sizeof(Bits), 0x55);
SetLastError(0xDEADFACE);
ok_long(NtGdiGetBitmapBits(hBitmap, 2, Bits), 2);
ok_long(GetLastError(), 0xDEADFACE);
ok_int(Bits[0], 0xAA);
ok_int(Bits[1], 0xAA);
ok_int(Bits[2], 0x55);
SetLastError(0xDEADFACE);
ok_long(NtGdiGetBitmapBits(hBitmap, 3, Bits), 3);
ok_long(GetLastError(), 0xDEADFACE);
ok_int(Bits[0], 0xAA);
ok_int(Bits[1], 0xAA);
ok_int(Bits[2], 0x33);
ok_int(Bits[3], 0x55);
FillMemory(Bits, sizeof(Bits), 0xAA);
SetLastError(0xDEADFACE);
ok_long(NtGdiSetBitmapBits(hBitmap, 3, Bits), 3);
ok_long(GetLastError(), 0xDEADFACE);
FillMemory(Bits, sizeof(Bits), 0x55);
SetLastError(0xDEADFACE);
ok_long(NtGdiGetBitmapBits(hBitmap, 3, Bits), 3);
ok_long(GetLastError(), 0xDEADFACE);
ok_int(Bits[0], 0xAA);
ok_int(Bits[1], 0xAA);
ok_int(Bits[2], 0xAA);
ok_int(Bits[3], 0x55);
SetLastError(0xDEADFACE);
ok_long(NtGdiGetBitmapBits(hBitmap, 4, Bits), 4);
ok_long(GetLastError(), 0xDEADFACE);
ok_int(Bits[0], 0xAA); ok_int(Bits[0], 0xAA);
ok_int(Bits[1], 0xAA); ok_int(Bits[1], 0xAA);
ok_int(Bits[2], 0xAA); ok_int(Bits[2], 0xAA);