Files
WinArk/WinSysCore/ProcessHandleTracker.h
2022-02-15 13:24:31 +08:00

27 lines
579 B
C++

#pragma once
namespace WinSys {
struct HandleEntryInfo {
HANDLE HandleValue;
uint16_t ObjectTypeIndex;
bool operator==(const HandleEntryInfo& other) const;
};
class ProcessHandleTracker {
public:
ProcessHandleTracker(uint32_t pid);
ProcessHandleTracker(HANDLE hProcess);
~ProcessHandleTracker();
bool IsValid() const;
uint32_t EnumHandles(bool clearHistory = false);
const std::vector<HandleEntryInfo>& GetNewHandles() const;
const std::vector<HandleEntryInfo>& GetClosedHandles() const;
private:
struct Impl;
std::unique_ptr<Impl> _impl;
};
}