mirror of
https://github.com/tnodir/fort
synced 2024-11-15 06:55:54 +00:00
Driver: Expand kernel stack for driver entry
This commit is contained in:
parent
7a805d77c9
commit
5846e535da
@ -82,6 +82,23 @@ static void fort_driver_unload(PDRIVER_OBJECT driver)
|
|||||||
fort_device_set(NULL);
|
fort_device_set(NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void NTAPI fort_driver_load_device_expand(PVOID param)
|
||||||
|
{
|
||||||
|
NTSTATUS *status = param;
|
||||||
|
|
||||||
|
*status = fort_device_load();
|
||||||
|
}
|
||||||
|
|
||||||
|
inline static void fort_driver_load_device(NTSTATUS *status)
|
||||||
|
{
|
||||||
|
const NTSTATUS status_expand = KeExpandKernelStackAndCallout(
|
||||||
|
&fort_driver_load_device_expand, status, KERNEL_STACK_SIZE);
|
||||||
|
|
||||||
|
if (!NT_SUCCESS(status_expand)) {
|
||||||
|
*status = status_expand;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
static NTSTATUS fort_driver_load(PDRIVER_OBJECT driver, PUNICODE_STRING reg_path)
|
static NTSTATUS fort_driver_load(PDRIVER_OBJECT driver, PUNICODE_STRING reg_path)
|
||||||
{
|
{
|
||||||
NTSTATUS status;
|
NTSTATUS status;
|
||||||
@ -106,7 +123,9 @@ static NTSTATUS fort_driver_load(PDRIVER_OBJECT driver, PUNICODE_STRING reg_path
|
|||||||
driver->MajorFunction[IRP_MJ_DEVICE_CONTROL] = &fort_device_control;
|
driver->MajorFunction[IRP_MJ_DEVICE_CONTROL] = &fort_device_control;
|
||||||
driver->MajorFunction[IRP_MJ_SHUTDOWN] = &fort_device_shutdown;
|
driver->MajorFunction[IRP_MJ_SHUTDOWN] = &fort_device_shutdown;
|
||||||
|
|
||||||
return fort_device_load();
|
fort_driver_load_device(&status);
|
||||||
|
|
||||||
|
return status;
|
||||||
}
|
}
|
||||||
|
|
||||||
NTSTATUS DriverCallbacksSetup(PFORT_PROXYCB_INFO cb_info)
|
NTSTATUS DriverCallbacksSetup(PFORT_PROXYCB_INFO cb_info)
|
||||||
|
Loading…
Reference in New Issue
Block a user