It is legal to call UnregisterClass with an hInstance of zero.

diff --git a/windows/class.c b/windows/class.c
index 2be09d9..ddc7cb6 100644
--- a/windows/class.c
+++ b/windows/class.c
@@ -409,7 +409,7 @@
     USER_Lock();
     if (atom &&
         (classPtr = CLASS_FindClassByAtom( atom, hInstance )) &&
-        (classPtr->hInstance == hInstance))
+        (!hInstance || classPtr->hInstance == hInstance))
     {
         ret = CLASS_FreeClass( classPtr );
     }