Changeset 1394


Ignore:
Timestamp:
Oct 21, 1999, 9:23:51 PM (26 years ago)
Author:
sandervl
Message:

class lookup fix

File:
1 edited

Legend:

Unmodified
Added
Removed
  • TabularUnified trunk/src/user32/win32class.cpp

    r949 r1394  
    1 /* $Id: win32class.cpp,v 1.1 1999-09-15 23:19:00 sandervl Exp $ */
     1/* $Id: win32class.cpp,v 1.2 1999-10-21 19:23:51 sandervl Exp $ */
    22/*
    33 * Win32 Window Class Managment Code for OS/2
     
    121121{
    122122  if(HIWORD(classname) == 0) {
    123         return classAtom == (DWORD)classname;
     123    return classAtom == (DWORD)classname;
    124124  }
    125125  if(fUnicode) {
    126         return (lstrcmpW(classNameW, (LPWSTR)classname) == 0);
    127   }
    128   else  return (strcmp(classNameA, classname) == 0);
     126    return (lstrcmpW(classNameW, (LPWSTR)classname) == 0);
     127  }
     128  else  return (strcmp(classNameA, classname) == 0);
    129129}
    130130//******************************************************************************
     
    150150                wndclass = (Win32WndClass *)wndclass->GetNext();
    151151                while(wndclass != NULL) {
    152                         if(stricmp(wndclass->classNameA, id) == 0 && wndclass->hInstance == hInstance) {
    153                                 leaveMutex(OBJTYPE_CLASS);
    154                                 return(wndclass);
     152                        if(stricmp(wndclass->classNameA, id) == 0)
     153                        {
     154                                //SvL: According to Wine, if the instance handle is the one of the main exe, everything is ok
     155                                if(hInstance == NULL || GetModuleHandleA(NULL) == hInstance ||
     156                                   wndclass->hInstance == hInstance)
     157                                {
     158                                    leaveMutex(OBJTYPE_CLASS);
     159                                    return(wndclass);
     160                                }
    155161                        }
    156162                        wndclass = (Win32WndClass *)wndclass->GetNext();
Note: See TracChangeset for help on using the changeset viewer.