Panoptes 1.0.0
Endpoint Detection and Response
Loading...
Searching...
No Matches
pano_filter.h File Reference
#include <fltKernel.h>

Go to the source code of this file.

Functions

NTSTATUS FilterInit (PDRIVER_OBJECT *DriverObject)
void FilterUninit ()
 Unregisters the minifilter if FilterInit registered it.
NTSTATUS FilterSetFileEvents (_In_reads_bytes_(Length) PVOID Buffer, _In_ ULONG Length)
 Sets which PANO_FILE_EVENT_GROUP bits are reported (IOCTL_PANOPTES_SET_FILE_EVENTS).

Function Documentation

◆ FilterInit()

NTSTATUS FilterInit ( PDRIVER_OBJECT * DriverObject)

Definition at line 870 of file pano_filter.cpp.

871{
872 NTSTATUS status = FltRegisterFilter(
873 *DriverObject, //Driver
874 &FilterRegistration, //Registration
875 &g_FilterHandle); //RetFilter
876 if (!NT_SUCCESS(status)) {
877 DbgPrint("Failed FltRegisterFilter\n");
878 switch (status)
879 {
880 case STATUS_INSUFFICIENT_RESOURCES:
881 DbgPrint("STATUS_INSUFFICIENT_RESOURCES\n");
882 break;
883 case STATUS_INVALID_PARAMETER:
884 DbgPrint("STATUS_INVALID_PARAMETER\n");
885 break;
886 case STATUS_FLT_NOT_INITIALIZED:
887 DbgPrint("STATUS_FLT_NOT_INITIALIZED\n");
888 break;
889 case STATUS_OBJECT_NAME_NOT_FOUND:
890 DbgPrint("STATUS_OBJECT_NAME_NOT_FOUND\n");
891 break;
892 default:
893 DbgPrint("UNKNOWN\n");
894 break;
895 }
896 return status;
897 }
898
899 status = FltStartFiltering(g_FilterHandle);
900 if (!NT_SUCCESS(status)) {
901 DbgPrint("Failed FltStartFiltering\n");
902 FltUnregisterFilter(g_FilterHandle);
903 g_FilterHandle = nullptr;
904 return status;
905 }
906
907 return status;
908}
const FLT_REGISTRATION FilterRegistration
PFLT_FILTER g_FilterHandle

References FilterRegistration, and g_FilterHandle.

Referenced by DriverEntry().

◆ FilterSetFileEvents()

NTSTATUS FilterSetFileEvents ( _In_reads_bytes_(Length) PVOID Buffer,
_In_ ULONG Length )

Sets which PANO_FILE_EVENT_GROUP bits are reported (IOCTL_PANOPTES_SET_FILE_EVENTS).

Parameters
BufferA PANO_FILE_EVENTS
LengthThe size of Buffer in bytes
Returns
STATUS_INVALID_PARAMETER if the buffer is too small or sets unknown bits

◆ FilterUninit()

void FilterUninit ( )

Unregisters the minifilter if FilterInit registered it.

Definition at line 910 of file pano_filter.cpp.

911{
912 if (g_FilterHandle == NULL) {
913 return;
914 }
915
916 FltUnregisterFilter(g_FilterHandle);
917 g_FilterHandle = NULL;
918}

References g_FilterHandle.

Referenced by DriverEntry(), PanoptesFilterUnload(), and UnloadPanoptes().