Browse Source

Add method PERToXERSyncMessage to print the sync message xml

COM-121
Thomas 3 years ago
parent
commit
1401b9b9cf
3 changed files with 29 additions and 0 deletions
  1. +23
    -0
      CpEpEngine.cpp
  2. +3
    -0
      CpEpEngine.h
  3. +3
    -0
      pEpCOMServerAdapter.idl

+ 23
- 0
CpEpEngine.cpp View File

@ -1770,3 +1770,26 @@ STDMETHODIMP CpEpEngine::DeliverHandshakeResult(enum SyncHandshakeResult result,
return S_OK;
}
STDMETHODIMP CpEpEngine::PERToXERSyncMessage(TextMessage *msg, BSTR * xer)
{
assert(msg);
if (!msg)
return E_INVALIDARG;
char* text;
::message *_msg = text_message_to_C(msg);
char* val = _msg->attachments->value;
PEP_STATUS status = ::PER_to_XER_Sync_msg(val, strlen(val), &text);
free_message(_msg);
if (status != PEP_STATUS_OK)
return FAIL(L"cannot get XER", status);
*xer = utf16_bstr(text);
pEp_free(text);
return S_OK;
}

+ 3
- 0
CpEpEngine.h View File

@ -12,6 +12,7 @@
#include <mutex>
#include <vector>
#include "..\libpEpAdapter\pc_container.hh"
#include "..\pEp\sync_codec.h"
#if defined(_WIN32_WCE) && !defined(_CE_DCOM) && !defined(_CE_ALLOW_SINGLE_THREADED_OBJECTS_IN_MTA)
#error "Single-threaded COM objects are not properly supported on Windows CE platform, such as the Windows Mobile platforms that do not include full DCOM support. Define _CE_ALLOW_SINGLE_THREADED_OBJECTS_IN_MTA to force ATL to support creating single-thread COM object's and allow use of it's single-threaded COM object implementations. The threading model in your rgs file was set to 'Free' as that is the only threading model supported in non DCOM Windows CE platforms."
@ -277,6 +278,8 @@ public:
// sync API
STDMETHOD(DeliverHandshakeResult)(enum SyncHandshakeResult result, SAFEARRAY *identities_sharing);
STDMETHOD(LeaveDeviceGroup)();
STDMETHOD(PERToXERSyncMessage)(TextMessage *msg, BSTR * xer);
};
OBJECT_ENTRY_AUTO(__uuidof(pEpEngine), CpEpEngine)

+ 3
- 0
pEpCOMServerAdapter.idl View File

@ -493,6 +493,9 @@ interface IpEpEngine : IUnknown {
// Get the comm type a bare key has
[id(53)] HRESULT GetKeyRating([in] BSTR fpr, [out, retval] pEpComType *commType);
// Decode a Sync message from PER into XER
[id(54)] HRESULT PERToXERSyncMessage([in] struct TextMessage *msg, [out, retval] BSTR *xer);
};
[


Loading…
Cancel
Save