diff --git a/src/main.cpp b/src/main.cpp index 5f36b8f..bad5cd6 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -2,27 +2,29 @@ #include "logging.h" #include "nt_ext.h" -_Function_class_(DRIVER_UNLOAD) - -void unload(PDRIVER_OBJECT /*DriverObject*/) -{ - DbgLog("Bye World\n"); -} - _Function_class_(KDEFERRED_ROUTINE) void NTAPI test_function(struct _KDPC* /*Dpc*/, - PVOID /*DeferredContext*/, + PVOID param, const PVOID arg1, const PVOID arg2) { const auto core_id = KeGetCurrentProcessorNumberEx(nullptr); - DbgLog("Hello from CPU %ul\n", core_id); + DbgLog("%s from CPU %u\n", static_cast(param), core_id); KeSignalCallDpcSynchronize(arg2); KeSignalCallDpcDone(arg1); } + +_Function_class_(DRIVER_UNLOAD) +void unload(PDRIVER_OBJECT /*DriverObject*/) +{ + DbgLog("Leaving World\n"); + KeGenericCallDpc(test_function, "Bye"); + DbgLog("Bye World\n"); +} + extern "C" { NTSTATUS DriverEntry(const PDRIVER_OBJECT DriverObject, PUNICODE_STRING /*RegistryPath*/) @@ -31,7 +33,7 @@ NTSTATUS DriverEntry(const PDRIVER_OBJECT DriverObject, PUNICODE_STRING /*Regist DbgLog("Hello World\n"); - KeGenericCallDpc(test_function, nullptr); + KeGenericCallDpc(test_function, "Hello"); DbgLog("Nice World\n");