question regarding dibsections
marcus at jet.franken.de
Fri Apr 28 15:38:13 CDT 2006
On Mon, Apr 24, 2006 at 09:44:50PM +0200, Marcus Meissner wrote:
> While debugging twain, I came across the nativexfer method, used by 60-70%
> of all twain using programs.
> It has some very unfortunate programming logic.
> Here is a sample snippet from:
> TW_UINT16 rc;
> TW_UINT32 hBitmap;
> TW_BOOL PendingXfers = TRUE;
> LPBITMAPINFOHEADER lpDib;
> hBitmap = NULL;
> rc = lpfnDSM_Entry(pAppId,pSourceId,DG_IMAGE,DAT_IMAGENATIVEXFER,MSG_GET,(TW_MEMREF)&hBitmap);
> lpDib = (LPBITMAPINFOHEADER)GlobalLock((void*)hBitmap);
> /* ... */
> (hBitmap is the return value of CreateDIBSection()).
> This sample code apparently assumes that GlobalLock(HBITMAP) gives it
> a pointer to a BITMAPINFOHEADER.
It also expects the DIB bits right behind this header (+ palette), which absolutely
does not match our currently DIB memory layouts.
I expect much fun :)
More information about the wine-devel