question regarding dibsections
marcus at jet.franken.de
Mon Apr 24 14:44:50 CDT 2006
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_BOOL PendingXfers = TRUE;
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.
We do not do this, for us HBITMAP is a regular 16bit GDI
handle. GlobalLock will not work on it :/
More information about the wine-devel