[FLTMGR] Callers must have registered an unload routine to be allowed to unload
authorGed Murphy <gedmurphy@reactos.org>
Mon, 29 Oct 2018 11:28:10 +0000 (11:28 +0000)
committerPierre Schweitzer <pierre@reactos.org>
Mon, 29 Oct 2018 22:56:39 +0000 (23:56 +0100)
drivers/filters/fltmgr/Filter.c

index 92a824c..1c50f14 100644 (file)
@@ -250,7 +250,7 @@ FltRegisterFilter(_In_ PDRIVER_OBJECT DriverObject,
     Filter->OldDriverUnload = (PFLT_FILTER_UNLOAD_CALLBACK)DriverObject->DriverUnload;
 
     /* Check we opted not to have an unload routine, or if we want to stop the driver from being unloaded */
-    if (!FlagOn(Filter->Flags, FLTFL_REGISTRATION_DO_NOT_SUPPORT_SERVICE_STOP))
+    if (Registration->FilterUnloadCallback && !FlagOn(Filter->Flags, FLTFL_REGISTRATION_DO_NOT_SUPPORT_SERVICE_STOP))
     {
         DriverObject->DriverUnload = (PDRIVER_UNLOAD)FltpMiniFilterDriverUnload;
     }