www.delorie.com/djgpp/bugs/show.cgi   search  
Bug 000348

When Created: 11/14/2001 20:37:41
Against DJGPP version: cvs
By whom: AxelAnwo@msn.com
Abstract: DJGPP can maul the video mode list returned by VESA VBE function 0x4F00 (Get Video Info)
After calling VESA VBE function 0x4F00 and acquiring the VBEInfoBlock structure, the VBEInfoBlock's VideoModePtr should point to a list of video modes supported by the video card (assuming VESA is supported, etc.).  However, it is possible that, when trying to determine the modes in this list, the program has (inadvertently) overwritten the memory pointed to by this pointer.

Workaround added: 11/14/2001 20:43:18
By whom: AxelAnwo@msn.com
This is (from what I can tell) associated with the use of 'cout' and accessing other pointers from the VBEInfoBlock structure.  If you place the code that reads the video mode list IMMEDIATELY after acquiring the InfoBlock with function 0x4F00, then the problem should resolve (at least it did for me).  DO NOT USE ANY OTHER POINTERS FROM THE STRUCTURE UNTIL *AFTER* ACQUIRING THE VIDEO MODE LIST.  Note: This problem was found on an HP 6630 series Pavilion PC running a Celeron 500 processor with 64 MB RAM.

Note added: 11/15/2001 08:23:43
By whom: eliz@is.elta.co.il
This is a usage problem: the VESA info block is in the transfer buffer, so if
the program invokes any real-mode services, such as disk or screen I/O, the
contents of the transfer buffer will be overwritten.

The solution is to copy the entire VESA info block from the transfer buffer
(using dosmemget or similar library functions) into a buffer in the application
data segment, before issuing any further library function calls.

I'm closing this report.

Closed on 11/15/2001 08:32:00: Not a bug; expected behavior
By whom: eliz@is.elta.co.il



  webmaster   donations   bookstore     delorie software   privacy  
  Copyright 2010   by DJ Delorie     Updated Jul 2010