Revert "Driver: Expand kernel stack for workers"

This partially reverts commit b1a1212227.
This commit is contained in:
Nodir Temirkhodjaev 2023-04-26 15:25:59 +03:00
parent be3e5ea0f0
commit f4516101dc
8 changed files with 8 additions and 41 deletions

Binary file not shown.

View File

@ -39,7 +39,6 @@
#define FACILITY_DRIVER 0x4
#define FACILITY_SHAPER 0x5
#define FACILITY_PROCESS_TREE 0x6
#define FACILITY_WORKER 0x7
//
@ -173,14 +172,4 @@
//
#define FORT_PSTREE_ENUM_PROCESSES_ERROR ((NTSTATUS)0xC0060002L)
/* Worker */
//
// MessageId: FORT_WORKER_CALLBACK_ERROR
//
// MessageText:
//
// Worker: Callback Error.
//
#define FORT_WORKER_CALLBACK_ERROR ((NTSTATUS)0xC0070001L)
#endif // FORTEVT_H

View File

@ -21,7 +21,6 @@ FacilityNames = (
Driver = 4:FACILITY_DRIVER
Shaper = 5:FACILITY_SHAPER
ProcessTree = 6:FACILITY_PROCESS_TREE
Worker = 7:FACILITY_WORKER
)
@ -101,11 +100,4 @@ Language=English
Enum Processes Error.
.
;/* Worker */
MessageId=1 Facility=Worker Severity=Error SymbolicName=FORT_WORKER_CALLBACK_ERROR
Language=English
Worker: Callback Error.
.
;#endif // FORTEVT_H

View File

@ -21,10 +21,8 @@ FORT_API void fort_device_set(PFORT_DEVICE device)
g_device = device;
}
static void NTAPI fort_worker_reauth(PVOID worker)
static void NTAPI fort_worker_reauth(void)
{
UNUSED(worker);
const FORT_CONF_FLAGS conf_flags = fort_device()->conf.conf_flags;
const NTSTATUS status = fort_callout_force_reauth(conf_flags);
@ -214,7 +212,7 @@ static NTSTATUS fort_device_control_app(const PFORT_APP_ENTRY app_entry, ULONG l
fort_conf_ref_put(&fort_device()->conf, conf_ref);
if (NT_SUCCESS(status)) {
fort_worker_reauth(NULL);
fort_worker_reauth();
}
return status;
@ -234,7 +232,7 @@ static NTSTATUS fort_device_control_setzones(const PFORT_CONF_ZONES zones, ULONG
} else {
fort_conf_zones_set(&fort_device()->conf, conf_zones);
fort_worker_reauth(NULL);
fort_worker_reauth();
return STATUS_SUCCESS;
}
@ -248,7 +246,7 @@ static NTSTATUS fort_device_control_setzoneflag(const PFORT_CONF_ZONE_FLAG zone_
if (len == sizeof(FORT_CONF_ZONE_FLAG)) {
fort_conf_zone_flag_set(&fort_device()->conf, zone_flag);
fort_worker_reauth(NULL);
fort_worker_reauth();
return STATUS_SUCCESS;
}

View File

@ -842,10 +842,8 @@ static void fort_pstree_enum_processes_loop(
}
}
FORT_API void NTAPI fort_pstree_enum_processes(PVOID worker)
FORT_API void NTAPI fort_pstree_enum_processes(void)
{
UNUSED(worker);
NTSTATUS status;
ULONG bufferSize;

View File

@ -32,7 +32,7 @@ FORT_API void fort_pstree_open(PFORT_PSTREE ps_tree);
FORT_API void fort_pstree_close(PFORT_PSTREE ps_tree);
FORT_API void NTAPI fort_pstree_enum_processes(PVOID worker);
FORT_API void NTAPI fort_pstree_enum_processes(void);
FORT_API BOOL fort_pstree_get_proc_name(
PFORT_PSTREE ps_tree, DWORD processId, PUNICODE_STRING path, BOOL *inherited);

View File

@ -7,21 +7,11 @@
#include "fortcb.h"
#include "forttrace.h"
static void fort_worker_callback_run_expand(PFORT_WORKER worker, PEXPAND_STACK_CALLOUT callout)
{
const NTSTATUS status = KeExpandKernelStackAndCallout(callout, worker, FORT_KERNEL_STACK_SIZE);
if (!NT_SUCCESS(status)) {
LOG("Worker Callback: Error: %x\n", status);
TRACE(FORT_WORKER_CALLBACK_ERROR, status, 0, 0);
}
}
static void fort_worker_callback_run(
PFORT_WORKER worker, enum FORT_WORKER_TYPE worker_type, UCHAR id_bits)
{
if ((id_bits & (1 << worker_type)) != 0) {
fort_worker_callback_run_expand(worker, worker->funcs[worker_type]);
worker->funcs[worker_type]();
}
}

View File

@ -9,7 +9,7 @@ enum FORT_WORKER_TYPE {
FORT_WORKER_FUNC_COUNT,
};
typedef void(NTAPI *FORT_WORKER_FUNC)(PVOID worker);
typedef void(NTAPI *FORT_WORKER_FUNC)(void);
typedef struct fort_worker
{