This commit is contained in:
lhodges1 2023-08-19 14:03:48 +10:00
parent 6203ebde15
commit 6246307bfd
2 changed files with 10 additions and 7 deletions

View file

@ -50,14 +50,9 @@ NTSTATUS DeviceControl(
if ( !NT_SUCCESS( status ) ) if ( !NT_SUCCESS( status ) )
DEBUG_ERROR( "Failed to start thread to validate system drivers" ); DEBUG_ERROR( "Failed to start thread to validate system drivers" );
/* /* return early as IRP completion was handled inside the function */
* wait on our thread so we dont complete the IRP before we've filled the
* buffer with information and prevent any weird IRP multithreaded interactions
*/
KeWaitForSingleObject( handle, Executive, KernelMode, FALSE, NULL );
ZwClose( handle ); ZwClose( handle );
break; return status;
default: default:
DEBUG_ERROR( "Invalid IOCTL passed to driver" ); DEBUG_ERROR( "Invalid IOCTL passed to driver" );

View file

@ -333,5 +333,13 @@ NTSTATUS HandleValidateDriversIOCTL(
ExFreePoolWithTag( head, INVALID_DRIVER_LIST_HEAD_POOL ); ExFreePoolWithTag( head, INVALID_DRIVER_LIST_HEAD_POOL );
ExFreePoolWithTag( system_modules.address, SYSTEM_MODULES_POOL ); ExFreePoolWithTag( system_modules.address, SYSTEM_MODULES_POOL );
/*
* Complete the IRP here so we don't have to implement a waiting mechanism
* to prevent an early completion of the IRP.
*/
IoCompleteRequest( Irp, IO_NO_INCREMENT );
Irp->IoStatus.Status = status;
return status; return status;
} }