Misc fixes in NtQueryDirectoryFile():
- Don't leak auxbuffer
- Don't allow two completion routines
svn path=/trunk/; revision=74451
return Status;
}
+ /* Are there two associated completion routines? */
+ if (FileObject->CompletionContext != NULL && ApcRoutine != NULL)
+ {
+ ObDereferenceObject(FileObject);
+ if (AuxBuffer) ExFreePoolWithTag(AuxBuffer, TAG_SYSB);
+ return STATUS_INVALID_PARAMETER;
+ }
+
/* Check if we have an even handle */
if (EventHandle)
{
if (!NT_SUCCESS(Status))
{
/* Fail */
+ if (AuxBuffer) ExFreePoolWithTag(AuxBuffer, TAG_SYSB);
ObDereferenceObject(FileObject);
return Status;
}