diff options
author | Toni Uhlig <matzeton@googlemail.com> | 2021-04-07 00:22:58 +0200 |
---|---|---|
committer | Toni Uhlig <matzeton@googlemail.com> | 2021-04-07 00:22:58 +0200 |
commit | ac1b72946c226eb3cd4f3f0b8f13a8330142ebe8 (patch) | |
tree | 9484a03619915b7f7854b0e4c216bb165047ee11 /ddk-template-cplusplus.cpp |
initial commit
Signed-off-by: Toni Uhlig <matzeton@googlemail.com>
Diffstat (limited to 'ddk-template-cplusplus.cpp')
-rw-r--r-- | ddk-template-cplusplus.cpp | 50 |
1 files changed, 50 insertions, 0 deletions
diff --git a/ddk-template-cplusplus.cpp b/ddk-template-cplusplus.cpp new file mode 100644 index 0000000..3ab6257 --- /dev/null +++ b/ddk-template-cplusplus.cpp @@ -0,0 +1,50 @@ +#include <ntddk.h> + +#include <vector> + +class TestSmth +{ +public: + TestSmth() {} + void doSmth(void) + { + DbgPrint("%s\n", "Hello Class!"); + } +}; + +static void test_cplusplus(void) +{ + TestSmth t; + t.doSmth(); +} + +extern "C" +{ + +DRIVER_INITIALIZE DriverEntry; +DRIVER_UNLOAD DriverUnload; + +NTSTATUS DriverEntry( + _In_ struct _DRIVER_OBJECT *DriverObject, + _In_ PUNICODE_STRING RegistryPath +) +{ + DbgPrint("%s\n", "Hello ring0!"); + + /* support for service stopping */ + DriverObject->DriverUnload = DriverUnload; + + test_cplusplus(); + + return STATUS_SUCCESS; +} + +VOID +DriverUnload( + _In_ struct _DRIVER_OBJECT *DriverObject +) +{ + DbgPrint("%s\n", "Bye ring0!"); +} + +} |