2023-08-17 10:45:50 +02:00
|
|
|
#ifndef DRIVER_H
|
|
|
|
#define DRIVER_H
|
|
|
|
|
|
|
|
#include <ntifs.h>
|
|
|
|
#include <wdftypes.h>
|
|
|
|
#include <wdf.h>
|
|
|
|
|
2023-08-24 15:12:49 +02:00
|
|
|
typedef struct _DRIVER_CONFIG
|
|
|
|
{
|
|
|
|
BOOLEAN initialised;
|
|
|
|
LONG protected_process_id;
|
|
|
|
PEPROCESS protected_process_eprocess;
|
2023-09-01 13:46:31 +02:00
|
|
|
CHAR driver_name[ 128 ];
|
|
|
|
UNICODE_STRING driver_path;
|
2023-08-24 15:12:49 +02:00
|
|
|
KGUARDED_MUTEX lock;
|
|
|
|
|
|
|
|
}DRIVER_CONFIG, *PDRIVER_CONFIG;
|
|
|
|
|
|
|
|
NTSTATUS InitialiseDriverConfigOnProcessLaunch(
|
|
|
|
_In_ PIRP Irp
|
2023-08-20 16:12:04 +02:00
|
|
|
);
|
|
|
|
|
2023-08-24 15:12:49 +02:00
|
|
|
VOID GetProtectedProcessEProcess(
|
2023-08-30 15:23:04 +02:00
|
|
|
_Out_ PEPROCESS* Process
|
2023-08-20 16:12:04 +02:00
|
|
|
);
|
|
|
|
|
2023-08-24 15:12:49 +02:00
|
|
|
|
|
|
|
VOID GetProtectedProcessId(
|
2023-08-24 17:10:40 +02:00
|
|
|
_Out_ PLONG ProcessId
|
|
|
|
);
|
|
|
|
|
|
|
|
VOID ReadInitialisedConfigFlag(
|
|
|
|
_Out_ PBOOLEAN Flag
|
2023-08-20 16:12:04 +02:00
|
|
|
);
|
|
|
|
|
2023-08-24 15:12:49 +02:00
|
|
|
|
2023-09-01 13:46:31 +02:00
|
|
|
VOID TerminateProtectedProcessOnViolation();
|
|
|
|
|
2023-08-24 15:25:56 +02:00
|
|
|
VOID ClearDriverConfigOnProcessTermination();
|
2023-09-01 13:46:31 +02:00
|
|
|
|
2023-08-17 10:45:50 +02:00
|
|
|
#endif
|