[Bug 2682] New: PrgWin Fifth Edition - PoePoem.c - Unhandled Page Fault

Wine Bugs wine-bugs at winehq.org
Fri Jan 28 15:12:32 CST 2005


http://bugs.winehq.org/show_bug.cgi?id=2682

           Summary: PrgWin Fifth Edition - PoePoem.c - Unhandled Page Fault
           Product: Wine
           Version: 20010112
          Platform: PC
        OS/Version: Linux
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: wine-programs
        AssignedTo: wine-bugs at winehq.org
        ReportedBy: ikrakow_1999 at yahoo.com


Petzold Chapter 10 - PoePoem.c - produces the following message:

"Exception raised"
"Unhandled page fault on write access to 0x56ae117a at address 0x56ae0692.  Do
you wish to debug it?"  If you answer Yes, program enters Winedbg, with an
"Unhandled exception (thread 0009), starting debugger)" message.

The text of the poem is a locked resource.  There's a pointer (*pText) to the
locked resource.  The program bombs on the following line:

*pText = '\0';

If this line is commented out, the program runs fine, displaying the poem in the
window.  Below is a diff -C 10 output to show the context:

*** PoePoemHasBug.c	2005-01-28 15:48:22.753580008 -0500
--- PoePoemRunsOk.c	2005-01-28 15:48:22.753580008 -0500
***************
*** 98,118 ****
            
            pText = (char *) LockResource (hResource) ;
           iNumLines = 0 ;
            
            while (*pText != '\\' && *pText != '\0')
            {
                 if (*pText == '\n')
                      iNumLines ++ ;
               pText = AnsiNext (pText) ;
            }
!          *pText = '\0' ;
            
            SetScrollRange (hScroll, SB_CTL, 0, iNumLines, FALSE) ;
            SetScrollPos   (hScroll, SB_CTL, 0, FALSE) ;
            return 0 ;
            
       case WM_SIZE :
            MoveWindow (hScroll, LOWORD (lParam) - xScroll, 0,
                        xScroll, cyClient = HIWORD (lParam), TRUE) ;
            SetFocus (hwnd) ;
            return 0 ;
--- 98,118 ----
            
            pText = (char *) LockResource (hResource) ;
           iNumLines = 0 ;
            
            while (*pText != '\\' && *pText != '\0')
            {
                 if (*pText == '\n')
                      iNumLines ++ ;
               pText = AnsiNext (pText) ;
            }
! //       *pText = '\0' ;
            
            SetScrollRange (hScroll, SB_CTL, 0, iNumLines, FALSE) ;
            SetScrollPos   (hScroll, SB_CTL, 0, FALSE) ;
            return 0 ;
            
       case WM_SIZE :
            MoveWindow (hScroll, LOWORD (lParam) - xScroll, 0,
                        xScroll, cyClient = HIWORD (lParam), TRUE) ;
            SetFocus (hwnd) ;
            return 0 ;

-- 
Configure bugmail: http://bugs.winehq.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.



More information about the wine-bugs mailing list