Signed-off-by: Jacek Caban jacek@codeweavers.com --- v2: Don't create the actual file (debugging leftover).
dlls/gdi32/tests/metafile.c | 188 ++++++++++++++++++++++++++++++++++++ 1 file changed, 188 insertions(+)
On Thu, Sep 09, 2021 at 03:06:40PM +0200, Jacek Caban wrote:
+static void test_emf_mask_blit(void) +{
- BITMAPINFO bmi = {{ sizeof(bmi) }};
BITMAPINFO only contains one bmiColors element and you're using two later on. Typically you'd point bmi at a bmi_buffer of the correct size.
- bmi.bmiHeader.biHeight = 3;
- bmi.bmiHeader.biWidth = 4;
- bmi.bmiHeader.biBitCount = 1;
- bmi.bmiHeader.biPlanes = 1;
- bmi.bmiHeader.biCompression = BI_RGB;
- bmi.bmiHeader.biClrUsed = 1;
- bmi.bmiColors[0].rgbRed = bmi.bmiColors[0].rgbGreen = bmi.bmiColors[0].rgbBlue = 0;
- bmi.bmiColors[1].rgbRed = bmi.bmiColors[1].rgbGreen = bmi.bmiColors[1].rgbBlue = 255;
- mask_bitmap = CreateDIBSection(dib_hdc, &bmi, DIB_RGB_COLORS, &bits, NULL, 0);
- ok(!!mask_bitmap, "CreateDIBSection failed, error %d\n", GetLastError());
- memset(bits, ~0, bmi.bmiHeader.biSize);
Did you really mean biSize here? You were probably thinking of biSizeImage, but that's not set by CreateDIBSection, so you'll have to calculate yourself.
Huw.