FIX: QuickWin Copying Large Selection Causes GP Fault (86068)
The information in this article applies to:
- Microsoft FORTRAN Compiler for MS-DOS 5.1
- Microsoft FORTRAN compiler for OS/2 5.1
This article was previously published under Q86068 SYMPTOMS
Running a QuickWin application created by Microsoft FORTRAN version 5.1 for
MS-DOS and OS/2 that outputs a large quantity of output to a child window,
and then selecting a large amount of the output and choosing Copy from the
Edit menu, may cause a general protection (GP) fault under Windows 3.1 or
an unrecoverable application error (UAE) under Windows 3.0. If a smaller
(yet still large) region is selected, a dialog box may be generated with
the following error:
QWIN Warning
Out of Memory
CAUSE
The Copy menu item does a call to the Windows GlobalAlloc() API to allocate
memory from the global heap. QuickWin applications calculate the size of
the allocation by using a RECT Windows structure containing the dimensions
of the selection. The elements of this structure are only 2-byte integers
and when a very large region of text is selected, the integer values
overflow. The resulting handle returned from the GlobalAlloc() function is
invalid. The subsequent attempt to use the allocated memory causes a GP
fault. The QWIN Warning dialog box is generated when the size of the
selection is small enough to not overflow the integer elements of the RECT
structure but too big for GlobalAlloc() to succeed.
RESOLUTION
Do not attempt to copy extremely large areas of text in a QuickWin
application child window at one time. Select and copy smaller regions.
STATUS
Microsoft has confirmed this to be a problem in Microsoft FORTRAN version
5.1 for MS-DOS and Windows. This problem was corrected in FORTRAN
PowerStation.
Modification Type: | Major | Last Reviewed: | 10/23/2003 |
---|
Keywords: | kbfix KB86068 |
---|
|