From 3a3cbeecc113daf992de838a39569f6c81876dbe Mon Sep 17 00:00:00 2001 From: Toni Uhlig Date: Wed, 28 Apr 2021 17:05:10 +0200 Subject: Added first known issue regarding `static MyClass test;` ctor/dtor failure. Signed-off-by: Toni Uhlig --- ddk-template-cplusplus.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'ddk-template-cplusplus.cpp') diff --git a/ddk-template-cplusplus.cpp b/ddk-template-cplusplus.cpp index 9406213..380603a 100644 --- a/ddk-template-cplusplus.cpp +++ b/ddk-template-cplusplus.cpp @@ -7,12 +7,18 @@ class TestSmth public: TestSmth() { + DbgPrint("%s\n", "ctor"); + } + ~TestSmth() + { + DbgPrint("%s\n", "dtor"); } void doSmth(void) { DbgPrint("%s\n", "Hello Class!"); } }; +static TestSmth * cdtor_test; class Derived : public TestSmth { @@ -20,6 +26,9 @@ public: Derived() { } + ~Derived() + { + } void doSmth(void) { DbgPrint("%s\n", "Hello Derived!"); @@ -75,6 +84,7 @@ extern "C" (void)RegistryPath; DbgPrint("%s\n", "Hello ring0!"); + cdtor_test = new TestSmth(); /* support for service stopping */ DriverObject->DriverUnload = DriverUnload; @@ -88,6 +98,7 @@ extern "C" { (void)DriverObject; + delete cdtor_test; DbgPrint("%s\n", "Bye ring0!"); } } -- cgit v1.2.3