mirror of
https://github.com/reactos/reactos.git
synced 2025-07-03 23:31:22 +00:00
- Don't leave a bad handle or object pointer
- Make sure we don't try to dereference a non-referenced handle svn path=/trunk/; revision=40412
This commit is contained in:
parent
7025dd53e2
commit
5ee60afbf2
2 changed files with 7 additions and 1 deletions
|
@ -187,6 +187,9 @@ PAFD_HANDLE LockHandles( PAFD_HANDLE HandleArray, UINT HandleCount ) {
|
|||
(PVOID*)&FileObjects[i].Handle,
|
||||
NULL );
|
||||
}
|
||||
|
||||
if( !NT_SUCCESS(Status) )
|
||||
FileObjects[i].Handle = 0;
|
||||
}
|
||||
|
||||
if( !NT_SUCCESS(Status) ) {
|
||||
|
|
|
@ -137,14 +137,17 @@ static NTSTATUS TdiOpenDevice(
|
|||
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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue