mirror of
https://github.com/BeneficialCode/WinArk
synced 2026-08-09 12:00:31 +00:00
20 lines
568 B
C++
20 lines
568 B
C++
#include "stdafx.h"
|
|
#include "TimerObjectType.h"
|
|
#include "NtDll.h"
|
|
|
|
TimerObjectType::TimerObjectType(int index, PCWSTR name) : ObjectType(index, name) {
|
|
}
|
|
|
|
CString TimerObjectType::GetDetails(HANDLE hTimer) {
|
|
CString details;
|
|
TIMER_BASIC_INFORMATION bi;
|
|
if (NT_SUCCESS(::NtQueryTimer(hTimer, TimerBasicInformation, &bi, sizeof(bi), nullptr))) {
|
|
if (bi.TimerState != 0)
|
|
details.Format(L"State: %d, Remaining: %lld msec", (int)bi.TimerState, bi.RemainingTime.QuadPart / 10000);
|
|
else
|
|
details.Format(L"State: %d", (int)bi.TimerState);
|
|
}
|
|
|
|
return details;
|
|
}
|