No subject


Tue Aug 30 15:12:41 CDT 2005


-- BEGIN MSDN QUOTE --

GetDIBits

...
Return Values

If the lpvBits parameter is non-NULL and the function succeeds,
the return value is the number of scan lines copied from the bitmap.

Windows 95/98/Me: If the lpvBits parameter is NULL and GetDIBits
successfully fills the BITMAPINFO structure, the return value is
the total number of scan lines in the bitmap.

Windows NT/2000/XP: If the lpvBits parameter is NULL and
GetDIBits successfully fills the BITMAPINFO structure, the
return value is non-zero.

If the function fails, the return value is zero.

...

If lpvBits is NULL and the bit count member of BITMAPINFO is 
initialized to zero, GetDIBits fills in a BITMAPINFOHEADER
structure or BITMAPCOREHEADER without the color table. This
technique can be used to query bitmap attributes.
-- END MSDN QUOTE --

An application that relies on the GetDIBits behavior of 
returning bitmap attributes when lpvBits is NULL probably 
also sets cScanLines to 0 when calling this function. On 
Windows 9x, GetDIBits() returns the total number of scanlines 
in the DIB even if cScanLines is 0. The Wine implementation
copies over the cScanLines parameter without modification.
This leads a Windows application that relies on the nonzero
return behavior to (incorrectly) believe that the call failed.

This patch corrects the deviation and makes it conform to the
Windows 9x behavior. Since the MSDN only states that the
return value is nonzero for NT/2000, applications written on
NT/2000 should also be satisfied with this patch.

Thanks for your attention!
Alex Villacís Lasso


------------------------------------------------------------------------
Mail enviado desde PortalMail 1.4.2 Web based email system.
PaloSanto Solutions, Sunnyvale CA.
http://www.palosanto.com

---MOQ10855834022db50a0aeb5b51c760e333c4bd777e16
Content-Type: application/octet-stream; name="wine-patch-GetDIBits.diff"
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename="wine-patch-GetDIBits.diff"

ZGlmZiAtdXJOIHdpbmUtMjAwNDA1MDUvb2JqZWN0cy9kaWIuYyB3aW5lLTIwMDQwNTA1LXBhdGNo
L29iamVjdHMvZGliLmMKLS0tIHdpbmUtMjAwNDA1MDUvb2JqZWN0cy9kaWIuYwkyMDA0LTAzLTMw
IDE1OjM4OjQ1LjAwMDAwMDAwMCAtMDUwMAorKysgd2luZS0yMDA0MDUwNS1wYXRjaC9vYmplY3Rz
L2RpYi5jCTIwMDQtMDUtMjQgMjM6MDY6MDIuMDAwMDAwMDAwIC0wNTAwCkBAIC03NDYsNiArNzQ2
LDcgQEAKIAkJCQkJICAgICAgIGluZm8tPmJtaUhlYWRlci5iaUhlaWdodCwKIAkJCQkJICAgICAg
IGluZm8tPmJtaUhlYWRlci5iaUJpdENvdW50ICk7CiAJfQorCWxpbmVzID0gaW5mby0+Ym1pSGVh
ZGVyLmJpSGVpZ2h0OwogICAgIH0KIAogICAgIFRSQUNFKCJiaVNpemVJbWFnZSA9ICVsZCwgYmlX
aWR0aCA9ICVsZCwgYmlIZWlnaHQgPSAlbGRcbiIsCg==


---MOQ10855834022db50a0aeb5b51c760e333c4bd777e16--



More information about the wine-patches mailing list