2 * ReactOS W32 Subsystem
3 * Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003 ReactOS Team
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version.
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
15 * You should have received a copy of the GNU General Public License along
16 * with this program; if not, write to the Free Software Foundation, Inc.,
17 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
31 IN OPTIONAL LPBYTE pBits
)
38 /* NOTE: Windows also doesn't store nr. of planes separately! */
39 BitsPixel
= BITMAP_GetRealBitsPixel(BitsPixel
* Planes
);
41 /* Check parameters */
42 if (BitsPixel
== 0 || Width
<= 0 || Width
>= 0x8000000 || Height
== 0)
44 DPRINT1("Width = %d, Height = %d BitsPixel = %d\n",
45 Width
, Height
, BitsPixel
);
46 SetLastWin32Error(ERROR_INVALID_PARAMETER
);
50 WidthBytes
= BITMAP_GetWidthBytes(Width
, BitsPixel
);
53 Size
.cy
= abs(Height
);
55 /* Make sure that cjBits will not overflow */
56 if ((ULONGLONG
)WidthBytes
* Size
.cy
>= 0x100000000ULL
)
58 DPRINT1("Width = %d, Height = %d BitsPixel = %d\n",
59 Width
, Height
, BitsPixel
);
60 SetLastWin32Error(ERROR_INVALID_PARAMETER
);
64 /* Create the bitmap object. */
65 hBitmap
= IntCreateBitmap(Size
, WidthBytes
,
66 BitmapFormat(BitsPixel
, BI_RGB
),
67 (Height
< 0 ? BMF_TOPDOWN
: 0) |
68 (NULL
== pBits
? 0 : BMF_NOZEROINIT
), NULL
);
71 DPRINT("IntGdiCreateBitmap: returned 0\n");
75 psurfBmp
= SURFACE_LockSurface(hBitmap
);
78 GreDeleteObject(hBitmap
);
82 psurfBmp
->flFlags
= BITMAPOBJ_IS_APIBITMAP
;
83 psurfBmp
->hDC
= NULL
; // Fixme
87 IntSetBitmapBits(psurfBmp
, psurfBmp
->SurfObj
.cjBits
, pBits
);
90 SURFACE_UnlockSurface(psurfBmp
);
92 DPRINT("IntGdiCreateBitmap : %dx%d, %d BPP colors, topdown %d, returning %08x\n",
93 Size
.cx
, Size
.cy
, BitsPixel
, (Height
< 0 ? 1 : 0), hBitmap
);
105 IN OPTIONAL LPBYTE pUnsafeBits
)
110 UINT cjBits
= BITMAP_GetWidthBytes(Width
, BitsPixel
) * abs(Height
);
112 // FIXME: Use MmSecureVirtualMemory
115 ProbeForRead(pUnsafeBits
, cjBits
, 1);
117 _SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER
)
126 return IntGdiCreateBitmap(Width
, Height
, Planes
, BitsPixel
, pUnsafeBits
);
130 IntCreateCompatibleBitmap(
137 /* MS doc says if width or height is 0, return 1-by-1 pixel, monochrome bitmap */
138 if (0 == Width
|| 0 == Height
)
140 Bmp
= NtGdiGetStockObject(DEFAULT_BITMAP
);
144 if (Dc
->dctype
!= DC_TYPE_MEMORY
)
147 Bmp
= IntGdiCreateBitmap(abs(Width
),
149 Dc
->ppdev
->gdiinfo
.cPlanes
,
150 Dc
->ppdev
->gdiinfo
.cBitsPixel
,
153 psurf
= SURFACE_LockSurface(Bmp
);
156 DPRINT1("Could not lock surface?\n");
160 psurf
->ppal
= PALETTE_ShareLockPalette(Dc
->ppdev
->devinfo
.hpalDefault
);
161 SURFACE_UnlockSurface(psurf
);
168 PSURFACE psurf
= Dc
->dclevel
.pSurface
;
169 Count
= BITMAP_GetObject(psurf
, sizeof(dibs
), &dibs
);
173 if (Count
== sizeof(BITMAP
))
175 /* We have a bitmap bug!!! W/O the HACK, we have white icons.
177 MSDN Note: When a memory device context is created, it initially
178 has a 1-by-1 monochrome bitmap selected into it. If this memory
179 device context is used in CreateCompatibleBitmap, the bitmap that
180 is created is a monochrome bitmap. To create a color bitmap, use
181 the hDC that was used to create the memory device context, as
182 shown in the following code:
184 HDC memDC = CreateCompatibleDC(hDC);
185 HBITMAP memBM = CreateCompatibleBitmap(hDC, nWidth, nHeight);
186 SelectObject(memDC, memBM);
188 Bmp
= IntGdiCreateBitmap(abs(Width
),
191 dibs
.dsBm
.bmBitsPixel
,
196 /* A DIB section is selected in the DC */
200 /* Allocate memory for a BITMAPINFOHEADER structure and a
201 color table. The maximum number of colors in a color table
202 is 256 which corresponds to a bitmap with depth 8.
203 Bitmaps with higher depths don't have color tables. */
204 bi
= ExAllocatePoolWithTag(PagedPool
,
205 sizeof(BITMAPINFOHEADER
) +
206 256 * sizeof(RGBQUAD
),
211 bi
->bmiHeader
.biSize
= sizeof(bi
->bmiHeader
);
212 bi
->bmiHeader
.biWidth
= Width
;
213 bi
->bmiHeader
.biHeight
= Height
;
214 bi
->bmiHeader
.biPlanes
= dibs
.dsBmih
.biPlanes
;
215 bi
->bmiHeader
.biBitCount
= dibs
.dsBmih
.biBitCount
;
216 bi
->bmiHeader
.biCompression
= dibs
.dsBmih
.biCompression
;
217 bi
->bmiHeader
.biSizeImage
= 0;
218 bi
->bmiHeader
.biXPelsPerMeter
= dibs
.dsBmih
.biXPelsPerMeter
;
219 bi
->bmiHeader
.biYPelsPerMeter
= dibs
.dsBmih
.biYPelsPerMeter
;
220 bi
->bmiHeader
.biClrUsed
= dibs
.dsBmih
.biClrUsed
;
221 bi
->bmiHeader
.biClrImportant
= dibs
.dsBmih
.biClrImportant
;
223 if (bi
->bmiHeader
.biCompression
== BI_BITFIELDS
)
225 /* Copy the color masks */
226 RtlCopyMemory(bi
->bmiColors
, dibs
.dsBitfields
, 3 * sizeof(DWORD
));
228 else if (bi
->bmiHeader
.biBitCount
<= 8)
230 /* Copy the color table */
232 PPALETTE PalGDI
= PALETTE_LockPalette(psurf
->hDIBPalette
);
236 ExFreePoolWithTag(bi
, TAG_TEMP
);
237 SetLastWin32Error(ERROR_INVALID_HANDLE
);
242 Index
< 256 && Index
< PalGDI
->NumColors
;
245 bi
->bmiColors
[Index
].rgbRed
= PalGDI
->IndexedColors
[Index
].peRed
;
246 bi
->bmiColors
[Index
].rgbGreen
= PalGDI
->IndexedColors
[Index
].peGreen
;
247 bi
->bmiColors
[Index
].rgbBlue
= PalGDI
->IndexedColors
[Index
].peBlue
;
248 bi
->bmiColors
[Index
].rgbReserved
= 0;
250 PALETTE_UnlockPalette(PalGDI
);
253 Bmp
= DIB_CreateDIBSection(Dc
,
261 ExFreePoolWithTag(bi
, TAG_TEMP
);
272 NtGdiCreateCompatibleBitmap(
280 if (Width
<= 0 || Height
<= 0 || (Width
* Height
) > 0x3FFFFFFF)
282 SetLastWin32Error(ERROR_INVALID_PARAMETER
);
287 return IntGdiCreateBitmap(Width
, Height
, 1, 1, 0);
291 DPRINT("NtGdiCreateCompatibleBitmap(%04x,%d,%d, bpp:%d) = \n",
292 hDC
, Width
, Height
, Dc
->ppdev
->gdiinfo
.cBitsPixel
);
296 SetLastWin32Error(ERROR_INVALID_HANDLE
);
300 Bmp
= IntCreateCompatibleBitmap(Dc
, Width
, Height
);
302 DPRINT("\t\t%04x\n", Bmp
);
308 NtGdiGetBitmapDimension(
318 psurfBmp
= SURFACE_LockSurface(hBitmap
);
319 if (psurfBmp
== NULL
)
321 SetLastWin32Error(ERROR_INVALID_HANDLE
);
327 ProbeForWrite(Dimension
, sizeof(SIZE
), 1);
328 *Dimension
= psurfBmp
->dimension
;
330 _SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER
)
336 SURFACE_UnlockSurface(psurfBmp
);
342 NtGdiGetPixel(HDC hDC
, INT XPos
, INT YPos
)
345 COLORREF Result
= (COLORREF
)CLR_INVALID
; // default to failure
346 BOOL bInRect
= FALSE
;
357 SetLastWin32Error(ERROR_INVALID_HANDLE
);
361 if (dc
->dctype
== DC_TYPE_INFO
)
367 XPos
+= dc
->ptlDCOrig
.x
;
368 YPos
+= dc
->ptlDCOrig
.y
;
369 if (RECTL_bPointInRect(&dc
->rosdc
.CombinedClip
->rclBounds
, XPos
, YPos
))
372 psurf
= dc
->dclevel
.pSurface
;
375 pso
= &psurf
->SurfObj
;
376 if(psurf
->hDIBPalette
)
377 ppal
= PALETTE_ShareLockPalette(psurf
->hDIBPalette
);
378 else if (psurf
->ppal
)
381 GDIOBJ_IncrementShareCount(&ppal
->BaseObject
);
384 ppal
= PALETTE_ShareLockPalette(dc
->ppdev
->devinfo
.hpalDefault
);
386 if (psurf
->SurfObj
.iBitmapFormat
== BMF_1BPP
&& !psurf
->hSecure
)
388 /* FIXME: palette should be gpalMono already ! */
389 EXLATEOBJ_vInitialize(&exlo
, &gpalMono
, &gpalRGB
, 0, 0xffffff, 0);
393 EXLATEOBJ_vInitialize(&exlo
, ppal
, &gpalRGB
, 0, 0xffffff, 0);
396 // check if this DC has a DIB behind it...
397 if (pso
->pvScan0
) // STYPE_BITMAP == pso->iType
400 Result
= XLATEOBJ_iXlate(&exlo
.xlo
,
401 DibFunctionsForBitmapFormat
[pso
->iBitmapFormat
].DIB_GetPixel(pso
, XPos
, YPos
));
404 EXLATEOBJ_vCleanup(&exlo
);
405 PALETTE_ShareUnlockPalette(ppal
);
410 // if Result is still CLR_INVALID, then the "quick" method above didn't work
411 if (bInRect
&& Result
== CLR_INVALID
)
413 // FIXME: create a 1x1 32BPP DIB, and blit to it
414 HDC hDCTmp
= NtGdiCreateCompatibleDC(hDC
);
417 static const BITMAPINFOHEADER bih
= { sizeof(BITMAPINFOHEADER
), 1, 1, 1, 32, BI_RGB
, 0, 0, 0, 0, 0 };
419 RtlMoveMemory(&(bi
.bmiHeader
), &bih
, sizeof(bih
));
420 hBmpTmp
= NtGdiCreateDIBitmapInternal(hDC
,
421 bi
.bmiHeader
.biWidth
,
422 bi
.bmiHeader
.biHeight
,
427 bi
.bmiHeader
.biBitCount
,
428 bi
.bmiHeader
.biSizeImage
,
432 //HBITMAP hBmpTmp = IntGdiCreateBitmap(1, 1, 1, 32, NULL);
435 HBITMAP hBmpOld
= (HBITMAP
)NtGdiSelectBitmap(hDCTmp
, hBmpTmp
);
440 NtGdiBitBlt(hDCTmp
, 0, 0, 1, 1, hDC
, XPos
, YPos
, SRCCOPY
, 0, 0);
441 NtGdiSelectBitmap(hDCTmp
, hBmpOld
);
443 // our bitmap is no longer selected, so we can access it's stuff...
444 psurf
= SURFACE_LockSurface(hBmpTmp
);
447 // Dont you need to convert something here?
448 Result
= *(COLORREF
*)psurf
->SurfObj
.pvScan0
;
449 SURFACE_UnlockSurface(psurf
);
452 GreDeleteObject(hBmpTmp
);
454 NtGdiDeleteObjectApp(hDCTmp
);
472 /* Don't copy more bytes than the buffer has */
473 Bytes
= min(Bytes
, psurf
->SurfObj
.cjBits
);
476 /* FIXME: Call DDI CopyBits here if available */
479 DPRINT("Calling device specific BitmapBits\n");
480 if (psurf
->DDBitmap
->funcs
->pBitmapBits
)
482 ret
= psurf
->DDBitmap
->funcs
->pBitmapBits(hbitmap
,
489 ERR_(bitmap
)("BitmapBits == NULL??\n");
496 RtlCopyMemory(Bits
, psurf
->SurfObj
.pvBits
, Bytes
);
506 OUT OPTIONAL PBYTE pUnsafeBits
)
511 if (pUnsafeBits
!= NULL
&& Bytes
== 0)
516 psurf
= SURFACE_LockSurface(hBitmap
);
519 SetLastWin32Error(ERROR_INVALID_HANDLE
);
523 bmSize
= BITMAP_GetWidthBytes(psurf
->SurfObj
.sizlBitmap
.cx
,
524 BitsPerFormat(psurf
->SurfObj
.iBitmapFormat
)) *
525 abs(psurf
->SurfObj
.sizlBitmap
.cy
);
527 /* If the bits vector is null, the function should return the read size */
528 if (pUnsafeBits
== NULL
)
530 SURFACE_UnlockSurface(psurf
);
534 /* Don't copy more bytes than the buffer has */
535 Bytes
= min(Bytes
, bmSize
);
537 // FIXME: use MmSecureVirtualMemory
540 ProbeForWrite(pUnsafeBits
, Bytes
, 1);
541 ret
= IntGetBitmapBits(psurf
, Bytes
, pUnsafeBits
);
543 _SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER
)
549 SURFACE_UnlockSurface(psurf
);
563 /* Don't copy more bytes than the buffer has */
564 Bytes
= min(Bytes
, psurf
->SurfObj
.cjBits
);
567 /* FIXME: call DDI specific function here if available */
570 DPRINT("Calling device specific BitmapBits\n");
571 if (psurf
->DDBitmap
->funcs
->pBitmapBits
)
573 ret
= psurf
->DDBitmap
->funcs
->pBitmapBits(hBitmap
,
580 DPRINT("BitmapBits == NULL??\n");
587 RtlCopyMemory(psurf
->SurfObj
.pvBits
, Bits
, Bytes
);
599 IN PBYTE pUnsafeBits
)
604 if (pUnsafeBits
== NULL
|| Bytes
== 0)
609 psurf
= SURFACE_LockSurface(hBitmap
);
612 SetLastWin32Error(ERROR_INVALID_HANDLE
);
618 ProbeForRead(pUnsafeBits
, Bytes
, 1);
619 ret
= IntSetBitmapBits(psurf
, Bytes
, pUnsafeBits
);
621 _SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER
)
627 SURFACE_UnlockSurface(psurf
);
633 NtGdiSetBitmapDimension(
645 psurf
= SURFACE_LockSurface(hBitmap
);
648 SetLastWin32Error(ERROR_INVALID_HANDLE
);
656 ProbeForWrite(Size
, sizeof(SIZE
), 1);
657 *Size
= psurf
->dimension
;
659 _SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER
)
666 /* The dimension is changed even if writing the old value failed */
667 psurf
->dimension
.cx
= Width
;
668 psurf
->dimension
.cy
= Height
;
670 SURFACE_UnlockSurface(psurf
);
675 VOID
IntHandleSpecialColorType(HDC hDC
, COLORREF
* Color
)
679 PALETTEENTRY palEntry
;
682 switch (*Color
>> 24)
684 case 0x10: /* DIBINDEX */
685 if (IntGetDIBColorTable(hDC
, LOWORD(*Color
), 1, &quad
) == 1)
687 *Color
= RGB(quad
.rgbRed
, quad
.rgbGreen
, quad
.rgbBlue
);
691 /* Out of color table bounds - use black */
692 *Color
= RGB(0, 0, 0);
695 case 0x02: /* PALETTERGB */
696 pdc
= DC_LockDc(hDC
);
697 if (pdc
->dclevel
.hpal
!= NtGdiGetStockObject(DEFAULT_PALETTE
))
699 index
= NtGdiGetNearestPaletteIndex(pdc
->dclevel
.hpal
, *Color
);
700 IntGetPaletteEntries(pdc
->dclevel
.hpal
, index
, 1, &palEntry
);
701 *Color
= RGB(palEntry
.peRed
, palEntry
.peGreen
, palEntry
.peBlue
);
705 /* Use the pure color */
706 *Color
= *Color
& 0x00FFFFFF;
710 case 0x01: /* PALETTEINDEX */
711 pdc
= DC_LockDc(hDC
);
712 if (IntGetPaletteEntries(pdc
->dclevel
.hpal
, LOWORD(*Color
), 1, &palEntry
) == 1)
714 *Color
= RGB(palEntry
.peRed
, palEntry
.peGreen
, palEntry
.peBlue
);
718 /* Index does not exist, use zero index */
719 IntGetPaletteEntries(pdc
->dclevel
.hpal
, 0, 1, &palEntry
);
720 *Color
= RGB(palEntry
.peRed
, palEntry
.peGreen
, palEntry
.peBlue
);
725 DPRINT("Unsupported color type %d passed\n", *Color
>> 24);
740 if ((Color
& 0xFF000000) != 0)
742 IntHandleSpecialColorType(hDC
, &Color
);
745 hBrush
= NtGdiCreateSolidBrush(Color
, NULL
);
749 OldBrush
= NtGdiSelectBrush(hDC
, hBrush
);
750 if (OldBrush
== NULL
)
752 GreDeleteObject(hBrush
);
756 NtGdiPatBlt(hDC
, X
, Y
, 1, 1, PATCOPY
);
757 NtGdiSelectBrush(hDC
, OldBrush
);
758 GreDeleteObject(hBrush
);
770 DPRINT("0 NtGdiSetPixel X %ld Y %ld C %ld\n", X
, Y
, Color
);
772 if (GdiSetPixelV(hDC
,X
,Y
,Color
))
774 Color
= NtGdiGetPixel(hDC
,X
,Y
);
775 DPRINT("1 NtGdiSetPixel X %ld Y %ld C %ld\n", X
, Y
, Color
);
779 Color
= (COLORREF
)CLR_INVALID
;
780 DPRINT("2 NtGdiSetPixel X %ld Y %ld C %ld\n", X
, Y
, Color
);
785 /* Internal Functions */
788 BITMAP_GetRealBitsPixel(UINT nBitsPixel
)
796 if (nBitsPixel
<= 16)
798 if (nBitsPixel
<= 24)
800 if (nBitsPixel
<= 32)
807 BITMAP_GetWidthBytes(INT bmWidth
, INT bpp
)
813 return 2 * ((bmWidth
+15) >> 4);
816 bmWidth
*= 3; /* fall through */
818 return bmWidth
+ (bmWidth
& 1);
828 return 2 * ((bmWidth
+3) >> 2);
837 return ((bmWidth
* bpp
+ 15) & ~15) >> 3;
841 BITMAP_CopyBitmap(HBITMAP hBitmap
)
845 SURFACE
*Bitmap
, *resBitmap
;
853 Bitmap
= GDIOBJ_LockObj(hBitmap
, GDI_OBJECT_TYPE_BITMAP
);
859 BITMAP_GetObject(Bitmap
, sizeof(BITMAP
), (PVOID
)&bm
);
861 if (Bitmap
->SurfObj
.lDelta
>= 0)
862 bm
.bmHeight
= -bm
.bmHeight
;
864 Size
.cx
= abs(bm
.bmWidth
);
865 Size
.cy
= abs(bm
.bmHeight
);
866 res
= IntCreateBitmap(Size
,
868 BitmapFormat(bm
.bmBitsPixel
* bm
.bmPlanes
, BI_RGB
),
869 (bm
.bmHeight
< 0 ? BMF_TOPDOWN
: 0) | BMF_NOZEROINIT
,
876 resBitmap
= GDIOBJ_LockObj(res
, GDI_OBJECT_TYPE_BITMAP
);
879 buf
= ExAllocatePoolWithTag(PagedPool
,
880 bm
.bmWidthBytes
* abs(bm
.bmHeight
),
884 GDIOBJ_UnlockObjByPtr((POBJ
)resBitmap
);
885 GDIOBJ_UnlockObjByPtr((POBJ
)Bitmap
);
886 GreDeleteObject(res
);
889 IntGetBitmapBits(Bitmap
, bm
.bmWidthBytes
* abs(bm
.bmHeight
), buf
);
890 IntSetBitmapBits(resBitmap
, bm
.bmWidthBytes
* abs(bm
.bmHeight
), buf
);
891 ExFreePoolWithTag(buf
,TAG_BITMAP
);
892 resBitmap
->flFlags
= Bitmap
->flFlags
;
893 GDIOBJ_UnlockObjByPtr((POBJ
)resBitmap
);
897 GreDeleteObject(res
);
902 GDIOBJ_UnlockObjByPtr((POBJ
)Bitmap
);
908 BITMAP_GetObject(SURFACE
*psurf
, INT Count
, LPVOID buffer
)
912 if (!buffer
) return sizeof(BITMAP
);
913 if ((UINT
)Count
< sizeof(BITMAP
)) return 0;
915 /* always fill a basic BITMAP structure */
918 pBitmap
->bmWidth
= psurf
->SurfObj
.sizlBitmap
.cx
;
919 pBitmap
->bmHeight
= psurf
->SurfObj
.sizlBitmap
.cy
;
920 pBitmap
->bmWidthBytes
= abs(psurf
->SurfObj
.lDelta
);
921 pBitmap
->bmPlanes
= 1;
922 pBitmap
->bmBitsPixel
= BitsPerFormat(psurf
->SurfObj
.iBitmapFormat
);
924 /* Check for DIB section */
927 /* Set bmBits in this case */
928 pBitmap
->bmBits
= psurf
->SurfObj
.pvBits
;
930 if (Count
>= sizeof(DIBSECTION
))
932 /* Fill rest of DIBSECTION */
933 PDIBSECTION pds
= buffer
;
935 pds
->dsBmih
.biSize
= sizeof(BITMAPINFOHEADER
);
936 pds
->dsBmih
.biWidth
= pds
->dsBm
.bmWidth
;
937 pds
->dsBmih
.biHeight
= pds
->dsBm
.bmHeight
;
938 pds
->dsBmih
.biPlanes
= pds
->dsBm
.bmPlanes
;
939 pds
->dsBmih
.biBitCount
= pds
->dsBm
.bmBitsPixel
;
940 switch (psurf
->SurfObj
.iBitmapFormat
)
942 /* FIXME: What about BI_BITFIELDS? */
949 pds
->dsBmih
.biCompression
= BI_RGB
;
952 pds
->dsBmih
.biCompression
= BI_RLE4
;
955 pds
->dsBmih
.biCompression
= BI_RLE8
;
958 pds
->dsBmih
.biCompression
= BI_JPEG
;
961 pds
->dsBmih
.biCompression
= BI_PNG
;
964 pds
->dsBmih
.biSizeImage
= psurf
->SurfObj
.cjBits
;
965 pds
->dsBmih
.biXPelsPerMeter
= 0;
966 pds
->dsBmih
.biYPelsPerMeter
= 0;
967 pds
->dsBmih
.biClrUsed
= psurf
->biClrUsed
;
968 pds
->dsBmih
.biClrImportant
= psurf
->biClrImportant
;
969 pds
->dsBitfields
[0] = psurf
->dsBitfields
[0];
970 pds
->dsBitfields
[1] = psurf
->dsBitfields
[1];
971 pds
->dsBitfields
[2] = psurf
->dsBitfields
[2];
972 pds
->dshSection
= psurf
->hDIBSection
;
973 pds
->dsOffset
= psurf
->dwOffset
;
975 return sizeof(DIBSECTION
);
980 /* not set according to wine test, confirmed in win2k */
981 pBitmap
->bmBits
= NULL
;
984 return sizeof(BITMAP
);
996 PSURFACE psurf
= SURFACE_LockSurface(hsurf
);
1000 SURFACE_UnlockSurface(psurf
);