adding get_crashdump_log()
authorVolker Birk <vb@pep-project.org>
Sun, 21 Feb 2016 12:56:08 +0100
changeset 570b6002476e85
parent 56 fb5f7a67a703
child 58 a0214629bc44
adding get_crashdump_log()
CpEpEngine.cpp
CpEpEngine.h
pEpCOMServerAdapter.idl
     1.1 --- a/CpEpEngine.cpp	Sat Jan 30 10:43:34 2016 +0100
     1.2 +++ b/CpEpEngine.cpp	Sun Feb 21 12:56:08 2016 +0100
     1.3 @@ -432,6 +432,27 @@
     1.4      }
     1.5  }
     1.6  
     1.7 +STDMETHODIMP CpEpEngine::get_crashdump_log(LONG maxlines, BSTR * log)
     1.8 +{
     1.9 +    assert(maxlines >= 0);
    1.10 +    assert(log);
    1.11 +
    1.12 +    if (!(maxlines >= 0 && log))
    1.13 +        return E_INVALIDARG;
    1.14 +
    1.15 +    char *_log;
    1.16 +    PEP_STATUS status = ::get_crashdump_log(get_session(), (int) maxlines, &_log);
    1.17 +    assert(status == PEP_STATUS_OK);
    1.18 +    if (status == PEP_OUT_OF_MEMORY)
    1.19 +        return E_OUTOFMEMORY;
    1.20 +    if (status != PEP_STATUS_OK || _log == NULL)
    1.21 +        return FAIL(L"get_crashdump_log");
    1.22 +
    1.23 +    *log = utf16_bstr(_log);
    1.24 +    pEp_free(_log);
    1.25 +    return S_OK;
    1.26 +}
    1.27 +
    1.28  STDMETHODIMP CpEpEngine::get_identity(BSTR address, pEp_identity_s * ident)
    1.29  {
    1.30      assert(address);
     2.1 --- a/CpEpEngine.h	Sat Jan 30 10:43:34 2016 +0100
     2.2 +++ b/CpEpEngine.h	Sun Feb 21 12:56:08 2016 +0100
     2.3 @@ -145,6 +145,7 @@
     2.4      STDMETHOD(recv_key)(BSTR pattern);
     2.5      STDMETHOD(find_keys)(BSTR pattern, LPSAFEARRAY * key_list);
     2.6      STDMETHOD(send_key)(BSTR pattern);
     2.7 +    STDMETHOD(get_crashdump_log)(LONG maxlines, BSTR * log);
     2.8  
     2.9      // keymanagement API
    2.10  
     3.1 --- a/pEpCOMServerAdapter.idl	Sat Jan 30 10:43:34 2016 +0100
     3.2 +++ b/pEpCOMServerAdapter.idl	Sun Feb 21 12:56:08 2016 +0100
     3.3 @@ -48,6 +48,7 @@
     3.4      HRESULT verify([in] BSTR text, [in] BSTR signature, [out] SAFEARRAY(BSTR) * key_list, [out, retval] pEp_STATUS * verify_status);
     3.5      HRESULT trustword([in] LONG value, [in, defaultvalue("en")] BSTR lang, [out, retval] BSTR * word);
     3.6      HRESULT trustwords([in] BSTR fpr, [in, defaultvalue("en")] BSTR lang, [in, defaultvalue(0)] LONG max_words, [out, retval] BSTR * words);
     3.7 +    HRESULT get_crashdump_log([in] LONG maxlines, [out, retval] BSTR * log);
     3.8  
     3.9      typedef enum _pEp_comm_type {
    3.10          pEp_ct_unknown = 0,