Skip to content

Commit e3521eb

Browse files
committed
[WIN32U_APITEST] Add a test for NtGdiCreateDIBSection
1 parent 54fea66 commit e3521eb

1 file changed

Lines changed: 10 additions & 0 deletions

File tree

‎modules/rostests/apitests/win32u/ntgdi/NtGdiCreateDIBSection.c‎

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -241,6 +241,16 @@ printf("dib with bitfileds: %p\n", hbmp);
241241

242242
if (hbmp) DeleteObject(hbmp);
243243

244+
/* Test overlapping bitfields */
245+
((DWORD*)pbmi->bmiColors)[0] = 0x00ff00;
246+
((DWORD*)pbmi->bmiColors)[1] = 0x000ff0;
247+
((DWORD*)pbmi->bmiColors)[2] = 0x0000ff;
248+
hbmp = NtGdiCreateDIBSection(hDC, NULL, 0, pbmi, 0, cjHeader, 0, 0, &pvBits);
249+
ok(hbmp != NULL, "NtGdiCreateDIBSection failed\n");
250+
ok_eq_int(GetObject(hbmp, sizeof(DIBSECTION), &dibsection), sizeof(DIBSECTION));
251+
ok_eq_hex(dibsection.dsBitfields[0], 0x00ff00);
252+
ok_eq_hex(dibsection.dsBitfields[1], 0x000ff0);
253+
ok_eq_hex(dibsection.dsBitfields[2], 0x0000ff);
244254

245255
/* Test BI_BITFIELDS */
246256
SetLastError(0);

0 commit comments

Comments
 (0)