0
|
1 #ifndef ANIMONE_ANIMONE_UTIL_WIN32_H_
|
|
2 #define ANIMONE_ANIMONE_UTIL_WIN32_H_
|
|
3
|
3
|
4 #include <windef.h>
|
0
|
5 #include <subauth.h>
|
3
|
6 #include <handleapi.h>
|
0
|
7
|
|
8 #include <memory>
|
|
9 #include <string>
|
|
10
|
|
11 namespace animone::internal::win32 {
|
|
12
|
|
13 struct HandleDeconstructor {
|
|
14 using pointer = HANDLE;
|
|
15 void operator()(pointer t) const { ::CloseHandle(t); };
|
|
16 };
|
|
17
|
|
18 using Handle = std::unique_ptr<HANDLE, HandleDeconstructor>;
|
|
19
|
|
20 /* ----------------------------------------------- */
|
|
21
|
|
22 std::string ToUtf8String(const std::wstring& string);
|
|
23 std::string ToUtf8String(const UNICODE_STRING& string);
|
|
24 std::wstring ToWstring(const std::string& string);
|
|
25
|
3
|
26 std::wstring GetProcessPath(DWORD process_id);
|
0
|
27 std::wstring GetFileNameFromPath(const std::wstring& path);
|
|
28 std::wstring GetFileNameWithoutExtension(const std::wstring& filename);
|
|
29
|
|
30 bool IsSystemDirectory(const std::string& path);
|
|
31 bool IsSystemDirectory(std::wstring path);
|
|
32
|
|
33 } // namespace animone::internal::win32
|
|
34
|
|
35 #endif // ANIMONE_ANIMONE_UTIL_WIN32_H_ |