Skip to content

Commit

Permalink
More trickery
Browse files Browse the repository at this point in the history
  • Loading branch information
nefarius committed Aug 20, 2024
1 parent 4a880cc commit 90ef614
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions include/nefarius/neflib/MiscWinApi.Impl.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@

namespace nefarius::winapi
{
std::expected<std::wstring, nefarius::utilities::Win32Error> GetProcessFullPathImpl(DWORD PID);

template <nefarius::utilities::string_type StringType>
std::expected<std::variant<std::string, std::wstring>, nefarius::utilities::Win32Error>
GetProcessFullPath(DWORD PID)
{
std::expected<std::wstring, nefarius::utilities::Win32Error> GetProcessFullPathImpl(DWORD ProcessID);

if constexpr (std::is_same_v<StringType, std::wstring>)
{
return GetProcessFullPathImpl(PID);
Expand Down
4 changes: 2 additions & 2 deletions src/MiscWinApi.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -96,9 +96,9 @@ std::expected<DWORD, Win32Error> nefarius::winapi::GetParentProcessID(DWORD Proc
return dwParentPID;
}

std::expected<std::wstring, Win32Error> nefarius::winapi::GetProcessFullPathImpl(DWORD PID)
std::expected<std::wstring, Win32Error> GetProcessFullPathImpl(DWORD ProcessID)
{
const HANDLE hProcess = OpenProcess(PROCESS_QUERY_INFORMATION | PROCESS_VM_READ, FALSE, PID);
const HANDLE hProcess = OpenProcess(PROCESS_QUERY_INFORMATION | PROCESS_VM_READ, FALSE, ProcessID);
if (hProcess == nullptr)
{
return std::unexpected(Win32Error("OpenProcess"));
Expand Down

0 comments on commit 90ef614

Please sign in to comment.