The information in this article applies to:
SYMPTOMSDrawing lines to a memory DC containing a complex clipping region causes an unrecoverable application error (UAE) or general protection (GP) fault. CAUSE
Under certain rare conditions, drawing a single line to a DC containing a
complex clipping region will cause a UAE under Windows 3.0 and a GP fault
under Windows 3.1.
For example, when the following GDI calls are performed on a memory bitmap, a UAE/GP fault will occur in the VGA display driver: The UAE/GP fault occurs at the display driver level because GDI is sending an incorrect parameter to the display driver's Output() function. The clipping rectangle sent to this function contains a -1 for one of the points, and negative values for clipping rectangles are not valid. A few display drivers, for example the XGA driver, perform parameter checking on this clipping rectangle and will not fail. Others, like the V7VGA, VGA, and 8514/a display drivers do not perform validation on this call and will produce a UAE/GP fault. RESOLUTION
Because this problem occurs only when the Y origin of your hDC is at the
physical (screen coordinate) Y origin, it is unlikely that this problem
will occur while you are drawing to a standard screen DC. For this UAE/GP
fault to occur on a screen DC, the top of your client area would have to be
at the screen Y origin, which is normally not the case.
Note that there is a distinction between logical and physical clipping regions; the above workaround works only with a logical clipping region. If you create a region and then select it into your DC as a clipping region, the coordinates for this region are device coordinates rather than logical coordinates. In this case, you need to manually offset of the top of the region by 1. Some of the functions that create physical regions are CreateRectRgn(), CreateEllipticRgn(), and OffsetRgn(). The functions GetClipBox() and GetRgnBox() can be used to determine the upper physical-coordinate extent of the regions. If your application uses only the functions IntersectClipRect() and ExcludeClipRect(), your clipping regions will be in logical units. Another workaround is to either not use complex clipping regions in your memory bitmaps or manually verify that no lines will be drawn above the top of your Y origin. NOTE: This UAE/GP fault might be generated for more than just MoveTo()/LineTo() calls--it can occur for any GDI call that generates lines, including rectangle, polygon, polypolygon, arc, and vector font output. STATUSMicrosoft has confirmed this to be a bug in Windows versions 3.0, 3.0a, and 3.1. However, because the conditions for this error to occur are very specific, most Windows applications will never encounter this problem. We are researching this problem and will post new information here in the Microsoft Knowledge Base as it becomes available. Additional query words: 3.00 3.00a 3.10 OS_POLYLINE buglist3.00 buglist3.00a buglist3.10
Keywords : kbSDKWin16 |
Last Reviewed: June 14, 1999 © 2000 Microsoft Corporation. All rights reserved. Terms of Use. |