mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-12 13:17:18 +02:00
win32: workaround windows 98 AV inside GetObjectType (issue #9955)
git-svn-id: trunk@12532 -
This commit is contained in:
parent
2bc78d0dfd
commit
ce4864f3b7
@ -487,10 +487,27 @@ begin
|
|||||||
if (blendFunction.AlphaFormat = AC_SRC_ALPHA) and (SrcSection.dsBm.bmBitsPixel <> 32) then Exit(False); // invalid
|
if (blendFunction.AlphaFormat = AC_SRC_ALPHA) and (SrcSection.dsBm.bmBitsPixel <> 32) then Exit(False); // invalid
|
||||||
|
|
||||||
// get destination info, atleast bitmap, if possible also section
|
// get destination info, atleast bitmap, if possible also section
|
||||||
if GetObjectType(hdcDest) = OBJ_MEMDC
|
if WindowsVersion in [wv95, wv98]
|
||||||
then DstBmp := GetCurrentObject(hdcDest, OBJ_BITMAP)
|
then begin
|
||||||
else DstBmp := 0;
|
// under windows 98 GetObjectType() sometimes produce AV inside and
|
||||||
if (DstBmp = 0) or (GetObject(DstBmp, SizeOf(DstSection), @DstSection) = 0)
|
// as result our debugger stopes and show exception
|
||||||
|
// lazarus is not alone application with such problem under windows 98
|
||||||
|
// here is workaround for windows 9x
|
||||||
|
DstBmp := GetCurrentObject(hdcDest, OBJ_BITMAP);
|
||||||
|
DstSection.dsBm.bmBits := nil;
|
||||||
|
if (DstBmp <> 0)
|
||||||
|
and ((GetObject(DstBmp, SizeOf(DstSection), @DstSection) < SizeOf(TDIBSection)) or (DstSection.dsBm.bmBits = nil))
|
||||||
|
then DstBmp := 0;
|
||||||
|
end
|
||||||
|
else begin
|
||||||
|
if GetObjectType(hdcDest) = OBJ_MEMDC
|
||||||
|
then DstBmp := GetCurrentObject(hdcDest, OBJ_BITMAP)
|
||||||
|
else DstBmp := 0;
|
||||||
|
if (DstBmp <> 0) and (GetObject(DstBmp, SizeOf(DstSection), @DstSection) = 0)
|
||||||
|
then DstBmp := 0;
|
||||||
|
end;
|
||||||
|
|
||||||
|
if (DstBmp = 0)
|
||||||
then begin
|
then begin
|
||||||
// GetCurrentObject can only be used on memory devices,
|
// GetCurrentObject can only be used on memory devices,
|
||||||
// so fill in some values manually
|
// so fill in some values manually
|
||||||
|
Loading…
Reference in New Issue
Block a user