ReactOS 0.4.16-dev-2206-gc56950d
NtGdiCreateDIBSection.c
Go to the documentation of this file.
1/*
2 * PROJECT: ReactOS api tests
3 * LICENSE: GPL - See COPYING in the top level directory
4 * PURPOSE: Test for NtGdiCreateDIBSection
5 * PROGRAMMERS:
6 */
7
8#include "../win32nt.h"
9
10/*
11HBITMAP
12APIENTRY
13NtGdiCreateDIBSection(
14 IN HDC hDC,
15 IN OPTIONAL HANDLE hSection,
16 IN DWORD dwOffset,
17 IN LPBITMAPINFO pbmi,
18 IN DWORD iUsage,
19 IN UINT cjHeader,
20 IN FLONG fl,
21 IN ULONG_PTR dwColorSpace,
22 OUT PVOID *ppvBits)
23*/
24
27{
28 ULONG WidthBits, WidthBytes;
29
30 WidthBits = pbih->biWidth * pbih->biBitCount * pbih->biPlanes;
31 WidthBytes = ((WidthBits + 31) & ~ 31) >> 3;
32
33 return pbih->biHeight * WidthBytes;
34}
35
36
38{
40 HDC hDC;
41 ULONG cjHeader;
42 PVOID pvBits = NULL;
44 DIBSECTION dibsection;
45
46 struct
47 {
48 BITMAPINFOHEADER bmiHeader;
49 RGBQUAD bmiColors[100];
50 } bmi;
52 PBITMAPINFOHEADER pbih = (PBITMAPINFOHEADER)&bmi.bmiHeader;
53 PBITMAPV4HEADER pbV4h = (PBITMAPV4HEADER)&bmi.bmiHeader;
54 PBITMAPV5HEADER pbV5h = (PBITMAPV5HEADER)&bmi.bmiHeader;
55
59
60 hDC = GetDC(0);
61 pbih->biSize = sizeof(BITMAPINFOHEADER);
62 pbih->biWidth = 2;
63 pbih->biHeight = 2;
64 pbih->biPlanes = 1;
65 pbih->biBitCount = 1;
66 pbih->biCompression = BI_RGB;
67 pbih->biSizeImage = 0;
68 pbih->biXPelsPerMeter = 100;
69 pbih->biYPelsPerMeter = 100;
70 pbih->biClrUsed = 2;
71 pbih->biClrImportant = 2;
72
73 cEntries = 0;
74
77 cjHeader = bmi.bmiHeader.biSize + cEntries * 4 + 8;
78
79 /* Test something simple */
80 SetLastError(0);
81 pvBits = 0;
82 hbmp = NtGdiCreateDIBSection(hDC, NULL, 0, pbmi, 0, cjHeader, 0, 0, &pvBits);
83 TEST(pvBits != NULL);
84 TEST(hbmp != 0);
85// TEST(GetLastError() == 0);
86 TEST(GetObject(hbmp, sizeof(DIBSECTION), &dibsection) == sizeof(DIBSECTION));
87 TEST(dibsection.dsBitfields[0] == 0);
88 TEST(dibsection.dsBitfields[1] == 0);
89 TEST(dibsection.dsBitfields[2] == 0);
90 TEST(dibsection.dshSection == 0);
91 TEST(dibsection.dsOffset == 0);
93
94
95 /* Test a 0 HDC */
96 SetLastError(0xdeadbeef);
97 pvBits = 0;
98 hbmp = NtGdiCreateDIBSection(0, NULL, 0, pbmi, 0, cjHeader, 0, 0, &pvBits);
99 TEST(pvBits != NULL);
100 TEST(hbmp != 0);
101 ok_hex(GetLastError(), 0xdeadbeef);
102 if (hbmp) DeleteObject(hbmp);
103
104 /* Test a wrong HDC */
105 SetLastError(0xdeadbeef);
106 pvBits = 0;
107 hbmp = NtGdiCreateDIBSection((HDC)(LONG_PTR)0xdeadbeef, NULL, 0, pbmi, 0, cjHeader, 0, 0, &pvBits);
108 TEST(pvBits != 0);
109 TEST(hbmp != 0);
110 ok_hex(GetLastError(), 0xdeadbeef);
111 if (hbmp) DeleteObject(hbmp);
112
113 /* Test pbmi = NULL */
114 SetLastError(0);
115 pvBits = (PVOID)-1;
116 hbmp = NtGdiCreateDIBSection(hDC, NULL, 0, NULL, 0, cjHeader, 0, 0, &pvBits);
117 TEST(pvBits == (PVOID)-1);
118 TEST(hbmp == 0);
119 TEST(GetLastError() == 0);
120 if (hbmp) DeleteObject(hbmp);
121
122 /* Test invalid pbmi */
123 SetLastError(0);
124 pvBits = (PVOID)-1;
125 hbmp = NtGdiCreateDIBSection(hDC, NULL, 0, (PVOID)(LONG_PTR)0x80001234, 0, cjHeader, 0, 0, &pvBits);
126 TEST(pvBits == (PVOID)-1);
127 TEST(hbmp == 0);
129 if (hbmp) DeleteObject(hbmp);
130
131 /* Test invalid pbmi */
132 SetLastError(0);
133 pvBits = (PVOID)-1;
134 hbmp = NtGdiCreateDIBSection(hDC, NULL, 0, (PVOID)(LONG_PTR)1, 0, cjHeader, 0, 0, &pvBits);
135 TEST(pvBits == (PVOID)-1);
136 TEST(hbmp == 0);
138 if (hbmp) DeleteObject(hbmp);
139
140 /* Test ppvBits = NULL */
141 SetLastError(0);
142 hbmp = NtGdiCreateDIBSection(0, NULL, 0, pbmi, 0, cjHeader, 0, 0, NULL);
143 TEST(hbmp == 0);
145 if (hbmp) DeleteObject(hbmp);
146
147 /* Test ppvBits = NULL and pbmi == 0*/
148 SetLastError(0);
149 hbmp = NtGdiCreateDIBSection(0, NULL, 0, NULL, 0, cjHeader, 0, 0, NULL);
150 TEST(hbmp == 0);
151 TEST(GetLastError() == 0);
152 if (hbmp) DeleteObject(hbmp);
153
154 /* Test ppvBits = NULL and wrong cjHeader */
155 SetLastError(0);
156 hbmp = NtGdiCreateDIBSection(0, NULL, 0, pbmi, 0, cjHeader+4, 0, 0, NULL);
157 TEST(hbmp == 0);
158 TEST(GetLastError() == 0);
159 if (hbmp) DeleteObject(hbmp);
160
161 /* Test ppvBits = NULL and cjHeader = 0 */
162 SetLastError(0);
163 hbmp = NtGdiCreateDIBSection(0, NULL, 0, pbmi, 0, 0, 0, 0, NULL);
164 TEST(hbmp == 0);
165 TEST(GetLastError() == 0);
166 if (hbmp) DeleteObject(hbmp);
167
168 /* Test wrong cjHeader */
169 SetLastError(0);
170 pvBits = (PVOID)-1;
171 hbmp = NtGdiCreateDIBSection(hDC, NULL, 0, pbmi, 0, cjHeader+4, 0, 0, &pvBits);
172 pvBits = (PVOID)-1;
173 TEST(hbmp == 0);
174 TEST(GetLastError() == 0);
175 if (hbmp) DeleteObject(hbmp);
176
177 /* Test different bitcount */
178 pbih->biBitCount = 4;
179 hbmp = NtGdiCreateDIBSection(hDC, NULL, 0, pbmi, 0, cjHeader, 0, 0, &pvBits);
180 TEST(hbmp != 0);
181 if (hbmp) DeleteObject(hbmp);
182
183 pbih->biBitCount = 8;
184 hbmp = NtGdiCreateDIBSection(hDC, NULL, 0, pbmi, 0, cjHeader, 0, 0, &pvBits);
185 TEST(hbmp != 0);
186 if (hbmp) DeleteObject(hbmp);
187
188 cjHeader = pbih->biSize;
189 pbih->biBitCount = 16;
190 hbmp = NtGdiCreateDIBSection(hDC, NULL, 0, pbmi, 0, cjHeader, 0, 0, &pvBits);
191 TEST(hbmp != 0);
192 if (hbmp) DeleteObject(hbmp);
193
194 pbih->biBitCount = 24;
195 hbmp = NtGdiCreateDIBSection(hDC, NULL, 0, pbmi, 0, cjHeader, 0, 0, &pvBits);
196 TEST(hbmp != 0);
197 if (hbmp) DeleteObject(hbmp);
198
199 pbih->biBitCount = 32;
200 hbmp = NtGdiCreateDIBSection(hDC, NULL, 0, pbmi, 0, cjHeader, 0, 0, &pvBits);
201 TEST(hbmp != 0);
202 if (hbmp) DeleteObject(hbmp);
203
204 /* Test BI_BITFIELDS */
205 cEntries = 3;
206 cjHeader = pbih->biSize + cEntries * sizeof(DWORD);
207 pbih->biBitCount = 16;
209 ((DWORD*)pbmi->bmiColors)[0] = 0x0007;
210 ((DWORD*)pbmi->bmiColors)[1] = 0x0038;
211 ((DWORD*)pbmi->bmiColors)[2] = 0x01C0;
212 hbmp = NtGdiCreateDIBSection(hDC, NULL, 0, pbmi, 0, cjHeader, 0, 0, &pvBits);
213 TEST(hbmp != 0);
214 TEST(GetObject(hbmp, sizeof(DIBSECTION), &dibsection) == sizeof(DIBSECTION));
215 TEST(dibsection.dsBm.bmType == 0);
216 TEST(dibsection.dsBm.bmWidth == 2);
217 TEST(dibsection.dsBm.bmHeight == 2);
218 TEST(dibsection.dsBm.bmWidthBytes == 4);
219 TEST(dibsection.dsBm.bmPlanes == 1);
220 TEST(dibsection.dsBm.bmBitsPixel == 16);
221 TEST(dibsection.dsBm.bmBits == pvBits);
222 TEST(dibsection.dsBmih.biSize == sizeof(BITMAPINFOHEADER));
223 TEST(dibsection.dsBmih.biWidth == 2);
224 TEST(dibsection.dsBmih.biHeight == 2);
225 TEST(dibsection.dsBmih.biPlanes == 1);
226 TEST(dibsection.dsBmih.biBitCount == 16);
227 TEST(dibsection.dsBmih.biCompression == BI_BITFIELDS);
228 TEST(dibsection.dsBmih.biSizeImage == 8);
229 TEST(dibsection.dsBmih.biXPelsPerMeter == 0);
230 TEST(dibsection.dsBmih.biYPelsPerMeter == 0);
231 TEST(dibsection.dsBmih.biClrUsed == 0);
232 TEST(dibsection.dsBmih.biClrImportant == 0);
233 TEST(dibsection.dsBitfields[0] == 0x0007);
234 TEST(dibsection.dsBitfields[1] == 0x0038);
235 TEST(dibsection.dsBitfields[2] == 0x01C0);
236 TEST(dibsection.dshSection == 0);
237 TEST(dibsection.dsOffset == 0);
238
239printf("dib with bitfileds: %p\n", hbmp);
240//system("PAUSE");
241
242 if (hbmp) DeleteObject(hbmp);
243
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);
254
255 /* Test BI_BITFIELDS */
256 SetLastError(0);
257 pvBits = 0;
258
259 pbih->biSize = sizeof(BITMAPINFOHEADER);
260 pbih->biWidth = 2;
261 pbih->biHeight = 2;
262 pbih->biPlanes = 1;
263 pbih->biBitCount = 4;
264 pbih->biCompression = BI_RGB;
265 pbih->biSizeImage = 0;
266 pbih->biXPelsPerMeter = 100;
267 pbih->biYPelsPerMeter = 100;
268 pbih->biClrUsed = 0;
269 pbih->biClrImportant = 0;
270 ((DWORD*)pbmi->bmiColors)[0] = 0xF800;
271 ((DWORD*)pbmi->bmiColors)[1] = 0x00ff00;
272 ((DWORD*)pbmi->bmiColors)[2] = 0x0000ff;
273 cEntries = 0;
274 cjHeader = bmi.bmiHeader.biSize + cEntries * 4 + 20;
275
276
281
282 cEntries = 2;
283 cjHeader = bmi.bmiHeader.biSize + cEntries * 4 + 8;
284
285 /* Test iUsage = 1 */
286 SetLastError(0);
287 pvBits = (PVOID)-1;
288 hbmp = NtGdiCreateDIBSection(hDC, NULL, 0, pbmi, 1, cjHeader, 0, 0, &pvBits);
289 TEST(pvBits == (PVOID)-1);
290 TEST(hbmp == 0);
291 TEST(GetLastError() == 0);
292 if (hbmp) DeleteObject(hbmp);
293
294
295
298 /* Test iUsage = 2 */
299 SetLastError(0);
300 pvBits = (PVOID)-1;
301 hbmp = NtGdiCreateDIBSection(hDC, NULL, 0, pbmi, 2, cjHeader, 0, 0, &pvBits);
302 TEST(pvBits == (PVOID)-1);
303 TEST(hbmp == 0);
304 TEST(GetLastError() == 0);
305 if (hbmp) DeleteObject(hbmp);
306
307
310 cEntries = 0;
311 cjHeader = bmi.bmiHeader.biSize + cEntries * 4 + 8;
312
313 /* Test iUsage = 3 */
314 SetLastError(0);
315 pvBits = (PVOID)-1;
316 hbmp = NtGdiCreateDIBSection(hDC, NULL, 0, pbmi, 3, cjHeader, 0, 0, &pvBits);
317 TEST(pvBits == (PVOID)-1);
318 TEST(hbmp == 0);
320 if (hbmp) DeleteObject(hbmp);
321
322 /* Test iUsage = 3 */
323 SetLastError(0);
324 pvBits = (PVOID)-1;
325 hbmp = NtGdiCreateDIBSection(hDC, NULL, 0, pbmi, 3, cjHeader+4, 0, 0, &pvBits);
326 TEST(pvBits == (PVOID)-1);
327 TEST(hbmp == 0);
328 TEST(GetLastError() == 0);
329 if (hbmp) DeleteObject(hbmp);
330
331 /* Test wrong iUsage */
332 SetLastError(0);
333 pvBits = (PVOID)-1;
334 hbmp = NtGdiCreateDIBSection(hDC, NULL, 0, pbmi, -55, cjHeader, 0, 0, &pvBits);
335 TEST(pvBits == (PVOID)-1);
336 TEST(hbmp == 0);
338 if (hbmp) DeleteObject(hbmp);
339
340 /* Test wrong iUsage and wrong cjHeader */
341 SetLastError(0);
342 pvBits = (PVOID)-1;
343 hbmp = NtGdiCreateDIBSection(hDC, NULL, 0, pbmi, -55, cjHeader+4, 0, 0, &pvBits);
344 TEST(pvBits == (PVOID)-1);
345 TEST(hbmp == 0);
346 TEST(GetLastError() == 0);
347 if (hbmp) DeleteObject(hbmp);
348
349 /* increased header size */
350 pbih->biSize = sizeof(BITMAPINFOHEADER) + 4;
351 cjHeader = pbih->biSize + cEntries * 4 + 8;
352 SetLastError(0xdeadbeef);
353 pvBits = 0;
354 hbmp = NtGdiCreateDIBSection(hDC, NULL, 0, pbmi, 0, cjHeader, 0, 0, &pvBits);
355 TEST(pvBits != NULL);
356 TEST(hbmp != 0);
357 ok_hex(GetLastError(), 0xdeadbeef);
358 if (hbmp) DeleteObject(hbmp);
359
360 /* increased header size */
361 pbih->biSize = sizeof(BITMAPINFOHEADER) + 2;
362 cjHeader = pbih->biSize + cEntries * 4 + 8;
363 SetLastError(0);
364 pvBits = (PVOID)-1;
365 hbmp = NtGdiCreateDIBSection(hDC, NULL, 0, pbmi, 0, cjHeader, 0, 0, &pvBits);
366 TEST(pvBits == (PVOID)-1);
367 TEST(hbmp == 0);
368 TEST(GetLastError() == 0);
369 if (hbmp) DeleteObject(hbmp);
370
371 /* decreased header size */
372 pbih->biSize = sizeof(BITMAPINFOHEADER) - 4;
373 cjHeader = pbih->biSize + cEntries * 4 + 8;
374 SetLastError(0);
375 pvBits = (PVOID)-1;
376 hbmp = NtGdiCreateDIBSection(hDC, NULL, 0, pbmi, 0, cjHeader, 0, 0, &pvBits);
377 TEST(pvBits == (PVOID)-1);
378 TEST(hbmp == 0);
379 TEST(GetLastError() == 0);
380 if (hbmp) DeleteObject(hbmp);
381
382
385 pbV4h->bV4Size = sizeof(BITMAPV4HEADER);
386 pbV4h->bV4Width = 2;
387 pbV4h->bV4Height = 3;
388 pbV4h->bV4Planes = 1;
389 pbV4h->bV4BitCount = 1;
390 pbV4h->bV4V4Compression = BI_RGB;
391 pbV4h->bV4SizeImage = 0;
392 pbV4h->bV4XPelsPerMeter = 100;
393 pbV4h->bV4YPelsPerMeter = 100;
394 pbV4h->bV4ClrUsed = 0;
395 pbV4h->bV4ClrImportant = 0;
396 pbV4h->bV4RedMask = 0;
397 pbV4h->bV4GreenMask = 0;
398 pbV4h->bV4BlueMask = 0;
399 pbV4h->bV4AlphaMask = 0;
400 pbV4h->bV4CSType = 0;
401 memset(&pbV4h->bV4Endpoints, 0, sizeof(CIEXYZTRIPLE));
402 pbV4h->bV4GammaRed = 0;
403 pbV4h->bV4GammaGreen = 0;
404 pbV4h->bV4GammaBlue = 0;
405
406 cEntries = 0;
407 cjHeader = bmi.bmiHeader.biSize + cEntries * 4 + 8;
408
409 /* Test something simple */
410 SetLastError(0xdeadbeef);
411 pvBits = 0;
412 hbmp = NtGdiCreateDIBSection(hDC, NULL, 0, pbmi, 0, cjHeader, 0, 0, &pvBits);
413 TEST(pvBits != NULL);
414 TEST(hbmp != 0);
415 ok_hex(GetLastError(), 0xdeadbeef);
416 if (hbmp) DeleteObject(hbmp);
417
418
421 pbV5h->bV5Size = sizeof(BITMAPV5HEADER);
422 pbV5h->bV5Width = 2;
423 pbV5h->bV5Height = 3;
424 pbV5h->bV5Planes = 1;
425 pbV5h->bV5BitCount = 1;
426 pbV5h->bV5Compression = BI_RGB;
427 pbV5h->bV5SizeImage = 0;
428 pbV5h->bV5XPelsPerMeter = 100;
429 pbV5h->bV5YPelsPerMeter = 100;
430 pbV5h->bV5ClrUsed = 2;
431 pbV5h->bV5ClrImportant = 2;
432 pbV5h->bV5RedMask = 0;
433 pbV5h->bV5GreenMask = 0;
434 pbV5h->bV5BlueMask = 0;
435 pbV5h->bV5AlphaMask = 0;
436 pbV5h->bV5CSType = 0;
437 memset(&pbV5h->bV5Endpoints, 0, sizeof(CIEXYZTRIPLE));
438 pbV5h->bV5GammaRed = 0;
439 pbV5h->bV5GammaGreen = 0;
440 pbV5h->bV5GammaBlue = 0;
441 pbV5h->bV5Intent = 0;
442 pbV5h->bV5ProfileData = 0;
443 pbV5h->bV5ProfileSize = 0;
444 pbV5h->bV5Reserved = 0;
445
446 cEntries = 0;
447 cjHeader = pbV5h->bV5Size + cEntries * 4 + 8;
448
449 /* Test something simple */
450 SetLastError(0xdeadbeef);
451 pvBits = 0;
452 hbmp = NtGdiCreateDIBSection(hDC, NULL, 0, pbmi, 0, cjHeader, 0, 0, &pvBits);
453 TEST(pvBits != NULL);
454 TEST(hbmp != 0);
455 ok_hex(GetLastError(), 0xdeadbeef);
456 if (hbmp) DeleteObject(hbmp);
457
458 /* increased header size */
459 pbV5h->bV5Size = sizeof(BITMAPV5HEADER) + 64;
460 cjHeader = pbV5h->bV5Size + cEntries * 4 + 8;
461 SetLastError(0xdeadbeef);
462 pvBits = 0;
463 hbmp = NtGdiCreateDIBSection(hDC, NULL, 0, pbmi, 0, cjHeader, 0, 0, &pvBits);
464 TEST(pvBits != NULL);
465 TEST(hbmp != 0);
466 ok_hex(GetLastError(), 0xdeadbeef);
467 if (hbmp) DeleteObject(hbmp);
468
469 /* Test section */
470 MaximumSize.QuadPart = 4096;
473 NULL,
477 NULL);
479
480 SetLastError(0);
481 pvBits = 0;
482 hbmp = NtGdiCreateDIBSection(hDC, hSection, 0, pbmi, 0, cjHeader, 0, 0, &pvBits);
483 TEST(pvBits != NULL);
484 TEST(hbmp != 0);
485// TEST(GetLastError() == 0);
486 printf("hbmp = %p, pvBits = %p, hSection = %p\n", hbmp, pvBits, hSection);
487//system("PAUSE");
488 if (hbmp) DeleteObject(hbmp);
489}
static HDC hDC
Definition: 3dtext.c:33
NTSTATUS NTAPI NtCreateSection(OUT PHANDLE SectionHandle, IN ACCESS_MASK DesiredAccess, IN POBJECT_ATTRIBUTES ObjectAttributes OPTIONAL, IN PLARGE_INTEGER MaximumSize OPTIONAL, IN ULONG SectionPageProtection OPTIONAL, IN ULONG AllocationAttributes, IN HANDLE FileHandle OPTIONAL)
Definition: section.c:3076
ULONG GetBitmapSize(BITMAPINFOHEADER *pbih)
#define ok_eq_hex(value, expected)
Definition: apitest.h:134
#define ok_eq_int(value, expected)
Definition: apitest.h:117
#define ok_hex(expression, result)
Definition: atltest.h:94
#define ok(value,...)
Definition: atltest.h:57
#define START_TEST(x)
Definition: atltest.h:75
LONG NTSTATUS
Definition: precomp.h:26
HBITMAP hbmp
#define NULL
Definition: types.h:112
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:33
#define ERROR_INVALID_PARAMETER
Definition: compat.h:101
#define SetLastError(x)
Definition: compat.h:752
struct tagBITMAPINFOHEADER * PBITMAPINFOHEADER
#define BI_RGB
Definition: precomp.h:44
ULONG RGBQUAD
Definition: precomp.h:47
unsigned long DWORD
Definition: ntddk_ex.h:95
#define printf
Definition: freeldr.h:104
pKey DeleteObject()
Status
Definition: gdiplustypes.h:25
#define BI_BITFIELDS
Definition: mmreg.h:507
#define ASSERT(a)
Definition: mode.c:44
#define TEST(x)
Definition: precomp.h:20
static HBITMAP
Definition: button.c:44
static HDC
Definition: imagelist.c:88
__int3264 LONG_PTR
Definition: mstsclib_h.h:276
_In_ ACCESS_MASK _In_opt_ POBJECT_ATTRIBUTES _In_opt_ PLARGE_INTEGER MaximumSize
Definition: mmfuncs.h:362
#define SEC_COMMIT
Definition: mmtypes.h:100
#define PAGE_READWRITE
Definition: nt_native.h:1307
#define SECTION_ALL_ACCESS
Definition: nt_native.h:1296
#define DWORD
Definition: nt_native.h:44
__kernel_entry W32KAPI HBITMAP APIENTRY NtGdiCreateDIBSection(_In_ HDC hdc, _In_opt_ HANDLE hSectionApp, _In_ DWORD dwOffset, _In_reads_bytes_opt_(cjHeader) LPBITMAPINFO pbmi, _In_ DWORD iUsage, _In_ UINT cjHeader, _In_ FLONG fl, _In_ ULONG_PTR dwColorSpace, _Outptr_ PVOID *ppvBits)
_In_ HBITMAP _In_ UINT _In_ UINT _Inout_ LPBITMAPINFO pbmi
Definition: ntgdi.h:2780
#define memset(x, y, z)
Definition: compat.h:39
ULONG biClrImportant
Definition: precomp.h:40
USHORT biBitCount
Definition: precomp.h:34
LONG biYPelsPerMeter
Definition: precomp.h:38
ULONG biCompression
Definition: precomp.h:35
LONG biXPelsPerMeter
Definition: precomp.h:37
BITMAPINFOHEADER bmiHeader
Definition: wingdi.h:1922
RGBQUAD bmiColors[1]
Definition: wingdi.h:1923
LONG bmHeight
Definition: wingdi.h:1869
LONG bmWidth
Definition: wingdi.h:1868
LONG bmType
Definition: wingdi.h:1867
LONG bmWidthBytes
Definition: wingdi.h:1870
LPVOID bmBits
Definition: wingdi.h:1873
WORD bmPlanes
Definition: wingdi.h:1871
WORD bmBitsPixel
Definition: wingdi.h:1872
DWORD dsBitfields[3]
Definition: wingdi.h:2117
DWORD dsOffset
Definition: wingdi.h:2119
HANDLE dshSection
Definition: wingdi.h:2118
BITMAP dsBm
Definition: wingdi.h:2115
BITMAPINFOHEADER dsBmih
Definition: wingdi.h:2116
void * PVOID
Definition: typedefs.h:50
uint32_t ULONG
Definition: typedefs.h:59
DWORD WINAPI GetLastError(void)
Definition: except.c:1042
_In_ const BITMAPINFO _In_ UINT _In_opt_ HANDLE hSection
Definition: wingdi.h:3685
_In_ UINT _In_ UINT cEntries
Definition: wingdi.h:4067
struct tagBITMAPINFO * PBITMAPINFO
#define GetObject
Definition: wingdi.h:4914
HDC WINAPI GetDC(_In_opt_ HWND)