INFO: Polyline() Function Causes Windows 95/98 to Fault (201212)



The information in this article applies to:

  • Microsoft Platform Software Development Kit (SDK) 1.0
  • Microsoft Win32 Device Driver Kit (DDK), when used with:
    • Microsoft Windows 95
    • Microsoft Windows 98

This article was previously published under Q201212

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.

REFERENCES

For additional information on the Polyline() function, please refer to the Windows Software Development Kit (SDK).

Modification Type:MinorLast Reviewed:7/11/2005
Keywords:kbinfo KB201212