16#define INVALID_POINTER ((PVOID)(ULONG_PTR)0xC0000000C0000000ULL)
55 if (fuUsage == 2)
return FALSE;
63 if (fuUsage == 2)
return FALSE;
82 if ((lpbmih ==
NULL) ||
109 {{
sizeof(
BITMAPINFOHEADER), 4, 4, 1, 8,
BI_RGB, 0, 1, 1, 1, 0}, {{0,0,0,0}}};
111 {{0, -2, -4, 55, 42, 21, 0, 1, 1, 1, 0}, {{0,0,0,0}}};
115 ok(
hdc != 0,
"failed\n");
193 ULONG i1, i2, i3, i4, i5, i6;
196 ULONG afInitf[12] = {0, 1,
CBM_CREATDIB, 3,
CBM_INIT, 5, 6, 7, 8, 0x10, 0x20};
199 ULONG aiUsage[5] = {0, 1, 2, 3, 23};
205 for (i2 = 0; i2 <
ARRAYSIZE(apbih); i2++)
207 for (i3 = 0; i3 <
ARRAYSIZE(afInitf); i3++)
209 for (i4 = 0; i4 <
ARRAYSIZE(apvBits); i4++)
211 for (i5 = 0; i5 <
ARRAYSIZE(apbmi); i5++)
213 for (i6 = 0; i6 <
ARRAYSIZE(aiUsage); i6++)
216 dwExpError = 0xbadbad00;
218 bExpSuccess =
GetExpected(&dwExpError, ahdc[i1], apbih[i2], afInitf[i3], apvBits[i4], apbmi[i5], aiUsage[i6]);
222 hbmp =
CreateDIBitmap(ahdc[i1], apbih[i2], afInitf[i3], apvBits[i4], apbmi[i5], aiUsage[i6]);
232 ok(
hbmp != 0,
"Expected success for (%ld,%ld,%ld,%ld,%ld,%ld) CreateDIBitmap(%p, %p, 0x%lx, %p, %p, %ld)\n",
233 i1, i2, i3, i4, i5, i6,
234 ahdc[i1], apbih[i2], afInitf[i3], apvBits[i4], apbmi[i5], aiUsage[i6]);
238 ok(
hbmp == 0,
"Expected failure for (%ld,%ld,%ld,%ld,%ld,%ld) CreateDIBitmap(%p, %p, 0x%lx, %p, %p, %ld)\n",
239 i1, i2, i3, i4, i5, i6,
240 ahdc[i1], apbih[i2], afInitf[i3], apvBits[i4], apbmi[i5], aiUsage[i6]);
273 ok(
hdc != 0,
"failed\n");
292 for(
i = 0;
i < 8;
i++ )
294 bmibuffer.bmiColors[
i] =
i;
299 ok(
hbmp != 0,
"failed\n");
313 BYTE rlebits[] = {2, 0, 0, 0, 2, 1, 0, 1};
332 ok(
hbmp != 0,
"failed\n");
335 ok(
ret != 0,
"failed\n");
350 ok(
hbmp != 0,
"failed\n");
354 ok(
ret != 0,
"failed\n");
375 {
sizeof(
BITMAPINFOHEADER), 4, 4, 1, 8,
BI_RLE8, 20, 1, 1, 4, 0},
377 {4,0, 0,2,0,1,0,2,3,1, 2,1, 2,2, 1,3,1,0,1,2, },
386 ok(
hbmp != 0,
"CreateDIBitmap failed.\n");
390 PackedDIB.bmiHeader.biSizeImage = 2;
392 ok(
hbmp != 0,
"CreateDIBitmap failed.\n");
396 PackedDIB.bmiHeader.biSizeImage = 1;
398 ok(
hbmp != 0,
"CreateDIBitmap failed.\n");
402 PackedDIB.bmiHeader.biSizeImage = 0;
404 ok(
hbmp == 0,
"CreateDIBitmap succeeded, expected failure\n");
408 PackedDIB.bmiHeader.biSizeImage = 20;
409 PackedDIB.ajBuffer[0] = 17;
411 ok(
hbmp != 0,
"CreateDIBitmap failed\n");
424 {{
sizeof(
BITMAPINFOHEADER), 4, 4, 1, 8,
BI_RGB, 0, 1, 1, 1, 0}, {{0,1,2,3}}};
425 BYTE ajBits[10] = {0,1,2,3,4,5,6,7,8,9};
433 {
sizeof(
BITMAPINFOHEADER), 8, 2, 1, 8,
BI_RLE8, 20, 1, 1, 4, 0},
436 BYTE ajBitsRLE[] = {4,0, 0,2,0,1,0,2,3,1, 2,1, 2,2, 1,3,1,0,1,2, };
441 ok(0,
"CreateCompatibleDC failed. Skipping tests!\n");
447 ok(
hbmp == 0,
"CreateDIBitmap should fail.\n");
451 ok(
hbmp != 0,
"CreateDIBitmap failed.\n");
477 ok(
hbmp != 0,
"CreateDIBitmap failed.\n");
490 ok(
hbmp != 0,
"CreateDIBitmap failed.\n");
518 ok(
hbmp == 0,
"CreateDIBitmap should fail.\n");
520 ok(
hbmp == 0,
"CreateDIBitmap should fail.\n");
void Test_CreateDIBitmap_DIB_PAL_COLORS(void)
void Test_CreateDIBitmap_RLE8()
void Test_CreateDIBitmap_CBM_CREATDIB(void)
void Test_CreateDIBitmap_Params(void)
void Test_CreateDIBitmap1(void)
BOOL GetExpected(DWORD *pdwError, HDC hdc, const BITMAPINFOHEADER *lpbmih, DWORD fdwInit, const VOID *lpbInit, const BITMAPINFO *lpbmi, UINT fuUsage)
#define ok_long(expression, result)
#define ok_int(expression, result)
#define ok_ptr(expression, result)
#define ERROR_INVALID_PARAMETER
static VOID BitBlt(_In_ ULONG Left, _In_ ULONG Top, _In_ ULONG Width, _In_ ULONG Height, _In_reads_bytes_(Delta *Height) PUCHAR Buffer, _In_ ULONG BitsPerPixel, _In_ ULONG Delta)
GLenum GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * bits
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
#define EXCEPTION_EXECUTE_HANDLER
_In_ HBITMAP _In_ UINT _In_ UINT _Inout_ LPBITMAPINFO pbmi
#define _SEH2_EXCEPT(...)
BITMAPINFOHEADER bmiHeader
DWORD WINAPI GetLastError(void)
HGDIOBJ WINAPI GetStockObject(_In_ int)
int WINAPI GetDeviceCaps(_In_opt_ HDC, _In_ int)
HPALETTE WINAPI SelectPalette(_In_ HDC, _In_ HPALETTE, _In_ BOOL)
HGDIOBJ WINAPI SelectObject(_In_ HDC, _In_ HGDIOBJ)
HDC WINAPI CreateCompatibleDC(_In_opt_ HDC hdc)
BOOL WINAPI DeleteDC(_In_ HDC)
HBITMAP WINAPI CreateDIBitmap(_In_ HDC hdc, _In_opt_ const BITMAPINFOHEADER *pbmih, _In_ DWORD fdwInit, _In_opt_ const VOID *pvInit, _In_opt_ const BITMAPINFO *pbmi, _In_ UINT uUsage)
HDC WINAPI GetDC(_In_opt_ HWND)