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
);
155 psurf
->ppal
= PALETTE_ShareLockPalette(Dc
->ppdev
->devinfo
.hpalDefault
);
156 SURFACE_UnlockSurface(psurf
);
162 PSURFACE psurf
= Dc
->dclevel
.pSurface
;
163 Count
= BITMAP_GetObject(psurf
, sizeof(dibs
), &dibs
);
167 if (Count
== sizeof(BITMAP
))
169 Bmp
= IntGdiCreateBitmap(abs(Width
),
172 dibs
.dsBm
.bmBitsPixel
,
175 if(Bmp
&& psurf
->ppal
)
177 PSURFACE psurfBmp
= SURFACE_LockSurface(Bmp
);
179 psurfBmp
->ppal
= psurf
->ppal
;
180 GDIOBJ_IncrementShareCount((POBJ
)psurf
->ppal
);
181 SURFACE_UnlockSurface(psurfBmp
);
186 /* A DIB section is selected in the DC */
190 /* Allocate memory for a BITMAPINFOHEADER structure and a
191 color table. The maximum number of colors in a color table
192 is 256 which corresponds to a bitmap with depth 8.
193 Bitmaps with higher depths don't have color tables. */
194 bi
= ExAllocatePoolWithTag(PagedPool
,
195 sizeof(BITMAPINFOHEADER
) +
196 256 * sizeof(RGBQUAD
),
201 bi
->bmiHeader
.biSize
= sizeof(bi
->bmiHeader
);
202 bi
->bmiHeader
.biWidth
= Width
;
203 bi
->bmiHeader
.biHeight
= Height
;
204 bi
->bmiHeader
.biPlanes
= dibs
.dsBmih
.biPlanes
;
205 bi
->bmiHeader
.biBitCount
= dibs
.dsBmih
.biBitCount
;
206 bi
->bmiHeader
.biCompression
= dibs
.dsBmih
.biCompression
;
207 bi
->bmiHeader
.biSizeImage
= 0;
208 bi
->bmiHeader
.biXPelsPerMeter
= dibs
.dsBmih
.biXPelsPerMeter
;
209 bi
->bmiHeader
.biYPelsPerMeter
= dibs
.dsBmih
.biYPelsPerMeter
;
210 bi
->bmiHeader
.biClrUsed
= dibs
.dsBmih
.biClrUsed
;
211 bi
->bmiHeader
.biClrImportant
= dibs
.dsBmih
.biClrImportant
;
213 if (bi
->bmiHeader
.biCompression
== BI_BITFIELDS
)
215 /* Copy the color masks */
216 RtlCopyMemory(bi
->bmiColors
, dibs
.dsBitfields
, 3 * sizeof(DWORD
));
218 else if (bi
->bmiHeader
.biBitCount
<= 8)
220 /* Copy the color table */
226 ExFreePoolWithTag(bi
, TAG_TEMP
);
227 SetLastWin32Error(ERROR_INVALID_HANDLE
);
231 PalGDI
= PALETTE_LockPalette(psurf
->ppal
->BaseObject
.hHmgr
);
234 Index
< 256 && Index
< PalGDI
->NumColors
;
237 bi
->bmiColors
[Index
].rgbRed
= PalGDI
->IndexedColors
[Index
].peRed
;
238 bi
->bmiColors
[Index
].rgbGreen
= PalGDI
->IndexedColors
[Index
].peGreen
;
239 bi
->bmiColors
[Index
].rgbBlue
= PalGDI
->IndexedColors
[Index
].peBlue
;
240 bi
->bmiColors
[Index
].rgbReserved
= 0;
242 PALETTE_UnlockPalette(PalGDI
);
245 Bmp
= DIB_CreateDIBSection(Dc
,
253 ExFreePoolWithTag(bi
, TAG_TEMP
);
264 NtGdiCreateCompatibleBitmap(
272 if (Width
<= 0 || Height
<= 0 || (Width
* Height
) > 0x3FFFFFFF)
274 SetLastWin32Error(ERROR_INVALID_PARAMETER
);
279 return IntGdiCreateBitmap(Width
, Height
, 1, 1, 0);
283 DPRINT("NtGdiCreateCompatibleBitmap(%04x,%d,%d, bpp:%d) = \n",
284 hDC
, Width
, Height
, Dc
->ppdev
->gdiinfo
.cBitsPixel
);
288 SetLastWin32Error(ERROR_INVALID_HANDLE
);
292 Bmp
= IntCreateCompatibleBitmap(Dc
, Width
, Height
);
294 DPRINT("\t\t%04x\n", Bmp
);
300 NtGdiGetBitmapDimension(
310 psurfBmp
= SURFACE_LockSurface(hBitmap
);
311 if (psurfBmp
== NULL
)
313 SetLastWin32Error(ERROR_INVALID_HANDLE
);
319 ProbeForWrite(Dimension
, sizeof(SIZE
), 1);
320 *Dimension
= psurfBmp
->dimension
;
322 _SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER
)
328 SURFACE_UnlockSurface(psurfBmp
);
334 NtGdiGetPixel(HDC hDC
, INT XPos
, INT YPos
)
337 COLORREF Result
= (COLORREF
)CLR_INVALID
; // default to failure
338 BOOL bInRect
= FALSE
;
349 SetLastWin32Error(ERROR_INVALID_HANDLE
);
353 if (dc
->dctype
== DC_TYPE_INFO
)
359 XPos
+= dc
->ptlDCOrig
.x
;
360 YPos
+= dc
->ptlDCOrig
.y
;
361 if (RECTL_bPointInRect(&dc
->rosdc
.CombinedClip
->rclBounds
, XPos
, YPos
))
364 psurf
= dc
->dclevel
.pSurface
;
367 pso
= &psurf
->SurfObj
;
371 GDIOBJ_IncrementShareCount(&ppal
->BaseObject
);
374 ppal
= PALETTE_ShareLockPalette(dc
->ppdev
->devinfo
.hpalDefault
);
376 if (psurf
->SurfObj
.iBitmapFormat
== BMF_1BPP
&& !psurf
->hSecure
)
378 /* FIXME: palette should be gpalMono already ! */
379 EXLATEOBJ_vInitialize(&exlo
, &gpalMono
, &gpalRGB
, 0, 0xffffff, 0);
383 EXLATEOBJ_vInitialize(&exlo
, ppal
, &gpalRGB
, 0, 0xffffff, 0);
386 // check if this DC has a DIB behind it...
387 if (pso
->pvScan0
) // STYPE_BITMAP == pso->iType
390 Result
= XLATEOBJ_iXlate(&exlo
.xlo
,
391 DibFunctionsForBitmapFormat
[pso
->iBitmapFormat
].DIB_GetPixel(pso
, XPos
, YPos
));
394 EXLATEOBJ_vCleanup(&exlo
);
395 PALETTE_ShareUnlockPalette(ppal
);
400 // if Result is still CLR_INVALID, then the "quick" method above didn't work
401 if (bInRect
&& Result
== CLR_INVALID
)
403 // FIXME: create a 1x1 32BPP DIB, and blit to it
404 HDC hDCTmp
= NtGdiCreateCompatibleDC(hDC
);
407 static const BITMAPINFOHEADER bih
= { sizeof(BITMAPINFOHEADER
), 1, 1, 1, 32, BI_RGB
, 0, 0, 0, 0, 0 };
409 RtlMoveMemory(&(bi
.bmiHeader
), &bih
, sizeof(bih
));
410 hBmpTmp
= NtGdiCreateDIBitmapInternal(hDC
,
411 bi
.bmiHeader
.biWidth
,
412 bi
.bmiHeader
.biHeight
,
417 bi
.bmiHeader
.biBitCount
,
418 bi
.bmiHeader
.biSizeImage
,
422 //HBITMAP hBmpTmp = IntGdiCreateBitmap(1, 1, 1, 32, NULL);
425 HBITMAP hBmpOld
= (HBITMAP
)NtGdiSelectBitmap(hDCTmp
, hBmpTmp
);
430 NtGdiBitBlt(hDCTmp
, 0, 0, 1, 1, hDC
, XPos
, YPos
, SRCCOPY
, 0, 0);
431 NtGdiSelectBitmap(hDCTmp
, hBmpOld
);
433 // our bitmap is no longer selected, so we can access it's stuff...
434 psurf
= SURFACE_LockSurface(hBmpTmp
);
437 // Dont you need to convert something here?
438 Result
= *(COLORREF
*)psurf
->SurfObj
.pvScan0
;
439 SURFACE_UnlockSurface(psurf
);
442 GreDeleteObject(hBmpTmp
);
444 NtGdiDeleteObjectApp(hDCTmp
);
462 /* Don't copy more bytes than the buffer has */
463 Bytes
= min(Bytes
, psurf
->SurfObj
.cjBits
);
466 /* FIXME: Call DDI CopyBits here if available */
469 DPRINT("Calling device specific BitmapBits\n");
470 if (psurf
->DDBitmap
->funcs
->pBitmapBits
)
472 ret
= psurf
->DDBitmap
->funcs
->pBitmapBits(hbitmap
,
479 ERR_(bitmap
)("BitmapBits == NULL??\n");
486 RtlCopyMemory(Bits
, psurf
->SurfObj
.pvBits
, Bytes
);
496 OUT OPTIONAL PBYTE pUnsafeBits
)
501 if (pUnsafeBits
!= NULL
&& Bytes
== 0)
506 psurf
= SURFACE_LockSurface(hBitmap
);
509 SetLastWin32Error(ERROR_INVALID_HANDLE
);
513 bmSize
= BITMAP_GetWidthBytes(psurf
->SurfObj
.sizlBitmap
.cx
,
514 BitsPerFormat(psurf
->SurfObj
.iBitmapFormat
)) *
515 abs(psurf
->SurfObj
.sizlBitmap
.cy
);
517 /* If the bits vector is null, the function should return the read size */
518 if (pUnsafeBits
== NULL
)
520 SURFACE_UnlockSurface(psurf
);
524 /* Don't copy more bytes than the buffer has */
525 Bytes
= min(Bytes
, bmSize
);
527 // FIXME: use MmSecureVirtualMemory
530 ProbeForWrite(pUnsafeBits
, Bytes
, 1);
531 ret
= IntGetBitmapBits(psurf
, Bytes
, pUnsafeBits
);
533 _SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER
)
539 SURFACE_UnlockSurface(psurf
);
553 /* Don't copy more bytes than the buffer has */
554 Bytes
= min(Bytes
, psurf
->SurfObj
.cjBits
);
557 /* FIXME: call DDI specific function here if available */
560 DPRINT("Calling device specific BitmapBits\n");
561 if (psurf
->DDBitmap
->funcs
->pBitmapBits
)
563 ret
= psurf
->DDBitmap
->funcs
->pBitmapBits(hBitmap
,
570 DPRINT("BitmapBits == NULL??\n");
577 RtlCopyMemory(psurf
->SurfObj
.pvBits
, Bits
, Bytes
);
589 IN PBYTE pUnsafeBits
)
594 if (pUnsafeBits
== NULL
|| Bytes
== 0)
599 psurf
= SURFACE_LockSurface(hBitmap
);
602 SetLastWin32Error(ERROR_INVALID_HANDLE
);
608 ProbeForRead(pUnsafeBits
, Bytes
, 1);
609 ret
= IntSetBitmapBits(psurf
, Bytes
, pUnsafeBits
);
611 _SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER
)
617 SURFACE_UnlockSurface(psurf
);
623 NtGdiSetBitmapDimension(
635 psurf
= SURFACE_LockSurface(hBitmap
);
638 SetLastWin32Error(ERROR_INVALID_HANDLE
);
646 ProbeForWrite(Size
, sizeof(SIZE
), 1);
647 *Size
= psurf
->dimension
;
649 _SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER
)
656 /* The dimension is changed even if writing the old value failed */
657 psurf
->dimension
.cx
= Width
;
658 psurf
->dimension
.cy
= Height
;
660 SURFACE_UnlockSurface(psurf
);
665 VOID
IntHandleSpecialColorType(HDC hDC
, COLORREF
* Color
)
669 PALETTEENTRY palEntry
;
672 switch (*Color
>> 24)
674 case 0x10: /* DIBINDEX */
675 if (IntGetDIBColorTable(hDC
, LOWORD(*Color
), 1, &quad
) == 1)
677 *Color
= RGB(quad
.rgbRed
, quad
.rgbGreen
, quad
.rgbBlue
);
681 /* Out of color table bounds - use black */
682 *Color
= RGB(0, 0, 0);
685 case 0x02: /* PALETTERGB */
686 pdc
= DC_LockDc(hDC
);
687 if (pdc
->dclevel
.hpal
!= NtGdiGetStockObject(DEFAULT_PALETTE
))
689 index
= NtGdiGetNearestPaletteIndex(pdc
->dclevel
.hpal
, *Color
);
690 IntGetPaletteEntries(pdc
->dclevel
.hpal
, index
, 1, &palEntry
);
691 *Color
= RGB(palEntry
.peRed
, palEntry
.peGreen
, palEntry
.peBlue
);
695 /* Use the pure color */
696 *Color
= *Color
& 0x00FFFFFF;
700 case 0x01: /* PALETTEINDEX */
701 pdc
= DC_LockDc(hDC
);
702 if (IntGetPaletteEntries(pdc
->dclevel
.hpal
, LOWORD(*Color
), 1, &palEntry
) == 1)
704 *Color
= RGB(palEntry
.peRed
, palEntry
.peGreen
, palEntry
.peBlue
);
708 /* Index does not exist, use zero index */
709 IntGetPaletteEntries(pdc
->dclevel
.hpal
, 0, 1, &palEntry
);
710 *Color
= RGB(palEntry
.peRed
, palEntry
.peGreen
, palEntry
.peBlue
);
715 DPRINT("Unsupported color type %d passed\n", *Color
>> 24);
730 if ((Color
& 0xFF000000) != 0)
732 IntHandleSpecialColorType(hDC
, &Color
);
735 hBrush
= NtGdiCreateSolidBrush(Color
, NULL
);
739 OldBrush
= NtGdiSelectBrush(hDC
, hBrush
);
740 if (OldBrush
== NULL
)
742 GreDeleteObject(hBrush
);
746 NtGdiPatBlt(hDC
, X
, Y
, 1, 1, PATCOPY
);
747 NtGdiSelectBrush(hDC
, OldBrush
);
748 GreDeleteObject(hBrush
);
760 DPRINT("0 NtGdiSetPixel X %ld Y %ld C %ld\n", X
, Y
, Color
);
762 if (GdiSetPixelV(hDC
,X
,Y
,Color
))
764 Color
= NtGdiGetPixel(hDC
,X
,Y
);
765 DPRINT("1 NtGdiSetPixel X %ld Y %ld C %ld\n", X
, Y
, Color
);
769 Color
= (COLORREF
)CLR_INVALID
;
770 DPRINT("2 NtGdiSetPixel X %ld Y %ld C %ld\n", X
, Y
, Color
);
775 /* Internal Functions */
778 BITMAP_GetRealBitsPixel(UINT nBitsPixel
)
786 if (nBitsPixel
<= 16)
788 if (nBitsPixel
<= 24)
790 if (nBitsPixel
<= 32)
797 BITMAP_GetWidthBytes(INT bmWidth
, INT bpp
)
803 return 2 * ((bmWidth
+15) >> 4);
806 bmWidth
*= 3; /* fall through */
808 return bmWidth
+ (bmWidth
& 1);
818 return 2 * ((bmWidth
+3) >> 2);
827 return ((bmWidth
* bpp
+ 15) & ~15) >> 3;
831 BITMAP_CopyBitmap(HBITMAP hBitmap
)
835 SURFACE
*Bitmap
, *resBitmap
;
843 Bitmap
= GDIOBJ_LockObj(hBitmap
, GDI_OBJECT_TYPE_BITMAP
);
849 BITMAP_GetObject(Bitmap
, sizeof(BITMAP
), (PVOID
)&bm
);
851 if (Bitmap
->SurfObj
.lDelta
>= 0)
852 bm
.bmHeight
= -bm
.bmHeight
;
854 Size
.cx
= abs(bm
.bmWidth
);
855 Size
.cy
= abs(bm
.bmHeight
);
856 res
= IntCreateBitmap(Size
,
858 BitmapFormat(bm
.bmBitsPixel
* bm
.bmPlanes
, BI_RGB
),
859 (bm
.bmHeight
< 0 ? BMF_TOPDOWN
: 0) | BMF_NOZEROINIT
,
866 resBitmap
= GDIOBJ_LockObj(res
, GDI_OBJECT_TYPE_BITMAP
);
869 buf
= ExAllocatePoolWithTag(PagedPool
,
870 bm
.bmWidthBytes
* abs(bm
.bmHeight
),
874 GDIOBJ_UnlockObjByPtr((POBJ
)resBitmap
);
875 GDIOBJ_UnlockObjByPtr((POBJ
)Bitmap
);
876 GreDeleteObject(res
);
879 IntGetBitmapBits(Bitmap
, bm
.bmWidthBytes
* abs(bm
.bmHeight
), buf
);
880 IntSetBitmapBits(resBitmap
, bm
.bmWidthBytes
* abs(bm
.bmHeight
), buf
);
881 ExFreePoolWithTag(buf
,TAG_BITMAP
);
882 resBitmap
->flFlags
= Bitmap
->flFlags
;
886 resBitmap
->ppal
= Bitmap
->ppal
;
887 GDIOBJ_IncrementShareCount(&Bitmap
->ppal
->BaseObject
);
889 GDIOBJ_UnlockObjByPtr((POBJ
)resBitmap
);
893 GreDeleteObject(res
);
898 GDIOBJ_UnlockObjByPtr((POBJ
)Bitmap
);
904 BITMAP_GetObject(SURFACE
*psurf
, INT Count
, LPVOID buffer
)
908 if (!buffer
) return sizeof(BITMAP
);
909 if ((UINT
)Count
< sizeof(BITMAP
)) return 0;
911 /* always fill a basic BITMAP structure */
914 pBitmap
->bmWidth
= psurf
->SurfObj
.sizlBitmap
.cx
;
915 pBitmap
->bmHeight
= psurf
->SurfObj
.sizlBitmap
.cy
;
916 pBitmap
->bmWidthBytes
= abs(psurf
->SurfObj
.lDelta
);
917 pBitmap
->bmPlanes
= 1;
918 pBitmap
->bmBitsPixel
= BitsPerFormat(psurf
->SurfObj
.iBitmapFormat
);
920 /* Check for DIB section */
923 /* Set bmBits in this case */
924 pBitmap
->bmBits
= psurf
->SurfObj
.pvBits
;
926 if (Count
>= sizeof(DIBSECTION
))
928 /* Fill rest of DIBSECTION */
929 PDIBSECTION pds
= buffer
;
931 pds
->dsBmih
.biSize
= sizeof(BITMAPINFOHEADER
);
932 pds
->dsBmih
.biWidth
= pds
->dsBm
.bmWidth
;
933 pds
->dsBmih
.biHeight
= pds
->dsBm
.bmHeight
;
934 pds
->dsBmih
.biPlanes
= pds
->dsBm
.bmPlanes
;
935 pds
->dsBmih
.biBitCount
= pds
->dsBm
.bmBitsPixel
;
936 switch (psurf
->SurfObj
.iBitmapFormat
)
938 /* FIXME: What about BI_BITFIELDS? */
945 pds
->dsBmih
.biCompression
= BI_RGB
;
948 pds
->dsBmih
.biCompression
= BI_RLE4
;
951 pds
->dsBmih
.biCompression
= BI_RLE8
;
954 pds
->dsBmih
.biCompression
= BI_JPEG
;
957 pds
->dsBmih
.biCompression
= BI_PNG
;
960 pds
->dsBmih
.biSizeImage
= psurf
->SurfObj
.cjBits
;
961 pds
->dsBmih
.biXPelsPerMeter
= 0;
962 pds
->dsBmih
.biYPelsPerMeter
= 0;
963 pds
->dsBmih
.biClrUsed
= psurf
->biClrUsed
;
964 pds
->dsBmih
.biClrImportant
= psurf
->biClrImportant
;
965 pds
->dsBitfields
[0] = psurf
->dsBitfields
[0];
966 pds
->dsBitfields
[1] = psurf
->dsBitfields
[1];
967 pds
->dsBitfields
[2] = psurf
->dsBitfields
[2];
968 pds
->dshSection
= psurf
->hDIBSection
;
969 pds
->dsOffset
= psurf
->dwOffset
;
971 return sizeof(DIBSECTION
);
976 /* not set according to wine test, confirmed in win2k */
977 pBitmap
->bmBits
= NULL
;
980 return sizeof(BITMAP
);
992 PSURFACE psurf
= SURFACE_LockSurface(hsurf
);
996 SURFACE_UnlockSurface(psurf
);