mirror of
https://github.com/reactos/reactos.git
synced 2025-07-05 04:01:23 +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,
|
(PVOID*)&FileObjects[i].Handle,
|
||||||
NULL );
|
NULL );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if( !NT_SUCCESS(Status) )
|
||||||
|
FileObjects[i].Handle = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
if( !NT_SUCCESS(Status) ) {
|
if( !NT_SUCCESS(Status) ) {
|
||||||
|
|
|
@ -137,14 +137,17 @@ static NTSTATUS TdiOpenDevice(
|
||||||
if (!NT_SUCCESS(Status)) {
|
if (!NT_SUCCESS(Status)) {
|
||||||
AFD_DbgPrint(MIN_TRACE, ("ObReferenceObjectByHandle() failed with status (0x%X).\n", Status));
|
AFD_DbgPrint(MIN_TRACE, ("ObReferenceObjectByHandle() failed with status (0x%X).\n", Status));
|
||||||
ZwClose(*Handle);
|
ZwClose(*Handle);
|
||||||
*Handle = NULL;
|
|
||||||
} else {
|
} else {
|
||||||
AFD_DbgPrint(MAX_TRACE, ("Got handle (0x%X) Object (0x%X)\n",
|
AFD_DbgPrint(MAX_TRACE, ("Got handle (0x%X) Object (0x%X)\n",
|
||||||
*Handle, *Object));
|
*Handle, *Object));
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
AFD_DbgPrint(MIN_TRACE, ("ZwCreateFile() failed with status (0x%X)\n", Status));
|
AFD_DbgPrint(MIN_TRACE, ("ZwCreateFile() failed with status (0x%X)\n", Status));
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!NT_SUCCESS(Status)) {
|
||||||
*Handle = NULL;
|
*Handle = NULL;
|
||||||
|
*Object = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
return Status;
|
return Status;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue