Browse Source

Wrap the per_user_directory() and per_machine_directory() methods

COM-121
Thomas 3 years ago
parent
commit
c112acb855
3 changed files with 43 additions and 0 deletions
  1. +34
    -0
      CpEpEngine.cpp
  2. +3
    -0
      CpEpEngine.h
  3. +6
    -0
      pEpCOMServerAdapter.idl

+ 34
- 0
CpEpEngine.cpp View File

@ -1861,3 +1861,37 @@ STDMETHODIMP CpEpEngine::EnableIdentityForSync(struct pEpIdentity * ident)
else
return FAIL(L"EnableIdentityForSync", status);
}
STDMETHODIMP CpEpEngine::PerMachineDirectory(BSTR * directory)
{
assert(directory);
if (!directory)
return E_INVALIDARG;
const char *_directory = ::per_machine_directory();
if (_directory == NULL)
return FAIL(L"PerMachineDirectory: _directory is NULL");
*directory = utf16_bstr(_directory);
return S_OK;
}
STDMETHODIMP CpEpEngine::PerUserDirectory(BSTR * directory)
{
assert(directory);
if (!directory)
return E_INVALIDARG;
const char *_directory = ::per_user_directory();
if (_directory == NULL)
return FAIL(L"PerUserDirectory: _directory is NULL");
*directory = utf16_bstr(_directory);
return S_OK;
}

+ 3
- 0
CpEpEngine.h View File

@ -285,6 +285,9 @@ public:
STDMETHOD(EnableIdentityForSync)(struct pEpIdentity * ident);
STDMETHOD(PERToXERSyncMessage)(TextMessage *msg, BSTR * xer);
STDMETHOD(PerMachineDirectory)(BSTR * directory);
STDMETHOD(PerUserDirectory)(BSTR * directory);
};
OBJECT_ENTRY_AUTO(__uuidof(pEpEngine), CpEpEngine)

+ 6
- 0
pEpCOMServerAdapter.idl View File

@ -506,6 +506,12 @@ interface IpEpEngine : IUnknown {
// Enable Sync for this identity
[id(56)] HRESULT EnableIdentityForSync([in] struct pEpIdentity * ident);
// Gets the directory where shared files are stored
[id(57)] HRESULT PerMachineDirectory([out, retval] BSTR *directory);
// Gets the directory for user files
[id(58)] HRESULT PerUserDirectory([out, retval] BSTR *directory);
};
[


Loading…
Cancel
Save