FIX: App Crash Using _getimage() or _putimage() in SVGA Mode
PSS ID Number: Q102151
Article last modified on 12-21-1993

7.00

MS-DOS


----------------------------------------------------------------------
The information in this article applies to:

 - Microsoft C/C++ for MS-DOS, version 7.0
----------------------------------------------------------------------

SYMPTOMS
========

An attempt to use the graphics library functions _getimage() and
_putimage in a Super VGA mode may cause an application to crash when
it runs in the MS-DOS operating system. If the application runs in an
MS-DOS window in the Microsoft Windows operating system, Windows may
generate the following message:

   This application has violated system integrity

STATUS
======

Microsoft has confirmed this to be a problem in C/C++ version 7.0 for
MS-DOS. This problem was corrected in C/C++ version 8.0 provided with
Microsoft Visual C++ version 1.0 for Windows.

MORE INFORMATION
================

The following code example demonstrates this problem.

Sample Code
-----------

/*
 * Compiler Options needed: None
 */

#include <conio.h>
#include <stdlib.h>
#include <malloc.h>
#include <graph.h>

void main(void)
{
   short i;
   char  __huge *buffer;
   struct videoconfig myscreen;
   long imsize;

   if (!_setvideomode(_VRES256COLOR))
      {
      puts("Unable to enable _VRES256COLOR mode.\n");
      exit(1);
      }

   _getvideoconfig(&myscreen);

   imsize = _imagesize(0, 0, myscreen.numxpixels - 1, 0);

   buffer = (char __far *)halloc(imsize, 1);
   if (buffer == NULL)
      exit(1);

   _getimage(0, 102, myscreen.numxpixels - 1, 102, buffer);

   _getch();
   _hfree(buffer);
   _setvideomode(_DEFAULTMODE);
}

Additional reference words: 1.00 7.00 8.00
KBCategory: Prg
KBSubCategory:

=============================================================================

Copyright Microsoft Corporation 1993.
