aboutsummaryrefslogtreecommitdiff
path: root/ddk-template-cplusplus.cpp
blob: 3ab6257251b4e6191000d7668d218c9740e62164 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
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!");
}

}