#include #include #include #include #include #include #include #include #include #include #include #include #include #include // C&P from: https://raw.githubusercontent.com/sidyhe/dxx/ed06aba3b91fe8e101d08c33c26ba73db96acef0/README.md void stl_test() { eastl::make_unique(); eastl::make_shared(); eastl::scoped_ptr dptr(new double(3.6)); eastl::set set_test; set_test.insert(1); set_test.insert(3); set_test.insert(5); set_test.erase(1); eastl::map map_test; map_test[0] = 1; map_test[10] = 11; map_test[20] = 12; map_test.erase(11); eastl::vector vec_test; vec_test.push_back(2); vec_test.push_back(3); vec_test.push_back(1); eastl::stable_sort(vec_test.begin(), vec_test.end(), eastl::less()); for (auto e : vec_test) { DbgPrint("%d\n", e); } eastl::string s; s = "This a string"; s.append("any"); DbgPrint("%s\n", s.c_str()); eastl::wstring ws; ws = L"wide string"; ws.clear(); eastl::unordered_set us_test; us_test.insert(333); eastl::unordered_map um_test; um_test.insert(eastl::make_pair(6.6, "9.9")); } void more_stl_test() { eastl::hash_map hm; hm[0] = "test1"; hm[10] = "test2"; hm[20] = "test3"; for (auto s : hm) { DbgPrint("%s\n", s.second.c_str()); } eastl::uniform_int_distribution uid(1, UINT32_MAX); DbgPrint("PRNG: %u\n", uid); auto lambda = [] { DbgPrint("Hello lambda!\n"); }; eastl::function fn = lambda; fn(); auto lambda2 = [](int n) { DbgPrint("Hello lambda2, %u!\n", n); return n; }; eastl::function fn2 = lambda2; fn2(1337); eastl::vector fill_me; for (auto i = UINT16_MAX; i > 0; --i) { fill_me.push_back(i); } DbgPrint("fill_me size: %zu\n", fill_me.size()); } extern "C" { DRIVER_INITIALIZE DriverEntry; DRIVER_UNLOAD DriverUnload; NTSTATUS DriverEntry(_In_ struct _DRIVER_OBJECT * DriverObject, _In_ PUNICODE_STRING RegistryPath) { (void)DriverObject; (void)RegistryPath; DbgPrint("%s\n", "Hello ring0!"); stl_test(); more_stl_test(); return STATUS_SUCCESS; } VOID DriverUnload(_In_ struct _DRIVER_OBJECT * DriverObject) { (void)DriverObject; DbgPrint("%s\n", "Bye ring0!"); } }