added check for hInstance in UnregisterClass()

svn path=/trunk/; revision=6907
This commit is contained in:
Thomas Bluemel 2003-12-07 23:01:01 +00:00
parent 088e628e66
commit bfcd20af5e

View file

@ -16,7 +16,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
/* $Id: class.c,v 1.43 2003/12/07 22:25:34 weiden Exp $
/* $Id: class.c,v 1.44 2003/12/07 23:01:01 weiden Exp $
*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel
@ -631,6 +631,13 @@ NtUserUnregisterClass(LPCWSTR ClassNameOrAtom,
return FALSE;
}
if(Class->hInstance && (Class->hInstance != hInstance))
{
ObmDereferenceObject(Class);
SetLastWin32Error(ERROR_CLASS_DOES_NOT_EXIST);
return FALSE;
}
if(ObmGetReferenceCount(Class) > 2)
{
ObmDereferenceObject(Class);