MCPcopy Create free account
hub / github.com/BeneficialCode/WinArk / GetObjectName

Method GetObjectName

WinArk/RegHelpers.cpp:37–51  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

35}
36
37CString RegHelpers::GetObjectName(HANDLE hObeject, DWORD pid) {
38 auto h = SecurityHelper::DupHandle(hObeject, pid, KEY_QUERY_VALUE);
39 if (h) {
40 BYTE buffer[2048];
41 auto status = NtQueryObject(h,
42 static_cast<OBJECT_INFORMATION_CLASS>(ObjectNameInformation),
43 buffer, sizeof(buffer), nullptr);
44 ::CloseHandle(h);
45 if (STATUS_SUCCESS == status) {
46 auto str = reinterpret_cast<UNICODE_STRING*>(buffer);
47 return CString(str->Buffer, str->Length / sizeof(WCHAR));
48 }
49 }
50 return L"";
51}
52
53
54CString RegHelpers::GetErrorText(DWORD error) {

Callers 2

OnShowJobMethod · 0.45
ParseTableEntryMethod · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected