mirror of
https://github.com/BeneficialCode/WinArk
synced 2026-08-09 12:00:31 +00:00
19 lines
526 B
C++
19 lines
526 B
C++
#include "stdafx.h"
|
|
#include "KeyObjectType.h"
|
|
#include "NtDll.h"
|
|
|
|
KeyObjectType::KeyObjectType(int index, PCWSTR name) : ObjectType(index, name) {
|
|
}
|
|
|
|
CString KeyObjectType::GetDetails(HANDLE hKey) {
|
|
CString details;
|
|
BYTE buffer[1 << 12];
|
|
ULONG len;
|
|
if (NT_SUCCESS(::NtQueryKey(hKey, KeyBasicInformation, buffer, sizeof(buffer), &len))) {
|
|
auto info = (KEY_BASIC_INFORMATION*)buffer;
|
|
details.Format(L"Last Write: %s",
|
|
(PCWSTR)CTime(*(FILETIME*)&info->LastWriteTime.QuadPart).Format(L"%D %X"));
|
|
}
|
|
return details;
|
|
}
|