mirror of
https://github.com/BeneficialCode/WinArk.git
synced 2026-10-19 06:06:10 +08:00
27 lines
579 B
C++
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;
|
|
};
|
|
} |