diff --git a/dlls/ddraw/dsurface/dib.c b/dlls/ddraw/dsurface/dib.c index bf333a9f2c..1eceea5ba4 100644 --- a/dlls/ddraw/dsurface/dib.c +++ b/dlls/ddraw/dsurface/dib.c @@ -36,7 +36,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(ddraw); /* FIXME */ -extern HBITMAP DIB_CreateDIBSection( HDC hdc, BITMAPINFO *bmi, UINT usage, LPVOID *bits, +extern HBITMAP DIB_CreateDIBSection( HDC hdc, const BITMAPINFO *bmi, UINT usage, VOID **bits, HANDLE section, DWORD offset, DWORD ovr_pitch ); static ICOM_VTABLE(IDirectDrawSurface7) DIB_IDirectDrawSurface7_VTable; diff --git a/dlls/gdi/gdi_private.h b/dlls/gdi/gdi_private.h index 5049f7cb2f..98eb5802aa 100644 --- a/dlls/gdi/gdi_private.h +++ b/dlls/gdi/gdi_private.h @@ -62,7 +62,7 @@ typedef struct tagDC_FUNCS BOOL (*pCloseFigure)(PHYSDEV); BOOL (*pCreateBitmap)(PHYSDEV,HBITMAP); BOOL (*pCreateDC)(HDC,PHYSDEV *,LPCWSTR,LPCWSTR,LPCWSTR,const DEVMODEW*); - HBITMAP (*pCreateDIBSection)(PHYSDEV,BITMAPINFO *,UINT,LPVOID *,HANDLE,DWORD,DWORD); + HBITMAP (*pCreateDIBSection)(PHYSDEV,const BITMAPINFO *,UINT,VOID **,HANDLE,DWORD,DWORD); BOOL (*pDeleteBitmap)(HBITMAP); BOOL (*pDeleteDC)(PHYSDEV); BOOL (*pDeleteObject)(PHYSDEV,HGDIOBJ); diff --git a/dlls/x11drv/dib.c b/dlls/x11drv/dib.c index 70e5086ff2..7807cdcdd4 100644 --- a/dlls/x11drv/dib.c +++ b/dlls/x11drv/dib.c @@ -4505,8 +4505,8 @@ static XImage *X11DRV_XShmCreateImage( int width, int height, int bpp, * X11DRV_DIB_CreateDIBSection */ HBITMAP X11DRV_DIB_CreateDIBSection( - X11DRV_PDEVICE *physDev, BITMAPINFO *bmi, UINT usage, - LPVOID *bits, HANDLE section, + X11DRV_PDEVICE *physDev, const BITMAPINFO *bmi, UINT usage, + VOID **bits, HANDLE section, DWORD offset, DWORD ovr_pitch) { HBITMAP res = 0; @@ -4516,7 +4516,7 @@ HBITMAP X11DRV_DIB_CreateDIBSection( int nColorMap; /* Fill BITMAP32 structure with DIB data */ - BITMAPINFOHEADER *bi = &bmi->bmiHeader; + const BITMAPINFOHEADER *bi = &bmi->bmiHeader; INT effHeight, totalSize; BITMAP bm; LPVOID mapBits = NULL; diff --git a/dlls/x11drv/x11drv.h b/dlls/x11drv/x11drv.h index 18dee6fa25..cc40b4a162 100644 --- a/dlls/x11drv/x11drv.h +++ b/dlls/x11drv/x11drv.h @@ -287,8 +287,8 @@ extern INT X11DRV_CoerceDIBSection2(HBITMAP bmp,INT,BOOL); extern INT X11DRV_LockDIBSection2(HBITMAP bmp,INT,BOOL); extern void X11DRV_UnlockDIBSection2(HBITMAP bmp,BOOL); -extern HBITMAP X11DRV_DIB_CreateDIBSection(X11DRV_PDEVICE *physDev, BITMAPINFO *bmi, UINT usage, - LPVOID *bits, HANDLE section, DWORD offset, DWORD ovr_pitch); +extern HBITMAP X11DRV_DIB_CreateDIBSection(X11DRV_PDEVICE *physDev, const BITMAPINFO *bmi, UINT usage, + VOID **bits, HANDLE section, DWORD offset, DWORD ovr_pitch); extern void X11DRV_DIB_DeleteDIBSection(struct tagBITMAPOBJ *bmp); extern INT X11DRV_DIB_Coerce(struct tagBITMAPOBJ *,INT,BOOL); extern INT X11DRV_DIB_Lock(struct tagBITMAPOBJ *,INT,BOOL); diff --git a/include/wine/wingdi16.h b/include/wine/wingdi16.h index ac6d65c7b9..701398ebff 100644 --- a/include/wine/wingdi16.h +++ b/include/wine/wingdi16.h @@ -409,7 +409,7 @@ HDC16 WINAPI CreateDC16(LPCSTR,LPCSTR,LPCSTR,const DEVMODEA*); HBITMAP16 WINAPI CreateDIBitmap16(HDC16,const BITMAPINFOHEADER*,DWORD, LPCVOID,const BITMAPINFO*,UINT16); HBRUSH16 WINAPI CreateDIBPatternBrush16(HGLOBAL16,UINT16); -HBITMAP16 WINAPI CreateDIBSection16 (HDC16, BITMAPINFO *, UINT16, +HBITMAP16 WINAPI CreateDIBSection16 (HDC16, const BITMAPINFO *, UINT16, SEGPTR *, HANDLE, DWORD offset); HBITMAP16 WINAPI CreateDiscardableBitmap16(HDC16,INT16,INT16); HRGN16 WINAPI CreateEllipticRgn16(INT16,INT16,INT16,INT16); diff --git a/include/wingdi.h b/include/wingdi.h index af6e932d32..b9858a041a 100644 --- a/include/wingdi.h +++ b/include/wingdi.h @@ -3167,8 +3167,8 @@ HBITMAP WINAPI CreateDIBitmap(HDC,const BITMAPINFOHEADER*,DWORD, LPCVOID,const BITMAPINFO*,UINT); HBRUSH WINAPI CreateDIBPatternBrush(HGLOBAL,UINT); HBRUSH WINAPI CreateDIBPatternBrushPt(const void*,UINT); -HBITMAP WINAPI CreateDIBSection (HDC, BITMAPINFO *, UINT, - LPVOID *, HANDLE, DWORD offset); +HBITMAP WINAPI CreateDIBSection(HDC, CONST BITMAPINFO *, UINT, + VOID **, HANDLE, DWORD offset); HBITMAP WINAPI CreateDiscardableBitmap(HDC,INT,INT); HRGN WINAPI CreateEllipticRgn(INT,INT,INT,INT); HRGN WINAPI CreateEllipticRgnIndirect(const RECT *); diff --git a/objects/dib.c b/objects/dib.c index 74fd3d1b69..9e60a7e52e 100644 --- a/objects/dib.c +++ b/objects/dib.c @@ -841,7 +841,7 @@ HBITMAP WINAPI CreateDIBitmap( HDC hdc, const BITMAPINFOHEADER *header, /*********************************************************************** * CreateDIBSection (GDI.489) */ -HBITMAP16 WINAPI CreateDIBSection16 (HDC16 hdc, BITMAPINFO *bmi, UINT16 usage, +HBITMAP16 WINAPI CreateDIBSection16 (HDC16 hdc, const BITMAPINFO *bmi, UINT16 usage, SEGPTR *bits16, HANDLE section, DWORD offset) { LPVOID bits32; @@ -853,7 +853,7 @@ HBITMAP16 WINAPI CreateDIBSection16 (HDC16 hdc, BITMAPINFO *bmi, UINT16 usage, BITMAPOBJ *bmp = (BITMAPOBJ *) GDI_GetObjPtr(hbitmap, BITMAP_MAGIC); if (bmp && bmp->dib && bits32) { - BITMAPINFOHEADER *bi = &bmi->bmiHeader; + const BITMAPINFOHEADER *bi = &bmi->bmiHeader; INT height = bi->biHeight >= 0 ? bi->biHeight : -bi->biHeight; INT width_bytes = DIB_GetDIBWidthBytes(bi->biWidth, bi->biBitCount); INT size = (bi->biSizeImage && bi->biCompression != BI_RGB) ? @@ -881,8 +881,8 @@ HBITMAP16 WINAPI CreateDIBSection16 (HDC16 hdc, BITMAPINFO *bmi, UINT16 usage, /*********************************************************************** * DIB_CreateDIBSection */ -HBITMAP DIB_CreateDIBSection(HDC hdc, BITMAPINFO *bmi, UINT usage, - LPVOID *bits, HANDLE section, +HBITMAP DIB_CreateDIBSection(HDC hdc, const BITMAPINFO *bmi, UINT usage, + VOID **bits, HANDLE section, DWORD offset, DWORD ovr_pitch) { HBITMAP hbitmap = 0; @@ -896,12 +896,6 @@ HBITMAP DIB_CreateDIBSection(HDC hdc, BITMAPINFO *bmi, UINT usage, bDesktopDC = TRUE; } - /* Windows ignores the supplied values of biClrUsed and biClrImportant thus: */ - if (bmi->bmiHeader.biBitCount >= 1 && bmi->bmiHeader.biBitCount <= 8) - bmi->bmiHeader.biClrUsed = bmi->bmiHeader.biClrImportant = 1L << bmi->bmiHeader.biBitCount; - else - bmi->bmiHeader.biClrUsed = bmi->bmiHeader.biClrImportant = 0; - if ((dc = DC_GetDCPtr( hdc ))) { if(dc->funcs->pCreateDIBSection) @@ -918,8 +912,8 @@ HBITMAP DIB_CreateDIBSection(HDC hdc, BITMAPINFO *bmi, UINT usage, /*********************************************************************** * CreateDIBSection (GDI32.@) */ -HBITMAP WINAPI CreateDIBSection(HDC hdc, BITMAPINFO *bmi, UINT usage, - LPVOID *bits, HANDLE section, +HBITMAP WINAPI CreateDIBSection(HDC hdc, CONST BITMAPINFO *bmi, UINT usage, + VOID **bits, HANDLE section, DWORD offset) { return DIB_CreateDIBSection(hdc, bmi, usage, bits, section, offset, 0);