Stowing changes from COM-28 COM-28
authorkrista
Thu, 01 Sep 2016 13:38:38 +0200
branchCOM-28
changeset 157ce82a4a45fc5
parent 154 09f6480a8c41
child 158 8c13eb85db47
Stowing changes from COM-28
CpEpEngine.cpp
CpEpEngine.h
pEpCOMServerAdapter.idl
pEp_utility.cpp
pEp_utility.h
stdafx.h
     1.1 --- a/CpEpEngine.cpp	Wed Aug 31 11:09:46 2016 +0200
     1.2 +++ b/CpEpEngine.cpp	Thu Sep 01 13:38:38 2016 +0200
     1.3 @@ -1300,10 +1300,10 @@
     1.4  	return S_FALSE;
     1.5  }
     1.6  
     1.7 -STDMETHODIMP CpEpEngine::OpenPGP_list_keyinfo(BSTR* search_pattern, LPSAFEARRAY* keyinfo_list) {
     1.8 +STDMETHODIMP CpEpEngine::OpenPGP_list_keyinfo(BSTR search_pattern, LPSAFEARRAY* keyinfo_list) {
     1.9      assert(keyinfo_list);
    1.10      
    1.11 -    if (key_list == NULL)
    1.12 +    if (keyinfo_list == NULL)
    1.13          return E_INVALIDARG;
    1.14  
    1.15      string _pattern = "";
    1.16 @@ -1311,7 +1311,7 @@
    1.17          _pattern = utf8_string(search_pattern);
    1.18      ::stringpair_list_t* _keyinfo_list = NULL;
    1.19  
    1.20 -    PEP_STATUS status = ::find_keys(get_session(), _pattern.c_str(), &_keyinfo_list);
    1.21 +    PEP_STATUS status = ::OpenPGP_list_keyinfo(get_session(), _pattern.c_str(), &_keyinfo_list);
    1.22      assert(status != PEP_OUT_OF_MEMORY);
    1.23      if (status == PEP_OUT_OF_MEMORY)
    1.24          return E_OUTOFMEMORY;
    1.25 @@ -1320,10 +1320,10 @@
    1.26          return FAIL(L"OpenPGP_list_keyinfo");
    1.27  
    1.28      if (_keyinfo_list && _keyinfo_list->value) {
    1.29 -        *keyinfo_list = stringpair_list(_keyinfo_list); // ???
    1.30 +        ::opt_field_array_from_C(_keyinfo_list, keyinfo_list);
    1.31      }
    1.32      else {
    1.33 -        ::free_stringlist(_keyinto_list);
    1.34 +        ::free_stringpair_list(_keyinfo_list);
    1.35          return FAIL(L"OpenPGP_list_keyinfo: no keys found");
    1.36      }
    1.37  
     2.1 --- a/CpEpEngine.h	Wed Aug 31 11:09:46 2016 +0200
     2.2 +++ b/CpEpEngine.h	Thu Sep 01 13:38:38 2016 +0200
     2.3 @@ -228,7 +228,7 @@
     2.4  	STDMETHOD(unregister_callbacks)(IpEpEngineCallbacks *obsolete_callback);
     2.5      
     2.6      // PGP compatibility functions
     2.7 -    STDMETHOD(OpenPGP_list_keyinfo)(BSTR* search_pattern, LPSAFEARRAY* keyinfo_list);
     2.8 +    STDMETHOD(OpenPGP_list_keyinfo)(BSTR search_pattern, LPSAFEARRAY* keyinfo_list);
     2.9  
    2.10  protected:
    2.11  	HRESULT Fire_MessageToSend(
     3.1 --- a/pEpCOMServerAdapter.idl	Wed Aug 31 11:09:46 2016 +0200
     3.2 +++ b/pEpCOMServerAdapter.idl	Thu Sep 01 13:38:38 2016 +0200
     3.3 @@ -205,6 +205,9 @@
     3.4      HRESULT blacklist_is_listed([in] BSTR fpr, [out, retval] VARIANT_BOOL *listed);
     3.5      HRESULT blacklist_retrieve([out, retval] SAFEARRAY(BSTR) *blacklist);
     3.6  
     3.7 +	// PGP compatibility functions
     3.8 +	HRESULT OpenPGP_list_keyinfo([in] BSTR search_pattern, [out, retval] LPSAFEARRAY* keyinfo_list);
     3.9 +
    3.10      // Message API
    3.11  
    3.12      typedef enum _pEp_color {
     4.1 --- a/pEp_utility.cpp	Wed Aug 31 11:09:46 2016 +0200
     4.2 +++ b/pEp_utility.cpp	Thu Sep 01 13:38:38 2016 +0200
     4.3 @@ -521,5 +521,14 @@
     4.4  
     4.5              return msg2;
     4.6          }
     4.7 +		void opt_field_array_from_C(stringpair_list_t* spair_list, LPSAFEARRAY* pair_list_out) {
     4.8 +			assert(spair_list);
     4.9 +			assert(pair_list_out);
    4.10 +			
    4.11 +			if (!spair_list)
    4.12 +				return;
    4.13 +
    4.14 +			*pair_list_out = array_from_C<opt_field, stringpair_list_t>(spair_list);
    4.15 +		}
    4.16      }
    4.17  }
     5.1 --- a/pEp_utility.h	Wed Aug 31 11:09:46 2016 +0200
     5.2 +++ b/pEp_utility.h	Thu Sep 01 13:38:38 2016 +0200
     5.3 @@ -41,6 +41,8 @@
     5.4          void clear_text_message(text_message *msg);
     5.5          ::pEp_identity *new_identity(const pEp_identity_s * ident);
     5.6  
     5.7 +		void opt_field_array_from_C(stringpair_list_t* spair_list, LPSAFEARRAY* pair_list_out);
     5.8 +
     5.9          static LPTYPELIB pTypelib = NULL;
    5.10  
    5.11          template< class UDType > static IRecordInfo *getRecordInfo()
     6.1 --- a/stdafx.h	Wed Aug 31 11:09:46 2016 +0200
     6.2 +++ b/stdafx.h	Thu Sep 01 13:38:38 2016 +0200
     6.3 @@ -49,4 +49,5 @@
     6.4  #include "../pEpEngine/src/message_api.h"
     6.5  #include "../pEpEngine/src/stringpair.h"
     6.6  #include "../pEpEngine/src/blacklist.h"
     6.7 -#include "../pEpEngine/src/sync.h"
     6.8 \ No newline at end of file
     6.9 +#include "../pEpEngine/src/sync.h"
    6.10 +#include "../pEpEngine/src/openpgp_compat.h"
    6.11 \ No newline at end of file