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

Method GetValueDetails

WinArk/View.cpp:478–509  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

476}
477
478CString CRegistryManagerView::GetValueDetails(const RegistryItem& item) const {
479 ATLASSERT(!item.Key);
480 CString text;
481 if (item.Value.IsEmpty())
482 item.Value = Registry::GetDataAsString(m_CurrentKey, item);
483 switch (item.Type)
484 {
485 case REG_EXPAND_SZ:
486 if (item.Value.Find(L"%") >= 0) {
487 text = Registry::ExpandStrings(item.Value);
488 }
489 break;
490
491 case REG_SZ:
492 if (item.Value[0] == L'@') {
493 static const CString paths[] = {
494 L"",
495 RegHelpers::GetSystemDir(),
496 RegHelpers::GetSystemDir() + CString(L"\\Drivers"),
497 RegHelpers::GetWindowsDir(),
498 };
499 for (auto& path : paths) {
500 if (ERROR_FILE_NOT_FOUND != ::RegLoadMUIString(m_CurrentKey.Get(),
501 item.Name, text.GetBufferSetLength(512), 512,
502 nullptr, REG_MUI_STRING_TRUNCATE, path.IsEmpty() ? nullptr : (PCWSTR)path))
503 break;
504 }
505 }
506 break;
507 }
508 return text;
509}
510
511CTreeItem CRegistryManagerView::InsertKeyItem(HTREEITEM hParent, PCWSTR name, NodeType type) {
512 bool accessDenied = (type & NodeType::AccessDenied) == NodeType::AccessDenied;

Callers

nothing calls this directly

Calls 3

IsEmptyMethod · 0.80
FindMethod · 0.80
GetMethod · 0.45

Tested by

no test coverage detected