- Make sure we don't try to dereference a non-referenced handle
svn path=/trunk/; revision=40412
(PVOID*)&FileObjects[i].Handle,
NULL );
}
+
+ if( !NT_SUCCESS(Status) )
+ FileObjects[i].Handle = 0;
}
if( !NT_SUCCESS(Status) ) {
if (!NT_SUCCESS(Status)) {
AFD_DbgPrint(MIN_TRACE, ("ObReferenceObjectByHandle() failed with status (0x%X).\n", Status));
ZwClose(*Handle);
- *Handle = NULL;
} else {
AFD_DbgPrint(MAX_TRACE, ("Got handle (0x%X) Object (0x%X)\n",
*Handle, *Object));
}
} else {
AFD_DbgPrint(MIN_TRACE, ("ZwCreateFile() failed with status (0x%X)\n", Status));
+ }
+
+ if (!NT_SUCCESS(Status)) {
*Handle = NULL;
+ *Object = NULL;
}
return Status;