- Fail in NtGdiCreateClientObj, when the object type is not valid.
This is based on Windows behavior, only more strict. Windows allows to set the stock bit and reuse count, which is probably not what we want.

svn path=/trunk/; revision=65052
This commit is contained in:
Timo Kreuzer
2014-10-27 20:40:11 +00:00
parent 0593e15998
commit 8ab78d931a
+9 -3
View File
@@ -1272,6 +1272,15 @@ NtGdiCreateClientObj(
POBJ pObject;
HANDLE handle;
/* Check if ulType is valid */
if ((ulType != GDILoObjType_LO_METAFILE16_TYPE) &&
(ulType != GDILoObjType_LO_METAFILE_TYPE) &&
(ulType != GDILoObjType_LO_METADC16_TYPE))
{
DPRINT1("NtGdiCreateClientObj: Invalid object type 0x%lx.\n", ulType);
return NULL;
}
/* Allocate a new object */
pObject = GDIOBJ_AllocateObject(GDIObjType_CLIENTOBJ_TYPE,
sizeof(CLIENTOBJ),
@@ -1282,9 +1291,6 @@ NtGdiCreateClientObj(
return NULL;
}
/* Mask out everything that would change the type in a wrong manner */
ulType &= (GDI_HANDLE_TYPE_MASK & ~GDI_HANDLE_BASETYPE_MASK);
/* Set the real object type */
pObject->hHmgr = UlongToHandle(ulType | GDILoObjType_LO_CLIENTOBJ_TYPE);