IPathCopyCopyConfigHelper::GetPluginInfo Returns information about an available plugin. @param p_Index 0-based index of the plugin requested. @param p_ppId Will contain a string representation of the plugin ID. @param p_ppDescription Will contain the plugin's description (what will appear in the contextual menu). @param p_pIsSeparator Will contain VARIANT_TRUE if this is a separator plugin, othe
| 76 | // @return Result code. |
| 77 | // |
| 78 | [[gsl::suppress(c.128)]] |
| 79 | STDMETHODIMP CPathCopyCopyConfigHelper::GetPluginInfo(ULONG p_Index, BSTR *p_ppId, BSTR *p_ppDescription, VARIANT_BOOL *p_pIsSeparator) |
| 80 | { |
| 81 | Initialize(); |
| 82 | HRESULT hRes = S_OK; |
| 83 | |
| 84 | if (p_ppId != nullptr && p_ppDescription != nullptr && p_Index < m_vspPlugins.size()) { |
| 85 | const PCC::PluginSP& spPlugin = m_vspPlugins.at(p_Index); |
| 86 | std::wstring pluginId(40, L'\0'); |
| 87 | if (::StringFromGUID2(spPlugin->Id(), &*pluginId.begin(), gsl::narrow_cast<int>(pluginId.size())) != 0) { |
| 88 | *p_ppId = ::SysAllocString(pluginId.c_str()); |
| 89 | *p_ppDescription = ::SysAllocString(spPlugin->Description().c_str()); |
| 90 | if (p_pIsSeparator != nullptr) { |
| 91 | *p_pIsSeparator = spPlugin->IsSeparator() ? VARIANT_TRUE : VARIANT_FALSE; |
| 92 | } |
| 93 | } else { |
| 94 | hRes = E_FAIL; |
| 95 | } |
| 96 | } else { |
| 97 | hRes = E_INVALIDARG; |
| 98 | } |
| 99 | |
| 100 | return hRes; |
| 101 | } |
| 102 | |
| 103 | // |
| 104 | // Performs late-initialization of members. |
nothing calls this directly
no test coverage detected