GDI Calls May Nay Work With Very Large Coordinates (299533)



The information in this article applies to:

  • Microsoft Windows 2000 Server SP1
  • Microsoft Windows 2000 Server SP2
  • Microsoft Windows 2000 Advanced Server SP1
  • Microsoft Windows 2000 Advanced Server SP2
  • Microsoft Windows 2000 Professional SP1
  • Microsoft Windows 2000 Professional SP2

This article was previously published under Q299533

SYMPTOMS

Graphics Device Interface (GDI) programs may encounter errors when sending large X and Y coordinates to Windows GDI functions. There are two conditions that apply:
  • The Software Development Kit (SDK) documentation incorrectly states that coordinate spaces for devices are limited to 2^27 units high (0x8000000) by 2^27 units wide (0x8000000). The actual limits are 2^26 (0x4000000). The GetLastError function typically returns error 534 (ERROR_ARITHMETIC_OVERFLOW) when these limits are exceeded.

    Programs that are most likely to exceed the coordinate limits are those programs that have large scrollable windows, that use multiple-pixel-wide pens with GDI primitives (such as those that are used to draw lines, rectangles, arcs, ellipses, and so on).
  • A GDI call may not work because there is an internal error. When this occurs, the GetLastError function returns error 8 (ERROR_NOT_ENOUGH_MEMORY). This article describes how to update your computer to fix this problem.

    This problem affects, but is not limited to, Windows GDI functions such as LineTo and Rectangle. For example, if a GDI program runs code that is similar to the following code by using a tow-pixel-wide pen, the LineTo function may not work:
    MoveToEx(hDC, 10, 10, NULL);
    LineTo(hDC, 10, 65000000);

CAUSE

This problem occurs because internal logic errors may result in an attempt to allocate a magnitude more memory than the amount of memory that is necessary.

RESOLUTION

To resolve this problem, obtain the latest service pack for Windows 2000. For additional information, click the following article number to view the article in the Microsoft Knowledge Base:

260910 How to Obtain the Latest Windows 2000 Service Pack

The English-language version of this fix should have the following file attributes or later:
   Date      Time   Version        Size       File name
   -------------------------------------------------------
   08/28/01  14:50  5.0.2195.3914    222,480  Gdi32.dll
   08/28/01  14:50  5.0.2195.4195    707,856  Kernel32.dll
   08/28/01  19:17  3.10.0.103        47,808  User.exe
   08/28/01  14:50  5.0.2195.3914    379,664  User32.dll
   08/28/01  14:50  5.0.2195.4254    368,400  Userenv.dll
   08/28/01  14:48  5.0.2195.4258  1,642,320  Win32k.sys
   08/28/01  22:39  5.0.2195.4235    178,960  Winlogon.exe
   08/28/01  14:50  5.0.2195.4121    243,472  Winsrv.dll

STATUS

Microsoft has confirmed that this is a problem in the Microsoft products that are listed at the beginning of this article. This problem was first corrected in Windows 2000 Service Pack 3.

This problem was corrected in Microsoft Windows XP.

MORE INFORMATION

For additional information about how to install Windows 2000 and Windows 2000 hotfixes at the same time, click the article number below to view the article in the Microsoft Knowledge Base:

249149 Installing Microsoft Windows 2000 and Windows 2000 Hotfixes


Modification Type:MinorLast Reviewed:9/26/2005
Keywords:kbHotfixServer kbQFE kbbug kbfix kbshell kbWin2000PreSP3Fix kbWin2000sp3fix KB299533