Stowing changes for checkout in windows. COM-28
authorKrista Grothoff <krista@pep-project.org>
Wed, 31 Aug 2016 11:09:46 +0200
branchCOM-28
changeset 15409f6480a8c41
parent 153 aecfde0414f7
child 157 ce82a4a45fc5
Stowing changes for checkout in windows.
CpEpEngine.cpp
CpEpEngine.h
     1.1 --- a/CpEpEngine.cpp	Mon Aug 29 12:25:21 2016 +0200
     1.2 +++ b/CpEpEngine.cpp	Wed Aug 31 11:09:46 2016 +0200
     1.3 @@ -1300,6 +1300,38 @@
     1.4  	return S_FALSE;
     1.5  }
     1.6  
     1.7 +STDMETHODIMP CpEpEngine::OpenPGP_list_keyinfo(BSTR* search_pattern, LPSAFEARRAY* keyinfo_list) {
     1.8 +    assert(keyinfo_list);
     1.9 +    
    1.10 +    if (key_list == NULL)
    1.11 +        return E_INVALIDARG;
    1.12 +
    1.13 +    string _pattern = "";
    1.14 +    if (search_pattern)
    1.15 +        _pattern = utf8_string(search_pattern);
    1.16 +    ::stringpair_list_t* _keyinfo_list = NULL;
    1.17 +
    1.18 +    PEP_STATUS status = ::find_keys(get_session(), _pattern.c_str(), &_keyinfo_list);
    1.19 +    assert(status != PEP_OUT_OF_MEMORY);
    1.20 +    if (status == PEP_OUT_OF_MEMORY)
    1.21 +        return E_OUTOFMEMORY;
    1.22 +
    1.23 +    if (status != ::PEP_STATUS_OK)
    1.24 +        return FAIL(L"OpenPGP_list_keyinfo");
    1.25 +
    1.26 +    if (_keyinfo_list && _keyinfo_list->value) {
    1.27 +        *keyinfo_list = stringpair_list(_keyinfo_list); // ???
    1.28 +    }
    1.29 +    else {
    1.30 +        ::free_stringlist(_keyinto_list);
    1.31 +        return FAIL(L"OpenPGP_list_keyinfo: no keys found");
    1.32 +    }
    1.33 +
    1.34 +    ::free_stringpair_list(_keyinfo_list);
    1.35 +    return S_OK;
    1.36 +    
    1.37 +}
    1.38 +
    1.39  HRESULT CpEpEngine::Fire_MessageToSend(text_message * msg)
    1.40  {
    1.41  	callbacks cbs = get_callbacks();
     2.1 --- a/CpEpEngine.h	Mon Aug 29 12:25:21 2016 +0200
     2.2 +++ b/CpEpEngine.h	Wed Aug 31 11:09:46 2016 +0200
     2.3 @@ -226,6 +226,9 @@
     2.4  
     2.5  	STDMETHOD(register_callbacks)(IpEpEngineCallbacks *new_callback);
     2.6  	STDMETHOD(unregister_callbacks)(IpEpEngineCallbacks *obsolete_callback);
     2.7 +    
     2.8 +    // PGP compatibility functions
     2.9 +    STDMETHOD(OpenPGP_list_keyinfo)(BSTR* search_pattern, LPSAFEARRAY* keyinfo_list);
    2.10  
    2.11  protected:
    2.12  	HRESULT Fire_MessageToSend(