Mercurial > minori
comparison dep/animia/src/fd/win32.cc @ 198:bc1ae1810855
dep/animia: switch from using classes to global functions
the old idea was ok, but sort of hackish; this method doesn't use classes
at all, and this way (especially important!) we can do wayland stuff AND x11
at the same time, which wasn't really possible without stupid workarounds in
the other method
author | Paper <mrpapersonic@gmail.com> |
---|---|
date | Sun, 24 Dec 2023 02:59:42 -0500 |
parents | c413e475f496 |
children |
comparison
equal
deleted
inserted
replaced
197:c4ca035c565d | 198:bc1ae1810855 |
---|---|
170 return false; | 170 return false; |
171 | 171 |
172 return true; | 172 return true; |
173 } | 173 } |
174 | 174 |
175 bool Win32FdTools::EnumerateOpenProcesses(process_proc_t process_proc) { | 175 bool EnumerateOpenProcesses(process_proc_t process_proc) { |
176 HANDLE hProcessSnap = ::CreateToolhelp32Snapshot(TH32CS_SNAPPROCESS, 0); | 176 HANDLE hProcessSnap = ::CreateToolhelp32Snapshot(TH32CS_SNAPPROCESS, 0); |
177 if (hProcessSnap == INVALID_HANDLE_VALUE) | 177 if (hProcessSnap == INVALID_HANDLE_VALUE) |
178 return false; | 178 return false; |
179 | 179 |
180 PROCESSENTRY32 pe32; | 180 PROCESSENTRY32 pe32; |
194 | 194 |
195 return true; | 195 return true; |
196 } | 196 } |
197 | 197 |
198 /* this could be changed to being a callback, but... I'm too lazy right now :) */ | 198 /* this could be changed to being a callback, but... I'm too lazy right now :) */ |
199 bool Win32FdTools::EnumerateOpenFiles(const std::set<pid_t>& pids, open_file_proc_t open_file_proc) { | 199 bool EnumerateOpenFiles(const std::set<pid_t>& pids, open_file_proc_t open_file_proc) { |
200 if (!open_file_proc) | 200 if (!open_file_proc) |
201 return false; | 201 return false; |
202 | 202 |
203 std::unordered_map<pid_t, Handle> proc_handles; | 203 std::unordered_map<pid_t, Handle> proc_handles; |
204 | 204 |