Update file_flt.c

This commit is contained in:
DavidXanatos 2023-05-25 23:07:04 +02:00
parent 3d9aba990a
commit 7d55ce934a
1 changed files with 2 additions and 2 deletions

View File

@ -481,7 +481,7 @@ check:
// check if there are any protected root folders and restict the access to // check if there are any protected root folders and restict the access to
// //
if (Iopb->MajorFunction == IRP_MJ_CREATE && File_ProtectedRoots.count != 0) { if (Iopb->MajorFunction == IRP_MJ_CREATE && File_ProtectedRoots.count != 0 && Data->Iopb->TargetFileObject) {
OBJECT_NAME_INFORMATION *Name; OBJECT_NAME_INFORMATION *Name;
ULONG NameLength; ULONG NameLength;
@ -599,7 +599,7 @@ check:
} }
else if (Iopb->MajorFunction == IRP_MJ_ACQUIRE_FOR_SECTION_SYNCHRONIZATION) { else if (Iopb->MajorFunction == IRP_MJ_ACQUIRE_FOR_SECTION_SYNCHRONIZATION) {
if (!proc->image_from_box && proc->protect_host_images) { if (!proc->image_from_box && proc->protect_host_images && Data->Iopb->TargetFileObject) {
// //
// If host image protection is enabled, check if we are in process of creating a new process // If host image protection is enabled, check if we are in process of creating a new process