aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/src/resource.hpp
diff options
context:
space:
mode:
authorEgor Tensin <Egor.Tensin@gmail.com>2016-10-14 00:00:22 +0300
committerEgor Tensin <Egor.Tensin@gmail.com>2016-10-14 00:00:22 +0300
commit69905917cf2c46fa0093df7323e5326450d1246b (patch)
tree2ec12ee6f588f7bcefab713c976ed64aa1e729ec /src/resource.hpp
parentrename the project (diff)
downloadprivilege-check-69905917cf2c46fa0093df7323e5326450d1246b.tar.gz
privilege-check-69905917cf2c46fa0093df7323e5326450d1246b.zip
move code from headers to .cpp files
Diffstat (limited to '')
-rw-r--r--src/resource.hpp25
1 files changed, 3 insertions, 22 deletions
diff --git a/src/resource.hpp b/src/resource.hpp
index 24fc2db..0e3186c 100644
--- a/src/resource.hpp
+++ b/src/resource.hpp
@@ -5,32 +5,13 @@
#pragma once
-#include "error.hpp"
-
-#include <cstddef>
+#include <Windows.h>
#include <string>
namespace resource
{
- HMODULE load_exe_module()
- {
- const auto module = GetModuleHandle(NULL);
- if (module == NULL)
- error::raise("GetModuleHandle");
- return module;
- }
-
- std::wstring load_string(unsigned int id)
- {
- wchar_t* s = nullptr;
-
- const auto ret = LoadStringW(
- load_exe_module(), id, reinterpret_cast<wchar_t*>(&s), 0);
-
- if (ret <= 0)
- error::raise("LoadStringW");
+ HMODULE load_exe_module();
- return {s, static_cast<std::size_t>(ret)};
- }
+ std::wstring load_string(unsigned int id);
}