aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorToni Uhlig <matzeton@googlemail.com>2023-07-02 14:33:31 +0200
committerToni Uhlig <matzeton@googlemail.com>2023-07-02 14:33:31 +0200
commit54db7a6b49e11fc16134e0994a901e17d2443a97 (patch)
tree688c39b30129a02203023938e315853c59caaaf1
parentde3d64ca85fcd3fa4251a4d4719c452da2a56987 (diff)
Improved `examples/dpp-example-cplusplus-EASTL.cpp` user mode build.
* added `_enable()` / `_disable()` semantics to `examples/dpp-example.c` Signed-off-by: Toni Uhlig <matzeton@googlemail.com>
-rw-r--r--examples/dpp-example-cplusplus-EASTL.cpp23
-rw-r--r--examples/dpp-example.c6
2 files changed, 10 insertions, 19 deletions
diff --git a/examples/dpp-example-cplusplus-EASTL.cpp b/examples/dpp-example-cplusplus-EASTL.cpp
index a92d4ed..d112a85 100644
--- a/examples/dpp-example-cplusplus-EASTL.cpp
+++ b/examples/dpp-example-cplusplus-EASTL.cpp
@@ -1,5 +1,6 @@
#ifndef BUILD_USERMODE
#include <ntddk.h>
+#endif
#include <cstdint>
@@ -16,28 +17,10 @@
#include <EASTL/unordered_set.h>
#include <EASTL/vector.h>
-using namespace eastl;
-#else
-#include <cstdint>
+#ifdef BUILD_USERMODE
#include <cstdio>
-#include <algorithm>
-#include <functional>
-#include <map>
-#include <memory>
-#include <set>
-#include <string>
-#include <unordered_map>
-#include <unordered_set>
-#include <vector>
-
-#include <boost/scoped_ptr.hpp>
-
#define DbgPrint printf
-
-using namespace std;
-using boost::scoped_ptr;
-
typedef struct
{
} DRIVER_OBJECT;
@@ -49,6 +32,8 @@ typedef UNICODE_STRING * PUNICODE_STRING;
typedef int NTSTATUS;
#endif
+using namespace eastl;
+
// C&P from: https://raw.githubusercontent.com/sidyhe/dxx/ed06aba3b91fe8e101d08c33c26ba73db96acef0/README.md
void stl_test()
{
diff --git a/examples/dpp-example.c b/examples/dpp-example.c
index 8a14af9..f5a079c 100644
--- a/examples/dpp-example.c
+++ b/examples/dpp-example.c
@@ -10,6 +10,12 @@ NTSTATUS DriverEntry(struct _DRIVER_OBJECT * DriverObject, PUNICODE_STRING Regis
DbgPrint("%s\n", "Hello ring0!");
+ // This is bad. Please do not call _disable/_enable in the DriverEntry.
+ DbgPrint("%s\n", "Disable/Enable Interrupts!");
+ _disable();
+ _enable();
+ DbgPrint("%s\n", "Done with Disable/Enable Interrupts!");
+
return STATUS_SUCCESS;
}