mapi_object.c File Reference

mapi_object_t support functions More...

#include "libmapi/libmapi.h"
#include "libmapi/libmapi_private.h"

Macros

#define INVALID_HANDLE_VALUE   0xffffffff
 keep intern to this file More...
 

Functions

_PUBLIC_ enum MAPISTATUS mapi_object_bookmark_debug (mapi_object_t *obj_table)
 
enum MAPISTATUS mapi_object_bookmark_find (mapi_object_t *obj_table, uint32_t bkPosition, struct SBinary_short *bin)
 
_PUBLIC_ enum MAPISTATUS mapi_object_bookmark_get_count (mapi_object_t *obj_table, uint32_t *count)
 
_PUBLIC_ enum MAPISTATUS mapi_object_copy (mapi_object_t *dst, mapi_object_t *src)
 
_PUBLIC_ void mapi_object_debug (mapi_object_t *obj)
 
mapi_handle_t mapi_object_get_handle (mapi_object_t *obj)
 
_PUBLIC_ mapi_id_t mapi_object_get_id (mapi_object_t *obj)
 
_PUBLIC_ enum MAPISTATUS mapi_object_get_logon_id (mapi_object_t *obj, uint8_t *logon_id)
 
_PUBLIC_ struct mapi_sessionmapi_object_get_session (mapi_object_t *obj)
 
_PUBLIC_ enum MAPISTATUS mapi_object_init (mapi_object_t *obj)
 
int mapi_object_is_invalid (mapi_object_t *obj)
 
_PUBLIC_ void mapi_object_release (mapi_object_t *obj)
 
void mapi_object_set_handle (mapi_object_t *obj, mapi_handle_t handle)
 
void mapi_object_set_id (mapi_object_t *obj, mapi_id_t id)
 
_PUBLIC_ void mapi_object_set_logon_id (mapi_object_t *obj, uint8_t logon_id)
 
_PUBLIC_ void mapi_object_set_logon_store (mapi_object_t *obj)
 
_PUBLIC_ void mapi_object_set_session (mapi_object_t *obj, struct mapi_session *session)
 
void mapi_object_table_init (TALLOC_CTX *mem_ctx, mapi_object_t *obj_table)
 

Detailed Description

mapi_object_t support functions

Macro Definition Documentation

#define INVALID_HANDLE_VALUE   0xffffffff

keep intern to this file

Referenced by mapi_object_is_invalid(), and mapi_object_release().

Function Documentation

_PUBLIC_ enum MAPISTATUS mapi_object_bookmark_debug ( mapi_object_t obj_table)

Dump bookmarks associated to a MAPI object table

Parameters
obj_tablepointer on the MAPI object table
Returns
MAPI_E_SUCCESS on success, otherwise MAPI error.

References mapi_obj_bookmark::bin, mapi_obj_table::bookmark, mapi_obj_bookmark::index, mapi_obj_bookmark::next, OPENCHANGE_RETVAL_IF, and mapi_object::private_data.

enum MAPISTATUS mapi_object_bookmark_find ( mapi_object_t obj_table,
uint32_t  bkPosition,
struct SBinary_short *  bin 
)

Fetch a bookmark within a MAPI object table

Parameters
obj_tablepointer on the MAPI object table
bkPositionthe bookmark position to find
binpointer on the Sbinary_short the function fills
Returns
MAPI_E_SUCCESS on success, otherwise MAPI error.

References mapi_obj_bookmark::bin, mapi_obj_table::bk_last, mapi_obj_table::bookmark, mapi_obj_bookmark::index, mapi_obj_bookmark::next, OPENCHANGE_RETVAL_IF, and mapi_object::private_data.

Referenced by FindRow(), and SeekRowBookmark().

_PUBLIC_ enum MAPISTATUS mapi_object_bookmark_get_count ( mapi_object_t obj_table,
uint32_t *  count 
)

Retrieve the number of bookmarks stored in a MAPI object table

Parameters
obj_tablepointer to the MAPI object table
countpointer to the number of bookmarks to return
Returns
MAPI_E_SUCCESS on success, otherwise MAPI error.

References mapi_obj_table::bk_last, OPENCHANGE_RETVAL_IF, and mapi_object::private_data.

_PUBLIC_ enum MAPISTATUS mapi_object_copy ( mapi_object_t dst,
mapi_object_t src 
)

Copy MAPI object

This function copies mapi_object data from source to destination.

Parameters
dstpointer on the destination MAPI object
srcpointer on the source MAPI object
Returns
MAPI_E_SUCCESS on success, otherwise MAPI_E_NOT_INITIALIZED

References mapi_object::handle, mapi_object::id, mapi_object::logon_id, OPENCHANGE_RETVAL_IF, mapi_object::private_data, and mapi_object::session.

_PUBLIC_ void mapi_object_debug ( mapi_object_t obj)

Dump a MAPI object (for debugging)

Parameters
objpointer on the MAPI object to dump out

References mapi_object::handle, and mapi_object::id.

mapi_handle_t mapi_object_get_handle ( mapi_object_t obj)

Retrieve the handle associated to a MAPI object

Parameters
objpointer on the MAPI object to retrieve the handle from
Returns
a valid MAPI object handle on success, otherwise 0xFFFFFFFF.

References mapi_object::handle.

Referenced by Abort(), AbortSubmit(), AddressTypes(), CloneStream(), CollapseRow(), CommitStream(), CopyFolder(), CopyProps(), CopyTo(), CopyToStream(), CreateAttach(), CreateBookmark(), CreateFolder(), CreateMessage(), DeleteAttach(), DeleteFolder(), DeleteMessage(), DeletePropertiesNoReplicate(), DeleteProps(), EmptyFolder(), ExpandRow(), FindRow(), FreeBookmark(), FXCopyFolder(), FXCopyMessages(), FXCopyProperties(), FXCopyTo(), FXDestConfigure(), FXGetBuffer(), FXPutBuffer(), GetAttachmentTable(), GetCollapseState(), GetContentsTable(), GetHierarchyTable(), GetIdFromLongTermId(), GetIDsFromNames(), GetLocalReplicaIds(), GetLongTermIdFromId(), GetMessageStatus(), GetNamesFromIDs(), GetOwningServers(), GetPermissionsTable(), GetPropList(), GetProps(), GetPropsAll(), GetReceiveFolder(), GetReceiveFolderTable(), GetRulesTable(), GetSearchCriteria(), GetStatus(), GetStoreState(), GetStreamSize(), GetTransportFolder(), GetValidAttach(), HardDeleteMessage(), HardDeleteMessagesAndSubfolders(), ICSSyncConfigure(), ICSSyncGetTransferState(), ICSSyncOpenCollector(), ICSSyncUploadStateBegin(), ICSSyncUploadStateContinue(), ICSSyncUploadStateEnd(), LockRegionStream(), mapi_object_is_invalid(), ModifyPermissions(), ModifyRecipients(), MoveCopyMessages(), MoveFolder(), OpenAttach(), OpenEmbeddedMessage(), OpenFolder(), OpenMessage(), OpenPublicFolderByName(), OpenStream(), OptionsData(), ProcessNotification(), PublicFolderIsGhosted(), QueryColumns(), QueryNamedProperties(), QueryPosition(), QueryRows(), ReadRecipients(), ReadStream(), Release(), ReloadCachedInformation(), RemoveAllRecipients(), Reset(), Restrict(), SaveChangesAttachment(), SaveChangesMessage(), SeekRow(), SeekRowApprox(), SeekRowBookmark(), SeekStream(), SetCollapseState(), SetColumns(), SetLocalReplicaMidsetDeleted(), SetMessageReadFlag(), SetMessageStatus(), SetPropertiesNoReplicate(), SetProps(), SetReadFlags(), SetReceiveFolder(), SetSearchCriteria(), SetSpooler(), SetStreamSize(), SetSyncNotificationGuid(), SortTable(), SpoolerLockMessage(), SubmitMessage(), Subscribe(), SyncOpenAdvisor(), TellVersion(), TransportNewMail(), TransportSend(), UnlockRegionStream(), WriteAndCommitStream(), and WriteStream().

_PUBLIC_ mapi_id_t mapi_object_get_id ( mapi_object_t obj)

Retrieve an object ID for a given MAPI object

Parameters
objpointer on the MAPI object to get the ID for
Returns
the object ID, or 0xFFFFFFFFFFFFFFFF if the object does not exist

References mapi_object::id.

Referenced by AbortSubmit(), CopyFolder(), CreateMessage(), GetOwningServers(), mapi_id_array_add_obj(), mapi_id_array_del_obj(), MoveFolder(), PublicFolderIsGhosted(), SetReceiveFolder(), SpoolerLockMessage(), Subscribe(), and TransportNewMail().

_PUBLIC_ enum MAPISTATUS mapi_object_get_logon_id ( mapi_object_t obj,
uint8_t *  logon_id 
)

Retrieve the logon id for a given MAPI object

Parameters
objpointer to the object to retrieve the logon id from
logon_idpointer to a variable to store the logon id
Returns
MAPI_E_SUCCESS on success, otherwise MAPI error.

References mapi_object::logon_id.

Referenced by Abort(), AbortSubmit(), AddressTypes(), CloneStream(), CollapseRow(), CommitStream(), CopyFolder(), CopyProps(), CopyTo(), CopyToStream(), CreateAttach(), CreateBookmark(), CreateFolder(), CreateMessage(), DeleteAttach(), DeleteFolder(), DeleteMessage(), DeletePropertiesNoReplicate(), DeleteProps(), EmptyFolder(), ExpandRow(), FindRow(), FreeBookmark(), FXCopyFolder(), FXCopyMessages(), FXCopyProperties(), FXCopyTo(), FXDestConfigure(), FXGetBuffer(), FXPutBuffer(), GetAttachmentTable(), GetCollapseState(), GetContentsTable(), GetHierarchyTable(), GetIdFromLongTermId(), GetIDsFromNames(), GetLocalReplicaIds(), GetLongTermIdFromId(), GetMessageStatus(), GetNamesFromIDs(), GetOwningServers(), GetPermissionsTable(), GetPropList(), GetProps(), GetPropsAll(), GetReceiveFolder(), GetReceiveFolderTable(), GetRulesTable(), GetSearchCriteria(), GetStatus(), GetStoreState(), GetStreamSize(), GetTransportFolder(), GetValidAttach(), HardDeleteMessage(), HardDeleteMessagesAndSubfolders(), ICSSyncConfigure(), ICSSyncGetTransferState(), ICSSyncOpenCollector(), ICSSyncUploadStateBegin(), ICSSyncUploadStateContinue(), ICSSyncUploadStateEnd(), LockRegionStream(), ModifyPermissions(), ModifyRecipients(), MoveCopyMessages(), MoveFolder(), OpenAttach(), OpenEmbeddedMessage(), OpenFolder(), OpenMessage(), OpenPublicFolderByName(), OpenStream(), OptionsData(), PublicFolderIsGhosted(), QueryColumns(), QueryNamedProperties(), QueryPosition(), QueryRows(), ReadRecipients(), ReadStream(), Release(), ReloadCachedInformation(), RemoveAllRecipients(), Reset(), Restrict(), SaveChangesAttachment(), SaveChangesMessage(), SeekRow(), SeekRowApprox(), SeekRowBookmark(), SeekStream(), SetCollapseState(), SetColumns(), SetLocalReplicaMidsetDeleted(), SetMessageReadFlag(), SetMessageStatus(), SetPropertiesNoReplicate(), SetProps(), SetReadFlags(), SetReceiveFolder(), SetSearchCriteria(), SetSpooler(), SetStreamSize(), SetSyncNotificationGuid(), SortTable(), SpoolerLockMessage(), SubmitMessage(), Subscribe(), SyncOpenAdvisor(), TellVersion(), TransportNewMail(), TransportSend(), UnlockRegionStream(), WriteAndCommitStream(), and WriteStream().

_PUBLIC_ struct mapi_session* mapi_object_get_session ( mapi_object_t obj)

Retrieve the session associated to the MAPI object

Parameters
objthe object to get the session for
Returns
pointer on a MAPI session on success, otherwise NULL

References mapi_object::session.

Referenced by Abort(), AbortSubmit(), AddressTypes(), AddUserPermission(), CloneStream(), CollapseRow(), CommitStream(), CopyFolder(), CopyProps(), CopyTo(), CopyToStream(), CreateAttach(), CreateBookmark(), CreateFolder(), CreateMessage(), DeleteAttach(), DeleteFolder(), DeleteMessage(), DeletePropertiesNoReplicate(), DeleteProps(), EmptyFolder(), ExpandRow(), FindRow(), FreeBookmark(), FXCopyFolder(), FXCopyMessages(), FXCopyProperties(), FXCopyTo(), FXDestConfigure(), FXGetBuffer(), FXPutBuffer(), GetAttachmentTable(), GetBestBody(), GetCollapseState(), GetContentsTable(), GetFolderItemsCount(), GetHierarchyTable(), GetIdFromLongTermId(), GetIDsFromNames(), GetLocalReplicaIds(), GetLongTermIdFromId(), GetMessageStatus(), GetNamesFromIDs(), GetOwningServers(), GetPermissionsTable(), GetPropList(), GetProps(), GetPropsAll(), GetReceiveFolder(), GetReceiveFolderTable(), GetRulesTable(), GetSearchCriteria(), GetStatus(), GetStoreState(), GetStreamSize(), GetTransportFolder(), GetUserFreeBusyData(), GetValidAttach(), HardDeleteMessage(), HardDeleteMessagesAndSubfolders(), ICSSyncConfigure(), ICSSyncGetTransferState(), ICSSyncOpenCollector(), ICSSyncUploadStateBegin(), ICSSyncUploadStateContinue(), ICSSyncUploadStateEnd(), IsFreeBusyConflict(), LockRegionStream(), Logoff(), mapi_SPropValue_array_named(), ModifyPermissions(), ModifyRecipients(), ModifyUserPermission(), MoveCopyMessages(), MoveFolder(), OpenAttach(), OpenEmbeddedMessage(), OpenFolder(), OpenMessage(), OpenPublicFolderByName(), OpenStream(), OptionsData(), PublicFolderIsGhosted(), QueryColumns(), QueryNamedProperties(), QueryPosition(), QueryRows(), ReadRecipients(), ReadStream(), Release(), ReloadCachedInformation(), RemoveAllRecipients(), RemoveUserPermission(), Reset(), Restrict(), SaveChangesAttachment(), SaveChangesMessage(), SeekRow(), SeekRowApprox(), SeekRowBookmark(), SeekStream(), SetCollapseState(), SetColumns(), SetLocalReplicaMidsetDeleted(), SetMessageReadFlag(), SetMessageStatus(), SetPropertiesNoReplicate(), SetProps(), SetReadFlags(), SetReceiveFolder(), SetSearchCriteria(), SetSpooler(), SetStreamSize(), SetSyncNotificationGuid(), SortTable(), SpoolerLockMessage(), SubmitMessage(), Subscribe(), SyncOpenAdvisor(), TellVersion(), TransportNewMail(), TransportSend(), UnlockRegionStream(), WrapCompressedRTFStream(), WriteAndCommitStream(), and WriteStream().

_PUBLIC_ enum MAPISTATUS mapi_object_init ( mapi_object_t obj)

Initialize MAPI object

This function is required to be called before any manipulation of this MAPI object.

Parameters
objthe object to initialize
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.
See Also
mapi_object_release

Referenced by CreateFolder(), GetUserFreeBusyData(), ModifyUserPermission(), RemoveUserPermission(), and Subscribe().

int mapi_object_is_invalid ( mapi_object_t obj)

Check if the supplied object has a valid handle

Parameters
objpointer on the MAPI object to test
Returns
0 on success, otherwise 1

References INVALID_HANDLE_VALUE, and mapi_object_get_handle().

_PUBLIC_ void mapi_object_release ( mapi_object_t obj)

Release MAPI object

This function is required to be called when this MAPI object is no longer required.

Parameters
objpointer on the MAPI object to release
See Also
mapi_object_initialize, Release

References mapi_object::handle, INVALID_HANDLE_VALUE, mapi_object::logon_id, mapi_session::logon_ids, mapi_object::private_data, Release(), mapi_object::session, and mapi_object::store.

Referenced by GetUserFreeBusyData(), Logoff(), ModifyUserPermission(), and RemoveUserPermission().

void mapi_object_set_id ( mapi_object_t obj,
mapi_id_t  id 
)

Set the id for a given MAPI object

Parameters
objpointer on the MAPI object to set the session for
idIdentifier to set to the object obj

References mapi_object::id.

Referenced by CreateFolder(), OpenFolder(), and SaveChangesMessage().

_PUBLIC_ void mapi_object_set_logon_id ( mapi_object_t obj,
uint8_t  logon_id 
)
_PUBLIC_ void mapi_object_set_logon_store ( mapi_object_t obj)

Mark a MAPI object as a store object

Parameters
objpointer to the object to set the store boolean for

References mapi_object::store.

Referenced by OpenPublicFolder(), and OpenUserMailbox().

void mapi_object_table_init ( TALLOC_CTX *  mem_ctx,
mapi_object_t obj_table 
)

Initialize MAPI object private data to store a MAPI object table

Parameters
mem_ctxpointer on the memory context
obj_tablepointer on the MAPI object

References mapi_obj_table::bk_last, mapi_obj_table::bookmark, mapi_object::private_data, and mapi_obj_table::proptags.

Referenced by GetContentsTable(), GetHierarchyTable(), GetPermissionsTable(), and GetRulesTable().


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/