diff options
| author | Egor Tensin <egor@tensin.name> | 2026-06-13 00:36:59 +0200 |
|---|---|---|
| committer | Egor Tensin <egor@tensin.name> | 2026-06-13 00:39:55 +0200 |
| commit | 190ff781eaee33e7a61aab44fc4133718cc0515b (patch) | |
| tree | 469cedfc87734589a4e9a0102f69324b9edb8f16 /src/process.hpp | |
| parent | cmake: upgrade minimum version (diff) | |
| download | privilege-check-190ff781eaee33e7a61aab44fc4133718cc0515b.tar.gz privilege-check-190ff781eaee33e7a61aab44fc4133718cc0515b.zip | |
add .clang-format
Diffstat (limited to 'src/process.hpp')
| -rw-r--r-- | src/process.hpp | 40 |
1 files changed, 17 insertions, 23 deletions
diff --git a/src/process.hpp b/src/process.hpp index c27dc3e..9ad93d9 100644 --- a/src/process.hpp +++ b/src/process.hpp @@ -5,36 +5,30 @@ #pragma once -#include "error.hpp" #include "cmd_line.hpp" +#include "error.hpp" #include <windows.h> #include <string> -namespace process -{ - inline HMODULE load_exe_module() - { - const auto module = GetModuleHandle(NULL); - if (module == NULL) - error::raise("GetModuleHandle"); - return module; - } +namespace process { - std::wstring get_executable_path(); - - inline std::wstring get_command_line() - { - return GetCommandLine(); - } +inline HMODULE load_exe_module() { + const auto module = GetModuleHandle(NULL); + if (module == NULL) + error::raise("GetModuleHandle"); + return module; +} - void runas( - const CommandLine& cmd_line, - HWND hwnd = NULL, - int nShow = SW_NORMAL); +std::wstring get_executable_path(); - void runas_self( - HWND hwnd = NULL, - int nShow = SW_NORMAL); +inline std::wstring get_command_line() { + return GetCommandLine(); } + +void runas(const CommandLine& cmd_line, HWND hwnd = NULL, int nShow = SW_NORMAL); + +void runas_self(HWND hwnd = NULL, int nShow = SW_NORMAL); + +} // namespace process |
