- Roel Messiant: Fix NtQueryObject to return the required buffer size if the buffer provided was too small. Unimplemented paths behaviour is preserved.

svn path=/trunk/; revision=50032
This commit is contained in:
Aleksey Bragin 2010-12-15 20:12:03 +00:00
parent 19e368a616
commit 074f4cec87

View file

@ -1549,6 +1549,7 @@ NtQueryObject(IN HANDLE ObjectHandle,
/* Information about all types */ /* Information about all types */
case ObjectTypesInformation: case ObjectTypesInformation:
DPRINT1("NOT IMPLEMENTED!\n"); DPRINT1("NOT IMPLEMENTED!\n");
InfoLength = Length;
Status = STATUS_NOT_IMPLEMENTED; Status = STATUS_NOT_IMPLEMENTED;
break; break;
@ -1580,6 +1581,7 @@ NtQueryObject(IN HANDLE ObjectHandle,
default: default:
/* Fail it */ /* Fail it */
InfoLength = Length;
Status = STATUS_INVALID_INFO_CLASS; Status = STATUS_INVALID_INFO_CLASS;
break; break;
} }
@ -1588,7 +1590,7 @@ NtQueryObject(IN HANDLE ObjectHandle,
if (ResultLength) if (ResultLength)
{ {
/* Write the length */ /* Write the length */
*ResultLength = Length; *ResultLength = InfoLength;
} }
} }
_SEH2_EXCEPT(ExSystemExceptionFilter()) _SEH2_EXCEPT(ExSystemExceptionFilter())