6
0
mirror of https://github.com/JKornev/hidden synced 2024-06-27 09:28:04 +00:00
hidden/Hidden/PsTable.h

40 lines
1.3 KiB
C
Raw Normal View History

2016-07-21 23:02:31 +00:00
#pragma once
#include <Ntddk.h>
#include "Helper.h"
2016-07-21 23:02:31 +00:00
typedef struct _ProcessTableEntry {
HANDLE processId;
BOOLEAN excluded;
ULONG inheritExclusion;
BOOLEAN protected;
ULONG inheritProtection;
BOOLEAN hidden;
BOOLEAN postponeHiding;
ULONG inheritStealth;
PEPROCESS reference;
HANDLE_TABLE_ENTRY cidEntryBackup;
PHANDLE_TABLE_ENTRY cidEntry;
BOOLEAN subsystem;
BOOLEAN inited;
2016-07-21 23:02:31 +00:00
} ProcessTableEntry, *PProcessTableEntry;
NTSTATUS InitializeProcessTable(VOID(*InitProcessEntryCallback)(PProcessTableEntry, PCUNICODE_STRING, HANDLE));
VOID ClearProcessTable(VOID(*CleanupCallback)(PProcessTableEntry));
VOID EnumProcessTable(VOID(*EnumCallback)(PProcessTableEntry));
2016-07-21 23:02:31 +00:00
// Important notice:
// Keep in mind that internal sync mechanisms removed from functions below (including DestroyProcessTable)
// because in some situations we need to perform two operation under one lock, for instance we should
// perform GetProcessInProcessTable and UpdateProcessInProcessTable under one lock. So in this case all
// functions, excluding InitializeProcessTable, should be synced manualy from external code
2016-07-21 23:02:31 +00:00
BOOLEAN AddProcessToProcessTable(PProcessTableEntry entry);
2021-08-15 00:18:23 +00:00
BOOLEAN RemoveProcessFromProcessTable(HANDLE ProcessId);
PProcessTableEntry GetProcessInProcessTable(HANDLE ProcessId);