aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/include/winapi/utils.hpp
diff options
context:
space:
mode:
authorEgor Tensin <Egor.Tensin@gmail.com>2020-10-18 04:05:48 +0300
committerEgor Tensin <Egor.Tensin@gmail.com>2020-10-18 04:08:01 +0300
commit512a25658dd6b737a16b91fb7eba43deef004d87 (patch)
treee9b5fe69f55d9e1ca124b13814f01f280778c165 /include/winapi/utils.hpp
parentProcess: add get_exe_path() (diff)
downloadwinapi-common-512a25658dd6b737a16b91fb7eba43deef004d87.tar.gz
winapi-common-512a25658dd6b737a16b91fb7eba43deef004d87.zip
add Sid class
It's another newcomer straight from privilege-check.
Diffstat (limited to 'include/winapi/utils.hpp')
-rw-r--r--include/winapi/utils.hpp24
1 files changed, 24 insertions, 0 deletions
diff --git a/include/winapi/utils.hpp b/include/winapi/utils.hpp
new file mode 100644
index 0000000..8e8407c
--- /dev/null
+++ b/include/winapi/utils.hpp
@@ -0,0 +1,24 @@
+// Copyright (c) 2020 Egor Tensin <Egor.Tensin@gmail.com>
+// This file is part of the "winapi-common" project.
+// For details, see https://github.com/egor-tensin/winapi-common.
+// Distributed under the MIT License.
+
+#pragma once
+
+#include <windows.h>
+
+#include <cassert>
+
+#define WINAPI_UNUSED_PARAMETER(...) (void)(__VA_ARGS__)
+
+namespace winapi {
+
+struct LocalDelete {
+ void operator()(void* ptr) const {
+ const auto ret = ::LocalFree(ptr);
+ assert(ret == NULL);
+ WINAPI_UNUSED_PARAMETER(ret);
+ }
+};
+
+} // namespace winapi