mirror of
https://github.com/reactos/reactos.git
synced 2025-08-02 00:13:04 +00:00
[WIN32K]
- 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:
parent
0593e15998
commit
8ab78d931a
1 changed files with 9 additions and 3 deletions
|
@ -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);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue