[Bug 6399] Crash with debugging tools of Gameboy Advance emulator " Visualboy Advance"

wine-bugs at winehq.org wine-bugs at winehq.org
Sat Dec 22 12:24:33 CST 2007


Andrey Turkin <andrey.turkin at gmail.com> changed:

           What    |Removed                     |Added
                 CC|                            |andrey.turkin at gmail.com

--- Comment #5 from Andrey Turkin <andrey.turkin at gmail.com>  2007-12-22 12:24:33 ---
The program is buggy; instead of
  CPen *old = (CPen *)memDC.SelectObject(pen);
there must be
  CPen *old = memDC.SelectObject(&pen);

Thanks to C++ polymorphism such small typo made almost bare SelectObject call
instead of MFC-wrapped CPen-aware call. old variable gets initialized with old
pen object ID, which then will be used as pointer to CPen. On Windows (in my
test anyway) old (default) pen ID is 0x1B00017, which points in middle of some
zero-filled memory block so this error was unnoticed. On Wine it is 0x60 hence
I doubt we should tune IDs and provide memory maps to work this around, unless
there are many such programs with same problem.

Configure bugmail: http://bugs.winehq.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are watching all bug changes.

More information about the wine-bugs mailing list