mirror of
https://github.com/ApfelTeeSaft/reactos.git
synced 2026-08-30 19:26:05 +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:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user