3
<title>MAPIClientLibraries 2.0 API Documentation</title>
4
<link href="doxygen.css" rel="stylesheet" type="text/css"/>
5
<link href="apidocs.css" rel="stylesheet" type="text/css"/>
9
<div class="header"></div>
10
<div id="middle_side">
11
<div id="right_side_home">
12
<!-- Generated by Doxygen 1.8.1.2 -->
13
<div id="navrow1" class="tabs">
15
<li><a href="index.html"><span>Main Page</span></a></li>
16
<li><a href="pages.html"><span>Related Pages</span></a></li>
17
<li><a href="annotated.html"><span>Data Structures</span></a></li>
18
<li class="current"><a href="files.html"><span>Files</span></a></li>
19
<li><a href="examples.html"><span>Examples</span></a></li>
22
<div id="navrow2" class="tabs2">
24
<li><a href="files.html"><span>File List</span></a></li>
25
<li><a href="globals.html"><span>Globals</span></a></li>
28
<div id="nav-path" class="navpath">
30
<li class="navelem"><a class="el" href="dir_f632a44caec7a90b6d38c87e3df284e5.html">libmapi</a></li> </ul>
35
<a href="#func-members">Functions</a> </div>
36
<div class="headertitle">
37
<div class="title">IMAPISupport.c File Reference</div> </div>
39
<div class="contents">
41
<p>MAPI notifications functions.
42
<a href="#details">More...</a></p>
43
<div class="textblock"><code>#include "libmapi/libmapi.h"</code><br/>
44
<code>#include "libmapi/libmapi_private.h"</code><br/>
45
</div><table class="memberdecls">
46
<tr class="heading"><td colspan="2"><h2><a name="func-members"></a>
47
Functions</h2></td></tr>
48
<tr class="memitem:adc7b00c3f0c5f688ff6eb96228e98191"><td class="memItemLeft" align="right" valign="top">_PUBLIC_ enum MAPISTATUS </td><td class="memItemRight" valign="bottom"><a class="el" href="IMAPISupport_8c.html#adc7b00c3f0c5f688ff6eb96228e98191">DispatchNotifications</a> (struct mapi_session *session)</td></tr>
49
<tr class="memitem:aa673e23d955303227b950c4f9ec6a2c0"><td class="memItemLeft" align="right" valign="top">_PUBLIC_ enum MAPISTATUS </td><td class="memItemRight" valign="bottom"><a class="el" href="IMAPISupport_8c.html#aa673e23d955303227b950c4f9ec6a2c0">MonitorNotification</a> (struct mapi_session *session, void *private_data, struct mapi_notify_continue_callback_data *cb_data)</td></tr>
50
<tr class="memitem:a30f5d03776a9e432af19d6803ee5784e"><td class="memItemLeft" align="right" valign="top">_PUBLIC_ enum MAPISTATUS </td><td class="memItemRight" valign="bottom"><a class="el" href="IMAPISupport_8c.html#a30f5d03776a9e432af19d6803ee5784e">Subscribe</a> (mapi_object_t *obj, uint32_t *connection, uint16_t NotificationFlags, bool WholeStore, mapi_notify_callback_t notify_callback, void *private_data)</td></tr>
51
<tr class="memitem:a35355b1cdd5ef508f1f57a41842f8bd9"><td class="memItemLeft" align="right" valign="top">_PUBLIC_ enum MAPISTATUS </td><td class="memItemRight" valign="bottom"><a class="el" href="IMAPISupport_8c.html#a35355b1cdd5ef508f1f57a41842f8bd9">Unsubscribe</a> (struct mapi_session *session, uint32_t ulConnection)</td></tr>
53
<a name="details" id="details"></a><h2>Detailed Description</h2>
54
<div class="textblock"><p>MAPI notifications functions. </p>
55
</div><h2>Function Documentation</h2>
56
<a class="anchor" id="adc7b00c3f0c5f688ff6eb96228e98191"></a>
58
<div class="memproto">
59
<table class="memname">
61
<td class="memname">_PUBLIC_ enum MAPISTATUS DispatchNotifications </td>
63
<td class="paramtype">struct mapi_session * </td>
64
<td class="paramname"><em>session</em></td><td>)</td>
68
</div><div class="memdoc">
69
<p>Force notification of pending events</p>
70
<p>This function force the server to send any pending notificaion and process them. These MAPI notifications are next compared to the registered ones and the callback specified in <a class="el" href="IMAPISupport_8c.html#a30f5d03776a9e432af19d6803ee5784e">Subscribe()</a> called if it matches.</p>
71
<dl class="section return"><dt>Returns</dt><dd>MAPI_E_SUCCESS on success, otherwise MAPI error.</dd></dl>
72
<dl class="section note"><dt>Note</dt><dd>Developers may also call <a class="el" href="IUnknown_8c.html#a8237c7fc76377cb07f3f55920d6f20de">GetLastError()</a> to retrieve the last MAPI error code. Possible MAPI error codes are:<ul>
73
<li>MAPI_E_NOT_INITIALIZED: MAPI subsystem has not been initialized</li>
74
<li>MAPI_E_CALL_FAILED: A network problem was encountered during the transaction</li>
77
<dl class="section see"><dt>See Also</dt><dd><a class="el" href="IMSProvider_8c.html#afc3af75a0198454829ede0ea20e7952e">RegisterNotification</a>, <a class="el" href="IMAPISupport_8c.html#a30f5d03776a9e432af19d6803ee5784e">Subscribe</a>, <a class="el" href="IMAPISupport_8c.html#a35355b1cdd5ef508f1f57a41842f8bd9">Unsubscribe</a>, <a class="el" href="IUnknown_8c.html#a8237c7fc76377cb07f3f55920d6f20de">GetLastError</a> </dd></dl>
79
<p>References <a class="el" href="emsmdb_8c.html#a7f4dfd76879dea2bf003f52d8bce38d3">emsmdb_transaction_null()</a>.</p>
83
<a class="anchor" id="aa673e23d955303227b950c4f9ec6a2c0"></a>
85
<div class="memproto">
86
<table class="memname">
88
<td class="memname">_PUBLIC_ enum MAPISTATUS MonitorNotification </td>
90
<td class="paramtype">struct mapi_session * </td>
91
<td class="paramname"><em>session</em>, </td>
94
<td class="paramkey"></td>
96
<td class="paramtype">void * </td>
97
<td class="paramname"><em>private_data</em>, </td>
100
<td class="paramkey"></td>
102
<td class="paramtype">struct mapi_notify_continue_callback_data * </td>
103
<td class="paramname"><em>cb_data</em> </td>
111
</div><div class="memdoc">
112
<p>Wait for notifications and process them</p>
113
<p>This function waits for notifications on the UDP port and generates the traffic needed to receive MAPI notifications. These MAPI notifications are next compared to the registered ones and the callback specified in <a class="el" href="IMAPISupport_8c.html#a30f5d03776a9e432af19d6803ee5784e">Subscribe()</a> called if it matches.</p>
114
<p>The function takes a callback in cb_data to check if it should continue to process notifications. Timeval in cb_data can be used to control the behavior of select.</p>
115
<dl class="section return"><dt>Returns</dt><dd>MAPI_E_SUCCESS on success, otherwise MAPI error.</dd></dl>
116
<dl class="section note"><dt>Note</dt><dd>Developers may also call <a class="el" href="IUnknown_8c.html#a8237c7fc76377cb07f3f55920d6f20de">GetLastError()</a> to retrieve the last MAPI error code. Possible MAPI error codes are:<ul>
117
<li>MAPI_E_NOT_INITIALIZED: MAPI subsystem has not been initialized</li>
118
<li>MAPI_E_CALL_FAILED: A network problem was encountered during the transaction</li>
121
<dl class="section see"><dt>See Also</dt><dd><a class="el" href="IMSProvider_8c.html#afc3af75a0198454829ede0ea20e7952e">RegisterNotification</a>, <a class="el" href="IMAPISupport_8c.html#a30f5d03776a9e432af19d6803ee5784e">Subscribe</a>, <a class="el" href="IMAPISupport_8c.html#a35355b1cdd5ef508f1f57a41842f8bd9">Unsubscribe</a>, <a class="el" href="IUnknown_8c.html#a8237c7fc76377cb07f3f55920d6f20de">GetLastError</a></dd></dl>
122
<dl class="section note"><dt>Note</dt><dd>This code is experimental. The current implementation is non-threaded, only supports fnevNewmail and fnevCreatedObject notifications and will block your process until you send a signal. </dd></dl>
124
<p>References <a class="el" href="emsmdb_8c.html#a7f4dfd76879dea2bf003f52d8bce38d3">emsmdb_transaction_null()</a>.</p>
128
<a class="anchor" id="a30f5d03776a9e432af19d6803ee5784e"></a>
129
<div class="memitem">
130
<div class="memproto">
131
<table class="memname">
133
<td class="memname">_PUBLIC_ enum MAPISTATUS Subscribe </td>
135
<td class="paramtype">mapi_object_t * </td>
136
<td class="paramname"><em>obj</em>, </td>
139
<td class="paramkey"></td>
141
<td class="paramtype">uint32_t * </td>
142
<td class="paramname"><em>connection</em>, </td>
145
<td class="paramkey"></td>
147
<td class="paramtype">uint16_t </td>
148
<td class="paramname"><em>NotificationFlags</em>, </td>
151
<td class="paramkey"></td>
153
<td class="paramtype">bool </td>
154
<td class="paramname"><em>WholeStore</em>, </td>
157
<td class="paramkey"></td>
159
<td class="paramtype">mapi_notify_callback_t </td>
160
<td class="paramname"><em>notify_callback</em>, </td>
163
<td class="paramkey"></td>
165
<td class="paramtype">void * </td>
166
<td class="paramname"><em>private_data</em> </td>
174
</div><div class="memdoc">
175
<p>Register an object to receive notifications</p>
176
<p>This function registers notifications on the Exchange server for an object. The function holds the notifications intended to be monitored in as a bitmask.</p>
177
<dl class="params"><dt>Parameters</dt><dd>
178
<table class="params">
179
<tr><td class="paramname">obj</td><td>the object to get notifications for </td></tr>
180
<tr><td class="paramname">connection</td><td>connection identifier for callback function </td></tr>
181
<tr><td class="paramname">NotificationFlags</td><td>mask for events to provide notifications for (see below) </td></tr>
182
<tr><td class="paramname">WholeStore</td><td>whether the scope for this notification is whole database </td></tr>
183
<tr><td class="paramname">notify_callback</td><td>notification callback function. </td></tr>
184
<tr><td class="paramname">private_data</td><td>the data to be passed at the callback function when invoked</td></tr>
188
<p>The Notification Flags can take the following values:</p>
190
<li>fnevCriticalError</li>
192
<li>fnevObjectCreated</li>
193
<li>fnevObjectDeleted</li>
194
<li>fnevObjectModified</li>
195
<li>fnevObjectMoved</li>
196
<li>fnevObjectCopied</li>
197
<li>fnevSearchComplete</li>
198
<li>fnevTableModified</li>
199
<li>fnevStatusObjectModified</li>
200
<li>fnevReservedForMapi</li>
201
<li>fnevExtended</li>
203
<dl class="section return"><dt>Returns</dt><dd>MAPI_E_SUCCESS on success, otherwise MAPI error.</dd></dl>
204
<dl class="section note"><dt>Note</dt><dd>Developers may also call <a class="el" href="IUnknown_8c.html#a8237c7fc76377cb07f3f55920d6f20de">GetLastError()</a> to retrieve the last MAPI error code. Possible MAPI error codes are:<ul>
205
<li>MAPI_E_NOT_INITIALIZED: MAPI subsystem has not been initialized</li>
206
<li>MAPI_E_CALL_FAILED: A network problem was encountered during the transaction</li>
209
<dl class="section see"><dt>See Also</dt><dd><a class="el" href="IMSProvider_8c.html#afc3af75a0198454829ede0ea20e7952e">RegisterNotification</a>, <a class="el" href="IMAPISupport_8c.html#a35355b1cdd5ef508f1f57a41842f8bd9">Unsubscribe</a>, <a class="el" href="IMAPISupport_8c.html#aa673e23d955303227b950c4f9ec6a2c0">MonitorNotification</a>, <a class="el" href="IUnknown_8c.html#a8237c7fc76377cb07f3f55920d6f20de">GetLastError</a> </dd></dl>
211
<p>References <a class="el" href="mapi__object_8c.html#aa94645f34e6c4bf1c0631dffb0742676">mapi_object_get_handle()</a>, <a class="el" href="mapi__object_8c.html#ad4477e1e7c6dd8314638a9886b570209">mapi_object_get_id()</a>, <a class="el" href="mapi__object_8c.html#a96bfa7545b6e9ad350c42ba0abd07da8">mapi_object_get_logon_id()</a>, <a class="el" href="mapi__object_8c.html#ae5ef3137838fbc0c3eaedd7da99f8adc">mapi_object_get_session()</a>, <a class="el" href="mapi__object_8c.html#af49c3130b8cb47f741ff652fc53c1364">mapi_object_init()</a>, <a class="el" href="mapi__object_8c.html#a6cad283dc5a1228734e816adb30aa53c">mapi_object_set_handle()</a>, and <a class="el" href="mapi__object_8c.html#a373e9bd46155ea22e816fa66944f22a6">mapi_object_set_session()</a>.</p>
215
<a class="anchor" id="a35355b1cdd5ef508f1f57a41842f8bd9"></a>
216
<div class="memitem">
217
<div class="memproto">
218
<table class="memname">
220
<td class="memname">_PUBLIC_ enum MAPISTATUS Unsubscribe </td>
222
<td class="paramtype">struct mapi_session * </td>
223
<td class="paramname"><em>session</em>, </td>
226
<td class="paramkey"></td>
228
<td class="paramtype">uint32_t </td>
229
<td class="paramname"><em>ulConnection</em> </td>
237
</div><div class="memdoc">
238
<p>Unregister notifications on a given object.</p>
239
<p>Cancel any notification registrations associated with the notify object. This function unregisters notifications on the Exchange server for the object specified with its connection number ulConnection. The function will releases the notification on the Exchange server and remove the entry from the internal notifications list.</p>
240
<p>The function takes a callback to execute when such notification occurs and returns the ulConnection identifier we can use in further management.</p>
241
<dl class="section return"><dt>Returns</dt><dd>MAPI_E_SUCCESS on success, otherwise MAPI error.</dd></dl>
242
<dl class="section note"><dt>Note</dt><dd>Developers may also call <a class="el" href="IUnknown_8c.html#a8237c7fc76377cb07f3f55920d6f20de">GetLastError()</a> to retrieve the last MAPI error code. Possible MAPI error codes are:<ul>
243
<li>MAPI_E_NOT_INITIALIZED: MAPI subsystem has not been initialized</li>
244
<li>MAPI_E_CALL_FAILED: A network problem was encountered during the transaction</li>
247
<dl class="section see"><dt>See Also</dt><dd><a class="el" href="IMSProvider_8c.html#afc3af75a0198454829ede0ea20e7952e">RegisterNotification</a>, <a class="el" href="IMAPISupport_8c.html#a30f5d03776a9e432af19d6803ee5784e">Subscribe</a>, <a class="el" href="IMAPISupport_8c.html#aa673e23d955303227b950c4f9ec6a2c0">MonitorNotification</a>, <a class="el" href="IUnknown_8c.html#a8237c7fc76377cb07f3f55920d6f20de">GetLastError</a> </dd></dl>
249
<p>References <a class="el" href="IUnknown_8c.html#ab3f224d83f10cbbcbeeeff3f4f73f230">Release()</a>.</p>
253
</div><!-- contents -->
256
<table style="clear:both; margin: 0.5em auto; width:80%; text-align: center; background-color:#f8f8f8; border:2px solid #e0e0e0; padding:5px;">
259
<img alt="Creative Commons License" src="CC_SomeRightsReserved.png" width="90" height="30" border="0" /><br />
260
<img alt="Creative Commons Attribution icon" src="24px-Cc-by_white.svg.png" width="24" height="24" border="0" />
261
<img alt="Creative Commons Share Alike icon" src="24px-Cc-sa_white.svg.png" width="24" height="24" border="0" />
263
<td> <i><strong class="selflink">This content</strong> is licensed under the Creative Commons<br />
264
Attribution ShareAlike License v. 3.0:<br />
265
<a href="http://creativecommons.org/licenses/by-sa/3.0/" class="external free" title="http://creativecommons.org/licenses/by-sa/3.0/" rel="nofollow">http://creativecommons.org/licenses/by-sa/3.0/</a></i>