mirror of
https://github.com/reactos/reactos.git
synced 2024-12-30 19:14:31 +00:00
[WIN32KNT_APITEST] Improve NtGdiSetBitmapBits 6 (#1320)
Add some PAGE_READONLY tests. Add two bit pattern tests. CORE-15657 and CORE-15695
This commit is contained in:
parent
5417742f48
commit
6360a53b12
1 changed files with 23 additions and 2 deletions
|
@ -78,7 +78,7 @@ START_TEST(NtGdiSetBitmapBits)
|
|||
ok_long(NtGdiSetBitmapBits(hBitmap, 100, Bits), 12);
|
||||
ok_long(GetLastError(), 0xDEADFACE);
|
||||
|
||||
/* Test large byte counts */
|
||||
/* Test large byte counts (with PAGE_NOACCESS) */
|
||||
LargeBits = VirtualAlloc(NULL, 0x100000 + PAGE_SIZE, MEM_RESERVE, PAGE_NOACCESS);
|
||||
VirtualAlloc(LargeBits, 0x100000, MEM_COMMIT, PAGE_READWRITE);
|
||||
CopyMemory(LargeBits, Bits, sizeof(Bits));
|
||||
|
@ -88,7 +88,26 @@ START_TEST(NtGdiSetBitmapBits)
|
|||
ok_long(GetLastError(), 0xDEADFACE);
|
||||
|
||||
SetLastError(0xDEADFACE);
|
||||
ok_long(NtGdiSetBitmapBits(hBitmap, 0x1000, LargeBits), 0xC);
|
||||
ok_long(NtGdiSetBitmapBits(hBitmap, 0x10000, LargeBits), 0xC);
|
||||
ok_long(GetLastError(), 0xDEADFACE);
|
||||
|
||||
SetLastError(0xDEADFACE);
|
||||
ok_long(NtGdiSetBitmapBits(hBitmap, 0x100000, LargeBits), 0xC);
|
||||
ok_long(GetLastError(), 0xDEADFACE);
|
||||
|
||||
SetLastError(0xDEADFACE);
|
||||
ok_long(NtGdiSetBitmapBits(hBitmap, 0x100001, LargeBits), 0x0);
|
||||
ok_long(GetLastError(), 0xDEADFACE);
|
||||
|
||||
VirtualFree(LargeBits, 0, MEM_RELEASE);
|
||||
|
||||
/* Test large byte counts (with PAGE_READONLY) */
|
||||
LargeBits = VirtualAlloc(NULL, 0x100000 + PAGE_SIZE, MEM_RESERVE, PAGE_READONLY);
|
||||
VirtualAlloc(LargeBits, 0x100000, MEM_COMMIT, PAGE_READWRITE);
|
||||
CopyMemory(LargeBits, Bits, sizeof(Bits));
|
||||
|
||||
SetLastError(0xDEADFACE);
|
||||
ok_long(NtGdiSetBitmapBits(hBitmap, 0x100, LargeBits), 0xC);
|
||||
ok_long(GetLastError(), 0xDEADFACE);
|
||||
|
||||
SetLastError(0xDEADFACE);
|
||||
|
@ -295,6 +314,7 @@ START_TEST(NtGdiSetBitmapBits)
|
|||
ok_int(Bits[4], 0x55);
|
||||
|
||||
ok_long(*(LPDWORD)pvBits, 0);
|
||||
ok_long(((LPDWORD)pvBits)[1], 0);
|
||||
|
||||
DeleteObject(hBitmap);
|
||||
DeleteDC(hDC);
|
||||
|
@ -396,6 +416,7 @@ START_TEST(NtGdiSetBitmapBits)
|
|||
ok_int(Bits[4], 0x55);
|
||||
|
||||
ok_long(*(LPDWORD)pvBits, 0x33AAAAAA);
|
||||
ok_long(((LPDWORD)pvBits)[1], 0x33333333);
|
||||
|
||||
DeleteObject(hBitmap);
|
||||
DeleteDC(hDC);
|
||||
|
|
Loading…
Reference in a new issue