Changeset 645 for trunk/src


Ignore:
Timestamp:
Aug 23, 1999, 3:07:56 PM (26 years ago)
Author:
phaller
Message:

Fix: GetClassInfoA fails on querying system classes. Win32Proc constructor crashed.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/user32/wndproc.cpp

    r364 r645  
    1 /* $Id: wndproc.cpp,v 1.14 1999-07-22 13:18:14 sandervl Exp $ */
     1/* $Id: wndproc.cpp,v 1.15 1999-08-23 13:07:10 phaller Exp $ */
    22
    33/*
     
    116116                        : hwnd(0), next(NULL), os2dlg(NULL), pOS2Callback(NULL)
    117117{
    118  WNDCLASSA wc;
    119  BOOL rc;
     118  WNDCLASSA wc;
     119  BOOL rc;
    120120
    121121  rc = GetClassInfoA(hinst, lpszClassName, &wc);
    122   assert(rc == TRUE);
    123 
    124 //  pCallback = Win32WindowClass::GetClassCallback(hinst, (LPSTR)wc.lpszClassName);
    125   pCallback = Win32WindowClass::GetClassCallback((LPSTR)wc.lpszClassName);
    126 //test (8nov)
    127   if(pCallback == NULL) {//system class
     122  if (rc == FALSE)
     123  {
     124    dprintf (("USER32:WNDPROC: GetClassInfoA(%s) failed.",
     125              lpszClassName));
     126  }
     127  else
     128  {
     129    //  pCallback = Win32WindowClass::GetClassCallback(hinst, (LPSTR)wc.lpszClassName);
     130    pCallback = Win32WindowClass::GetClassCallback((LPSTR)wc.lpszClassName);
     131    if(pCallback == NULL) //system class
    128132        pCallback = (WNDPROC)wc.lpfnWndProc;
    129133  }
    130 //  assert(pCallback != NULL);
    131134
    132135  //Insert it in front of the rest
     
    145148{
    146149  Win32WindowProc *window = Win32WindowProc::windows;
    147  
     150
    148151  /* @@@PH 98/07/13 what's this whole code good for ? */
    149   if(window == this) 
     152  if(window == this)
    150153  {
    151154    windows = next;
    152155  }
    153   else 
     156  else
    154157  {
    155158    /* @@@PH 98/07/13 window can be NULL */
    156159    if (window != NULL)
    157       while(window->next != NULL) 
     160      while(window->next != NULL)
    158161      {
    159         if(window->next == this) 
     162        if(window->next == this)
    160163        {
    161164          window->next = next;
     
    165168      }
    166169  }
    167  
    168   if(os2dlg) 
     170
     171  if(os2dlg)
    169172  {
    170173    DeleteWin32DlgTemplate(os2dlg);
     
    251254{
    252255  PostSpyMessage(hwnd, Msg, wParam, lParam);
    253   return pCallback(hwnd, Msg, wParam, lParam); 
     256  return pCallback(hwnd, Msg, wParam, lParam);
    254257}
    255258//******************************************************************************
     
    313316  SetWin32TIB();
    314317
    315   if(Msg == WM_MOUSEACTIVATE) 
     318  if(Msg == WM_MOUSEACTIVATE)
    316319  {
    317320        //Open32 sends an OS/2 window message for a button click
     
    329332        return(0);
    330333  }
    331  
     334
    332335  curwnd = Win32WindowProc::FindProc(hwnd);
    333336  if(!curwnd) {
     
    336339  }
    337340  if(curwnd != NULL) {
    338         switch(Msg) 
     341        switch(Msg)
    339342        {
    340343        case WM_KEYDOWN:
Note: See TracChangeset for help on using the changeset viewer.