Index: src/chext/MenuExt.cpp =================================================================== diff -u -N -rebc7fabbd2d59f9a0f723ea480b5374cc393ec12 -r2f696d06139af4d0fab14dd1613507b66f5169cb --- src/chext/MenuExt.cpp (.../MenuExt.cpp) (revision ebc7fabbd2d59f9a0f723ea480b5374cc393ec12) +++ src/chext/MenuExt.cpp (.../MenuExt.cpp) (revision 2f696d06139af4d0fab14dd1613507b66f5169cb) @@ -81,7 +81,7 @@ if(!hWnd) return S_OK; - HRESULT hResult = ReadShellConfig(); + HRESULT hResult = ShellExtensionVerifier::ReadShellConfig(m_piShellExtControl, m_tShellExtMenuConfig, eLocation_ContextMenu); LOG_HRESULT(m_spLog, hResult) << L"Read shell config"; if(SUCCEEDED(hResult)) @@ -368,40 +368,3 @@ return S_OK; } - -HRESULT CMenuExt::ReadShellConfig() -{ - try - { - HWND hWnd = ShellExtensionVerifier::VerifyShellExt(m_piShellExtControl); - if(hWnd == nullptr) - return E_FAIL; - - // get cfg from ch - unsigned long ulSHMID = GetTickCount(); - if(::SendMessage(hWnd, WM_GETCONFIG, eLocation_ContextMenu, ulSHMID) != TRUE) - { - LOG_ERROR(m_spLog) << L"Failed to retrieve configuration from Copy Handler"; - return E_FAIL; - } - - std::wstring strSHMName = IPCSupport::GenerateSHMName(ulSHMID); - - chcore::TSharedMemory tSharedMemory; - chcore::TString wstrData; - chcore::TConfig cfgShellExtData; - - tSharedMemory.Open(strSHMName.c_str()); - tSharedMemory.Read(wstrData); - - cfgShellExtData.ReadFromString(wstrData); - - m_tShellExtMenuConfig.ReadFromConfig(cfgShellExtData, _T("ShellExtCfg")); - - return S_OK; - } - catch(...) - { - return E_FAIL; - } -}