Microsoft KB Archive/201212

{|
 * width="100%"|

INFO: Polyline Function Causes Windows 95/98 to Fault

 * }

Q201212

-

The information in this article applies to:


 * Microsoft Win32 Software Development Kit (SDK)
 * Microsoft Win32 Device Driver Kit (DDK), used with:
 * Microsoft Windows 95
 * Microsoft Windows 98

-

SUMMARY
When you use the Polyline function in the Windows SDK, the system faults if the following is true:


 * The distance between the end points of the lines in one direction is more than 32767.

-and-


 * The display driver is using the DIBENG.

MORE INFORMATION
The Polyline function in the Windows SDK is used to draw a set of lines on the display. If the difference between the x coordinates or the y coordinates of the end points of a line is more than 32767, Windows 95 and Windows 98 generate a General Protection Fault. For example, the following call generates a fault in Windows 95 or Windows 98:

POINT points[] = {

{ -25000, 25000},  { 30000, -25000},   { 32000,  32000},   {-32000, -32000}

};

Polyline(hDC, &points[0], (sizeof(point) / sizeof(POINT)));

This fault only occurs if the display driver on the system is using DIBENG. To ensure that the applications run consistently on all Windows 95 or Windows 98 computers, you need to make sure that the difference between any set of x coordinates and any set of y coordinates is less than 32767 when calling the Polyline function, even if the fault does not occur your computer.