Wrap the per_user_directory() and per_machine_directory() methods sync
authorThomas
Mon, 16 Sep 2019 07:59:42 +0200
branchsync
changeset 358773b759ac1b8
parent 357 d868630b5a73
child 359 bc971f0f2e8c
Wrap the per_user_directory() and per_machine_directory() methods
CpEpEngine.cpp
CpEpEngine.h
pEpCOMServerAdapter.idl
     1.1 --- a/CpEpEngine.cpp	Mon Aug 26 15:49:15 2019 +0200
     1.2 +++ b/CpEpEngine.cpp	Mon Sep 16 07:59:42 2019 +0200
     1.3 @@ -1861,3 +1861,37 @@
     1.4  	else
     1.5  		return FAIL(L"EnableIdentityForSync", status);
     1.6  }
     1.7 +
     1.8 +STDMETHODIMP CpEpEngine::PerMachineDirectory(BSTR * directory)
     1.9 +{
    1.10 +	assert(directory);
    1.11 +
    1.12 +	if (!directory)
    1.13 +		return E_INVALIDARG;
    1.14 +
    1.15 +	const char *_directory = ::per_machine_directory();
    1.16 +
    1.17 +	if (_directory == NULL)
    1.18 +		return FAIL(L"PerMachineDirectory: _directory is NULL");
    1.19 +
    1.20 +	*directory = utf16_bstr(_directory);
    1.21 +
    1.22 +	return S_OK;
    1.23 +}
    1.24 +
    1.25 +STDMETHODIMP CpEpEngine::PerUserDirectory(BSTR * directory)
    1.26 +{
    1.27 +	assert(directory);
    1.28 +
    1.29 +	if (!directory)
    1.30 +		return E_INVALIDARG;
    1.31 +
    1.32 +	const char *_directory = ::per_user_directory();
    1.33 +
    1.34 +	if (_directory == NULL)
    1.35 +		return FAIL(L"PerUserDirectory: _directory is NULL");
    1.36 +
    1.37 +	*directory = utf16_bstr(_directory);
    1.38 +
    1.39 +	return S_OK;
    1.40 +}
     2.1 --- a/CpEpEngine.h	Mon Aug 26 15:49:15 2019 +0200
     2.2 +++ b/CpEpEngine.h	Mon Sep 16 07:59:42 2019 +0200
     2.3 @@ -285,6 +285,9 @@
     2.4  	STDMETHOD(EnableIdentityForSync)(struct pEpIdentity * ident);
     2.5  
     2.6  	STDMETHOD(PERToXERSyncMessage)(TextMessage *msg, BSTR * xer);
     2.7 +
     2.8 +	STDMETHOD(PerMachineDirectory)(BSTR * directory);
     2.9 +	STDMETHOD(PerUserDirectory)(BSTR * directory);
    2.10  };
    2.11  
    2.12  OBJECT_ENTRY_AUTO(__uuidof(pEpEngine), CpEpEngine)
     3.1 --- a/pEpCOMServerAdapter.idl	Mon Aug 26 15:49:15 2019 +0200
     3.2 +++ b/pEpCOMServerAdapter.idl	Mon Sep 16 07:59:42 2019 +0200
     3.3 @@ -506,6 +506,12 @@
     3.4  
     3.5  	// Enable Sync for this identity
     3.6  	[id(56)] HRESULT EnableIdentityForSync([in] struct pEpIdentity * ident);
     3.7 +
     3.8 +	// Gets the directory where shared files are stored
     3.9 +	[id(57)] HRESULT PerMachineDirectory([out, retval] BSTR *directory);
    3.10 +
    3.11 +	// Gets the directory for user files
    3.12 +	[id(58)] HRESULT PerUserDirectory([out, retval] BSTR *directory);
    3.13  };
    3.14  
    3.15  [