mirror-ac/driver/modules.h

84 lines
1.8 KiB
C
Raw Normal View History

2023-08-19 04:52:57 +02:00
#ifndef MODULES_H
#define MODULES_H
#include <ntifs.h>
#include <intrin.h>
2023-09-25 17:41:38 +02:00
2023-08-22 19:32:25 +02:00
#include "common.h"
2023-09-25 17:41:38 +02:00
#include "queue.h"
2023-08-19 04:52:57 +02:00
2023-09-28 18:10:01 +02:00
typedef struct _APC_OPERATION_ID
{
2023-12-13 05:06:27 +01:00
int operation_id;
2023-09-28 18:10:01 +02:00
2023-12-13 05:06:27 +01:00
} APC_OPERATION_ID, *PAPC_OPERATION_ID;
2023-09-28 18:10:01 +02:00
2023-08-19 04:52:57 +02:00
/* system modules information */
typedef struct _SYSTEM_MODULES
{
2023-12-13 05:06:27 +01:00
PVOID address;
INT module_count;
2023-08-19 04:52:57 +02:00
2023-12-13 05:06:27 +01:00
} SYSTEM_MODULES, *PSYSTEM_MODULES;
2023-08-19 04:52:57 +02:00
2023-09-25 17:41:38 +02:00
#define APC_CONTEXT_ID_STACKWALK 0x1
typedef struct _APC_CONTEXT_HEADER
{
2023-12-13 05:06:27 +01:00
LONG context_id;
volatile INT count;
volatile INT allocation_in_progress;
2023-09-25 17:41:38 +02:00
2023-12-13 05:06:27 +01:00
} APC_CONTEXT_HEADER, *PAPC_CONTEXT_HEADER;
2023-09-26 12:00:45 +02:00
typedef struct _APC_STACKWALK_CONTEXT
{
2023-12-13 05:06:27 +01:00
APC_CONTEXT_HEADER header;
PSYSTEM_MODULES modules;
2023-09-26 12:00:45 +02:00
2023-12-13 05:06:27 +01:00
} APC_STACKWALK_CONTEXT, *PAPC_STACKWALK_CONTEXT;
2023-09-25 17:41:38 +02:00
2023-10-05 08:27:17 +02:00
NTSTATUS
2023-12-13 05:06:27 +01:00
GetSystemModuleInformation(_Out_ PSYSTEM_MODULES ModuleInformation);
2023-08-19 04:52:57 +02:00
2023-10-05 08:27:17 +02:00
NTSTATUS
HandleValidateDriversIOCTL();
2023-08-19 04:52:57 +02:00
2023-10-05 08:27:17 +02:00
PRTL_MODULE_EXTENDED_INFO
2023-12-13 05:06:27 +01:00
FindSystemModuleByName(_In_ LPCSTR ModuleName, _In_ PSYSTEM_MODULES SystemModules);
2023-08-22 19:32:25 +02:00
2023-10-05 08:27:17 +02:00
NTSTATUS
HandleNmiIOCTL();
2023-09-02 15:47:15 +02:00
2023-09-26 15:32:06 +02:00
BOOLEAN
2023-12-13 05:06:27 +01:00
FreeApcContextStructure(_Inout_ PAPC_CONTEXT_HEADER Context);
2023-09-25 17:41:38 +02:00
2023-10-05 08:27:17 +02:00
NTSTATUS
2023-09-27 06:22:14 +02:00
ValidateThreadsViaKernelApc();
2023-09-24 13:13:20 +02:00
2023-09-26 15:32:06 +02:00
VOID
2023-12-13 05:06:27 +01:00
FreeApcStackwalkApcContextInformation(_Inout_ PAPC_STACKWALK_CONTEXT Context);
2023-10-07 17:37:47 +02:00
NTSTATUS
2023-12-13 05:06:27 +01:00
IsInstructionPointerInInvalidRegion(_In_ UINT64 RIP,
_In_ PSYSTEM_MODULES SystemModules,
_Out_ PBOOLEAN Result);
2023-10-07 17:37:47 +02:00
2024-01-08 04:57:07 +01:00
VOID
2023-12-13 05:06:27 +01:00
FlipKThreadMiscFlagsFlag(_In_ PKTHREAD Thread, _In_ ULONG FlagIndex, _In_ BOOLEAN NewValue);
2023-09-26 12:00:45 +02:00
2023-10-30 12:57:24 +01:00
NTSTATUS
2023-12-29 17:20:32 +01:00
DispatchStackwalkToEachCpuViaDpc();
2023-10-30 12:57:24 +01:00
2024-01-01 17:45:40 +01:00
NTSTATUS
ValidateHalDispatchTables();
PVOID
2024-01-28 08:34:09 +01:00
FindDriverBaseNoApi(_In_ PDRIVER_OBJECT DriverObject, _In_ PWCH Name);
2024-02-13 19:08:38 +01:00
NTSTATUS
GetDriverObjectByDriverName(_In_ PUNICODE_STRING DriverName, _Out_ PDRIVER_OBJECT* DriverObject);
2023-08-19 04:52:57 +02:00
#endif