aboutsummaryrefslogtreecommitdiffstats
path: root/src/native/addrbook/msoutlook/com
diff options
context:
space:
mode:
authorDamian Minkov <damencho@jitsi.org>2014-03-24 10:55:37 +0200
committerDamian Minkov <damencho@jitsi.org>2014-03-24 10:56:49 +0200
commitb035911232492e3bbf6e55b6e03087576e0010b6 (patch)
tree9b7ca2de192e90a36c153f6e616daf0d3c65b2c7 /src/native/addrbook/msoutlook/com
parent1cc5494e9adf6fb25acfa69cfa1e586866549b9a (diff)
downloadjitsi-b035911232492e3bbf6e55b6e03087576e0010b6.zip
jitsi-b035911232492e3bbf6e55b6e03087576e0010b6.tar.gz
jitsi-b035911232492e3bbf6e55b6e03087576e0010b6.tar.bz2
Fixes canceling outlook queries when new one is created and uses one remote object to deliver results from com server, instead of creating new one for every contact. Adds some measurement trace prints, that can track execution time of native part.
Diffstat (limited to 'src/native/addrbook/msoutlook/com')
-rw-r--r--src/native/addrbook/msoutlook/com/IMsOutlookAddrBookClient.h16
-rw-r--r--src/native/addrbook/msoutlook/com/IMsOutlookAddrBookClient.idl3
-rw-r--r--src/native/addrbook/msoutlook/com/IMsOutlookAddrBookClient.tlbbin1860 -> 1892 bytes
-rw-r--r--src/native/addrbook/msoutlook/com/IMsOutlookAddrBookServer.h16
-rw-r--r--src/native/addrbook/msoutlook/com/IMsOutlookAddrBookServer.idl3
-rw-r--r--src/native/addrbook/msoutlook/com/IMsOutlookAddrBookServer.tlbbin2572 -> 2604 bytes
-rw-r--r--src/native/addrbook/msoutlook/com/MsOutlookAddrBookClient.cxx10
-rw-r--r--src/native/addrbook/msoutlook/com/MsOutlookAddrBookClient.h3
-rw-r--r--src/native/addrbook/msoutlook/com/MsOutlookAddrBookServer.cxx47
-rw-r--r--src/native/addrbook/msoutlook/com/MsOutlookAddrBookServer.h5
10 files changed, 64 insertions, 39 deletions
diff --git a/src/native/addrbook/msoutlook/com/IMsOutlookAddrBookClient.h b/src/native/addrbook/msoutlook/com/IMsOutlookAddrBookClient.h
index b8eed7e..4337015 100644
--- a/src/native/addrbook/msoutlook/com/IMsOutlookAddrBookClient.h
+++ b/src/native/addrbook/msoutlook/com/IMsOutlookAddrBookClient.h
@@ -3,11 +3,11 @@
/* this ALWAYS GENERATED file contains the definitions for the interfaces */
- /* File created by MIDL compiler version 8.00.0595 */
-/* at Tue May 07 03:41:40 2013
+ /* File created by MIDL compiler version 8.00.0603 */
+/* at Mon Mar 24 09:03:06 2014
*/
/* Compiler settings for IMsOutlookAddrBookClient.idl:
- Oicf, W1, Zp8, env=Win32 (32b run), target_arch=X86 8.00.0595
+ Oicf, W1, Zp8, env=Win32 (32b run), target_arch=X86 8.00.0603
protocol : dce , ms_ext, c_ext, robust
error checks: allocation ref bounds_check enum stub_data
VC __declspec() decoration level:
@@ -84,7 +84,8 @@ EXTERN_C const IID IID_IMsOutlookAddrBookClient;
{
public:
virtual HRESULT STDMETHODCALLTYPE foreachMailUserCallback(
- /* [in] */ BSTR id) = 0;
+ /* [in] */ BSTR id,
+ /* [in] */ long callback) = 0;
virtual HRESULT STDMETHODCALLTYPE deleted(
/* [in] */ BSTR id) = 0;
@@ -118,7 +119,8 @@ EXTERN_C const IID IID_IMsOutlookAddrBookClient;
HRESULT ( STDMETHODCALLTYPE *foreachMailUserCallback )(
IMsOutlookAddrBookClient * This,
- /* [in] */ BSTR id);
+ /* [in] */ BSTR id,
+ /* [in] */ long callback);
HRESULT ( STDMETHODCALLTYPE *deleted )(
IMsOutlookAddrBookClient * This,
@@ -155,8 +157,8 @@ EXTERN_C const IID IID_IMsOutlookAddrBookClient;
( (This)->lpVtbl -> Release(This) )
-#define IMsOutlookAddrBookClient_foreachMailUserCallback(This,id) \
- ( (This)->lpVtbl -> foreachMailUserCallback(This,id) )
+#define IMsOutlookAddrBookClient_foreachMailUserCallback(This,id,callback) \
+ ( (This)->lpVtbl -> foreachMailUserCallback(This,id,callback) )
#define IMsOutlookAddrBookClient_deleted(This,id) \
( (This)->lpVtbl -> deleted(This,id) )
diff --git a/src/native/addrbook/msoutlook/com/IMsOutlookAddrBookClient.idl b/src/native/addrbook/msoutlook/com/IMsOutlookAddrBookClient.idl
index bf3450b..6e1fad5 100644
--- a/src/native/addrbook/msoutlook/com/IMsOutlookAddrBookClient.idl
+++ b/src/native/addrbook/msoutlook/com/IMsOutlookAddrBookClient.idl
@@ -10,7 +10,8 @@ import "Unknwn.idl", "oaidl.idl";
interface IMsOutlookAddrBookClient : IUnknown
{
HRESULT foreachMailUserCallback(
- [in] BSTR id);
+ [in] BSTR id,
+ [in] long callback);
HRESULT deleted(
[in] BSTR id);
diff --git a/src/native/addrbook/msoutlook/com/IMsOutlookAddrBookClient.tlb b/src/native/addrbook/msoutlook/com/IMsOutlookAddrBookClient.tlb
index 716c3aa..168d9ad 100644
--- a/src/native/addrbook/msoutlook/com/IMsOutlookAddrBookClient.tlb
+++ b/src/native/addrbook/msoutlook/com/IMsOutlookAddrBookClient.tlb
Binary files differ
diff --git a/src/native/addrbook/msoutlook/com/IMsOutlookAddrBookServer.h b/src/native/addrbook/msoutlook/com/IMsOutlookAddrBookServer.h
index 0cf23fa..aee8983 100644
--- a/src/native/addrbook/msoutlook/com/IMsOutlookAddrBookServer.h
+++ b/src/native/addrbook/msoutlook/com/IMsOutlookAddrBookServer.h
@@ -3,11 +3,11 @@
/* this ALWAYS GENERATED file contains the definitions for the interfaces */
- /* File created by MIDL compiler version 8.00.0595 */
-/* at Wed Jun 19 15:47:56 2013
+ /* File created by MIDL compiler version 8.00.0603 */
+/* at Mon Mar 24 09:03:14 2014
*/
/* Compiler settings for IMsOutlookAddrBookServer.idl:
- Oicf, W1, Zp8, env=Win32 (32b run), target_arch=X86 8.00.0595
+ Oicf, W1, Zp8, env=Win32 (32b run), target_arch=X86 8.00.0603
protocol : dce , ms_ext, c_ext, robust
error checks: allocation ref bounds_check enum stub_data
VC __declspec() decoration level:
@@ -84,7 +84,8 @@ EXTERN_C const IID IID_IMsOutlookAddrBookServer;
{
public:
virtual HRESULT STDMETHODCALLTYPE foreachMailUser(
- /* [in] */ BSTR query) = 0;
+ /* [in] */ BSTR query,
+ /* [in] */ long callback) = 0;
virtual HRESULT STDMETHODCALLTYPE IMAPIProp_GetProps(
/* [in] */ BSTR entryId,
@@ -138,7 +139,8 @@ EXTERN_C const IID IID_IMsOutlookAddrBookServer;
HRESULT ( STDMETHODCALLTYPE *foreachMailUser )(
IMsOutlookAddrBookServer * This,
- /* [in] */ BSTR query);
+ /* [in] */ BSTR query,
+ /* [in] */ long callback);
HRESULT ( STDMETHODCALLTYPE *IMAPIProp_GetProps )(
IMsOutlookAddrBookServer * This,
@@ -198,8 +200,8 @@ EXTERN_C const IID IID_IMsOutlookAddrBookServer;
( (This)->lpVtbl -> Release(This) )
-#define IMsOutlookAddrBookServer_foreachMailUser(This,query) \
- ( (This)->lpVtbl -> foreachMailUser(This,query) )
+#define IMsOutlookAddrBookServer_foreachMailUser(This,query,callback) \
+ ( (This)->lpVtbl -> foreachMailUser(This,query,callback) )
#define IMsOutlookAddrBookServer_IMAPIProp_GetProps(This,entryId,nbPropIds,propIds,flags,props,propsLength,propsType) \
( (This)->lpVtbl -> IMAPIProp_GetProps(This,entryId,nbPropIds,propIds,flags,props,propsLength,propsType) )
diff --git a/src/native/addrbook/msoutlook/com/IMsOutlookAddrBookServer.idl b/src/native/addrbook/msoutlook/com/IMsOutlookAddrBookServer.idl
index 354c947..5fbaffa 100644
--- a/src/native/addrbook/msoutlook/com/IMsOutlookAddrBookServer.idl
+++ b/src/native/addrbook/msoutlook/com/IMsOutlookAddrBookServer.idl
@@ -10,7 +10,8 @@ import "Unknwn.idl", "oaidl.idl";
interface IMsOutlookAddrBookServer : IUnknown
{
HRESULT foreachMailUser(
- [in] BSTR query);
+ [in] BSTR query,
+ [in] long callback);
HRESULT IMAPIProp_GetProps(
[in] BSTR entryId,
diff --git a/src/native/addrbook/msoutlook/com/IMsOutlookAddrBookServer.tlb b/src/native/addrbook/msoutlook/com/IMsOutlookAddrBookServer.tlb
index a653c05..9492af3 100644
--- a/src/native/addrbook/msoutlook/com/IMsOutlookAddrBookServer.tlb
+++ b/src/native/addrbook/msoutlook/com/IMsOutlookAddrBookServer.tlb
Binary files differ
diff --git a/src/native/addrbook/msoutlook/com/MsOutlookAddrBookClient.cxx b/src/native/addrbook/msoutlook/com/MsOutlookAddrBookClient.cxx
index 8ae23fb..b21a636 100644
--- a/src/native/addrbook/msoutlook/com/MsOutlookAddrBookClient.cxx
+++ b/src/native/addrbook/msoutlook/com/MsOutlookAddrBookClient.cxx
@@ -100,17 +100,21 @@ STDMETHODIMP_(ULONG) MsOutlookAddrBookClient::Release()
* a search via the foreachMailUser function.
*
* @param id The contact identifier.
+ * @param callback the callback address
*
* @return S_OK.
*/
HRESULT STDMETHODCALLTYPE MsOutlookAddrBookClient::foreachMailUserCallback(
- BSTR id)
+ BSTR id, long callback)
{
char * charId = StringUtils::WideCharToMultiByte(id);
- MAPINotification_callCallbackMethod(charId, NULL);
+ boolean res = MAPINotification_callCallbackMethod(charId, callback);
free(charId);
- return S_OK;
+ if(res)
+ return S_OK;
+ else
+ return E_ABORT;
}
/**
diff --git a/src/native/addrbook/msoutlook/com/MsOutlookAddrBookClient.h b/src/native/addrbook/msoutlook/com/MsOutlookAddrBookClient.h
index f21b3c4..159e0f8 100644
--- a/src/native/addrbook/msoutlook/com/MsOutlookAddrBookClient.h
+++ b/src/native/addrbook/msoutlook/com/MsOutlookAddrBookClient.h
@@ -35,7 +35,8 @@ class MsOutlookAddrBookClient:
STDMETHODIMP_(ULONG) Release();
// IMsOutlookAddrBookClient
- HRESULT STDMETHODCALLTYPE foreachMailUserCallback(BSTR id);
+ HRESULT STDMETHODCALLTYPE foreachMailUserCallback(
+ BSTR id, long callback);
HRESULT STDMETHODCALLTYPE deleted(BSTR id);
HRESULT STDMETHODCALLTYPE inserted(BSTR id);
diff --git a/src/native/addrbook/msoutlook/com/MsOutlookAddrBookServer.cxx b/src/native/addrbook/msoutlook/com/MsOutlookAddrBookServer.cxx
index 1d3d362..f80b60b 100644
--- a/src/native/addrbook/msoutlook/com/MsOutlookAddrBookServer.cxx
+++ b/src/native/addrbook/msoutlook/com/MsOutlookAddrBookServer.cxx
@@ -101,54 +101,67 @@ STDMETHODIMP_(ULONG) MsOutlookAddrBookServer::Release()
* Starts a search for contact using MAPI.A
*
* @param query The search pattern (unused).
+ * @param callbackAddress The address of the callback.
*
* @return S_OK.
*/
-HRESULT STDMETHODCALLTYPE MsOutlookAddrBookServer::foreachMailUser(BSTR query)
+HRESULT STDMETHODCALLTYPE MsOutlookAddrBookServer::foreachMailUser(
+ BSTR query, long callbackAddress)
{
char * charQuery = StringUtils::WideCharToMultiByte(query);
- MsOutlookAddrBookContactQuery_foreachMailUser(
- charQuery,
- (void *) MsOutlookAddrBookServer::foreachMailUserCallback,
- NULL);
+ HRESULT hr = E_FAIL;
+
+ IMsOutlookAddrBookClient * msOutlookAddrBookClient = NULL;
+ if((hr = CoCreateInstance(
+ CLSID_MsOutlookAddrBookClient,
+ NULL,
+ CLSCTX_LOCAL_SERVER,
+ IID_IMsOutlookAddrBookClient,
+ (void**) &msOutlookAddrBookClient)) == S_OK)
+ {
+ hr = MsOutlookAddrBookContactQuery_foreachMailUser(
+ charQuery,
+ (void *) MsOutlookAddrBookServer::foreachMailUserCallback,
+ (void *) msOutlookAddrBookClient,
+ callbackAddress);
+
+ msOutlookAddrBookClient->Release();
+ }
free(charQuery);
- return S_OK;
+ return hr == S_OK;
}
/**
* Calls back the java side to list a contact.
*
* @param iUnknown The string representation of the entry id of the contact.
- * @param object Not used. Must be set to NULL.
+ * @param callbackClient the client object to call the callback and pass the
+ * result and the callbackAddress we have received.
+ * @param callbackAddress the address of the callback function.
*
* @return True everything works fine and that we must continue to list the
* other contacts. False otherwise.
*/
boolean MsOutlookAddrBookServer::foreachMailUserCallback(
LPSTR iUnknown,
- void * object)
+ void * callbackClient,
+ long callbackAddress)
{
HRESULT hr = E_FAIL;
- IMsOutlookAddrBookClient * msOutlookAddrBookClient = NULL;
- if((hr = CoCreateInstance(
- CLSID_MsOutlookAddrBookClient,
- NULL,
- CLSCTX_LOCAL_SERVER,
- IID_IMsOutlookAddrBookClient,
- (void**) &msOutlookAddrBookClient)) == S_OK)
+ if(callbackClient)
{
LPWSTR iUnknownW = StringUtils::MultiByteToWideChar(iUnknown);
BSTR res = SysAllocString(iUnknownW);
- hr = msOutlookAddrBookClient->foreachMailUserCallback(res);
+ hr = ((IMsOutlookAddrBookClient *)callbackClient)
+ ->foreachMailUserCallback(res, callbackAddress);
SysFreeString(res);
free(iUnknownW);
- msOutlookAddrBookClient->Release();
}
return (hr == S_OK);
diff --git a/src/native/addrbook/msoutlook/com/MsOutlookAddrBookServer.h b/src/native/addrbook/msoutlook/com/MsOutlookAddrBookServer.h
index a1ba304..190217a 100644
--- a/src/native/addrbook/msoutlook/com/MsOutlookAddrBookServer.h
+++ b/src/native/addrbook/msoutlook/com/MsOutlookAddrBookServer.h
@@ -35,7 +35,7 @@ class MsOutlookAddrBookServer:
STDMETHODIMP_(ULONG) Release();
// IMsOutlookAddrBookServer
- HRESULT STDMETHODCALLTYPE foreachMailUser(BSTR query);
+ HRESULT STDMETHODCALLTYPE foreachMailUser(BSTR query, long callback);
HRESULT STDMETHODCALLTYPE IMAPIProp_GetProps(
BSTR entryId,
@@ -74,7 +74,8 @@ class MsOutlookAddrBookServer:
static boolean foreachMailUserCallback(
LPSTR iUnknown,
- void * object);
+ void * callbackClient,
+ long callbackAddress);
};
#endif