IMSProvider.c File Reference

Provider operations. More...

#include "libmapi/libmapi.h"

Functions

enum MAPISTATUS GetNewLogonId (struct mapi_session *session, uint8_t *logon_id)
 
_PUBLIC_ enum MAPISTATUS Logoff (mapi_object_t *obj_store)
 
enum MAPISTATUS Logon (struct mapi_session *session, struct mapi_provider *provider, enum PROVIDER_ID provider_id)
 
_PUBLIC_ enum MAPISTATUS RegisterAsyncNotification (struct mapi_session *session, uint32_t *resultFlag)
 
_PUBLIC_ enum MAPISTATUS RegisterNotification (struct mapi_session *session)
 
_PUBLIC_ enum MAPISTATUS RfrGetFQDNFromLegacyDN (struct mapi_context *mapi_ctx, struct mapi_session *session, const char **serverFQDN)
 
_PUBLIC_ enum MAPISTATUS RfrGetNewDSA (struct mapi_context *mapi_ctx, struct mapi_session *session, const char *server, const char *userDN, char **dsa)
 

Detailed Description

Provider operations.

Function Documentation

enum MAPISTATUS GetNewLogonId ( struct mapi_session session,
uint8_t *  logon_id 
)

Retrieve a free logon identifier within the session

Parameters
sessionpointer to the MAPI session context
logon_idpointer to the logon identifier the function returns
Returns
MAPI_E_SUCCESS on success, otherwise MAPI eorr

References mapi_session::logon_ids, and OPENCHANGE_RETVAL_IF.

Referenced by OpenPublicFolder(), and OpenUserMailbox().

_PUBLIC_ enum MAPISTATUS Logoff ( mapi_object_t obj_store)

Logoff an Exchange store

This function uninitializes the MAPI session associated to the object.

Parameters
obj_storepointer to the store object
Returns
MAPI_E_SUCCESS on success, otherwise MAPI_E_NOT_FOUND
Examples:
fetchappointment.c, and fetchmail.c.

References mapi_session::mapi_ctx, mapi_object_get_session(), mapi_object_release(), MAPIFreeBuffer(), mapi_session::next, OPENCHANGE_RETVAL_IF, and mapi_context::session.

_PUBLIC_ enum MAPISTATUS RegisterAsyncNotification ( struct mapi_session session,
uint32_t *  resultFlag 
)

Create an asynchronous notification

This function initializes the notification subsystem and configures the server to send notifications. Note that this call will block.

Parameters
sessionthe session context to register for notifications on.
resultFlagthe result of the operation (true if there was anything returned)
Returns
MAPI_E_SUCCESS on success, otherwise MAPI error.
Note
Developers may also call GetLastError() to retrieve the last MAPI error code. Possible MAPI error codes are:
  • MAPI_E_NOT_INITIALIZED: MAPI subsystem has not been initialized
  • MAPI_E_CALL_FAILED: A network problem was encountered during the transaction
See Also
RegisterNotification

References mapi_provider::ctx, mapi_session::emsmdb, emsmdb_async_waitex(), emsmdb_context::mem_ctx, notifications::next, mapi_notify_ctx::notifications, mapi_session::notify_ctx, OPENCHANGE_RETVAL_IF, and notifications::prev.

_PUBLIC_ enum MAPISTATUS RegisterNotification ( struct mapi_session session)

Initialize the notification subsystem

This function initializes the notification subsystem, binds a local UDP port to receive Exchange (server side) notifications and configures the server to send notifications on this port.

Parameters
sessionthe session context to register for notifications on.
Returns
MAPI_E_SUCCESS on success, otherwise MAPI error.
Note
Developers may also call GetLastError() to retrieve the last MAPI error code. Possible MAPI error codes are:
  • MAPI_E_NOT_INITIALIZED: MAPI subsystem has not been initialized
  • MAPI_E_CALL_FAILED: A network problem was encountered during the transaction
See Also
RegisterAsyncNotification, Subscribe, Unsubscribe, MonitorNotification, GetLastError

References mapi_provider::ctx, mapi_session::emsmdb, emsmdb_bind_notification(), emsmdb_register_notification(), mapi_session::mapi_ctx, emsmdb_context::mem_ctx, mapi_session::notify_ctx, and OPENCHANGE_RETVAL_IF.

_PUBLIC_ enum MAPISTATUS RfrGetFQDNFromLegacyDN ( struct mapi_context mapi_ctx,
struct mapi_session session,
const char **  serverFQDN 
)

Returns the FQDN of the NSPI server corresponding to a DN

Parameters
mapi_ctxpointer to the MAPI context
sessionpointer to the MAPI session context
serverFQDNpointer to the server FQDN string (return value)
Returns
MAPI_E_SUCCESS on success, otherwise a MAPI error and serverFQDN content set to NULL.

References mapi_profile::credentials, mapi_profile::homemdb, mapi_context::lp_ctx, OPENCHANGE_RETVAL_IF, mapi_session::profile, RfrGetFQDNFromLegacyDN(), and mapi_profile::server.

Referenced by RfrGetFQDNFromLegacyDN().

_PUBLIC_ enum MAPISTATUS RfrGetNewDSA ( struct mapi_context mapi_ctx,
struct mapi_session session,
const char *  server,
const char *  userDN,
char **  dsa 
)

Returns the name of an NSPI server

Parameters
mapi_ctxpointer to the MAPI context
sessionpointer to the MAPI session context
serverthe Exchange server address (IP or FQDN)
userDNoptional user mailbox DN
dsapointer to a new dsa (return value), containing a valid allocated string on success, otherwise NULL
Returns
MAPI_E_SUCCESS on success, otherwise a MAPI error and serverFQDN content set to NULL.
Note
The string returned can either be RfrGetNewDSA one on success, or a copy of the server's argument one on failure. If no server string is provided, NULL is returned.

It is up to the developer to free the returned string when not needed anymore.

References mapi_profile::credentials, mapi_context::lp_ctx, mapi_session::profile, RfrGetNewDSA(), and mapi_context::session.

Referenced by Logon(), and RfrGetNewDSA().


Creative Commons License
Creative Commons Attribution icon Creative Commons Share Alike icon
This content is licensed under the Creative Commons
Attribution ShareAlike License v. 3.0:
http://creativecommons.org/licenses/by-sa/3.0/