Mercurial > minori
diff dep/animia/src/fd/win32.cc @ 139:478f3b366199
dep/animia: separate lots of things, use base class for OS stuff
author | Paper <mrpapersonic@gmail.com> |
---|---|
date | Sun, 12 Nov 2023 16:43:07 -0500 |
parents | 28842a8d0c6b |
children | 1e696863b54c |
line wrap: on
line diff
--- a/dep/animia/src/fd/win32.cc Sun Nov 12 04:53:19 2023 -0500 +++ b/dep/animia/src/fd/win32.cc Sun Nov 12 16:43:07 2023 -0500 @@ -199,7 +199,7 @@ return true; } -bool GetAllPids(std::set<pid_t>& pids) { +bool Win32FdTools::GetAllPids(std::set<pid_t>& pids) { HANDLE hProcessSnap = ::CreateToolhelp32Snapshot(TH32CS_SNAPPROCESS, 0); if (hProcessSnap == INVALID_HANDLE_VALUE) return false; @@ -220,7 +220,7 @@ return true; } -bool GetProcessName(pid_t pid, std::string& result) { +bool Win32FdTools::GetProcessName(pid_t pid, std::string& result) { unsigned long ret_size = 0; // size given by GetModuleBaseNameW Handle handle(::OpenProcess(PROCESS_QUERY_INFORMATION | PROCESS_VM_READ, FALSE, pid)); if (!handle.get()) @@ -242,7 +242,7 @@ } /* this could be changed to being a callback, but... I'm too lazy right now :) */ -bool EnumerateOpenFiles(const std::set<pid_t>& pids, std::vector<std::tuple<pid_t, std::string>>& files) { +bool Win32FdTools::EnumerateOpenFiles(const std::set<pid_t>& pids, std::vector<std::tuple<pid_t, std::string>>& files) { std::unordered_map<pid_t, Handle> proc_handles; for (const pid_t& pid : pids) {