📄 edkmapi.h
字号:
// --edkmapi.h------------------------------------------------------------------
//
// Header file for module containing MAPI utility functions.
//
// Copyright 1986 - 1998 Microsoft Corporation. All Rights Reserved.
// -----------------------------------------------------------------------------
#ifndef _EDKMAPI_H
#define _EDKMAPI_H
#ifdef __cplusplus
extern "C" {
#endif // __cplusplus
// Flags for HrMAPIOpenCachedProp().
#define EDK_CACHE_READ 0x00000001L
#define EDK_CACHE_WRITE 0x00000002L
#define MODRECIP_EMPTY (MODRECIP_ADD|MODRECIP_REMOVE)
/* Values of PR_NDR_REASON_CODE */
#define MAPI_REASON(_code) ((LONG) _code)
#define MAPI_REASON_TRANSFER_FAILED MAPI_REASON( 0 )
#define MAPI_REASON_TRANSFER_IMPOSSIBLE MAPI_REASON( 1 )
#define MAPI_REASON_CONVERSION_NOT_PERFORMED MAPI_REASON( 2 )
#define MAPI_REASON_PHYSICAL_RENDITN_NOT_DONE MAPI_REASON( 3 )
#define MAPI_REASON_PHYSICAL_DELIV_NOT_DONE MAPI_REASON( 4 )
#define MAPI_REASON_RESTRICTED_DELIVERY MAPI_REASON( 5 )
#define MAPI_REASON_DIRECTORY_OPERATN_FAILED MAPI_REASON( 6 )
#define CbSPropValue(_centries) \
((_centries)*sizeof(SPropValue))
#define CbNewADRENTRY(_centries) \
(offsetof(ADRENTRY,rgPropVals) + (_centries)*sizeof(LPSPropValue))
#define CbADRENTRY(_lpadrentry) \
(offsetof(ADRENTRY,rgPropVals) + (UINT)(_lpadrentry)->cValues*sizeof(LPSPropValue))
#define VALID_RECIP_TYPE(ulRecipType) \
(((ulRecipType & (~MAPI_SUBMITTED)) == MAPI_ORIG) || \
((ulRecipType & (~MAPI_SUBMITTED)) == MAPI_TO) || \
((ulRecipType & (~MAPI_SUBMITTED)) == MAPI_CC) || \
((ulRecipType & (~MAPI_SUBMITTED)) == MAPI_BCC))
#define VALID_RELOP_T(x) \
(((((ULONG)(x)) >= 0) && (((ULONG)(x)) < ((ULONG)RELOP_RE))) ? TRUE : FALSE)
#define VALID_ATTACH_METHOD(x) \
(((((ULONG)(x)) >= ((ULONG)NO_ATTACHMENT)) && \
(((ULONG)(x)) < ((ULONG)ATTACH_OLE))) ? TRUE : FALSE)
//$--MSG_T----------------------------------------------------------------------
// Type of message.
// -----------------------------------------------------------------------------
typedef enum _msg
{
MSG_ENVELOPE = 0, // message envelope
MSG_CONTENT, // message contents
MSG_LAST // all values are less than this
} MSG_T;
#define VALID_MSG_T(x) \
(((((ULONG)(x)) >= 0) && (((ULONG)(x)) < ((ULONG)MSG_LAST))) ? TRUE : FALSE)
//$--MD_ACTION_T----------------------------------------------------------------
// Type defining possible actions taken by an MD.
// -----------------------------------------------------------------------------
typedef enum _md_action
{
MD_AC_EXPANDED = -2, // Distribution list expanded
MD_AC_REDIRECTED, // Recipient address changed
MD_AC_RELAYED, // Normal action of a relay MTAE
MD_AC_REROUTED, // Previous attempt to route message
MD_AC_LAST // All values are less than this
} MD_ACTION_T;
#define VALID_MD_ACTION(x) \
((((LONG)(x)) >= ((LONG)-2)) && (((LONG)(x)) < ((LONG)MD_AC_LAST)))
#define CbNewTRACEINFO(_centries) \
(offsetof(TRACEINFO,rgtraceentry) + (_centries)*sizeof(TRACEENTRY))
#define CbTRACEINFO(_lptraceinfo) \
(offsetof(TRACEINFO,rgtraceentry) + \
((_lptraceinfo)->cEntries*sizeof(TRACEENTRY)))
#define CbNewINTTRACEINFO(_centries) \
(offsetof(INTTRACEINFO,rgIntTraceEntry) + (_centries)*sizeof(INTTRACEENTRY))
#define CbINTTRACEINFO(_lptraceinfo) \
(offsetof(INTTRACEINFO,rgIntTraceEntry) + \
((_lptraceinfo)->cEntries*sizeof(INTTRACEENTRY)))
//******************************************************************************
//
// EDKMAPI.C function prototypes
//
//******************************************************************************
//$--HrMAPIGetFirstSRowSet------------------------------------------------------
// Gets the first SRowSet from a table
// -----------------------------------------------------------------------------
HRESULT HrMAPIGetFirstSRowSet( // RETURNS: return code
IN LPMAPITABLE lpTable, // pointer to table address variable
IN ULONG cRows, // count of number of rows in SRowSet
IN LPSPropTagArray rgPropTags, // array of property tags
OUT LPSRowSet FAR *lppRows); // pointer to address variable for
// SRowSet
//$--HrMAPIGetNextSRowSet-------------------------------------------------------
// Gets the next SRowSet from a table
// -----------------------------------------------------------------------------
HRESULT HrMAPIGetNextSRowSet( // RETURNS: return code
IN LPMAPITABLE lpTable, // pointer to table
IN ULONG cRows, // count of number of rows in SRowSet
IN LPSPropTagArray rgPropTags, // array of property tags
OUT LPSRowSet FAR *lppRows); // pointer to address variable for
// SRowSet
//$--HrMAPICreateEntryList------------------------------------------------------
// Creates an ENTRYLIST.
// -----------------------------------------------------------------------------
HRESULT HrMAPICreateEntryList( // RETURNS: return code
IN ULONG cbeid, // count of bytes in Entry ID
IN LPENTRYID lpeid, // pointer to Entry ID
OUT LPENTRYLIST FAR *lppEntryList); // pointer to address variable of Entry
// list
//$--HrMAPIAppendEntryList------------------------------------------------------
// Appends to an ENTRYLIST.
// -----------------------------------------------------------------------------
HRESULT HrMAPIAppendEntryList( // RETURNS: return code
IN ULONG cbeid, // count of bytes in Entry ID
IN LPENTRYID lpeid, // pointer to Entry ID
OUT LPENTRYLIST FAR lpEntryList); // pointer to address variable of Entry
// list
//$--HrMAPIDestroyEntryList-----------------------------------------------------
// Frees an ENTRYLIST.
// -----------------------------------------------------------------------------
HRESULT HrMAPIDestroyEntryList( // RETURNS: return code
IN OUT LPENTRYLIST FAR *lppEntryList);// pointer to address variable of Entry
// list
//$--HrMAPIWriteStreamToFile----------------------------------------------------
// Write stream to a file given a file handle.
// -----------------------------------------------------------------------------
HRESULT HrMAPIWriteStreamToFile( // RETURNS: return code
IN LPSTREAM lpStream, // Pointer to stream
OUT HANDLE hFile); // Handle to file
//$--HrMAPIWriteFileToStream----------------------------------------------------
// Write file to a stream given a stream pointer.
// -----------------------------------------------------------------------------
HRESULT HrMAPIWriteFileToStream( // RETURNS: return code
IN HANDLE hFile, // Handle to file
OUT LPSTREAM lpStream); // Pointer to stream
//$--HrMAPIWriteAttachmentToFile------------------------------------------------
// Write the identified message attachment to a file.
// -----------------------------------------------------------------------------
HRESULT HrMAPIWriteAttachmentToFile( // RETURNS: return code
IN LPMESSAGE pMessage, // Message containing the attachments
IN ULONG iAttach, // Attachment identifier
OUT HANDLE hFile); // Handle to file
//$--HrMAPIGotoSRow-------------------------------------------------------------
// Goto the specified SRow in an SRowSet.
//------------------------------------------------------------------------------
HRESULT HrMAPIGotoSRow( // RETURNS: return code
IN LPSRowSet FAR lpRows, // pointer to SRowSet
IN ULONG ulRow, // index of SRow in SRowSet
OUT LPSRow *lppRow); // pointer to SRow
//$--HrMAPIGotoFirstSRow--------------------------------------------------------
// Goto the first SRow in an SRowSet.
//------------------------------------------------------------------------------
HRESULT HrMAPIGotoFirstSRow( // RETURNS: return code
IN LPSRowSet FAR lpRows, // pointer to SRowSet
OUT ULONG *lpulRow, // index of SRow in SRowSet
OUT LPSRow *lppRow); // pointer to SRow
//$--HrMAPIGotoNextSRow---------------------------------------------------------
// Goto the next SRow in an SRowSet.
//------------------------------------------------------------------------------
HRESULT HrMAPIGotoNextSRow( // RETURNS: return code
IN LPSRowSet FAR lpRows, // pointer to SRowSet
IN OUT ULONG *lpulRow, // index of SRow in SRowSet
OUT LPSRow *lppRow); // pointer to SRow
//$--HrMAPIWriteStreamToMemory--------------------------------------------------
// Reads a given number of bytes from a stream to a block of memory.
// -----------------------------------------------------------------------------
HRESULT HrMAPIWriteStreamToMemory( // RETURNS: return code
IN LPSTREAM lpStream, // pointer to stream
IN ULONG cBytes, // count of bytes in memory
IN LPBYTE lpbBytes, // pointer to memory
OUT ULONG *lpcBytesRead); // count of bytes read from stream
//$--HrMAPIWriteMemoryToStream--------------------------------------------------
// Writes a given number of bytes from a block of memory to a stream
// -----------------------------------------------------------------------------
HRESULT HrMAPIWriteMemoryToStream( // RETURNS: return code
IN LPSTREAM lpStream, // pointer to stream
IN ULONG cBytes, // count of bytes in memory
IN LPBYTE lpbBytes, // pointer to memory
OUT ULONG *lpcBytesWritten); // count of bytes written from stream
//$--HrMAPISetStreamSize--------------------------------------------------------
// Sets the size of the given stream.
// -----------------------------------------------------------------------------
HRESULT HrMAPISetStreamSize( // RETURNS: return code
IN LPSTREAM lpStream, // pointer to stream
IN ULONG cBytes); // count of bytes in stream
//******************************************************************************
//
// IADDRESS.C function prototypes
//
//******************************************************************************
//$--HrMAPICreateAddressList----------------------------------------------------
// Create an address list.
// -----------------------------------------------------------------------------
HRESULT HrMAPICreateAddressList( // RETURNS: return code
IN ULONG cProps, // count of values in address list
// entry
IN LPSPropValue lpPropValues, // pointer to address list entry
OUT LPADRLIST *lppAdrList); // pointer to address list pointer
//$--HrMAPIAppendAddressList----------------------------------------------------
// Append to an address list.
// -----------------------------------------------------------------------------
HRESULT HrMAPIAppendAddressList( // RETURNS: return code
IN ULONG cProps, // count of values in address list
// entry
IN LPSPropValue lpPropValues, // pointer to address list entry
IN OUT LPADRLIST *lppAdrList); // pointer to address list pointer
//$--HrMAPICreateSizedAddressList-----------------------------------------------
// Create a sized address list.
// -----------------------------------------------------------------------------
HRESULT HrMAPICreateSizedAddressList( // RETURNS: return code
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -