UnregisterClass (class,0) is legal

Medland, Bill Bill.Medland at accpac.com
Mon Nov 19 14:57:11 CST 2001


I don't know the details (because of course Microsoft don't tell us) but it
is possible to unregister a class using a hInstance of 0.
 <<diff30.txt>> 
-------------- next part --------------
Bill Medland (medbi01 at accpac.com)
It is legal to call UnregisterClass with an hInstance of zero.

Index: wine/windows/class.c
===================================================================
RCS file: /home/wine/wine/windows/class.c,v
retrieving revision 1.43
diff -u -r1.43 class.c
--- wine/windows/class.c	2001/11/16 18:11:43	1.43
+++ wine/windows/class.c	2001/11/19 19:30:39
@@ -409,7 +409,7 @@
     USER_Lock();
     if (atom &&
         (classPtr = CLASS_FindClassByAtom( atom, hInstance )) &&
-        (classPtr->hInstance == hInstance))
+        (!hInstance || classPtr->hInstance == hInstance))
     {
         ret = CLASS_FreeClass( classPtr );
     }


More information about the wine-patches mailing list