diff --git a/bazaar/MAPIEx/MAPIAppointment.cpp b/bazaar/MAPIEx/MAPIAppointment.cpp index 3d7ad71df..1a430f520 100644 --- a/bazaar/MAPIEx/MAPIAppointment.cpp +++ b/bazaar/MAPIEx/MAPIAppointment.cpp @@ -17,7 +17,7 @@ // Ported to U++ Framework by Koldo. See License.txt file #include "MAPIEx.h" -#include "MapiUtil.h" +//#include "MapiUtil.h" ///////////////////////////////////////////////////////////// // MAPIAppointment diff --git a/bazaar/MAPIEx/MAPIContact.cpp b/bazaar/MAPIEx/MAPIContact.cpp index 0a3dd07b5..132de06f7 100644 --- a/bazaar/MAPIEx/MAPIContact.cpp +++ b/bazaar/MAPIEx/MAPIContact.cpp @@ -17,7 +17,7 @@ // Ported to U++ Framework by Koldo. See License.txt file #include "MAPIEx.h" -#include "MapiUtil.h" +//#include "MapiUtil.h" #include diff --git a/bazaar/MAPIEx/MAPIEx.cpp b/bazaar/MAPIEx/MAPIEx.cpp index c76fd8bca..ebd15cdf3 100644 --- a/bazaar/MAPIEx/MAPIEx.cpp +++ b/bazaar/MAPIEx/MAPIEx.cpp @@ -17,7 +17,7 @@ // Ported to U++ Framework by Koldo. See License.txt file #include "MAPIEx.h" -#include "MapiUtil.h" +//#include "MapiUtil.h" #include "MAPISink.h" #ifdef _WIN32_WCE @@ -25,13 +25,14 @@ #pragma comment(lib,"cemapi.lib") #pragma comment(lib,"pimstore.lib") -#else -#pragma comment (lib,"mapi32.lib") +//#else +//#pragma comment (lib, "mapi32.lib") #endif -#pragma comment(lib,"Ole32.lib") +//#pragma comment(lib,"Ole32.lib") INITBLOCK { - MAPIEx::Init(); + if (!MAPIEx::Init()) + Panic("Impossible to initialize MAPI"); } EXITBLOCK { diff --git a/bazaar/MAPIEx/MAPIEx.h b/bazaar/MAPIEx/MAPIEx.h index 4d06cb0a0..ee536cb10 100644 --- a/bazaar/MAPIEx/MAPIEx.h +++ b/bazaar/MAPIEx/MAPIEx.h @@ -4,8 +4,8 @@ #include using namespace Upp; -#undef CY -#define CY tagCY +//#undef CY +//#define CY tagCY //////////////////////////////////////////////////////////////////////////////////////////////////////////// @@ -28,11 +28,29 @@ using namespace Upp; #include #include #else +#undef __MINGW_EXTENSION + #if defined(__GNUC__) || defined(__GNUG__) + #define __MINGW_EXTENSION __extension__ + #else + #define __MINGW_EXTENSION + #endif + #define _FILETIME_ + #define _tagCY_DEFINED + #define CY tagCY + #ifndef __LP64__ /* 32 bit target, 64 bit Mingw target */ + #define __LONG32 long + #else /* 64 bit Cygwin target */ + #define __LONG32 int + #endif + #ifndef __C89_NAMELESS + #define __C89_NAMELESS __MINGW_EXTENSION + #endif #include +#include #include #endif -#define RELEASE(s) if(s!=NULL) { s->Release();s=NULL; } +#define RELEASE(s) if(s != NULL) {s->Release(); s=NULL;} #define MAPI_NO_CACHE ((ULONG)0x00000200) diff --git a/bazaar/MAPIEx/MAPIEx.upp b/bazaar/MAPIEx/MAPIEx.upp index ce8057e0b..960bce0a9 100644 --- a/bazaar/MAPIEx/MAPIEx.upp +++ b/bazaar/MAPIEx/MAPIEx.upp @@ -4,7 +4,7 @@ uses Core, Functions4U; -library(GCC WIN32) "mapi32 kernel32"; +library(WIN32) mapi32; file MAPIAppointment.cpp, diff --git a/bazaar/MAPIEx/MAPIFolder.cpp b/bazaar/MAPIEx/MAPIFolder.cpp index 42ee68f33..a8bcd0320 100644 --- a/bazaar/MAPIEx/MAPIFolder.cpp +++ b/bazaar/MAPIEx/MAPIFolder.cpp @@ -17,7 +17,7 @@ // Ported to U++ Framework by Koldo. See License.txt file #include "MAPIEx.h" -#include "MapiUtil.h" +//#include "MapiUtil.h" ///////////////////////////////////////////////////////////// // MAPIFolder diff --git a/bazaar/MAPIEx/MAPIMessage.cpp b/bazaar/MAPIEx/MAPIMessage.cpp index b28cf71d3..431a0fae2 100644 --- a/bazaar/MAPIEx/MAPIMessage.cpp +++ b/bazaar/MAPIEx/MAPIMessage.cpp @@ -17,7 +17,7 @@ // Ported to U++ Framework by Koldo. See License.txt file #include "MAPIEx.h" -#include "MapiUtil.h" +//#include "MapiUtil.h" #include const GUID CLSID_MailMessage={ 0x00020D0B, 0x0000, 0x0000, 0xC0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46 }; diff --git a/bazaar/MAPIEx/MAPIObject.cpp b/bazaar/MAPIEx/MAPIObject.cpp index 1bf3254f2..61bdea868 100644 --- a/bazaar/MAPIEx/MAPIObject.cpp +++ b/bazaar/MAPIEx/MAPIObject.cpp @@ -17,7 +17,7 @@ // Ported to U++ Framework by Koldo. See License.txt file #include "MAPIEx.h" -#include "MapiUtil.h" +//#include "MapiUtil.h" #include ///////////////////////////////////////////////////////////// @@ -630,7 +630,7 @@ bool MAPIObject::SetHTML(const String &strHTML) { } else { // otherwise lets encode it into RTF const char *szCodePage = "1252"; // default codepage is ANSI - Latin I - GetLocaleInfo(LOCALE_SYSTEM_DEFAULT, LOCALE_IDEFAULTANSICODEPAGE, (CHAR*)szCodePage, strlen(szCodePage)); + GetLocaleInfo(LOCALE_SYSTEM_DEFAULT, LOCALE_IDEFAULTANSICODEPAGE, (CHAR*)szCodePage, (int)strlen(szCodePage)); String strRTF; strRTF = Format("{\\rtf1\\ansi\\ansicpg%s\\fromhtml1 {\\*\\htmltag1 ", szCodePage); diff --git a/bazaar/MAPIEx/MAPIObject.h b/bazaar/MAPIEx/MAPIObject.h index 45fce1f86..c2ad6bf64 100644 --- a/bazaar/MAPIEx/MAPIObject.h +++ b/bazaar/MAPIEx/MAPIObject.h @@ -31,8 +31,8 @@ public: // Attributes protected: - MAPIEx* m_pMAPI; - IMAPIProp* m_pItem; + MAPIEx *m_pMAPI; + IMAPIProp *m_pItem; SBinary m_entryID; // Operations diff --git a/bazaar/MAPIEx/plugin/MAPIAppointment.cpp b/bazaar/MAPIEx/plugin/MAPIAppointment.cpp deleted file mode 100644 index bf3983bda..000000000 --- a/bazaar/MAPIEx/plugin/MAPIAppointment.cpp +++ /dev/null @@ -1,187 +0,0 @@ -//////////////////////////////////////////////////////////////////////////////////////////////////////////// -// -// File: MAPIAppointment.cpp -// Description: MAPI Appointment class wrapper -// -// Copyright (C) 2005-2011, Noel Dillabough -// -// This source code is free to use and modify provided this notice remains intact and that any enhancements -// or bug fixes are posted to the CodeProject page hosting this class for the community to benefit. -// -// Usage: see the CodeProject article at http://www.codeproject.com/internet/CMapiEx.asp -// -//////////////////////////////////////////////////////////////////////////////////////////////////////////// - -#include "MAPIExPCH.h" -#include "MAPIEx.h" - -///////////////////////////////////////////////////////////// -// CMAPIAppointment - -CMAPIAppointment::CMAPIAppointment() -{ -#ifdef _WIN32_WCE - m_pAppointment=NULL; -#endif -} - -CMAPIAppointment::~CMAPIAppointment() -{ - Close(); -} - -#ifdef _WIN32_WCE -BOOL CMAPIAppointment::Open(CMAPIEx* pMAPI, IAppointment* pAppointment) -{ - Close(); - m_pMAPI=pMAPI; - m_pAppointment=pAppointment; - return TRUE; -} - -void CMAPIAppointment::Close() -{ - RELEASE(m_pAppointment); - m_pMAPI=NULL; -} - -BOOL CMAPIAppointment::GetPropertyString(ULONG ulProperty, CString& strProperty, BOOL bStream) -{ - return m_pMAPI->GetPOOM()->GetProperty(m_pAppointment,ulProperty, strProperty); -} - -BOOL CMAPIAppointment::SetPropertyString(ULONG ulProperty, LPCTSTR szProperty, BOOL bStream) -{ - return m_pMAPI->GetPOOM()->SetProperty(m_pAppointment,ulProperty, szProperty); -} - -#else - -BOOL CMAPIAppointment::GetSubject(CString& strSubject) -{ - if(GetPropertyString(PR_SUBJECT, strSubject)) return TRUE; - return FALSE; -} - -BOOL CMAPIAppointment::GetLocation(CString& strLocation) -{ - if(GetOutlookPropertyString(OUTLOOK_DATA2, OUTLOOK_APPOINTMENT_LOCATION, strLocation)) return TRUE; - return FALSE; -} - -BOOL CMAPIAppointment::GetStartTime(SYSTEMTIME& tmStart) -{ - LPSPropValue pProp; - if(GetOutlookProperty(OUTLOOK_DATA2, OUTLOOK_APPOINTMENT_START, pProp)) - { - FILETIME tmLocal; - FileTimeToLocalFileTime(&pProp->Value.ft, &tmLocal); - FileTimeToSystemTime(&tmLocal, &tmStart); - MAPIFreeBuffer(pProp); - return TRUE; - } - return FALSE; -} - -BOOL CMAPIAppointment::GetStartTime(CString& strStartTime, LPCTSTR szFormat) -{ - SYSTEMTIME tm; - if(GetStartTime(tm)) - { - TCHAR szTime[256]; - if(!szFormat) szFormat=_T("MM/dd/yyyy hh:mm:ss tt"); - GetDateFormat(LOCALE_SYSTEM_DEFAULT, 0, &tm, szFormat, szTime, 256); - GetTimeFormat(LOCALE_SYSTEM_DEFAULT, 0, &tm, szTime, szTime, 256); - strStartTime=szTime; - return TRUE; - } - return FALSE; -} - -BOOL CMAPIAppointment::GetEndTime(SYSTEMTIME& tmEnd) -{ - LPSPropValue pProp; - if(GetOutlookProperty(OUTLOOK_DATA2, OUTLOOK_APPOINTMENT_END, pProp)) - { - FILETIME tmLocal; - FileTimeToLocalFileTime(&pProp->Value.ft, &tmLocal); - FileTimeToSystemTime(&tmLocal, &tmEnd); - MAPIFreeBuffer(pProp); - return TRUE; - } - return FALSE; -} - -BOOL CMAPIAppointment::GetEndTime(CString& strEndTime, LPCTSTR szFormat) -{ - SYSTEMTIME tm; - if(GetEndTime(tm)) - { - TCHAR szTime[256]; - if(!szFormat) szFormat=_T("MM/dd/yyyy hh:mm:ss tt"); - GetDateFormat(LOCALE_SYSTEM_DEFAULT, 0, &tm, szFormat, szTime, 256); - GetTimeFormat(LOCALE_SYSTEM_DEFAULT, 0, &tm, szTime, szTime, 256); - strEndTime=szTime; - return TRUE; - } - return FALSE; -} - -BOOL CMAPIAppointment::SetSubject(LPCTSTR szSubject) -{ - return SetPropertyString(PR_SUBJECT, szSubject); -} - -BOOL CMAPIAppointment::SetLocation(LPCTSTR szLocation) -{ - return SetOutlookProperty(OUTLOOK_DATA2, OUTLOOK_APPOINTMENT_START, szLocation); -} - -BOOL CMAPIAppointment::SetStartTime(SYSTEMTIME& tmStart) -{ - FILETIME ftStart; - SystemTimeToFileTime(&tmStart, &ftStart); - return SetOutlookProperty(OUTLOOK_DATA2, OUTLOOK_APPOINTMENT_START, ftStart); -} - -BOOL CMAPIAppointment::SetEndTime(SYSTEMTIME& tmEnd) -{ - FILETIME ftEnd; - SystemTimeToFileTime(&tmEnd, &ftEnd); - return SetOutlookProperty(OUTLOOK_DATA2, OUTLOOK_APPOINTMENT_START, ftEnd); -} - -const GUID PSETID_Meeting = {0x6ED8DA90, 0x450B, 0x101B, {0x98, 0xDA, 0x00, 0xAA, 0x00, 0x3F, 0x13, 0x05}}; - -#define LID_GLOBAL_OBJID 0x23 - -BOOL CMAPIAppointment::GetMeetingUID(CString& strUID) -{ - BOOL bResult=FALSE; - - MAPINAMEID NamedID = {0}; - NamedID.lpguid = (LPGUID) &PSETID_Meeting; - NamedID.ulKind = MNID_ID; - NamedID.Kind.lID = LID_GLOBAL_OBJID; - LPMAPINAMEID lpNamedID = &NamedID; - - LPSPropTagArray lpNamedPropTags = NULL; - if(m_pItem && m_pItem->GetIDsFromNames(1, &lpNamedID, NULL, &lpNamedPropTags)==S_OK) - { - // Set our type to binary - lpNamedPropTags->aulPropTag[0] = CHANGE_PROP_TYPE(lpNamedPropTags->aulPropTag[0],PT_BINARY); - - // Get the value of the property. - LPSPropValue pProp; - ULONG ulVal = 0; - if(m_pItem->GetProps(lpNamedPropTags, 0, &ulVal, &pProp)==S_OK) - { - bResult=GetHexString(strUID, pProp->Value.bin); - MAPIFreeBuffer(pProp); - } - MAPIFreeBuffer(lpNamedPropTags); - } - return bResult; -} - -#endif diff --git a/bazaar/MAPIEx/plugin/MAPIAppointment.h b/bazaar/MAPIEx/plugin/MAPIAppointment.h deleted file mode 100644 index fa8bba667..000000000 --- a/bazaar/MAPIEx/plugin/MAPIAppointment.h +++ /dev/null @@ -1,72 +0,0 @@ -#ifndef __MAPIAPPOINTMENT_H__ -#define __MAPIAPPOINTMENT_H__ - -//////////////////////////////////////////////////////////////////////////////////////////////////////////// -// -// File: MAPIAppointment.h -// Description: MAPI Appointment class wrapper -// -// Copyright (C) 2005-2011, Noel Dillabough -// -// This source code is free to use and modify provided this notice remains intact and that any enhancements -// or bug fixes are posted to the CodeProject page hosting this class for the community to benefit. -// -// Usage: see the CodeProject article at http://www.codeproject.com/internet/CMapiEx.asp -// -//////////////////////////////////////////////////////////////////////////////////////////////////////////// - -class CMAPIEx; -class CMAPIAppointment; - -#ifdef _WIN32_WCE -#include "POOM.h" -#endif - -///////////////////////////////////////////////////////////// -// CMAPIAppointment - -class AFX_EXT_CLASS CMAPIAppointment : public CMAPIObject -{ -public: - CMAPIAppointment(); - ~CMAPIAppointment(); - - enum { OUTLOOK_DATA2=0x00062002, OUTLOOK_APPOINTMENT_START=0x820D, OUTLOOK_APPOINTMENT_END=0x820E, - OUTLOOK_APPOINTMENT_LOCATION=0x8208 - }; - -// Attributes -protected: -#ifdef _WIN32_WCE - IAppointment* m_pAppointment; -#endif - -// Operations -public: -#ifdef _WIN32_WCE - BOOL Open(CMAPIEx* pMAPI, IAppointment* pAppointment); - virtual void Close(); - - virtual BOOL GetPropertyString(ULONG ulProperty, CString& strProperty, BOOL bStream=FALSE); - virtual BOOL SetPropertyString(ULONG ulProperty, LPCTSTR szProperty, BOOL bStream=FALSE); -#else - BOOL GetSubject(CString& strSubject); - BOOL GetLocation(CString& strLocation); - BOOL GetStartTime(SYSTEMTIME& tmStart); - BOOL GetStartTime(CString& strStartTime, LPCTSTR szFormat=NULL); // NULL defaults to "MM/dd/yyyy hh:mm:ss tt" - BOOL GetEndTime(SYSTEMTIME& tmEnd); - BOOL GetEndTime(CString& strEndTime, LPCTSTR szFormat=NULL); // NULL defaults to "MM/dd/yyyy hh:mm:ss tt" - - BOOL SetSubject(LPCTSTR szSubject); - BOOL SetLocation(LPCTSTR szLocation); - BOOL SetStartTime(SYSTEMTIME& tmStart); - BOOL SetEndTime(SYSTEMTIME& tmEnd); - - BOOL GetMeetingUID(CString& strUID); -#endif -}; - -#define PR_APPOINTMENT_START PROP_TAG( PT_SYSTIME, CMAPIAppointment::OUTLOOK_APPOINTMENT_START) -#define PR_APPOINTMENT_END PROP_TAG( PT_SYSTIME, CMAPIAppointment::OUTLOOK_APPOINTMENT_END) - -#endif diff --git a/bazaar/MAPIEx/plugin/MAPIAttachment.cpp b/bazaar/MAPIEx/plugin/MAPIAttachment.cpp deleted file mode 100644 index 9842baf64..000000000 --- a/bazaar/MAPIEx/plugin/MAPIAttachment.cpp +++ /dev/null @@ -1,248 +0,0 @@ -//////////////////////////////////////////////////////////////////////////////////////////////////////////// -// -// File: MAPIAttachment.cpp -// Description: MAPI Attachment class wrapper -// -// Copyright (C) 2005-2011, Noel Dillabough -// -// This source code is free to use and modify provided this notice remains intact and that any enhancements -// or bug fixes are posted to the CodeProject page hosting this class for the community to benefit. -// -// Usage: see the CodeProject article at http://www.codeproject.com/internet/CMapiEx.asp -// -//////////////////////////////////////////////////////////////////////////////////////////////////////////// - -#include "MAPIExPCH.h" -#include "MAPIEx.h" - -///////////////////////////////////////////////////////////// -// MAPIAttachment - -CMAPIAttachment::CMAPIAttachment() -{ - m_pStream=NULL; - m_nBytesWritten=0; -} - -CMAPIAttachment::~CMAPIAttachment() -{ - Close(); -} - -void CMAPIAttachment::Attach(LPATTACH pAttachment) -{ - Close(); - m_pItem=pAttachment; -} - -LPATTACH CMAPIAttachment::Detach() -{ - LPATTACH pAttachment=Attachment(); - m_pItem=NULL; - return pAttachment; -} - -BOOL CMAPIAttachment::Create(LPMESSAGE pMessage) -{ - Close(); - - BOOL bResult=FALSE; - if(pMessage) - { - LPATTACH pAttachment; - ULONG ulAttachmentNum=0; - - if(pMessage->CreateAttach(NULL, 0, &ulAttachmentNum, &pAttachment)==S_OK) - { - m_pItem=pAttachment; - - const int nProperties=2; - SPropValue prop[nProperties]; - memset(prop, 0,sizeof(SPropValue)*nProperties); - prop[0].ulPropTag=PR_ATTACH_METHOD; - prop[0].Value.ul=ATTACH_BY_VALUE; - prop[1].ulPropTag=PR_RENDERING_POSITION; - prop[1].Value.l=1; - if(pAttachment->SetProps(nProperties, prop, NULL)==S_OK) - { - bResult=TRUE; - } - } - } - return bResult; -} - -BOOL CMAPIAttachment::Open(LPMESSAGE pMessage, int nIndex) -{ - Close(); - - BOOL bResult=FALSE; - LPMAPITABLE pAttachTable; - if(nIndex>=0 && pMessage && pMessage->GetAttachmentTable(0, &pAttachTable)==S_OK) - { - enum { PROP_ATTACH_NUM, ATTACH_COLS }; - static SizedSPropTagArray(ATTACH_COLS, Columns)={ATTACH_COLS, PR_ATTACH_NUM }; - if(pAttachTable->SetColumns((LPSPropTagArray)&Columns, 0)==S_OK) - { - if(pAttachTable->SeekRow(BOOKMARK_BEGINNING, nIndex, NULL)==S_OK) - { - LPSRowSet pRows=NULL; - if(pAttachTable->QueryRows(1, 0, &pRows)==S_OK) - { - if(pRows->cRows > 0) - { - LPATTACH pAttachment; - if(pMessage->OpenAttach(pRows->aRow[0].lpProps[PROP_ATTACH_NUM].Value.ul, NULL, 0, &pAttachment)==S_OK) - { - m_pItem=pAttachment; - bResult=TRUE; - } - } - FreeProws(pRows); - } - } - } - } - return bResult; -} - -void CMAPIAttachment::Close() -{ - CloseStream(); - CMAPIObject::Close(); -} - -BOOL CMAPIAttachment::GetDisplayName(CString& strDisplayName) -{ - return GetPropertyString(PR_DISPLAY_NAME, strDisplayName); -} - -BOOL CMAPIAttachment::GetFileName(CString& strFileName) -{ - return GetPropertyString(PR_ATTACH_FILENAME, strFileName); -} - -BOOL CMAPIAttachment::GetLongFileName(CString& strLongFileName) -{ - return GetPropertyString(PR_ATTACH_LONG_FILENAME, strLongFileName); -} - -BOOL CMAPIAttachment::GetCID(CString& strCID) -{ - return GetPropertyString(PR_ATTACH_CONTENT_ID, strCID); -} - -BOOL CMAPIAttachment::SetDisplayName(LPCTSTR szDisplayName) -{ - return SetPropertyString(PR_DISPLAY_NAME, szDisplayName); -} - -BOOL CMAPIAttachment::SetFileName(LPCTSTR szFileName) -{ - return SetPropertyString(PR_ATTACH_FILENAME, szFileName); -} - -BOOL CMAPIAttachment::SetLongFileName(LPCTSTR szLongFileName) -{ - return SetPropertyString(PR_ATTACH_LONG_FILENAME, szLongFileName); -} - -BOOL CMAPIAttachment::SetCID(LPCTSTR szCID) -{ - return SetPropertyString(PR_ATTACH_CONTENT_ID, szCID); -} - -BOOL CMAPIAttachment::OpenStream(BOOL bCreate) -{ - if(m_pItem) - { - ULONG ulInterfaceOptions=STGM_READ; - ULONG ulFlags=0; - if(bCreate) - { - ulInterfaceOptions=0; - ulFlags=MAPI_MODIFY | MAPI_CREATE; - } - return (m_pItem->OpenProperty(PR_ATTACH_DATA_BIN, &IID_IStream, ulInterfaceOptions, ulFlags, (LPUNKNOWN*)&m_pStream)==S_OK); - } - return FALSE; -} - -int CMAPIAttachment::Read(BYTE* pData, int nCount) -{ - if(m_pStream) - { - ULONG ulRead; - m_pStream->Read(pData, nCount, &ulRead); - return ulRead; - } - return -1; -} - -int CMAPIAttachment::Write(BYTE* pData, int nCount) -{ - if(m_pStream) - { - ULONG ulWritten; - m_pStream->Write(pData, nCount, &ulWritten); - m_nBytesWritten+=ulWritten; - return ulWritten; - } - return -1; -} - -void CMAPIAttachment::CloseStream() -{ - if(m_pStream) - { - m_pStream->Commit(STGC_DEFAULT); - RELEASE(m_pStream); - SetPropertyValue(PR_ATTACH_SIZE, m_nBytesWritten); - m_nBytesWritten=0; - } -} - -BOOL CMAPIAttachment::LoadAttachment(LPCTSTR szPath) -{ - CFile file; - if(file.Open(szPath, CFile::modeRead) && OpenStream(TRUE)) - { - const int BUF_SIZE=4096; - BYTE pData[BUF_SIZE]; - ULONG ulRead; - - ulRead=file.Read(pData, BUF_SIZE); - while(ulRead) - { - Write(pData, ulRead); - ulRead=file.Read(pData, BUF_SIZE); - } - - file.Close(); - CloseStream(); - return TRUE; - } - return FALSE; -} - -BOOL CMAPIAttachment::SaveAttachment(LPCTSTR szPath) -{ - CFile file; - if(file.Open(szPath, CFile::modeCreate | CFile::modeWrite) && OpenStream(FALSE)) - { - const int BUF_SIZE=4096; - BYTE pData[BUF_SIZE]; - ULONG ulRead; - - do { - ulRead=Read(pData, BUF_SIZE); - if(ulRead) file.Write(pData, ulRead); - } while(ulRead>=BUF_SIZE); - - - file.Close(); - CloseStream(); - return TRUE; - } - return FALSE; -} diff --git a/bazaar/MAPIEx/plugin/MAPIAttachment.h b/bazaar/MAPIEx/plugin/MAPIAttachment.h deleted file mode 100644 index bfbb9dae8..000000000 --- a/bazaar/MAPIEx/plugin/MAPIAttachment.h +++ /dev/null @@ -1,65 +0,0 @@ -#ifndef __MAPIATTACHMENT_H__ -#define __MAPIATTACHMENT_H__ - -//////////////////////////////////////////////////////////////////////////////////////////////////////////// -// -// File: MAPIAttachment.h -// Description: MAPI Attachment class wrapper -// -// Copyright (C) 2005-2011, Noel Dillabough -// -// This source code is free to use and modify provided this notice remains intact and that any enhancements -// or bug fixes are posted to the CodeProject page hosting this class for the community to benefit. -// -// Usage: see the CodeProject article at http://www.codeproject.com/internet/CMapiEx.asp -// -//////////////////////////////////////////////////////////////////////////////////////////////////////////// - -class CMAPIEx; -class CMAPIAttachment; - -///////////////////////////////////////////////////////////// -// CMAPIAttachment - -#define PR_ATTACHMENT_UNKNOWN 0x7FFF000B - -class AFX_EXT_CLASS CMAPIAttachment : public CMAPIObject -{ -public: - CMAPIAttachment(); - ~CMAPIAttachment(); - -// Attributes -protected: - LPSTREAM m_pStream; - int m_nBytesWritten; - -// Operations -public: - inline LPATTACH Attachment() { return (LPATTACH)m_pItem; } - void Attach(LPATTACH pAttachment); - LPATTACH Detach(); - BOOL Create(LPMESSAGE pMessage); - BOOL Open(LPMESSAGE pMessage, int nIndex); - void Close(); - - BOOL GetDisplayName(CString& strDisplayName); - BOOL GetFileName(CString& strFileName); - BOOL GetLongFileName(CString& strLongFileName); - BOOL GetCID(CString& strCID); - - BOOL SetDisplayName(LPCTSTR szDisplayName); - BOOL SetFileName(LPCTSTR szFileName); - BOOL SetLongFileName(LPCTSTR szLongFileName); - BOOL SetCID(LPCTSTR szCID); - - BOOL OpenStream(BOOL bCreate=FALSE); - int Read(BYTE* pData, int nCount); - int Write(BYTE* pData, int nCount); - void CloseStream(); - - BOOL LoadAttachment(LPCTSTR szPath); - BOOL SaveAttachment(LPCTSTR szPath); -}; - -#endif diff --git a/bazaar/MAPIEx/plugin/MAPIContact.cpp b/bazaar/MAPIEx/plugin/MAPIContact.cpp deleted file mode 100644 index 430444f1b..000000000 --- a/bazaar/MAPIEx/plugin/MAPIContact.cpp +++ /dev/null @@ -1,801 +0,0 @@ -//////////////////////////////////////////////////////////////////////////////////////////////////////////// -// -// File: MAPIContact.cpp -// Description: MAPI Contact class wrapper -// -// Copyright (C) 2005-2011, Noel Dillabough -// -// This source code is free to use and modify provided this notice remains intact and that any enhancements -// or bug fixes are posted to the CodeProject page hosting this class for the community to benefit. -// -// Usage: see the CodeProject article at http://www.codeproject.com/internet/CMapiEx.asp -// -//////////////////////////////////////////////////////////////////////////////////////////////////////////// - -#include "MAPIExPCH.h" -#include "MAPIEx.h" - -#define CATEGORIES_PROPERTY _T("Keywords") - -///////////////////////////////////////////////////////////// -// CContactAddress - -const ULONG ContactAddressTag[][5]={ - { PR_HOME_ADDRESS_CITY, PR_HOME_ADDRESS_COUNTRY, PR_HOME_ADDRESS_STATE_OR_PROVINCE, - PR_HOME_ADDRESS_STREET, PR_HOME_ADDRESS_POSTAL_CODE }, - { PR_BUSINESS_ADDRESS_CITY, PR_BUSINESS_ADDRESS_COUNTRY, PR_BUSINESS_ADDRESS_STATE_OR_PROVINCE, - PR_BUSINESS_ADDRESS_STREET, PR_BUSINESS_ADDRESS_POSTAL_CODE }, - { PR_OTHER_ADDRESS_CITY, PR_OTHER_ADDRESS_COUNTRY, PR_OTHER_ADDRESS_STATE_OR_PROVINCE, - PR_OTHER_ADDRESS_STREET, PR_OTHER_ADDRESS_POSTAL_CODE }, -}; - -CContactAddress::CContactAddress() -{ -} - -BOOL CContactAddress::FillAddress(CMAPIContact& contact,AddressType nType) -{ - if(nTypeOTHER) return FALSE; - m_nType=nType; - - if(!contact.GetPropertyString(ContactAddressTag[nType][0], m_strCity)) return FALSE; - if(!contact.GetPropertyString(ContactAddressTag[nType][1], m_strCountry)) return FALSE; - if(!contact.GetPropertyString(ContactAddressTag[nType][2], m_strStateOrProvince)) return FALSE; - if(!contact.GetPropertyString(ContactAddressTag[nType][3], m_strStreet)) return FALSE; - if(!contact.GetPropertyString(ContactAddressTag[nType][4], m_strPostalCode)) return FALSE; - return TRUE; -} - -BOOL CContactAddress::SaveAddress(CMAPIContact& contact,AddressType nType) -{ - if(nTypeOTHER) return FALSE; - m_nType=nType; - - if(!contact.SetPropertyString(ContactAddressTag[nType][0], m_strCity)) return FALSE; - if(!contact.SetPropertyString(ContactAddressTag[nType][1], m_strCountry)) return FALSE; - if(!contact.SetPropertyString(ContactAddressTag[nType][2], m_strStateOrProvince)) return FALSE; - if(!contact.SetPropertyString(ContactAddressTag[nType][3], m_strStreet)) return FALSE; - if(!contact.SetPropertyString(ContactAddressTag[nType][4], m_strPostalCode)) return FALSE; - return TRUE; -} - -///////////////////////////////////////////////////////////// -// CMAPIContact - -const ULONG PhoneNumberIDs[]={ - PR_PRIMARY_TELEPHONE_NUMBER, PR_BUSINESS_TELEPHONE_NUMBER, PR_HOME_TELEPHONE_NUMBER, - PR_CALLBACK_TELEPHONE_NUMBER, PR_BUSINESS2_TELEPHONE_NUMBER, PR_MOBILE_TELEPHONE_NUMBER, - PR_RADIO_TELEPHONE_NUMBER, PR_CAR_TELEPHONE_NUMBER, PR_OTHER_TELEPHONE_NUMBER, - PR_PAGER_TELEPHONE_NUMBER, PR_PRIMARY_FAX_NUMBER, PR_BUSINESS_FAX_NUMBER, - PR_HOME_FAX_NUMBER, PR_TELEX_NUMBER, PR_ISDN_NUMBER, PR_ASSISTANT_TELEPHONE_NUMBER, - PR_HOME2_TELEPHONE_NUMBER, PR_TTYTDD_PHONE_NUMBER, PR_COMPANY_MAIN_PHONE_NUMBER, 0 -}; - -const ULONG NameIDs[]={ PR_DISPLAY_NAME, PR_GIVEN_NAME, PR_MIDDLE_NAME, PR_SURNAME, 0 }; - -CMAPIContact::CMAPIContact() -{ -#ifdef _WIN32_WCE - m_pPOOM=NULL; - m_pContact=NULL; -#endif -} - -CMAPIContact::~CMAPIContact() -{ - Close(); -} - -#ifdef _WIN32_WCE -BOOL CMAPIContact::Open(CMAPIEx* pMAPI, CPOOM* pPOOM, IContact* pContact) -{ - Close(); - m_pMAPI=pMAPI; - m_pContact=pContact; - if(!m_pPOOM) m_pPOOM=pPOOM; - return TRUE; -} - -void CMAPIContact::Close() -{ - RELEASE(m_pContact); - m_pMAPI=NULL; -} - -BOOL CMAPIContact::Save(BOOL bClose) -{ - return (m_pContact->Save()==S_OK); -} - -BOOL CMAPIContact::GetPropertyString(ULONG ulProperty, CString& strProperty, BOOL bStream) -{ - return m_pPOOM ? m_pPOOM->GetProperty(m_pContact,ulProperty, strProperty) : FALSE; -} - -BOOL CMAPIContact::SetPropertyString(ULONG ulProperty, LPCTSTR szProperty, BOOL bStream) -{ - return m_pPOOM ? m_pPOOM->SetProperty(m_pContact,ulProperty, szProperty) : FALSE; -} -#endif - -BOOL CMAPIContact::Create(CMAPIEx* pMAPI, CMAPIFolder* pFolder) -{ - if(!pMAPI) return FALSE; - if(!pFolder) pFolder=pMAPI->GetFolder(); - if(!pFolder) pFolder=pMAPI->OpenContacts(); -#ifdef _WIN32_WCE - if(pFolder) - { - m_pPOOM=pFolder->GetPOOM(); - return m_pPOOM ? m_pPOOM->Create(pMAPI,*this) : FALSE; - } - return FALSE; -#else - if(!CMAPIObject::Create(pMAPI, pFolder)) return FALSE; - - SetMessageClass(_T("IPM.Contact")); - SetImportance(IMPORTANCE_NORMAL); - SetSensitivity(SENSITIVITY_NONE); - - return TRUE; -#endif -} - -BOOL CMAPIContact::GetName(CString& strName, ULONG ulNameID) -{ - ULONG i=0; - while(NameIDs[i]!=ulNameID && NameIDs[i]>0) i++; - if(!NameIDs[i]) - { - strName=_T(""); - return FALSE; - } - else - { - return GetPropertyString(ulNameID, strName); - } -} - -int CMAPIContact::GetOutlookEmailID(int nIndex) -{ - ULONG ulProperty[]={ OUTLOOK_EMAIL1, OUTLOOK_EMAIL2, OUTLOOK_EMAIL3 }; - if(nIndex<1 || nIndex>3) return 0; - return ulProperty[nIndex-1]; -} - -// uses the built in outlook email fields, OUTLOOK_EMAIL1 etc, minus 1 for ADDR_TYPE and +1 for EmailOriginalDisplayName -BOOL CMAPIContact::GetEmail(CString& strEmail, int nIndex) -{ - ULONG nID=GetOutlookEmailID(nIndex); - if(!nID) return FALSE; - -#ifdef _WIN32_WCE - return GetPropertyString(nID, strEmail); -#else - LPSPropValue pProp; - if(GetOutlookProperty(OUTLOOK_DATA1, nID-1, pProp)) - { - CString strAddrType=CMAPIEx::GetValidString(*pProp); - MAPIFreeBuffer(pProp); - if(GetOutlookProperty(OUTLOOK_DATA1, nID, pProp)) - { - strEmail=CMAPIEx::GetValidString(*pProp); - MAPIFreeBuffer(pProp); - if(strAddrType==_T("EX")) - { - // for EX types we use the original display name (seems to contain the appropriate data) - if(GetOutlookProperty(OUTLOOK_DATA1, nID+1, pProp)) - { - strEmail=CMAPIEx::GetValidString(*pProp); - MAPIFreeBuffer(pProp); - } - } - return TRUE; - } - } - return FALSE; -#endif -} - -BOOL CMAPIContact::GetEmailDisplayAs(CString& strDisplayAs, int nIndex) -{ -#ifdef _WIN32_WCE - return GetEmail(strDisplayAs, nIndex); -#else - ULONG nID=GetOutlookEmailID(nIndex); - if(!nID) return FALSE; - - LPSPropValue pProp; - if(GetOutlookProperty(OUTLOOK_DATA1, nID-3, pProp)) - { - strDisplayAs=CMAPIEx::GetValidString(*pProp); - MAPIFreeBuffer(pProp); - return TRUE; - } - return FALSE; -#endif -} - -BOOL CMAPIContact::GetHomePage(CString& strHomePage, BOOL bBusiness) -{ - return GetPropertyString(bBusiness ? PR_BUSINESS_HOME_PAGE : PR_PERSONAL_HOME_PAGE, strHomePage); -} - -BOOL CMAPIContact::GetPhoneNumber(CString& strPhoneNumber, ULONG ulPhoneNumberID) -{ - ULONG i=0; - while(PhoneNumberIDs[i]!=ulPhoneNumberID && PhoneNumberIDs[i]>0) i++; - if(!PhoneNumberIDs[i]) - { - strPhoneNumber=_T(""); - return FALSE; - } - else - { - return GetPropertyString(ulPhoneNumberID, strPhoneNumber); - } -} - -BOOL CMAPIContact::GetAddress(CContactAddress& address, CContactAddress::AddressType nType) -{ - return address.FillAddress(*this, nType); -} - -BOOL CMAPIContact::GetPostalAddress(CString& strAddress) -{ -#ifdef _WIN32_WCE - return FALSE; -#else - return GetPropertyString(PR_POSTAL_ADDRESS, strAddress); -#endif -} - -BOOL CMAPIContact::GetIMAddress(CString& strIMAddress) -{ -#ifndef _WIN32_WCE - LPSPropValue pProp; - if(GetOutlookProperty(OUTLOOK_DATA1, OUTLOOK_IM_ADDRESS, pProp)) - { - strIMAddress=CMAPIEx::GetValidString(*pProp); - MAPIFreeBuffer(pProp); - return TRUE; - } -#endif - return FALSE; -} - -BOOL CMAPIContact::GetFileAs(CString& strFileAs) -{ -#ifdef _WIN32_WCE - return GetPropertyString(PR_DISPLAY_NAME, strFileAs); -#else - LPSPropValue pProp; - if(GetOutlookProperty(OUTLOOK_DATA1, OUTLOOK_FILE_AS, pProp)) - { - strFileAs=CMAPIEx::GetValidString(*pProp); - MAPIFreeBuffer(pProp); - return TRUE; - } - return FALSE; -#endif -} - -BOOL CMAPIContact::GetTitle(CString& strTitle) -{ - return GetPropertyString(PR_TITLE, strTitle); -} - -BOOL CMAPIContact::GetCompany(CString& strCompany) -{ - return GetPropertyString(PR_COMPANY_NAME, strCompany); -} - -BOOL CMAPIContact::GetProfession(CString& strProfession) -{ - return GetPropertyString(PR_PROFESSION, strProfession); -} - -BOOL CMAPIContact::GetDisplayNamePrefix(CString& strPrefix) -{ - return GetPropertyString(PR_DISPLAY_NAME_PREFIX, strPrefix); -} - -BOOL CMAPIContact::GetGeneration(CString& strGeneration) -{ - return GetPropertyString(PR_GENERATION, strGeneration); -} - -BOOL CMAPIContact::GetDepartment(CString& strDepartment) -{ - return GetPropertyString(PR_DEPARTMENT_NAME, strDepartment); -} - -BOOL CMAPIContact::GetOffice(CString& strOffice) -{ - return GetPropertyString(PR_OFFICE_LOCATION, strOffice); -} - -BOOL CMAPIContact::GetManagerName(CString& strManagerName) -{ - return GetPropertyString(PR_MANAGER_NAME, strManagerName); -} - -BOOL CMAPIContact::GetAssistantName(CString& strAssistantName) -{ - return GetPropertyString(PR_ASSISTANT, strAssistantName); -} - -BOOL CMAPIContact::GetNickName(CString& strNickName) -{ - return GetPropertyString(PR_NICKNAME, strNickName); -} - -BOOL CMAPIContact::GetSpouseName(CString& strSpouseName) -{ - return GetPropertyString(PR_SPOUSE_NAME, strSpouseName); -} - -BOOL CMAPIContact::GetBirthday(SYSTEMTIME& tmBirthday) -{ -#ifdef _WIN32_WCE - return m_pPOOM ? m_pPOOM->GetDate(m_pContact, PR_BIRTHDAY,tmBirthday) : FALSE; -#else - LPSPropValue pProp; - if(GetProperty(PR_BIRTHDAY, pProp)==S_OK) - { - SYSTEMTIME tm; - FileTimeToSystemTime(&pProp->Value.ft, &tm); - SystemTimeToTzSpecificLocalTime(NULL, &tm, &tmBirthday); - - MAPIFreeBuffer(pProp); - return TRUE; - } - return FALSE; -#endif -} - -BOOL CMAPIContact::GetBirthday(CString& strBirthday, LPCTSTR szFormat) -{ - SYSTEMTIME tm; - if(GetBirthday(tm)) - { - TCHAR szDate[256]; - if(!szFormat) szFormat=_T("MM/dd/yyyy"); - GetDateFormat(LOCALE_SYSTEM_DEFAULT, 0, &tm, szFormat, szDate, 256); - strBirthday=szDate; - return TRUE; - } - return FALSE; -} - -BOOL CMAPIContact::GetAnniversary(SYSTEMTIME& tmAnniversary) -{ -#ifdef _WIN32_WCE - return m_pPOOM ? m_pPOOM->GetDate(m_pContact, PR_WEDDING_ANNIVERSARY,tmAnniversary) : FALSE; -#else - LPSPropValue pProp; - if(GetProperty(PR_WEDDING_ANNIVERSARY, pProp)==S_OK) - { - SYSTEMTIME tm; - FileTimeToSystemTime(&pProp->Value.ft, &tm); - SystemTimeToTzSpecificLocalTime(NULL, &tm, &tmAnniversary); - - MAPIFreeBuffer(pProp); - return TRUE; - } - return FALSE; -#endif -} - -BOOL CMAPIContact::GetAnniversary(CString& strAnniversary, LPCTSTR szFormat) -{ - SYSTEMTIME tm; - if(GetAnniversary(tm)) - { - TCHAR szDate[256]; - if(!szFormat) szFormat=_T("MM/dd/yyyy"); - GetDateFormat(LOCALE_SYSTEM_DEFAULT, 0, &tm, szFormat, szDate,256); - strAnniversary=szDate; - return TRUE; - } - return FALSE; -} - -// Categories are stored under the multi-value named property CATEGORIES_PROPERTY -BOOL CMAPIContact::GetCategories(CString& strCategories) -{ -#ifdef _WIN32_WCE - return GetPropertyString(OUTLOOK_CATEGORIES, strCategories); -#else - LPSPropValue pProp; - if(GetNamedProperty(CATEGORIES_PROPERTY, pProp)) - { - strCategories=""; - - ULONG i; - CString strCategory; - for(i=0;iValue.MVi.cValues;i++) - { - strCategory=CMAPIEx::GetValidMVString(*pProp, i); - if(strCategory.GetLength()) - { - if(strCategories.GetLength()) strCategories+=';'; - strCategories+=strCategory; - } - } - MAPIFreeBuffer(pProp); - return TRUE; - } - return FALSE; -#endif -} - -BOOL CMAPIContact::SetName(LPCTSTR szName, ULONG ulNameID) -{ - ULONG i=0; - while(NameIDs[i]!=ulNameID && NameIDs[i]>0) i++; - if(!NameIDs[i]) return FALSE; - return SetPropertyString(ulNameID, szName); -} - -// only supports setting SMTP Email Addresses, sets both display properties, use SetEmailDisplayAs to set the -// outlook DisplayAs property to some other text. You should check that the text is a valid SMTP email address -// ie name.name@domain.domain because this function will allow any string -BOOL CMAPIContact::SetEmail(LPCTSTR szEmail, int nIndex) -{ - ULONG nID=GetOutlookEmailID(nIndex); - if(!nID) return FALSE; - -#ifdef _WIN32_WCE - return m_pPOOM ? m_pPOOM->SetProperty(m_pContact, nID, szEmail) : FALSE; -#else - if(SetOutlookProperty(OUTLOOK_DATA1, nID-1, _T("SMTP"))) - { - // we set the email field and both display properties - if(!SetOutlookProperty(OUTLOOK_DATA1, nID, szEmail)) return FALSE; - if(!SetOutlookProperty(OUTLOOK_DATA1, nID+1, szEmail)) return FALSE; - if(!SetOutlookProperty(OUTLOOK_DATA1, nID-3, szEmail)) return FALSE; - return TRUE; - } - return FALSE; -#endif -} - -BOOL CMAPIContact::SetEmailDisplayAs(LPCTSTR szDisplayAs, int nIndex) -{ -#ifdef _WIN32_WCE - return FALSE; -#endif - ULONG nID=GetOutlookEmailID(nIndex); - if(!nID) return FALSE; - - return SetOutlookProperty(OUTLOOK_DATA1, nID-3, szDisplayAs); -} - -BOOL CMAPIContact::SetHomePage(LPCTSTR szHomePage, BOOL bBuiness) -{ - return SetPropertyString(bBuiness ? PR_BUSINESS_HOME_PAGE : PR_PERSONAL_HOME_PAGE, szHomePage); -} - -BOOL CMAPIContact::SetPhoneNumber(LPCTSTR szPhoneNumber, ULONG ulPhoneNumberID) -{ - ULONG i=0; - while(PhoneNumberIDs[i]!=ulPhoneNumberID && PhoneNumberIDs[i]>0) i++; - if(!PhoneNumberIDs[i] || !szPhoneNumber) return FALSE; - - // lets do a check for North American phone numbers and change the format if so to "(code) xxx-yyyy" - CString strPhoneNumber=szPhoneNumber; - if(strPhoneNumber.GetLength()==12 && szPhoneNumber[3]==(TCHAR)'-' && szPhoneNumber[7]==(TCHAR)'-') - { - strPhoneNumber.Format(_T("(%s) %s"), strPhoneNumber.Mid(0,3), strPhoneNumber.Right(8)); - } - return SetPropertyString(ulPhoneNumberID, strPhoneNumber); -} - -BOOL CMAPIContact::SetAddress(CContactAddress& address, CContactAddress::AddressType nType) -{ - return address.SaveAddress(*this, nType); -} - -// Sets the PR_POSTAL_ADDRESS text and checks the appropriate outlook checkbox by setting the index -BOOL CMAPIContact::SetPostalAddress(CContactAddress::AddressType nType) -{ -#ifdef _WIN32_WCE - return FALSE; -#else - CContactAddress address; - if(!GetAddress(address, nType)) return FALSE; - - CString strPostalAddress; - strPostalAddress.Format(_T("%s\r\n%s %s %s\r\n%s"),address.m_strStreet,address.m_strCity,address.m_strStateOrProvince,address.m_strPostalCode,address.m_strCountry); - if(!SetPropertyString(PR_POSTAL_ADDRESS, strPostalAddress)) return FALSE; - - return SetOutlookProperty(OUTLOOK_DATA1, OUTLOOK_POSTAL_ADDRESS, (int)nType+1); -#endif -} - -// updates the outlook display address; call this after changing address fields -BOOL CMAPIContact::UpdateDisplayAddress(CContactAddress::AddressType nType) -{ -#ifdef _WIN32_WCE - return FALSE; -#else - CContactAddress address; - if(!GetAddress(address, nType)) return FALSE; - - CString strDisplayAddress; - strDisplayAddress.Format(_T("%s\r\n%s %s %s\r\n%s"),address.m_strStreet,address.m_strCity,address.m_strStateOrProvince,address.m_strPostalCode,address.m_strCountry); - - ULONG ulProperty=OUTLOOK_DISPLAY_ADDRESS_HOME+(int)nType; - return SetOutlookProperty(OUTLOOK_DATA1,ulProperty, strDisplayAddress); -#endif -} - -BOOL CMAPIContact::SetNotes(LPCTSTR szNotes, BOOL bRTF) -{ -#ifdef _WIN32_WCE - return SetPropertyString(PR_BODY, szNotes); -#else - if(!Contact() || !szNotes) return FALSE; - ULONG nLen=(ULONG)_tcslen(szNotes); - - HRESULT hr=E_FAIL; - LPSTREAM pStream=NULL; - if(bRTF) - { - if(Contact()->OpenProperty(PR_RTF_COMPRESSED, &IID_IStream, STGM_CREATE | STGM_WRITE, MAPI_MODIFY | MAPI_CREATE, (LPUNKNOWN*)&pStream)==S_OK) - { - IStream *pUncompressed; - if(WrapCompressedRTFStream(pStream,MAPI_MODIFY, &pUncompressed)==S_OK) - { - hr=pUncompressed->Write(szNotes, nLen*sizeof(TCHAR), NULL); - if(pUncompressed->Commit(STGC_DEFAULT)==S_OK) pStream->Commit(STGC_DEFAULT); - RELEASE(pUncompressed); - } - } - } - else - { - if(Contact()->OpenProperty(PR_BODY, &IID_IStream, 0, MAPI_MODIFY | MAPI_CREATE, (LPUNKNOWN*)&pStream)==S_OK) - { - hr=pStream->Write(szNotes, (nLen+1)*sizeof(TCHAR), NULL); - } - } - RELEASE(pStream); - return (hr==S_OK); -#endif -} - -BOOL CMAPIContact::SetIMAddress(LPCTSTR szIMAddress) -{ -#ifndef _WIN32_WCE - return SetOutlookProperty(OUTLOOK_DATA1, OUTLOOK_IM_ADDRESS, szIMAddress); -#else - return FALSE; -#endif -} - -BOOL CMAPIContact::SetFileAs(LPCTSTR szFileAs) -{ -#ifdef _WIN32_WCE - return SetPropertyString(PR_DISPLAY_NAME, szFileAs); -#else - return SetOutlookProperty(OUTLOOK_DATA1, OUTLOOK_FILE_AS, szFileAs); -#endif -} - -BOOL CMAPIContact::SetTitle(LPCTSTR szTitle) -{ - return SetPropertyString(PR_TITLE, szTitle); -} - -BOOL CMAPIContact::SetCompany(LPCTSTR szCompany) -{ - return SetPropertyString(PR_COMPANY_NAME, szCompany); -} - -BOOL CMAPIContact::SetProfession(LPCTSTR szProfession) -{ - return SetPropertyString(PR_PROFESSION, szProfession); -} - -BOOL CMAPIContact::SetDisplayNamePrefix(LPCTSTR szPrefix) -{ - return SetPropertyString(PR_DISPLAY_NAME_PREFIX, szPrefix); -} - -BOOL CMAPIContact::SetGeneration(LPCTSTR szGeneration) -{ - return SetPropertyString(PR_GENERATION, szGeneration); -} - -// After changing any name field you should call this to update PR_INITIALS and PR_DISPLAY_NAME -BOOL CMAPIContact::UpdateDisplayName() -{ - CString strPrefix, strFirst, strMiddle, strLast, strGeneration, strFullName, strFileAs, strInitials; - if(GetDisplayNamePrefix(strPrefix) && strPrefix.GetLength()) - { - strFullName=strPrefix; - strFullName+=(TCHAR)' '; - } - if(GetName(strFirst, PR_GIVEN_NAME) && strFirst.GetLength()) - { - strFileAs+=strFirst; - strInitials+=strFirst.GetAt(0); - strInitials+=(TCHAR)'.'; - } - if(GetName(strMiddle, PR_MIDDLE_NAME) && strMiddle.GetLength()) - { - if(strFileAs.GetLength()) strFileAs+=(TCHAR)' '; - strFileAs+=strMiddle; - strInitials+=(TCHAR)strMiddle.GetAt(0); - strInitials+=(TCHAR)'.'; - - int i=1, nLen=strMiddle.GetLength(); - while(iSetDate(m_pContact, PR_BIRTHDAY,tmBirthday) : FALSE; -#else - SPropValue prop; - prop.ulPropTag=PR_BIRTHDAY; - SystemTimeToFileTime(&tmBirthday, &prop.Value.ft); - return (Contact()->SetProps(1, &prop, NULL)==S_OK); -#endif -} - -BOOL CMAPIContact::SetAnniversary(SYSTEMTIME& tmAnniversary) -{ -#ifdef _WIN32_WCE - return m_pPOOM ? m_pPOOM->SetDate(m_pContact, PR_WEDDING_ANNIVERSARY,tmAnniversary) : FALSE; -#else - SPropValue prop; - prop.ulPropTag=PR_WEDDING_ANNIVERSARY; - SystemTimeToFileTime(&tmAnniversary, &prop.Value.ft); - return (Contact()->SetProps(1, &prop, NULL)==S_OK); -#endif -} - -// Categories are stored under the multi-value named property CATEGORIES_PROPERTY -// Pass in a string of semicolon separated category names -BOOL CMAPIContact::SetCategories(LPCTSTR szCategories) -{ -#ifdef _WIN32_WCE - return SetPropertyString(OUTLOOK_CATEGORIES, szCategories); -#else - CString strCategories=szCategories; - int nCount=0, nIndex=0; - CString strCategory=strCategories.Tokenize(_T(";"), nIndex); - while(strCategory.GetLength()) - { - nCount++; - strCategory=strCategories.Tokenize(_T(";"), nIndex); - } - - HRESULT hr=E_FAIL; - if(!nCount) - { - if(DeleteNamedProperty(CATEGORIES_PROPERTY)) return TRUE; - } - else - { - LPTSTR* arCategories=new LPTSTR[nCount]; - - nCount=0; - nIndex=0; - int nLen=0; - strCategory=strCategories.Tokenize(_T(";"), nIndex); - do { - nLen=strCategory.GetLength(); - if(nLen>0) - { - arCategories[nCount]=new TCHAR[nLen+1]; - memcpy(arCategories[nCount], (LPCTSTR)strCategory, nLen*sizeof(TCHAR)); - arCategories[nCount++][nLen]=(TCHAR)0; - strCategory=strCategories.Tokenize(_T(";"), nIndex); - } - } while(nLen); - - LPSPropValue pProp; - if(SetNamedMVProperty(CATEGORIES_PROPERTY, (LPCTSTR*)arCategories, nCount, pProp)) - { - hr=Contact()->SetProps(1, pProp, NULL); - MAPIFreeBuffer(pProp); - } - - for(nIndex=0;nIndex0 && !DeleteAttachment()) return FALSE; - - BOOL bPicture=FALSE; - if(szPath!=NULL) bPicture=AddAttachment(szPath, CONTACT_PICTURE, CONTACT_PICTURE); - SetOutlookProperty(CMAPIContact::OUTLOOK_DATA1, CMAPIContact::OUTLOOK_PICTURE_FLAG, bPicture, PT_BOOLEAN); - if(szPath==NULL) return TRUE; - return bPicture; -#endif -} diff --git a/bazaar/MAPIEx/plugin/MAPIContact.h b/bazaar/MAPIEx/plugin/MAPIContact.h deleted file mode 100644 index e846170c7..000000000 --- a/bazaar/MAPIEx/plugin/MAPIContact.h +++ /dev/null @@ -1,149 +0,0 @@ -#ifndef __MAPICONTACT_H__ -#define __MAPICONTACT_H__ - -//////////////////////////////////////////////////////////////////////////////////////////////////////////// -// -// File: MAPIContact.h -// Description: MAPI Contact class wrapper -// -// Copyright (C) 2005-2011, Noel Dillabough -// -// This source code is free to use and modify provided this notice remains intact and that any enhancements -// or bug fixes are posted to the CodeProject page hosting this class for the community to benefit. -// -// Usage: see the CodeProject article at http://www.codeproject.com/internet/CMapiEx.asp -// -//////////////////////////////////////////////////////////////////////////////////////////////////////////// - -class CMAPIEx; -class CMAPIContact; - -#ifdef _WIN32_WCE -#include "POOM.h" -#endif - -///////////////////////////////////////////////////////////// -// CContactAddress - -class AFX_EXT_CLASS CContactAddress : public CObject -{ -public: - CContactAddress(); - - enum AddressType { HOME, BUSINESS, OTHER, MAX_ADDRESS_TYPES }; - -// Attributes -public: - AddressType m_nType; - CString m_strStreet; - CString m_strCity; - CString m_strStateOrProvince; - CString m_strPostalCode; - CString m_strCountry; - -// Operations -protected: - BOOL FillAddress(CMAPIContact& contact,AddressType nType); - BOOL SaveAddress(CMAPIContact& contact,AddressType nType); - - friend CMAPIContact; -}; - -///////////////////////////////////////////////////////////// -// CMAPIContact - -#define CONTACT_PICTURE _T("ContactPicture.jpg") - -class AFX_EXT_CLASS CMAPIContact : public CMAPIObject -{ -public: - CMAPIContact(); - ~CMAPIContact(); - - enum { OUTLOOK_DATA1=0x00062004, OUTLOOK_EMAIL1=0x8083, OUTLOOK_EMAIL2=0x8093, OUTLOOK_EMAIL3=0x80A3, - OUTLOOK_IM_ADDRESS=0x8062, OUTLOOK_FILE_AS=0x8005, OUTLOOK_POSTAL_ADDRESS=0x8022, OUTLOOK_DISPLAY_ADDRESS_HOME=0x801A, - OUTLOOK_PICTURE_FLAG=0x8015, OUTLOOK_CATEGORIES=0xF101E - }; - -// Attributes -protected: -#ifdef _WIN32_WCE - CPOOM* m_pPOOM; - IContact* m_pContact; -#endif - -// Operations -public: - inline LPMAILUSER Contact() { return (LPMAILUSER)m_pItem; } - -#ifdef _WIN32_WCE - BOOL Open(CMAPIEx* pMAPI, CPOOM* pPOOM, IContact* pContact); - virtual void Close(); - virtual BOOL Save(BOOL bClose=TRUE); - - virtual BOOL GetPropertyString(ULONG ulProperty, CString& strProperty, BOOL bStream=FALSE); - virtual BOOL SetPropertyString(ULONG ulProperty, LPCTSTR szProperty, BOOL bStream=FALSE); -#endif - - BOOL Create(CMAPIEx* pMAPI, CMAPIFolder* pFolder=NULL); - - BOOL GetName(CString& strName, ULONG ulNameID=PR_DISPLAY_NAME); - BOOL GetEmail(CString& strEmail, int nIndex=1); // 1, 2 or 3 for outlook email addresses - BOOL GetEmailDisplayAs(CString& strDisplayAs, int nIndex=1); - BOOL GetHomePage(CString& strHomePage, BOOL bBuiness=TRUE); - BOOL GetPhoneNumber(CString& strPhoneNumber, ULONG ulPhoneNumberID); - BOOL GetAddress(CContactAddress& address, CContactAddress::AddressType nType); - BOOL GetPostalAddress(CString& strAddress); - BOOL GetIMAddress(CString& strIMAddress); - BOOL GetFileAs(CString& strFileAs); - BOOL GetTitle(CString& strTitle); - BOOL GetCompany(CString& strCompany); - BOOL GetProfession(CString& strProfession); - BOOL GetDisplayNamePrefix(CString& strPrefix); - BOOL GetGeneration(CString& strGeneration); - BOOL GetDepartment(CString& strDepartment); - BOOL GetOffice(CString& strOffice); - BOOL GetManagerName(CString& strManagerName); - BOOL GetAssistantName(CString& strAssistantName); - BOOL GetNickName(CString& strNickName); - BOOL GetSpouseName(CString& strSpouseName); - BOOL GetBirthday(SYSTEMTIME& tmBirthday); - BOOL GetBirthday(CString& strBirthday, LPCTSTR szFormat=NULL); // NULL defaults to "MM/dd/yyyy" - BOOL GetAnniversary(SYSTEMTIME& tmAnniversary); - BOOL GetAnniversary(CString& strAnniversary, LPCTSTR szFormat=NULL); - BOOL GetCategories(CString& strCategories); - - BOOL SetName(LPCTSTR szName, ULONG ulNameID=PR_DISPLAY_NAME); - BOOL SetEmail(LPCTSTR szEmail, int nIndex=1); - BOOL SetEmailDisplayAs(LPCTSTR szDisplayAs, int nIndex=1); - BOOL SetHomePage(LPCTSTR szHomePage, BOOL bBuiness=TRUE); - BOOL SetPhoneNumber(LPCTSTR szPhoneNumber, ULONG ulPhoneNumberID); - BOOL SetAddress(CContactAddress& address, CContactAddress::AddressType nType); - BOOL SetPostalAddress(CContactAddress::AddressType nType); - BOOL UpdateDisplayAddress(CContactAddress::AddressType nType); - BOOL SetNotes(LPCTSTR szNotes, BOOL bRTF=FALSE); - BOOL SetIMAddress(LPCTSTR szIMAddress); - BOOL SetFileAs(LPCTSTR szFileAs); - BOOL SetTitle(LPCTSTR szTitle); - BOOL SetCompany(LPCTSTR szCompany); - BOOL SetProfession(LPCTSTR szProfession); - BOOL SetDisplayNamePrefix(LPCTSTR szPrefix); - BOOL SetGeneration(LPCTSTR szGeneration); - BOOL UpdateDisplayName(); - BOOL SetDepartment(LPCTSTR szDepartment); - BOOL SetOffice(LPCTSTR szOffice); - BOOL SetManagerName(LPCTSTR szManagerName); - BOOL SetAssistantName(LPCTSTR szAssistantName); - BOOL SetNickName(LPCTSTR szNickName); - BOOL SetSpouseName(LPCTSTR szSpouseName); - BOOL SetBirthday(SYSTEMTIME& tmBirthday); - BOOL SetAnniversary(SYSTEMTIME& tmAnniversary); - BOOL SetCategories(LPCTSTR szCategories); - BOOL HasPicture(); - BOOL SetPicture(LPCTSTR szPath); - -protected: - int GetOutlookEmailID(int nIndex); -}; - -#endif diff --git a/bazaar/MAPIEx/plugin/MAPIEx.cpp b/bazaar/MAPIEx/plugin/MAPIEx.cpp deleted file mode 100644 index 0a919c2dd..000000000 --- a/bazaar/MAPIEx/plugin/MAPIEx.cpp +++ /dev/null @@ -1,808 +0,0 @@ -//////////////////////////////////////////////////////////////////////////////////////////////////////////// -// -// File: MAPIEx.cpp -// Description: Windows Extended MAPI class -// -// Copyright (C) 2005-2011, Noel Dillabough -// -// This source code is free to use and modify provided this notice remains intact and that any enhancements -// or bug fixes are posted to the CodeProject page hosting this class for the community to benefit. -// -// Usage: see the CodeProject article at http://www.codeproject.com/internet/CMapiEx.asp -// -//////////////////////////////////////////////////////////////////////////////////////////////////////////// - -#include "MAPIExPCH.h" -#include "MAPIEx.h" -#include "MAPISink.h" - -#ifdef _WIN32_WCE -#include -#pragma comment(lib,"cemapi.lib") -#pragma comment(lib,"pimstore.lib") - -#else -#pragma comment (lib,"mapi32.lib") -#endif -#pragma comment(lib,"Ole32.lib") - -void WINAPI FreeProws(LPSRowSet pRows) -{ - if(pRows) - { - for(ULONG i=0;icRows;i++) - { - MAPIFreeBuffer(pRows->aRow[i].lpProps); - } - MAPIFreeBuffer(pRows); - } -} - -///////////////////////////////////////////////////////////// -// CMAPIEx - -int CMAPIEx::cm_bComInit=FALSE; - -#ifdef UNICODE -int CMAPIEx::cm_nMAPICode=MAPI_UNICODE; -#else -int CMAPIEx::cm_nMAPICode=0; -#endif - -CMAPIEx::CMAPIEx() -{ - m_pSession=NULL; - m_pMsgStore=NULL; - m_pFolder=NULL; - m_sink=0; -} - -CMAPIEx::~CMAPIEx() -{ - Logout(); -} - -// dwFlags set to defaults but added as a param here for special cases. -BOOL CMAPIEx::Init(DWORD dwFlags, BOOL bInitAsService) -{ - if(CoInitializeEx(NULL, COINIT_MULTITHREADED)==S_OK) cm_bComInit=TRUE; -#ifdef _WIN32_WCE - // flags are ignored on Windows CE - if(MAPIInitialize(NULL)!=S_OK) return FALSE; - CPOOM::Init(); -#else - if(!dwFlags) dwFlags=MAPI_NO_COINIT | MAPI_MULTITHREAD_NOTIFICATIONS; - if(bInitAsService) dwFlags|=MAPI_NT_SERVICE; - - MAPIINIT_0 MAPIInit={ MAPI_INIT_VERSION, dwFlags }; - if(MAPIInitialize(&MAPIInit)!=S_OK) return FALSE; -#endif - return TRUE; -} - -void CMAPIEx::Term() -{ - MAPIUninitialize(); -#ifdef _WIN32_WCE - CPOOM::Term(); -#endif - if(cm_bComInit) CoUninitialize(); -} - -// dwFlags set to defaults but added as a param here for special cases (ie MAPI_NO_MAIL) -BOOL CMAPIEx::Login(LPCTSTR szProfileName, DWORD dwFlags, BOOL bInitAsService) -{ - if(!dwFlags) dwFlags=MAPI_EXTENDED | MAPI_USE_DEFAULT | MAPI_NEW_SESSION; - if(bInitAsService) dwFlags|=MAPI_EXPLICIT_PROFILE | MAPI_NT_SERVICE; - return (MAPILogonEx(NULL, (LPTSTR)szProfileName, NULL, dwFlags, &m_pSession)==S_OK); -} - -void CMAPIEx::Logout() -{ - if(m_sink) - { - if(m_pMsgStore) m_pMsgStore->Unadvise(m_sink); - m_sink=0; - } - - delete m_pFolder; - m_pFolder=NULL; - RELEASE(m_pMsgStore); - RELEASE(m_pSession); -} - -BOOL CMAPIEx::CreateProfile(LPCTSTR szProfileName) -{ - LPPROFADMIN lpProfAdmin=NULL; - if(MAPIAdminProfiles(0, &lpProfAdmin)!=S_OK) return FALSE; - HRESULT hr=lpProfAdmin->CreateProfile((LPTSTR)szProfileName, NULL, 0, 0); - RELEASE(lpProfAdmin); - return (hr==S_OK); -} - -BOOL CMAPIEx::DeleteProfile(LPCTSTR szProfileName) -{ - LPPROFADMIN lpProfAdmin=NULL; - if(MAPIAdminProfiles(0, &lpProfAdmin)!=S_OK) return FALSE; - HRESULT hr=lpProfAdmin->DeleteProfile((LPTSTR)szProfileName, 0); - RELEASE(lpProfAdmin); - return (hr==S_OK); -} - -BOOL CMAPIEx::CreateMessageService(LPCTSTR szProfileName, LPCTSTR szService, LPCTSTR szDisplayName) -{ - BOOL bResult=FALSE; - LPPROFADMIN lpProfAdmin=NULL; - if(MAPIAdminProfiles(0, &lpProfAdmin)==S_OK) - { - LPSERVICEADMIN lpMsgServiceAdmin=NULL; - if(lpProfAdmin->AdminServices((LPTSTR)szProfileName, NULL, NULL, MAPI_DIALOG, &lpMsgServiceAdmin) == S_OK) - { - bResult=(lpMsgServiceAdmin->CreateMsgService((LPTSTR)szService, (LPTSTR)szDisplayName, NULL, SERVICE_UI_ALWAYS | SERVICE_UI_ALLOWED)==S_OK); - RELEASE(lpMsgServiceAdmin); - } - RELEASE(lpProfAdmin); - } - return bResult; -} - -// Sets (replaces) the internal folder, will be deleted when this goes out of scope -void CMAPIEx::SetFolder(CMAPIFolder* pFolder) -{ - delete m_pFolder; - m_pFolder=pFolder; -} - -// if I try to use MAPI_UNICODE when UNICODE is defined I get the MAPI_E_BAD_CHARWIDTH -// error so I force narrow strings here -BOOL CMAPIEx::GetProfileName(CString& strProfileName) -{ - BOOL bResult=FALSE; -#ifndef _WIN32_WCE - if(!m_pSession) return FALSE; - - LPSRowSet pRows=NULL; - const int nProperties=2; - SizedSPropTagArray(nProperties, Columns)={nProperties,{PR_DISPLAY_NAME_A, PR_RESOURCE_TYPE}}; - - IMAPITable* pStatusTable; - if(m_pSession->GetStatusTable(0, &pStatusTable)==S_OK) - { - if(pStatusTable->SetColumns((LPSPropTagArray)&Columns, 0)==S_OK) - { - while(pStatusTable->QueryRows(1, 0, &pRows)==S_OK) - { - if(pRows->cRows!=1) FreeProws(pRows); - else if(pRows->aRow[0].lpProps[1].Value.ul==MAPI_SUBSYSTEM) - { - strProfileName=(LPSTR)GetValidString(pRows->aRow[0].lpProps[0]); - FreeProws(pRows); - bResult=TRUE; - } - else - { - FreeProws(pRows); - continue; - } - break; - } - } - RELEASE(pStatusTable); - } -#endif - return bResult; -} - -BOOL CMAPIEx::GetProfileEmail(CString& strProfileEmail) -{ -#ifndef _WIN32_WCE - if(!m_pSession) return NULL; - - SBinary entryID; - if(m_pSession->QueryIdentity(&entryID.cb, (LPENTRYID*)&entryID.lpb)==S_OK) - { - return GetExEmail(entryID, strProfileEmail); - } -#endif - return FALSE; -} - -int CMAPIEx::GetMessageStoreCount() -{ - IMAPITable* pMsgStoresTable; - if(m_pSession && m_pSession->GetMsgStoresTable(0, &pMsgStoresTable)==S_OK) - { - ULONG ulCount; - HRESULT hr=pMsgStoresTable->GetRowCount(0, &ulCount); - RELEASE(pMsgStoresTable); - if(hr==S_OK) return ulCount; - } - return -1; -} - -BOOL CMAPIEx::GetMessageStoreProperties(int nIndex, CString& strName, BOOL& bDefaultStore) -{ - BOOL bResult=FALSE; - IMAPITable* pMsgStoresTable; - if(m_pSession && m_pSession->GetMsgStoresTable(0, &pMsgStoresTable)==S_OK) - { - LPSRowSet pRows=NULL; - const int nProperties=3; - SizedSPropTagArray(nProperties, Columns)={nProperties,{PR_DISPLAY_NAME, PR_ENTRYID, PR_DEFAULT_STORE}}; - - if(pMsgStoresTable->SetColumns((LPSPropTagArray)&Columns, 0)==S_OK) - { - if(pMsgStoresTable->SeekRow(BOOKMARK_BEGINNING, nIndex, NULL)==S_OK) - { - if(pMsgStoresTable->QueryRows(1, 0, &pRows)==S_OK) - { - if(pRows->cRows>0) - { - strName=GetValidString(pRows->aRow[0].lpProps[0]); - bDefaultStore=pRows->aRow[0].lpProps[2].Value.b; - bResult=TRUE; - } - FreeProws(pRows); - } - } - } - RELEASE(pMsgStoresTable); - } - return bResult; -} - -BOOL CMAPIEx::OpenMessageStore(int nIndex, ULONG ulFlags) -{ - BOOL bResult=FALSE; - IMAPITable* pMsgStoresTable; - if(m_pSession && m_pSession->GetMsgStoresTable(0, &pMsgStoresTable)==S_OK) - { - LPSRowSet pRows=NULL; - const int nProperties=3; - SizedSPropTagArray(nProperties, Columns)={nProperties,{PR_DISPLAY_NAME, PR_ENTRYID, PR_DEFAULT_STORE}}; - - if(pMsgStoresTable->SetColumns((LPSPropTagArray)&Columns, 0)==S_OK) - { - if(pMsgStoresTable->SeekRow(BOOKMARK_BEGINNING, nIndex, NULL)==S_OK) - { - if(pMsgStoresTable->QueryRows(1, 0, &pRows)==S_OK) - { - if(pRows->cRows>0) - { - m_ulMDBFlags=ulFlags; - RELEASE(m_pMsgStore); - bResult=(m_pSession->OpenMsgStore(NULL, pRows->aRow[0].lpProps[1].Value.bin.cb, (ENTRYID*)pRows->aRow[0].lpProps[1].Value.bin.lpb, NULL,MDB_NO_DIALOG | MAPI_BEST_ACCESS, &m_pMsgStore)==S_OK); - } - FreeProws(pRows); - } - } - } - RELEASE(pMsgStoresTable); - } - return bResult; -} - -// do not set MAPI_NO_CACHE flag for Outlook 97 and 2000 -BOOL CMAPIEx::OpenMessageStore(LPCTSTR szStore, ULONG ulFlags) -{ - BOOL bResult=FALSE; - IMAPITable* pMsgStoresTable; - if(m_pSession && m_pSession->GetMsgStoresTable(0, &pMsgStoresTable)==S_OK) - { - LPSRowSet pRows=NULL; - const int nProperties=3; - SizedSPropTagArray(nProperties, Columns)={nProperties,{PR_DISPLAY_NAME, PR_ENTRYID, PR_DEFAULT_STORE}}; - - if(pMsgStoresTable->SetColumns((LPSPropTagArray)&Columns, 0)==S_OK) - { - while(pMsgStoresTable->QueryRows(1, 0, &pRows)==S_OK) - { - if(pRows->cRows!=1) FreeProws(pRows); - else { - if(!szStore) - { - if(pRows->aRow[0].lpProps[2].Value.b) bResult=TRUE; - } - else - { - CString strStore=GetValidString(pRows->aRow[0].lpProps[0]); - if(strStore.Find(szStore)!=-1) bResult=TRUE; - } - if(!bResult) - { - FreeProws(pRows); - continue; - } - } - break; - } - if(bResult) - { - m_ulMDBFlags=ulFlags; - RELEASE(m_pMsgStore); - bResult=(m_pSession->OpenMsgStore(NULL, pRows->aRow[0].lpProps[1].Value.bin.cb, (ENTRYID*)pRows->aRow[0].lpProps[1].Value.bin.lpb, NULL,MDB_NO_DIALOG | MAPI_BEST_ACCESS, &m_pMsgStore)==S_OK); - FreeProws(pRows); - } - } - RELEASE(pMsgStoresTable); - } - return bResult; -} - -ULONG CMAPIEx::GetMessageStoreSupport() -{ - if(!m_pMsgStore) return FALSE; - - LPSPropValue props=NULL; - ULONG cValues=0; - ULONG rgTags[]={ 1, PR_STORE_SUPPORT_MASK }; - ULONG ulSupport=0; - - if(m_pMsgStore->GetProps((LPSPropTagArray) rgTags, CMAPIEx::cm_nMAPICode, &cValues, &props)==S_OK) - { - ulSupport=props->Value.ul; - MAPIFreeBuffer(props); - } - return ulSupport; -} - -#ifdef _WIN32_WCE -CPOOM* CMAPIEx::GetPOOM() -{ - return m_pFolder ? m_pFolder->GetPOOM() : NULL; -} -#endif - -CMAPIFolder* CMAPIEx::OpenFolder(unsigned long ulFolderID, BOOL bInternal) -{ - if(!m_pMsgStore) return NULL; - - LPSPropValue props=NULL; - ULONG cValues=0; - DWORD dwObjType; - ULONG rgTags[]={ 1, ulFolderID }; - LPMAPIFOLDER pFolder; - - if(m_pMsgStore->GetProps((LPSPropTagArray) rgTags, cm_nMAPICode, &cValues, &props)!=S_OK) return NULL; - if(m_pMsgStore->OpenEntry(props[0].Value.bin.cb, (LPENTRYID)props[0].Value.bin.lpb, NULL, m_ulMDBFlags, &dwObjType, (LPUNKNOWN*)&pFolder)!=S_OK) return NULL; - MAPIFreeBuffer(props); - - if(pFolder) - { - CMAPIFolder* pMAPIFolder=new CMAPIFolder(this, pFolder); - if(bInternal) - { - delete m_pFolder; - m_pFolder=pMAPIFolder; - } - return pMAPIFolder; - } - return NULL; -} - -CMAPIFolder* CMAPIEx::OpenFolder(LPCTSTR szFolderName, BOOL bInternal) -{ - CMAPIFolder* pRoot=OpenRootFolder(FALSE); - CMAPIFolder* pFolder=NULL; - if(pRoot) - { - pFolder=pRoot->OpenSubFolder(szFolderName); - if(bInternal) - { - delete m_pFolder; - m_pFolder=pFolder; - } - delete pRoot; - } - return pFolder; -} - -CMAPIFolder* CMAPIEx::OpenSpecialFolder(unsigned long ulFolderID, BOOL bInternal) -{ -#ifdef _WIN32_WCE - CMAPIFolder* pFolder=new CMAPIFolder(this, NULL); - if(pFolder->GetPOOM()->OpenFolder(ulFolderID, bInternal)!=NULL) - { - if(bInternal) - { - delete m_pFolder; - m_pFolder=pFolder; - } - return pFolder; - } - return NULL; -#else - CMAPIFolder* pInbox=OpenInbox(FALSE); - if(!pInbox || !m_pMsgStore) return FALSE; - - LPSPropValue props=NULL; - ULONG cValues=0; - DWORD dwObjType; - ULONG rgTags[]={ 1, ulFolderID }; - LPMAPIFOLDER pFolder; - - if(pInbox->Folder()->GetProps((LPSPropTagArray) rgTags, cm_nMAPICode, &cValues, &props)!=S_OK) return NULL; - HRESULT hr=m_pMsgStore->OpenEntry(props[0].Value.bin.cb, (LPENTRYID)props[0].Value.bin.lpb, NULL, m_ulMDBFlags, &dwObjType, (LPUNKNOWN*)&pFolder); - MAPIFreeBuffer(props); - delete pInbox; - if(hr!=S_OK) return NULL; - - if(pFolder) - { - CMAPIFolder* pMAPIFolder=new CMAPIFolder(this, pFolder); - if(bInternal) - { - delete m_pFolder; - m_pFolder=pMAPIFolder; - } - return pMAPIFolder; - } - return NULL; -#endif -} - -CMAPIFolder* CMAPIEx::OpenRootFolder(BOOL bInternal) -{ - return OpenFolder(PR_IPM_SUBTREE_ENTRYID, bInternal); -} - -CMAPIFolder* CMAPIEx::OpenInbox(BOOL bInternal) -{ -#ifdef _WIN32_WCE - return OpenFolder(PR_CE_IPM_INBOX_ENTRYID, bInternal); -#else - if(!m_pMsgStore) return NULL; - - ULONG cbEntryID; - LPENTRYID pEntryID; - DWORD dwObjType; - LPMAPIFOLDER pFolder; - - if(m_pMsgStore->GetReceiveFolder(NULL, 0, &cbEntryID, &pEntryID, NULL)!=S_OK) return NULL; - HRESULT hr=m_pMsgStore->OpenEntry(cbEntryID, pEntryID, NULL, m_ulMDBFlags, &dwObjType, (LPUNKNOWN*)&pFolder); - MAPIFreeBuffer(pEntryID); - - if(hr==S_OK && pFolder) - { - CMAPIFolder* pMAPIFolder=new CMAPIFolder(this, pFolder); - if(bInternal) - { - delete m_pFolder; - m_pFolder=pMAPIFolder; - } - return pMAPIFolder; - } - return NULL; -#endif -} - -CMAPIFolder* CMAPIEx::OpenOutbox(BOOL bInternal) -{ - return OpenFolder(PR_IPM_OUTBOX_ENTRYID, bInternal); -} - -CMAPIFolder* CMAPIEx::OpenSentItems(BOOL bInternal) -{ - return OpenFolder(PR_IPM_SENTMAIL_ENTRYID, bInternal); -} - -CMAPIFolder* CMAPIEx::OpenDeletedItems(BOOL bInternal) -{ - return OpenFolder(PR_IPM_WASTEBASKET_ENTRYID, bInternal); -} - -CMAPIFolder* CMAPIEx::OpenContacts(BOOL bInternal) -{ - return OpenSpecialFolder(PR_IPM_CONTACT_ENTRYID, bInternal); -} - -CMAPIFolder* CMAPIEx::OpenDrafts(BOOL bInternal) -{ -#ifdef _WIN32_WCE - return OpenFolder(PR_CE_IPM_DRAFTS_ENTRYID, bInternal); -#else - return OpenSpecialFolder(PR_IPM_DRAFTS_ENTRYID, bInternal); -#endif -} - -CMAPIFolder* CMAPIEx::OpenCalendar(BOOL bInternal) -{ - return OpenSpecialFolder(PR_IPM_APPOINTMENT_ENTRYID, bInternal); -} - -CMAPIFolder* CMAPIEx::OpenJunkFolder(BOOL bInternal) -{ - return OpenFolder(_T("Junk E-mail"), bInternal); -} - -LPMAPITABLE CMAPIEx::GetHierarchy() -{ - return m_pFolder ? m_pFolder->GetHierarchy() : NULL; -} - -LPMAPITABLE CMAPIEx::GetContents() -{ - return m_pFolder ? m_pFolder->GetContents() : NULL; -} - -int CMAPIEx::GetRowCount() -{ - return m_pFolder ? m_pFolder->GetRowCount() : 0; -} - -BOOL CMAPIEx::SortContents(ULONG ulSortParam, ULONG ulSortField) -{ - return m_pFolder ? m_pFolder->SortContents(ulSortParam,ulSortField) : FALSE; -} - -BOOL CMAPIEx::SetUnreadOnly(BOOL bUnreadOnly) -{ - return m_pFolder ? m_pFolder->SetUnreadOnly(bUnreadOnly) : FALSE; -} - -BOOL CMAPIEx::SetRestriction(SRestriction* pRestriction) -{ - return m_pFolder ? m_pFolder->SetRestriction(pRestriction) : FALSE; -} - -BOOL CMAPIEx::GetNextMessage(CMAPIMessage& message) -{ - return m_pFolder ? m_pFolder->GetNextMessage(message) : FALSE; -} - -BOOL CMAPIEx::GetNextContact(CMAPIContact& contact) -{ - return m_pFolder ? m_pFolder->GetNextContact(contact) : FALSE; -} - -BOOL CMAPIEx::GetNextAppointment(CMAPIAppointment& appointment) -{ - return m_pFolder ? m_pFolder->GetNextAppointment(appointment) : FALSE; -} - -BOOL CMAPIEx::GetNextSubFolder(CMAPIFolder& folder, CString& strFolder) -{ - return m_pFolder ? m_pFolder->GetNextSubFolder(folder, strFolder) : FALSE; -} - -// call with ulEventMask set to ALL notifications ORed together, only one Advise Sink is used. -BOOL CMAPIEx::Notify(LPNOTIFCALLBACK lpfnCallback, LPVOID lpvContext, ULONG ulEventMask) -{ - if(GetMessageStoreSupport()&STORE_NOTIFY_OK) - { - if(m_sink) m_pMsgStore->Unadvise(m_sink); - CMAPISink* pAdviseSink=new CMAPISink(lpfnCallback, lpvContext); - if(m_pMsgStore->Advise(0, NULL,ulEventMask, pAdviseSink, &m_sink)==S_OK) return TRUE; - delete pAdviseSink; - m_sink=0; - } - return FALSE; -} - -// pumps the message queue, use this when waiting for notifications -void CMAPIEx::PumpMessages() -{ - MSG msg; - while(PeekMessage(&msg, NULL, 0, 0, PM_REMOVE)) - { - TranslateMessage(&msg); - DispatchMessage(&msg); - } -} - -// sometimes the string in prop is invalid, causing unexpected crashes -#ifndef _WIN32_WCE -LPCTSTR CMAPIEx::ValidateString(LPCTSTR s) -{ - if(s && !::IsBadStringPtr(s, (UINT_PTR)-1)) return s; - return NULL; -} -#else -// Windows Mobile does not have IsBadStringPtr so I use SEH -// I shut off optimization because the optimizer still had trouble with the try/catch -#pragma optimize("",off) -LPCTSTR CMAPIEx::ValidateString(LPCTSTR s) -{ - try - { - if(s) - { - TCHAR ch=*s; - return s; - } - } - catch(...) - { - } - return NULL; -} -#pragma optimize("",on) -#endif - -LPCTSTR CMAPIEx::GetValidString(SPropValue& prop) -{ - return ValidateString(prop.Value.LPSZ); -} - -// sometimes the string in prop is invalid, causing unexpected crashes -LPCTSTR CMAPIEx::GetValidMVString(SPropValue& prop, int nIndex) -{ - return ValidateString(prop.Value.MVSZ.LPPSZ[nIndex]); -} - -// special case of GetValidString to take the narrow string in UNICODE -void CMAPIEx::GetNarrowString(SPropValue& prop, CString& strNarrow) -{ - LPCTSTR s=GetValidString(prop); - if(!s) strNarrow=_T(""); - else { -#ifdef UNICODE - // VS2005 can copy directly - if(_MSC_VER>=1400) - { - strNarrow=(LPCSTR)s; - } - else - { - WCHAR wszWide[256]; - MultiByteToWideChar(CP_ACP, 0, (LPCSTR)s, -1, wszWide, 255); - strNarrow=wszWide; - } -#else - strNarrow=s; -#endif - } -} - -// Shows the default Address Book dialog, return FALSE on failure, IDOK or IDCANCEL on success -// I force narrow strings here because it for some reason doesn't work in UNICODE -int CMAPIEx::ShowAddressBook(LPADRLIST& pAddressList, LPCTSTR szCaption) -{ -#ifndef _WIN32_WCE - if(!m_pSession) return FALSE; - - LPADRBOOK pAddressBook; - if(m_pSession->OpenAddressBook(0, NULL, 0, &pAddressBook)==S_OK) - { - pAddressList=NULL; - - char* lppszDestTitles[]={ "To" }; - ULONG lpulDestComps[]={ MAPI_TO }; - - ADRPARM adrparm; - memset(&adrparm, 0,sizeof(ADRPARM)); - adrparm.ulFlags=DIALOG_MODAL | AB_RESOLVE; - - adrparm.lpszCaption=(LPTSTR)szCaption; -#ifdef UNICODE - char szNarrowCaption[256]; - if(szCaption) - { - WideCharToMultiByte(CP_ACP, 0, szCaption, -1, szNarrowCaption, 255, NULL, NULL); - adrparm.lpszCaption=(LPTSTR)szNarrowCaption; - } -#endif - adrparm.cDestFields = 1; - adrparm.lppszDestTitles = (LPTSTR*)lppszDestTitles; - adrparm.lpulDestComps = lpulDestComps; - - HWND hDesktop = ::GetDesktopWindow(); - HRESULT hr = pAddressBook->Address((ULONG_PTR*)&hDesktop, &adrparm, &pAddressList); - RELEASE(pAddressBook); - if(hr == S_OK) - return IDOK; - if(hr == MAPI_E_USER_CANCEL) - return IDCANCEL; - } -#endif - return FALSE; -} - -// utility function to release ADRLIST entries -void CMAPIEx::ReleaseAddressList(LPADRLIST pAddressList) -{ -#ifndef _WIN32_WCE - FreePadrlist(pAddressList); -#else - if(pAddressList) - { - for(ULONG i=0;icEntries;i++) MAPIFreeBuffer(pAddressList->aEntries[i].rgPropVals); - MAPIFreeBuffer(pAddressList); - } -#endif -} - -BOOL CMAPIEx::CompareEntryIDs(ULONG cb1, LPENTRYID lpb1, ULONG cb2, LPENTRYID lpb2) -{ - ULONG ulResult; - if(m_pSession && m_pSession->CompareEntryIDs(cb1, lpb1, cb2, lpb2, 0, &ulResult)==S_OK) - { - return ulResult; - } - return FALSE; -} - -// ADDRENTRY objects from Address don't come in unicode so I check for _A and force narrow strings -BOOL CMAPIEx::GetEmail(ADRENTRY& adrEntry, CString& strEmail) -{ -#ifndef _WIN32_WCE - LPSPropValue pProp=PpropFindProp(adrEntry.rgPropVals,adrEntry.cValues, PR_ADDRTYPE); - if(!pProp) pProp=PpropFindProp(adrEntry.rgPropVals,adrEntry.cValues, PR_ADDRTYPE_A); - if(pProp) - { - CString strAddrType; - GetNarrowString(*pProp, strAddrType); - if(strAddrType==_T("EX")) - { - pProp=PpropFindProp(adrEntry.rgPropVals,adrEntry.cValues, PR_ENTRYID); - - SBinary entryID; - entryID.cb=pProp->Value.bin.cb; - entryID.lpb=pProp->Value.bin.lpb; - - return GetExEmail(entryID, strEmail); - } - } - pProp=PpropFindProp(adrEntry.rgPropVals,adrEntry.cValues, PR_EMAIL_ADDRESS); - if(!pProp) pProp=PpropFindProp(adrEntry.rgPropVals,adrEntry.cValues, PR_EMAIL_ADDRESS_A); - if(pProp) - { - GetNarrowString(*pProp, strEmail); - return TRUE; - } -#endif - return FALSE; -} - -BOOL CMAPIEx::GetExEmail(SBinary entryID, CString& strEmail) -{ - BOOL bResult=FALSE; -#ifndef _WIN32_WCE - if(!m_pSession) return FALSE; - - LPADRBOOK pAddressBook; - if(m_pSession->OpenAddressBook(0, NULL, AB_NO_DIALOG, &pAddressBook)==S_OK) - { - ULONG ulObjType; - IMAPIProp* pItem=NULL; - if(pAddressBook->OpenEntry(entryID.cb, (ENTRYID*)entryID.lpb, NULL,MAPI_BEST_ACCESS, &ulObjType, (LPUNKNOWN*)&pItem)==S_OK) - { - if(ulObjType==MAPI_MAILUSER) - { - LPSPropValue pProp; - ULONG ulPropCount; - ULONG pSMTP[]={ 1, PR_SMTP_ADDRESS }; - ULONG pEmail[]={ 1, PR_EMAIL_ADDRESS }; - - if(pItem->GetProps((LPSPropTagArray)pSMTP, CMAPIEx::cm_nMAPICode, &ulPropCount, &pProp)==S_OK) - { - strEmail=CMAPIEx::GetValidString(*pProp); - MAPIFreeBuffer(pProp); - bResult=TRUE; - } - if(!bResult && pItem->GetProps((LPSPropTagArray)pEmail, CMAPIEx::cm_nMAPICode, &ulPropCount, &pProp)==S_OK) - { - strEmail=CMAPIEx::GetValidString(*pProp); - MAPIFreeBuffer(pProp); - bResult=TRUE; - } - } - RELEASE(pItem); - } - RELEASE(pAddressBook); - } -#endif - return bResult; -} - -void CMAPIEx::GetSystemTime(SYSTEMTIME& tm, int wYear, int wMonth, int wDay, int wHour, int wMinute, int wSecond, int wMilliSeconds) -{ - tm.wYear=(WORD)wYear; - tm.wMonth=(WORD)wMonth; - tm.wDay=(WORD)wDay; - tm.wHour=(WORD)wHour; - tm.wMinute=(WORD)wMinute; - tm.wSecond=(WORD)wSecond; - tm.wMilliseconds=(WORD)wMilliSeconds; - tm.wDayOfWeek=0; -} diff --git a/bazaar/MAPIEx/plugin/MAPIEx.h b/bazaar/MAPIEx/plugin/MAPIEx.h deleted file mode 100644 index 5daa44ccf..000000000 --- a/bazaar/MAPIEx/plugin/MAPIEx.h +++ /dev/null @@ -1,174 +0,0 @@ -#ifndef __MAPIEX_H__ -#define __MAPIEX_H__ - -//////////////////////////////////////////////////////////////////////////////////////////////////////////// -// -// File: MAPIEx.h -// Description: Windows Extended MAPI class -// -// Copyright (C) 2005-2011, Noel Dillabough -// -// This source code is free to use and modify provided this notice remains intact and that any enhancements -// or bug fixes are posted to the CodeProject page hosting this class for all to benefit. -// -// Usage: see the CodeProject article at http://www.codeproject.com/internet/CMapiEx.asp -// -//////////////////////////////////////////////////////////////////////////////////////////////////////////// - -#ifdef _WIN32_WCE -#include -#include -#else -#define INITGUID -#define USES_IID_IMessage -#include -#include - -#include -#include -#endif - -#define RELEASE(s) if(s!=NULL) { s->Release();s=NULL; } - -#define MAPI_NO_CACHE ((ULONG)0x00000200) -#define MAPIEX_NOTIFICATIONS 0x007F - -#include "MAPIObject.h" -#include "MAPIMessage.h" -#include "MAPIContact.h" -#include "MAPIAppointment.h" -#include "MAPIFolder.h" -#include "MAPIAttachment.h" - -//////////////////////////////////////////////////////////////////////////////////////////////////////////// -// CMAPIEx - -class AFX_EXT_CLASS CMAPIEx -{ -public: - CMAPIEx(); - ~CMAPIEx(); - -// Attributes -public: - static int cm_bComInit; - static int cm_nMAPICode; - -protected: - IMAPISession* m_pSession; - LPMDB m_pMsgStore; - ULONG m_ulMDBFlags; - CMAPIFolder* m_pFolder; - ULONG m_sink; - -// Operations -public: - static BOOL Init(DWORD dwFlags=0, BOOL bInitAsService=FALSE); - static void Term(); - BOOL Login(LPCTSTR szProfileName=NULL, DWORD dwFlags=0, BOOL bInitAsService=FALSE); - void Logout(); - BOOL CreateProfile(LPCTSTR szProfileName); - BOOL DeleteProfile(LPCTSTR szProfileName); - BOOL CreateMessageService(LPCTSTR szProfileName, LPCTSTR szService, LPCTSTR szDisplayName); - - IMAPISession* GetSession() { return m_pSession; } - LPMDB GetMessageStore() { return m_pMsgStore; } - CMAPIFolder* GetFolder() { return m_pFolder; } - void SetFolder(CMAPIFolder* pFolder); - - BOOL GetProfileName(CString& strProfileName); - BOOL GetProfileEmail(CString& strProfileEmail); - int GetMessageStoreCount(); - BOOL GetMessageStoreProperties(int nIndex, CString& strName, BOOL& bDefaultStore); - BOOL OpenMessageStore(int nIndex, ULONG ulFlags=MAPI_MODIFY | MAPI_NO_CACHE); - BOOL OpenMessageStore(LPCTSTR szStore=NULL, ULONG ulFlags=MAPI_MODIFY | MAPI_NO_CACHE); - ULONG GetMessageStoreSupport(); - -#ifdef _WIN32_WCE - CPOOM* GetPOOM(); -#endif - - // use bInternal to specify that MAPIEx keeps track of and subsequently deletes the folder - // remember to eventually delete returned folders if calling with bInternal=FALSE - CMAPIFolder* OpenFolder(unsigned long ulFolderID, BOOL bInternal); - CMAPIFolder* OpenFolder(LPCTSTR szFolderName, BOOL bInternal); - CMAPIFolder* OpenSpecialFolder(unsigned long ulFolderID, BOOL bInternal); - CMAPIFolder* OpenRootFolder(BOOL bInternal=TRUE); - CMAPIFolder* OpenInbox(BOOL bInternal=TRUE); - CMAPIFolder* OpenOutbox(BOOL bInternal=TRUE); - CMAPIFolder* OpenSentItems(BOOL bInternal=TRUE); - CMAPIFolder* OpenDeletedItems(BOOL bInternal=TRUE); - CMAPIFolder* OpenContacts(BOOL bInternal=TRUE); - CMAPIFolder* OpenDrafts(BOOL bInternal=TRUE); - CMAPIFolder* OpenCalendar(BOOL bInternal=TRUE); - CMAPIFolder* OpenJunkFolder(BOOL bInternal=TRUE); - - LPMAPITABLE GetHierarchy(); - LPMAPITABLE GetContents(); - int GetRowCount(); - BOOL SortContents(ULONG ulSortParam=TABLE_SORT_ASCEND, ULONG ulSortField=PR_MESSAGE_DELIVERY_TIME); - BOOL SetUnreadOnly(BOOL bUnreadOnly=TRUE); - BOOL SetRestriction(SRestriction* pRestriction); - BOOL GetNextMessage(CMAPIMessage& message); - BOOL GetNextContact(CMAPIContact& contact); - BOOL GetNextAppointment(CMAPIAppointment& appointment); - BOOL GetNextSubFolder(CMAPIFolder& folder, CString& strFolder); - - BOOL Notify(LPNOTIFCALLBACK lpfnCallback, LPVOID lpvContext, ULONG ulEventMask=MAPIEX_NOTIFICATIONS); - static void PumpMessages(); - - int ShowAddressBook(LPADRLIST& pAddressList, LPCTSTR szCaption=NULL); - BOOL GetEmail(ADRENTRY& adrEntry, CString& strEmail); - BOOL GetExEmail(SBinary entryID, CString& strEmail); - static LPCTSTR GetValidString(SPropValue& prop); - static LPCTSTR GetValidMVString(SPropValue& prop, int nIndex); - static void GetNarrowString(SPropValue& prop, CString& strNarrow); - static void GetSystemTime(SYSTEMTIME& tm, int wYear, int wMonth, int wDay, int wHour=0, int wMinute=0, int wSecond=0, int wMilliSeconds=0); - static void ReleaseAddressList(LPADRLIST pAddressList); - BOOL CompareEntryIDs(ULONG cb1, LPENTRYID lpb1, ULONG cb2, LPENTRYID lpb2); - -protected: - static LPCTSTR ValidateString(LPCTSTR s); -}; - -#ifndef MSGSTATUS_HAS_PR_BODY_HTML -#define MSGSTATUS_HAS_PR_BODY_HTML 0x80000000 -#endif - -#ifndef PR_BODY_HTML -#define PR_BODY_HTML PROP_TAG( PT_TSTRING, 0x1013) -#define PR_BODY_HTML_A PROP_TAG( PT_STRING8, 0x1013) -#endif - -#ifndef STORE_HTML_OK -#define STORE_HTML_OK ((ULONG)0x00010000) -#endif - -#ifndef PR_ATTACH_CONTENT_ID -#define PR_ATTACH_CONTENT_ID PROP_TAG(PT_TSTRING, 0x3712) -#endif - -#ifndef PR_SMTP_ADDRESS -#define PR_SMTP_ADDRESS PROP_TAG(PT_TSTRING, 0x39FE) -#endif - -#ifndef PR_MSG_EDITOR_FORMAT -#define PR_MSG_EDITOR_FORMAT PROP_TAG(PT_LONG, 0x5909) -#define EDITOR_FORMAT_DONTKNOW ((ULONG)0) -#define EDITOR_FORMAT_PLAINTEXT ((ULONG)1) -#define EDITOR_FORMAT_HTML ((ULONG)2) -#define EDITOR_FORMAT_RTF ((ULONG)3) -#endif - -#define PR_IPM_APPOINTMENT_ENTRYID (PROP_TAG(PT_BINARY, 0x36D0)) -#define PR_IPM_CONTACT_ENTRYID (PROP_TAG(PT_BINARY, 0x36D1)) -#define PR_IPM_JOURNAL_ENTRYID (PROP_TAG(PT_BINARY, 0x36D2)) -#define PR_IPM_NOTE_ENTRYID (PROP_TAG(PT_BINARY, 0x36D3)) -#define PR_IPM_TASK_ENTRYID (PROP_TAG(PT_BINARY, 0x36D4)) -#define PR_IPM_DRAFTS_ENTRYID (PROP_TAG(PT_BINARY, 0x36D7)) - -#ifndef MAPI_NO_COINIT -#define MAPI_NO_COINIT 0x8 -#endif - -#endif diff --git a/bazaar/MAPIEx/plugin/MAPIExPCH.cpp b/bazaar/MAPIEx/plugin/MAPIExPCH.cpp deleted file mode 100644 index 094d377f6..000000000 --- a/bazaar/MAPIEx/plugin/MAPIExPCH.cpp +++ /dev/null @@ -1 +0,0 @@ -#include "MAPIExPCH.h" diff --git a/bazaar/MAPIEx/plugin/MAPIExPCH.h b/bazaar/MAPIEx/plugin/MAPIExPCH.h deleted file mode 100644 index 33c0cd5f0..000000000 --- a/bazaar/MAPIEx/plugin/MAPIExPCH.h +++ /dev/null @@ -1,17 +0,0 @@ -#ifndef __MAPIEXPCH_H__ -#define __MAPIEXPCH_H__ - -#define VC_EXTRALEAN // Exclude rarely-used stuff from Windows headers -#include // MFC core and standard components - -#ifdef MAPIEX_EXPORTS -#undef AFX_EXT_CLASS -#define AFX_EXT_CLASS __declspec(dllexport) -#else -#undef AFX_EXT_CLASS -#define AFX_EXT_CLASS -#endif - -#include - -#endif diff --git a/bazaar/MAPIEx/plugin/MAPIFolder.cpp b/bazaar/MAPIEx/plugin/MAPIFolder.cpp deleted file mode 100644 index 3203d24b1..000000000 --- a/bazaar/MAPIEx/plugin/MAPIFolder.cpp +++ /dev/null @@ -1,352 +0,0 @@ -//////////////////////////////////////////////////////////////////////////////////////////////////////////// -// -// File: MAPIFolder.cpp -// Description: MAPI Folder class wrapper -// -// Copyright (C) 2005-2011, Noel Dillabough -// -// This source code is free to use and modify provided this notice remains intact and that any enhancements -// or bug fixes are posted to the CodeProject page hosting this class for the community to benefit. -// -// Usage: see the CodeProject article at http://www.codeproject.com/internet/CMapiEx.asp -// -//////////////////////////////////////////////////////////////////////////////////////////////////////////// - -#include "MAPIExPCH.h" -#include "MAPIEx.h" - -///////////////////////////////////////////////////////////// -// CMAPIFolder - -CMAPIFolder::CMAPIFolder() -{ - Init(); -} - -CMAPIFolder::CMAPIFolder(CMAPIEx* pMAPI, LPMAPIFOLDER pFolder, LPCTSTR szName) -{ - Init(); - - m_entryID.cb=0; - Attach(pMAPI, pFolder, szName); -} - -CMAPIFolder::~CMAPIFolder() -{ - Close(); -} - -void CMAPIFolder::Init() -{ - m_pHierarchy=NULL; - m_pContents=NULL; - m_nMaxRowsSize=DEFAULT_FOLDER_BUFFER_SIZE; - m_pRows=NULL; - ClearBuffer(); -} - -void CMAPIFolder::Close() -{ - ClearBuffer(); - RELEASE(m_pHierarchy); - RELEASE(m_pContents); - CMAPIObject::Close(); -} - -void CMAPIFolder::SetBufferSize(int nSize) -{ - m_nMaxRowsSize=max(1, nSize); -} - -void CMAPIFolder::ClearBuffer() -{ - if(m_pRows!=NULL) - { - FreeProws(m_pRows); - m_pRows=NULL; - } - m_nRowsIndex=0; -} - -void CMAPIFolder::Attach(CMAPIEx* pMAPI, LPMAPIFOLDER pFolder, LPCTSTR szName) -{ - Close(); - m_pMAPI=pMAPI; - m_pItem=pFolder; - m_strName=szName; - LPSPropValue pProp; - if(GetProperty(PR_ENTRYID, pProp)==S_OK) - { - SetEntryID(&pProp->Value.bin); - MAPIFreeBuffer(pProp); - } - else - { - SetEntryID(NULL); - } -} - -LPMAPIFOLDER CMAPIFolder::Detach() -{ - LPMAPIFOLDER pFolder=Folder(); - m_pItem=NULL; - return pFolder; -} - -LPCTSTR CMAPIFolder::GetName() -{ - return m_strName; -} - -LPMAPITABLE CMAPIFolder::GetHierarchy() -{ - RELEASE(m_pHierarchy); - if(Folder()->GetHierarchyTable(0, &m_pHierarchy)!=S_OK) return NULL; - - const int nProperties=2; - SizedSPropTagArray(nProperties, Columns)={nProperties,{PR_DISPLAY_NAME, PR_ENTRYID}}; - if(m_pHierarchy->SetColumns((LPSPropTagArray)&Columns, 0)!=S_OK) - { - RELEASE(m_pHierarchy); - return NULL; - } - return m_pHierarchy; -} - -// High Level function to open a sub folder by iterating recursively (DFS) over all folders -// (use instead of manually calling GetHierarchy and GetNextSubFolder) -CMAPIFolder* CMAPIFolder::OpenSubFolder(LPCTSTR szSubFolder) -{ - if(!GetHierarchy()) return NULL; - - CString strFolder; - CMAPIFolder folder; - CMAPIFolder* pSubFolder=NULL; - while(GetNextSubFolder(folder, strFolder)) - { - if(!strFolder.CompareNoCase(szSubFolder)) - { - pSubFolder=new CMAPIFolder(m_pMAPI,folder.Detach()); - } - else - { - pSubFolder=folder.OpenSubFolder(szSubFolder); - } - if(pSubFolder) break; - } - return pSubFolder; -} - -// Creates a sub-folder under pFolder, opens the folder if it already exists -CMAPIFolder* CMAPIFolder::CreateSubFolder(LPCTSTR szSubFolder) -{ - LPMAPIFOLDER pSubFolder=NULL; - ULONG ulFolderType=FOLDER_GENERIC; - ULONG ulFlags=OPEN_IF_EXISTS | CMAPIEx::cm_nMAPICode; - - Folder()->CreateFolder(ulFolderType, (LPTSTR)szSubFolder, NULL, NULL,ulFlags, &pSubFolder); - return pSubFolder ? new CMAPIFolder(m_pMAPI, pSubFolder) : NULL; -} - -// Deletes a sub-folder and ALL sub folders/messages -BOOL CMAPIFolder::DeleteSubFolder(LPCTSTR szSubFolder) -{ - if(GetHierarchy()) - { - CString strFolder; - CMAPIFolder folder; - while(GetNextSubFolder(folder, strFolder)) - { - if(!strFolder.CompareNoCase(szSubFolder)) - { - return DeleteSubFolder(&folder); - } - } - } - return FALSE; -} - -// Deletes a sub-folder and ALL sub folders/messages -BOOL CMAPIFolder::DeleteSubFolder(CMAPIFolder* pSubFolder) -{ - if(!pSubFolder) return FALSE; - - LPSPropValue props=NULL; - ULONG cValues=0; - ULONG rgTags[]={ 1, PR_ENTRYID }; - - if(pSubFolder->Folder()->GetProps((LPSPropTagArray) rgTags, CMAPIEx::cm_nMAPICode, &cValues, &props)==S_OK) - { - HRESULT hr=Folder()->DeleteFolder(props[0].Value.bin.cb, (LPENTRYID)props[0].Value.bin.lpb, NULL, NULL,DEL_FOLDERS|DEL_MESSAGES); - MAPIFreeBuffer(props); - return (hr==S_OK); - } - return FALSE; -} - -LPMAPITABLE CMAPIFolder::GetContents() -{ - RELEASE(m_pContents); - if(Folder()->GetContentsTable(CMAPIEx::cm_nMAPICode, &m_pContents)!=S_OK) return NULL; - - const int nProperties=MESSAGE_COLS; - SizedSPropTagArray(nProperties, Columns)={nProperties,{PR_MESSAGE_FLAGS, PR_ENTRYID }}; - if(m_pContents->SetColumns((LPSPropTagArray)&Columns, 0)!=S_OK) - { - RELEASE(m_pContents); - return NULL; - } - return m_pContents; -} - -int CMAPIFolder::GetRowCount() -{ - ULONG ulCount; - if(!m_pContents || m_pContents->GetRowCount(0, &ulCount)!=S_OK) return -1; - return ulCount; -} - -BOOL CMAPIFolder::SortContents(ULONG ulSortParam, ULONG ulSortField) -{ - if(!m_pContents) return FALSE; - - SizedSSortOrderSet(1, SortColums) = {1, 0, 0, {{ulSortField, ulSortParam}}}; - return (m_pContents->SortTable((LPSSortOrderSet)&SortColums, 0)==S_OK); -} - -BOOL CMAPIFolder::SetUnreadOnly(BOOL bUnreadOnly) -{ - if(bUnreadOnly) - { - SRestriction res; - res.rt=RES_BITMASK; - res.res.resBitMask.relBMR=BMR_EQZ; - res.res.resBitMask.ulPropTag=PR_MESSAGE_FLAGS; - res.res.resBitMask.ulMask=MSGFLAG_READ; - return SetRestriction(&res); - } - return SetRestriction(NULL); -} - -BOOL CMAPIFolder::SetRestriction(SRestriction* pRestriction) -{ - return (m_pContents && m_pContents->Restrict(pRestriction, 0)==S_OK); -} - -BOOL CMAPIFolder::QueryRows() -{ - ClearBuffer(); - if(m_pContents) - { - if(m_pContents->QueryRows(m_nMaxRowsSize, 0, &m_pRows)==S_OK) - { - return TRUE; - } - m_pRows=NULL; - } - return FALSE; -} - -SRow* CMAPIFolder::GetNextRow() -{ - if(m_pRows==NULL || m_nRowsIndex>=m_pRows->cRows) - { - if(!QueryRows()) return NULL; - } - if(m_pRows->cRows==0) - { - ClearBuffer(); - return NULL; - } - return &m_pRows->aRow[m_nRowsIndex++]; -} - -BOOL CMAPIFolder::GetNextMessage(CMAPIMessage& message) -{ - SRow* pRow=GetNextRow(); - return pRow ? message.Open(m_pMAPI, pRow->lpProps[PROP_ENTRYID].Value.bin) : FALSE; -} - -BOOL CMAPIFolder::GetNextContact(CMAPIContact& contact) -{ -#ifdef _WIN32_WCE - return m_poom.GetNextContact(m_pMAPI, contact); -#else - SRow* pRow=GetNextRow(); - return pRow ? contact.Open(m_pMAPI, pRow->lpProps[PROP_ENTRYID].Value.bin) : FALSE; -#endif -} - -BOOL CMAPIFolder::GetNextAppointment(CMAPIAppointment& appointment) -{ -#ifdef _WIN32_WCE - return m_poom.GetNextAppointment(m_pMAPI,appointment); -#else - SRow* pRow=GetNextRow(); - return pRow ? appointment.Open(m_pMAPI, pRow->lpProps[PROP_ENTRYID].Value.bin) : FALSE; -#endif -} - -BOOL CMAPIFolder::GetNextSubFolder(CMAPIFolder& folder, CString& strFolder) -{ - if(!m_pHierarchy) return NULL; - folder.Close(); - - DWORD dwObjType; - LPSRowSet pRows=NULL; - - LPMAPIFOLDER pSubFolder=NULL; - if(m_pHierarchy->QueryRows(1, 0, &pRows)==S_OK) - { - if(pRows->cRows) - { - if(Folder()->OpenEntry(pRows->aRow[0].lpProps[PROP_ENTRYID].Value.bin.cb, (LPENTRYID)pRows->aRow[0].lpProps[PROP_ENTRYID].Value.bin.lpb, NULL, MAPI_MODIFY, &dwObjType, (LPUNKNOWN*)&pSubFolder)==S_OK) - { - strFolder=CMAPIEx::GetValidString(pRows->aRow[0].lpProps[0]); - folder.Attach(m_pMAPI, pSubFolder, strFolder); - } - } - FreeProws(pRows); - } - return (pSubFolder!=NULL); -} - -BOOL CMAPIFolder::DeleteMessage(CMAPIMessage& message) -{ - return DeleteObject(message); -} - -BOOL CMAPIFolder::CopyMessage(CMAPIMessage& message, CMAPIFolder* pFolderDest) -{ - if(!pFolderDest) return FALSE; - - ENTRYLIST entries={ 1, message.GetEntryID() }; - HRESULT hr=Folder()->CopyMessages(&entries, NULL, pFolderDest->Folder(), NULL, NULL, 0); - return (hr==S_OK); -} - -BOOL CMAPIFolder::MoveMessage(CMAPIMessage& message, CMAPIFolder* pFolderDest) -{ - if(!pFolderDest) return FALSE; - - ENTRYLIST entries={ 1, message.GetEntryID() }; - HRESULT hr=Folder()->CopyMessages(&entries, NULL, pFolderDest->Folder(), NULL, NULL,MESSAGE_MOVE); - return (hr==S_OK); -} - -BOOL CMAPIFolder::DeleteContact(CMAPIContact& contact) -{ - return DeleteObject(contact); -} - -BOOL CMAPIFolder::DeleteAppointment(CMAPIAppointment& appointment) -{ - return DeleteObject(appointment); -} - -BOOL CMAPIFolder::DeleteObject(CMAPIObject& object) -{ - ENTRYLIST entries={ 1, object.GetEntryID() }; - HRESULT hr=Folder()->DeleteMessages(&entries, NULL, NULL, 0); - return (hr==S_OK); -} diff --git a/bazaar/MAPIEx/plugin/MAPIFolder.h b/bazaar/MAPIEx/plugin/MAPIFolder.h deleted file mode 100644 index 63a912506..000000000 --- a/bazaar/MAPIEx/plugin/MAPIFolder.h +++ /dev/null @@ -1,95 +0,0 @@ -#ifndef __MAPIFOLDER_H__ -#define __MAPIFOLDER_H__ - -//////////////////////////////////////////////////////////////////////////////////////////////////////////// -// -// File: MAPIFolder.h -// Description: MAPI Folder class wrapper -// -// Copyright (C) 2005-2011, Noel Dillabough -// -// This source code is free to use and modify provided this notice remains intact and that any enhancements -// or bug fixes are posted to the CodeProject page hosting this class for the community to benefit. -// -// Usage: see the CodeProject article at http://www.codeproject.com/internet/CMapiEx.asp -// -//////////////////////////////////////////////////////////////////////////////////////////////////////////// - -#ifdef _WIN32_WCE -#include "POOM.h" -#define DEFAULT_FOLDER_BUFFER_SIZE 128 -#else -#define DEFAULT_FOLDER_BUFFER_SIZE 512 -#endif - -///////////////////////////////////////////////////////////// -// CMAPIFolder - -class AFX_EXT_CLASS CMAPIFolder : public CMAPIObject -{ -public: - CMAPIFolder(); - CMAPIFolder(CMAPIEx* pMAPI, LPMAPIFOLDER pFolder, LPCTSTR szName=NULL); - ~CMAPIFolder(); - - enum { PROP_MESSAGE_FLAGS, PROP_ENTRYID, MESSAGE_COLS }; - -// Attributes -protected: - LPMAPITABLE m_pHierarchy; - LPMAPITABLE m_pContents; - int m_nMaxRowsSize; - ULONG m_nRowsIndex; - LPSRowSet m_pRows; - CString m_strName; - -#ifdef _WIN32_WCE - CPOOM m_poom; -#endif - -// Operations -public: - inline LPMAPIFOLDER Folder() { return (LPMAPIFOLDER)m_pItem; } - void Attach(CMAPIEx* pMAPI, LPMAPIFOLDER pFolder, LPCTSTR szName); - LPMAPIFOLDER Detach(); - -#ifdef _WIN32_WCE - CPOOM* GetPOOM() { return &m_poom; } -#endif - - virtual void Close(); - void SetBufferSize(int nSize); - void ClearBuffer(); - - LPCTSTR GetName(); - LPMAPITABLE GetHierarchy(); - CMAPIFolder* OpenSubFolder(LPCTSTR szSubFolder); - CMAPIFolder* CreateSubFolder(LPCTSTR szSubFolder); - BOOL DeleteSubFolder(LPCTSTR szSubFolder); - BOOL DeleteSubFolder(CMAPIFolder* pFolder); - - LPMAPITABLE GetContents(); - int GetRowCount(); - BOOL SortContents(ULONG ulSortParam=TABLE_SORT_ASCEND, ULONG ulSortField=PR_MESSAGE_DELIVERY_TIME); - BOOL SetUnreadOnly(BOOL bUnreadOnly=TRUE); - BOOL SetRestriction(SRestriction* pRestriction); - BOOL GetNextMessage(CMAPIMessage& message); - BOOL GetNextContact(CMAPIContact& contact); - BOOL GetNextAppointment(CMAPIAppointment& appointment); - BOOL GetNextSubFolder(CMAPIFolder& folder, CString& strFolder); - - BOOL DeleteMessage(CMAPIMessage& message); - BOOL CopyMessage(CMAPIMessage& message, CMAPIFolder* pFolderDest); - BOOL MoveMessage(CMAPIMessage& message, CMAPIFolder* pFolderDest); - - BOOL DeleteContact(CMAPIContact& contact); - BOOL DeleteAppointment(CMAPIAppointment& appointment); - -protected: - void Init(); - BOOL DeleteObject(CMAPIObject& object); - BOOL QueryRows(); - SRow* GetNextRow(); -}; - -#endif diff --git a/bazaar/MAPIEx/plugin/MAPIMessage.cpp b/bazaar/MAPIEx/plugin/MAPIMessage.cpp deleted file mode 100644 index c379761f4..000000000 --- a/bazaar/MAPIEx/plugin/MAPIMessage.cpp +++ /dev/null @@ -1,557 +0,0 @@ -//////////////////////////////////////////////////////////////////////////////////////////////////////////// -// -// File: MAPIMessage.cpp -// Description: MAPI Message class wrapper -// -// Copyright (C) 2005-2011, Noel Dillabough -// -// This source code is free to use and modify provided this notice remains intact and that any enhancements -// or bug fixes are posted to the CodeProject page hosting this class for the community to benefit. -// -// Usage: see the CodeProject article at http://www.codeproject.com/internet/CMapiEx.asp -// -//////////////////////////////////////////////////////////////////////////////////////////////////////////// - -#include "MAPIExPCH.h" -#include "MAPIEx.h" - -#include - -const GUID CLSID_MailMessage={ 0x00020D0B, 0x0000, 0x0000, 0xC0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46 }; - -///////////////////////////////////////////////////////////// -// CMAPIMessage - -CMAPIMessage::CMAPIMessage() -{ - m_pRecipients=NULL; -} - -CMAPIMessage::~CMAPIMessage() -{ - Close(); -} - -BOOL CMAPIMessage::Open(CMAPIEx* pMAPI, SBinary entryID) -{ - if(!CMAPIObject::Open(pMAPI,entryID)) return FALSE; - - GetPropertyString(PR_SENDER_NAME, m_strSenderName); - FillSenderEmail(); - GetPropertyString(PR_SUBJECT, m_strSubject); - - return TRUE; -} - -void CMAPIMessage::Close() -{ - RELEASE(m_pRecipients); - CMAPIObject::Close(); -} - -BOOL CMAPIMessage::GetHeader(CString& strHeader) -{ - return GetPropertyString(PR_TRANSPORT_MESSAGE_HEADERS, strHeader); -} - -void CMAPIMessage::FillSenderEmail() -{ - CString strAddrType; - GetPropertyString(PR_SENDER_ADDRTYPE, strAddrType); - GetPropertyString(PR_SENDER_EMAIL_ADDRESS, m_strSenderEmail); - - // for Microsoft Exchange server internal mails we want to try to resolve the SMTP email address - if(strAddrType==_T("EX")) - { - LPSPropValue pProp; - if(GetProperty(PR_SENDER_ENTRYID, pProp)==S_OK) - { - if(m_pMAPI) m_pMAPI->GetExEmail(pProp->Value.bin, m_strSenderEmail); - MAPIFreeBuffer(pProp); - } - } -} - -BOOL CMAPIMessage::GetReceivedTime(SYSTEMTIME& tmReceived) -{ - LPSPropValue pProp; - if(GetProperty(PR_MESSAGE_DELIVERY_TIME, pProp)==S_OK) - { - FILETIME tmLocal; - FileTimeToLocalFileTime(&pProp->Value.ft, &tmLocal); - FileTimeToSystemTime(&tmLocal, &tmReceived); - MAPIFreeBuffer(pProp); - return TRUE; - } - return FALSE; -} - -BOOL CMAPIMessage::GetReceivedTime(CString& strReceivedTime, LPCTSTR szFormat) -{ - SYSTEMTIME tm; - if(GetReceivedTime(tm)) - { - TCHAR szTime[256]; - if(!szFormat) szFormat=_T("MM/dd/yyyy hh:mm:ss tt"); - GetDateFormat(LOCALE_SYSTEM_DEFAULT, 0, &tm, szFormat, szTime, 256); - GetTimeFormat(LOCALE_SYSTEM_DEFAULT, 0, &tm, szTime, szTime, 256); - strReceivedTime=szTime; - return TRUE; - } - return FALSE; -} - -BOOL CMAPIMessage::GetSubmitTime(SYSTEMTIME& tmSubmit) -{ - LPSPropValue pProp; - if(GetProperty(PR_CLIENT_SUBMIT_TIME, pProp)==S_OK) - { - FILETIME tmLocal; - FileTimeToLocalFileTime(&pProp->Value.ft, &tmLocal); - FileTimeToSystemTime(&tmLocal, &tmSubmit); - MAPIFreeBuffer(pProp); - return TRUE; - } - return FALSE; -} - -BOOL CMAPIMessage::GetSubmitTime(CString& strSubmitTime, LPCTSTR szFormat) -{ - SYSTEMTIME tm; - if(GetSubmitTime(tm)) - { - TCHAR szTime[256]; - if(!szFormat) szFormat=_T("MM/dd/yyyy hh:mm:ss tt"); - GetDateFormat(LOCALE_SYSTEM_DEFAULT, 0, &tm, szFormat, szTime,256); - GetTimeFormat(LOCALE_SYSTEM_DEFAULT, 0, &tm, szTime, szTime,256); - strSubmitTime=szTime; - return TRUE; - } - return FALSE; -} - -BOOL CMAPIMessage::GetTo(CString& strTo) -{ - return GetPropertyString(PR_DISPLAY_TO, strTo); -} - -BOOL CMAPIMessage::GetCC(CString& strCC) -{ - return GetPropertyString(PR_DISPLAY_CC, strCC); -} - -BOOL CMAPIMessage::GetBCC(CString& strBCC) -{ - return GetPropertyString(PR_DISPLAY_BCC, strBCC); -} - -int CMAPIMessage::GetMessageStatus() -{ - return GetPropertyValue(PR_MSG_STATUS, 0); -} - -int CMAPIMessage::GetPriority() -{ - return GetPropertyValue(PR_PRIORITY, PRIO_NONURGENT); -} - -DWORD CMAPIMessage::GetSize() -{ - return GetPropertyValue(PR_MESSAGE_SIZE, 0); -} - -BOOL CMAPIMessage::GetRecipients() -{ - if(!Message()) return FALSE; - RELEASE(m_pRecipients); - - if(Message()->GetRecipientTable(CMAPIEx::cm_nMAPICode, &m_pRecipients)!=S_OK) return FALSE; - - const int nProperties=RECIPIENT_COLS; - SizedSPropTagArray(nProperties, Columns)={nProperties,{PR_RECIPIENT_TYPE, PR_DISPLAY_NAME, PR_EMAIL_ADDRESS, PR_ADDRTYPE, PR_ENTRYID }}; - return (m_pRecipients->SetColumns((LPSPropTagArray)&Columns, 0)==S_OK); -} - -BOOL CMAPIMessage::GetNextRecipient(CString& strName, CString& strEmail, int& nType) -{ - if(!m_pRecipients) return FALSE; - - LPSRowSet pRows=NULL; - BOOL bResult=FALSE; - if(m_pRecipients->QueryRows(1, 0, &pRows)==S_OK) - { - if(pRows->cRows) - { - nType=pRows->aRow[0].lpProps[PROP_RECIPIENT_TYPE].Value.ul; - strName=CMAPIEx::GetValidString(pRows->aRow[0].lpProps[PROP_RECIPIENT_NAME]); - - // for Microsoft Exchange server internal mails we want to try to resolve the SMTP email address - CString strAddrType=CMAPIEx::GetValidString(pRows->aRow[0].lpProps[PROP_ADDR_TYPE]); - if(strAddrType==_T("EX")) - { - if(m_pMAPI) m_pMAPI->GetExEmail(pRows->aRow[0].lpProps[PROP_ENTRYID].Value.bin, strEmail); - } - else - { - strEmail=CMAPIEx::GetValidString(pRows->aRow[0].lpProps[PROP_RECIPIENT_EMAIL]); - } - bResult=TRUE; - } - FreeProws(pRows); - } - return bResult; -} - -BOOL CMAPIMessage::GetReplyTo(CString& strEmail) -{ - BOOL bResult=FALSE; - LPSPropValue prop; - if(GetProperty(PR_REPLY_RECIPIENT_ENTRIES, prop) == S_OK) - { - LPFLATENTRYLIST pReplyEntryList=(LPFLATENTRYLIST)prop->Value.bin.lpb; - if(pReplyEntryList->cEntries>0) - { - LPFLATENTRY pReplyEntry=(LPFLATENTRY)pReplyEntryList->abEntries; - - SBinary entryID; - entryID.cb=pReplyEntry->cb; - entryID.lpb=pReplyEntry->abEntry; - bResult=m_pMAPI->GetExEmail(entryID, strEmail); - } - MAPIFreeBuffer(prop); - } - return bResult; -} - -// nPriority defaults to IMPORTANCE_NORMAL, IMPORTANCE_HIGH or IMPORTANCE_LOW also valid -BOOL CMAPIMessage::Create(CMAPIEx* pMAPI, int nPriority, BOOL bSaveToSentFolder, CMAPIFolder* pFolder) -{ - if(!pMAPI) return FALSE; - if(!pFolder) pFolder=pMAPI->GetFolder(); - if(!pFolder) pFolder=pMAPI->OpenOutbox(); - if(!CMAPIObject::Create(pMAPI, pFolder)) return FALSE; - - SPropValue prop; - SetMessageFlags(MSGFLAG_UNSENT | MSGFLAG_FROMME); - - LPSPropValue pProp=NULL; - ULONG cValues=0; - ULONG rgTags[]={ 1, PR_IPM_SENTMAIL_ENTRYID }; - - if(m_pMAPI->GetMessageStore()->GetProps((LPSPropTagArray) rgTags, CMAPIEx::cm_nMAPICode, &cValues, &pProp)==S_OK) - { - if(bSaveToSentFolder) - { - prop.ulPropTag=PR_SENTMAIL_ENTRYID; - prop.Value.bin=pProp[0].Value.bin; - } - else - { - prop.ulPropTag=PR_DELETE_AFTER_SUBMIT; - prop.Value.b=TRUE; - } - Message()->SetProps(1, &prop, NULL); - SetEntryID(&(pProp[0].Value.bin)); - MAPIFreeBuffer(pProp); - } - - if(nPriority!=IMPORTANCE_NORMAL) - { - prop.ulPropTag=PR_IMPORTANCE; - prop.Value.l=nPriority; - Message()->SetProps(1, &prop, NULL); - } - - SetMessageClass(_T("IPM.Note")); - -#ifdef _WIN32_WCE - prop.ulPropTag=PR_MSG_STATUS; - prop.Value.ul=MSGSTATUS_RECTYPE_SMTP; - Message()->SetProps(1, &prop, NULL); -#endif - - return TRUE; -} - -BOOL CMAPIMessage::IsUnread() -{ - return (!(GetMessageFlags()&MSGFLAG_READ)); -} - -BOOL CMAPIMessage::MarkAsRead(BOOL bRead) -{ -#ifdef _WIN32_WCE - int ulMessageFlags=GetMessageFlags(); - if(bRead) ulMessageFlags|=MSGFLAG_READ; - else ulMessageFlags&=~MSGFLAG_READ; - return SetMessageFlags(ulMessageFlags); -#else - return (Message()->SetReadFlag(bRead ? MSGFLAG_READ : CLEAR_READ_FLAG)==S_OK); -#endif -} - -BOOL CMAPIMessage::AddRecipients(LPADRLIST pAddressList) -{ - HRESULT hr=E_INVALIDARG; -#ifdef _WIN32_WCE - hr=Message()->ModifyRecipients(MODRECIP_ADD, pAddressList); -#else - LPADRBOOK pAddressBook; - if(m_pMAPI->GetSession()->OpenAddressBook(0, NULL, AB_NO_DIALOG, &pAddressBook)!=S_OK) return FALSE; - - if(pAddressBook->ResolveName(0, CMAPIEx::cm_nMAPICode, NULL, pAddressList)==S_OK) hr=Message()->ModifyRecipients(MODRECIP_ADD, pAddressList); - RELEASE(pAddressBook); -#endif - return (hr==S_OK); -} - -// AddrType only needed by Windows CE, use SMTP, or SMS etc, default NULL will not set PR_ADDRTYPE -BOOL CMAPIMessage::AddRecipient(LPCTSTR szEmail, int nType, LPCTSTR szAddrType) -{ - if(!Message() || !m_pMAPI) return FALSE; - - int nBufSize=CbNewADRLIST(1); - LPADRLIST pAddressList=NULL; - MAPIAllocateBuffer(nBufSize, (LPVOID FAR*)&pAddressList); - memset(pAddressList, 0, nBufSize); - - int nProperties=3; - if(szAddrType==NULL) nProperties--; - pAddressList->cEntries=1; - - pAddressList->aEntries[0].ulReserved1=0; - pAddressList->aEntries[0].cValues=nProperties; - - MAPIAllocateBuffer(sizeof(SPropValue)*nProperties, (LPVOID FAR*)&pAddressList->aEntries[0].rgPropVals); - memset(pAddressList->aEntries[0].rgPropVals, 0, sizeof(SPropValue)*nProperties); - - pAddressList->aEntries[0].rgPropVals[0].ulPropTag=PR_RECIPIENT_TYPE; - pAddressList->aEntries[0].rgPropVals[0].Value.ul=nType; - -#ifdef _WIN32_WCE - pAddressList->aEntries[0].rgPropVals[1].ulPropTag=PR_EMAIL_ADDRESS; - pAddressList->aEntries[0].rgPropVals[1].Value.LPSZ=(TCHAR*)szEmail; -#else - pAddressList->aEntries[0].rgPropVals[1].ulPropTag=PR_DISPLAY_NAME; - pAddressList->aEntries[0].rgPropVals[1].Value.LPSZ=(TCHAR*)szEmail; -#endif - - if(szAddrType!=NULL) - { - pAddressList->aEntries[0].rgPropVals[2].ulPropTag=PR_ADDRTYPE; - pAddressList->aEntries[0].rgPropVals[2].Value.LPSZ=(TCHAR*)szAddrType; - } - - BOOL bResult=AddRecipients(pAddressList); - CMAPIEx::ReleaseAddressList(pAddressList); - return bResult; -} - -void CMAPIMessage::SetSubject(LPCTSTR szSubject) -{ - m_strSubject=szSubject; - SetPropertyString(PR_SUBJECT, szSubject); -} - -void CMAPIMessage::SetSender(LPCTSTR szSenderName, LPCTSTR szSenderEmail) -{ - m_strSenderName=szSenderName; - m_strSenderEmail=szSenderEmail; - LPTSTR szAddrType=_T("SMTP"); - if(m_strSenderName.GetLength() && m_strSenderEmail.GetLength()) - { - SetPropertyString(PR_SENDER_NAME, szSenderName); - SetPropertyString(PR_SENDER_EMAIL_ADDRESS, szSenderEmail); - -#ifndef _WIN32_WCE - LPADRBOOK pAddressBook; - if(m_pMAPI->GetSession()->OpenAddressBook(0, NULL, AB_NO_DIALOG, &pAddressBook)==S_OK) - { - SPropValue prop; - if(pAddressBook->CreateOneOff((LPTSTR)szSenderName, szAddrType, (LPTSTR)szSenderEmail, 0, &prop.Value.bin.cb, (LPENTRYID*)&prop.Value.bin.lpb)==S_OK) - { - prop.ulPropTag=PR_SENT_REPRESENTING_ENTRYID; - Message()->SetProps(1, &prop, NULL); - - SetPropertyString(PR_SENT_REPRESENTING_NAME, szSenderName); - SetPropertyString(PR_SENT_REPRESENTING_EMAIL_ADDRESS, szSenderEmail); - SetPropertyString(PR_SENT_REPRESENTING_ADDRTYPE, szAddrType); - } - } - RELEASE(pAddressBook); -#endif - } -} - -BOOL CMAPIMessage::SetReceivedTime(SYSTEMTIME tmReceived, BOOL bLocalTime) -{ - SPropValue prop; - prop.ulPropTag=PR_MESSAGE_DELIVERY_TIME; -#ifndef _WIN32_WCE - if(bLocalTime) TzSpecificLocalTimeToSystemTime(NULL, &tmReceived, &tmReceived); -#endif - SystemTimeToFileTime(&tmReceived, &prop.Value.ft); - return (Message() && Message()->SetProps(1, &prop, NULL)==S_OK); -} - -BOOL CMAPIMessage::SetSubmitTime(SYSTEMTIME tmSubmit, BOOL bLocalTime) -{ - SPropValue prop; - prop.ulPropTag=PR_CLIENT_SUBMIT_TIME; -#ifndef _WIN32_WCE - if(bLocalTime) TzSpecificLocalTimeToSystemTime(NULL, &tmSubmit, &tmSubmit); -#endif - SystemTimeToFileTime(&tmSubmit, &prop.Value.ft); - return (Message() && Message()->SetProps(1, &prop, NULL)==S_OK); -} - -// request a Read Receipt sent to szReceiverEmail -BOOL CMAPIMessage::SetReadReceipt(BOOL bSet, LPCTSTR szReceiverEmail) -{ - if(!Message()) return FALSE; - - SPropValue prop; - prop.ulPropTag=PR_READ_RECEIPT_REQUESTED; - prop.Value.b=(unsigned short)bSet; - if(Message()->SetProps(1, &prop, NULL)!=S_OK) return FALSE; - - if(bSet && szReceiverEmail && _tcslen(szReceiverEmail)>0) SetPropertyString(PR_READ_RECEIPT_REQUESTED, szReceiverEmail); - return TRUE; -} - -BOOL CMAPIMessage::SetDeliveryReceipt(BOOL bSet) -{ - if(!Message()) return FALSE; - - SPropValue prop; - prop.ulPropTag=PR_ORIGINATOR_DELIVERY_REPORT_REQUESTED; - prop.Value.b=(unsigned short)bSet; - return (Message()->SetProps(1, &prop, NULL)!=S_OK); -} - -// limited compare, compares entry IDs and subject to determine if two emails are equal -BOOL CMAPIMessage::operator==(CMAPIMessage& message) -{ - if(!m_entryID.cb || !message.m_entryID.cb || m_entryID.cb!=message.m_entryID.cb) return FALSE; - if(memcmp(m_entryID.lpb,message.m_entryID.lpb, m_entryID.cb)) return FALSE; - return (!m_strSubject.Compare(message.m_strSubject)); -} - -// Novell GroupWise customization by jcadmin -#ifndef GROUPWISE -BOOL CMAPIMessage::MarkAsPrivate() { return FALSE; } -#else -#include GWMAPI.h -//(from Novell Developer Kit) -#define SEND_OPTIONS_MARK_PRIVATE 0x00080000L - -void CMAPIMessage::MarkAsPrivate() -{ - SPropValue prop; - prop.ulPropTag=PR_NGW_SEND_OPTIONS; - prop.Value.l=NGW_SEND_OPTIONS_MARK_PRIVATE; - return (Message()->SetProps(1, &prop, NULL)==S_OK); -} -#endif - -// In WinCE, use MSGSTATUS_RECTYPE_SMS for an SMS, MSGSTATUS_RECTYPE_SMTP for an email -BOOL CMAPIMessage::SetMessageStatus(int nMessageStatus) -{ - SPropValue prop; - prop.ulPropTag=PR_MSG_STATUS; - prop.Value.ul=nMessageStatus; - return (Message()->SetProps(1, &prop, NULL)==S_OK); -} - -// Shows the default MAPI form for IMessage, returns FALSE on failure, IDOK on success or close existing messages -// and IDCANCEL on close new messages -int CMAPIMessage::ShowForm(CMAPIEx* pMAPI) -{ - CMAPIFolder* pFolder=pMAPI->GetFolder(); - IMAPISession* pSession=pMAPI->GetSession(); - ULONG ulMessageToken; - - if(pFolder && pSession && pSession->PrepareForm(NULL,Message(), &ulMessageToken)==S_OK) - { - ULONG ulMessageStatus=GetPropertyValue(PR_MSG_STATUS, 0); - ULONG ulMessageFlags=GetMessageFlags(); - ULONG ulAccess=GetPropertyValue(PR_ACCESS, 0); - - LPSPropValue pProp; - if(GetProperty(PR_MESSAGE_CLASS, pProp)==S_OK) - { -#ifdef UNICODE - char szMessageClass[256]; - WideCharToMultiByte(CP_ACP, 0, pProp->Value.LPSZ,-1, szMessageClass,255, NULL, NULL); -#else - char* szMessageClass=pProp->Value.LPSZ; -#endif - HRESULT hr=pSession->ShowForm(NULL, pMAPI->GetMessageStore(), pFolder->Folder(), NULL,ulMessageToken, NULL, 0,ulMessageStatus,ulMessageFlags,ulAccess, szMessageClass); - MAPIFreeBuffer(pProp); - if(hr==S_OK) return IDOK; - if(hr==MAPI_E_USER_CANCEL) return IDCANCEL; - } - } - return FALSE; -} - -BOOL CMAPIMessage::Send() -{ - if(Message() && Message()->SubmitMessage(0)==S_OK) - { - Close(); - return TRUE; - } - return FALSE; -} - -BOOL CMAPIMessage::SaveAsMsg(LPCTSTR szPath) -{ - CString strPath=szPath; - if(strPath.GetLength()<4 || strPath.Right(4).CompareNoCase(".msg")) strPath+=".msg"; -#ifdef _WIN32_WCE - return FALSE; -#else - LPSTORAGE pStorage; - DWORD dwFlags=STGM_READWRITE | STGM_TRANSACTED | STGM_CREATE; -#ifdef UNICODE - if(::StgCreateDocfile(strPath, dwFlags, 0, &pStorage) == S_OK) -#else - WCHAR wszPath[_MAX_PATH]; - MultiByteToWideChar(CP_ACP, 0, (LPCSTR)strPath, -1, wszPath, _MAX_PATH); - if(StgCreateDocfile(wszPath, dwFlags, 0, &pStorage) == S_OK) -#endif - { - LPMSGSESS pMsgSession; - LPMALLOC pMalloc = MAPIGetDefaultMalloc(); - if(OpenIMsgSession(pMalloc, 0, &pMsgSession) == S_OK) { - LPMESSAGE pIMsg; - if(OpenIMsgOnIStg(pMsgSession, MAPIAllocateBuffer, MAPIAllocateMore, MAPIFreeBuffer, pMalloc, NULL, pStorage, NULL, 0, 0, &pIMsg) == S_OK) { - // client must support CLSID_MailMessage as the compound document - if(WriteClassStg(pStorage, CLSID_MailMessage) == S_OK) { - // exclude these properties from the copy operation to speed things up - SizedSPropTagArray ( 7, excludeTags ); - excludeTags.cValues=7; - excludeTags.aulPropTag[0]=PR_ACCESS; - excludeTags.aulPropTag[1]=PR_BODY; - excludeTags.aulPropTag[2]=PR_RTF_SYNC_BODY_COUNT; - excludeTags.aulPropTag[3]=PR_RTF_SYNC_BODY_CRC; - excludeTags.aulPropTag[4]=PR_RTF_SYNC_BODY_TAG; - excludeTags.aulPropTag[5]=PR_RTF_SYNC_PREFIX_COUNT; - excludeTags.aulPropTag[6]=PR_RTF_SYNC_TRAILING_COUNT; - - if(Message()->CopyTo(0, NULL, (LPSPropTagArray)&excludeTags, NULL, NULL, (LPIID)&IID_IMessage, pIMsg, 0, NULL ) == S_OK) { - pIMsg->SaveChanges(KEEP_OPEN_READWRITE); - pStorage->Commit(STGC_DEFAULT); - } - } - RELEASE(pIMsg); - } - CloseIMsgSession(pMsgSession); - } - RELEASE(pStorage); - return TRUE; - } - return FALSE; -#endif -} diff --git a/bazaar/MAPIEx/plugin/MAPIMessage.h b/bazaar/MAPIEx/plugin/MAPIMessage.h deleted file mode 100644 index 901e5452d..000000000 --- a/bazaar/MAPIEx/plugin/MAPIMessage.h +++ /dev/null @@ -1,92 +0,0 @@ -#ifndef __MAPIMESSAGE_H__ -#define __MAPIMESSAGE_H__ - -//////////////////////////////////////////////////////////////////////////////////////////////////////////// -// -// File: MAPIMessage.h -// Description: MAPI Message class wrapper -// -// Copyright (C) 2005-2011, Noel Dillabough -// -// This source code is free to use and modify provided this notice remains intact and that any enhancements -// or bug fixes are posted to the CodeProject page hosting this class for the community to benefit. -// -// Usage: see the CodeProject article at http://www.codeproject.com/internet/CMapiEx.asp -// -//////////////////////////////////////////////////////////////////////////////////////////////////////////// - -class CMAPIEx; - -///////////////////////////////////////////////////////////// -// CMAPIMessage - -class AFX_EXT_CLASS CMAPIMessage : public CMAPIObject -{ -public: - CMAPIMessage(); - ~CMAPIMessage(); - - enum { PROP_RECIPIENT_TYPE, PROP_RECIPIENT_NAME, PROP_RECIPIENT_EMAIL, PROP_ADDR_TYPE, PROP_ENTRYID, RECIPIENT_COLS }; - -// Attributes -protected: - CString m_strSenderName; - CString m_strSenderEmail; - CString m_strSubject; - CString m_strBody; - CString m_strRTF; - - LPMAPITABLE m_pRecipients; - -// Operations -public: - virtual BOOL Open(CMAPIEx* pMAPI,SBinary entry); - virtual void Close(); - - BOOL IsUnread(); - BOOL MarkAsRead(BOOL bRead=TRUE); - BOOL Create(CMAPIEx* pMAPI, int nPriority=IMPORTANCE_NORMAL, BOOL bSaveToSentFolder=TRUE, CMAPIFolder* pFolder=NULL); - int ShowForm(CMAPIEx* pMAPI); - BOOL Send(); - - BOOL GetHeader(CString& strHeader); - LPCTSTR GetSenderName() { return m_strSenderName; } - LPCTSTR GetSenderEmail() { return m_strSenderEmail; } - LPCTSTR GetSubject() { return m_strSubject; } - BOOL GetReceivedTime(SYSTEMTIME& tmReceived); - BOOL GetReceivedTime(CString& strReceivedTime, LPCTSTR szFormat=NULL); // NULL defaults to "MM/dd/yyyy hh:mm:ss tt" - BOOL GetSubmitTime(SYSTEMTIME& tmSubmit); - BOOL GetSubmitTime(CString& strSubmitTime, LPCTSTR szFormat=NULL); - BOOL GetTo(CString& strTo); - BOOL GetCC(CString& strCC); - BOOL GetBCC(CString& strBCC); - int GetSensitivity(); - int GetMessageStatus(); - int GetPriority(); - DWORD GetSize(); - - BOOL GetRecipients(); - BOOL GetNextRecipient(CString& strName, CString& strEmail, int& nType); - BOOL GetReplyTo(CString& strEmail); - - BOOL AddRecipients(LPADRLIST pAddressList); - BOOL AddRecipient(LPCTSTR szEmail, int nType=MAPI_TO, LPCTSTR szAddrType=NULL); // MAPI_CC and MAPI_BCC also valid - void SetSubject(LPCTSTR szSubject); - void SetSender(LPCTSTR szSenderName, LPCTSTR szSenderEmail); - BOOL SetReceivedTime(SYSTEMTIME tmReceived, BOOL bLocalTime=FALSE); - BOOL SetSubmitTime(SYSTEMTIME tmSubmit, BOOL bLocalTime=FALSE); - BOOL SetReadReceipt(BOOL bSet=TRUE, LPCTSTR szReceiverEmail=NULL); - BOOL SetDeliveryReceipt(BOOL bSet=TRUE); - BOOL MarkAsPrivate(); - BOOL SetMessageStatus(int nMessageStatus); - - // compares entryID and subject only - BOOL operator==(CMAPIMessage& message); - - BOOL SaveAsMsg(LPCTSTR szPath); - -protected: - void FillSenderEmail(); -}; - -#endif diff --git a/bazaar/MAPIEx/plugin/MAPIObject.cpp b/bazaar/MAPIEx/plugin/MAPIObject.cpp deleted file mode 100644 index 20e1b48c2..000000000 --- a/bazaar/MAPIEx/plugin/MAPIObject.cpp +++ /dev/null @@ -1,845 +0,0 @@ -//////////////////////////////////////////////////////////////////////////////////////////////////////////// -// -// File: MAPIObject.cpp -// Description: Base class for code common to MAPI Items (messages, contacts etc) -// -// Copyright (C) 2005-2011, Noel Dillabough -// -// This source code is free to use and modify provided this notice remains intact and that any enhancements -// or bug fixes are posted to the CodeProject page hosting this class for the community to benefit. -// -// Usage: see the CodeProject article at http://www.codeproject.com/internet/CMapiEx.asp -// -//////////////////////////////////////////////////////////////////////////////////////////////////////////// - -#include "MAPIExPCH.h" -#include "MAPIEx.h" - -///////////////////////////////////////////////////////////// -// CMAPIObject - -CMAPIObject::CMAPIObject() -{ - m_pMAPI=NULL; - m_pItem=NULL; - m_entryID.cb=0; - SetEntryID(NULL); -} - -CMAPIObject::~CMAPIObject() -{ -} - -BOOL CMAPIObject::GetHexString(CString& strHex, SBinary bin) -{ - strHex.Empty(); - if(bin.cb) - { - TCHAR szBuffer[3]; - for(ULONG i=0;icb; - if(m_entryID.cb) - { - m_entryID.lpb=new BYTE[m_entryID.cb]; - memcpy(m_entryID.lpb, pEntryID->lpb, m_entryID.cb); - } - } - else - { - m_entryID.cb=0; - } -} - -BOOL CMAPIObject::Open(CMAPIEx* pMAPI, SBinary entryID) -{ - Close(); - m_pMAPI=pMAPI; - ULONG ulObjType; - if(m_pMAPI->GetSession()->OpenEntry(entryID.cb, (LPENTRYID)entryID.lpb, NULL, MAPI_BEST_ACCESS, &ulObjType, (LPUNKNOWN*)&m_pItem)!=S_OK) return FALSE; - SetEntryID(&entryID); - return TRUE; -} - -void CMAPIObject::Close() -{ - SetEntryID(NULL); - RELEASE(m_pItem); - m_pMAPI=NULL; -} - -BOOL CMAPIObject::Save(BOOL bClose) -{ - ULONG ulFlags=bClose ? 0 : KEEP_OPEN_READWRITE; - if(m_pItem && m_pItem->SaveChanges(ulFlags)==S_OK) - { - if(bClose) Close(); - return TRUE; - } - return FALSE; -} - -int CMAPIObject::GetMessageFlags() -{ - return GetPropertyValue(PR_MESSAGE_FLAGS, 0); -} - -BOOL CMAPIObject::SetMessageFlags(int nFlags) -{ - SPropValue prop; - prop.ulPropTag=PR_MESSAGE_FLAGS; - prop.Value.l=nFlags; - return (m_pItem && m_pItem->SetProps(1, &prop, NULL)==S_OK); -} - -int CMAPIObject::GetSensitivity() -{ - return GetPropertyValue(PR_SENSITIVITY, -1); -} - -BOOL CMAPIObject::SetSensitivity(int nSensitivity) -{ - SPropValue prop; - prop.ulPropTag=PR_SENSITIVITY; - prop.Value.l=nSensitivity; - return (Message()->SetProps(1, &prop, NULL)==S_OK); -} - -int CMAPIObject::GetImportance() -{ - return GetPropertyValue(PR_IMPORTANCE, IMPORTANCE_NORMAL); -} - -BOOL CMAPIObject::SetImportance(int nImportance) -{ - SPropValue prop; - prop.ulPropTag=PR_IMPORTANCE; - prop.Value.l=nImportance; - return (Message()->SetProps(1, &prop, NULL)==S_OK); -} - -BOOL CMAPIObject::GetMessageClass(CString& strMessageClass) -{ - return GetPropertyString(PR_MESSAGE_CLASS, strMessageClass); -} - -BOOL CMAPIObject::SetMessageClass(LPCTSTR szMessageClass) -{ - SPropValue prop; - prop.ulPropTag=PR_MESSAGE_CLASS; - prop.Value.LPSZ=(LPTSTR)szMessageClass; - return (Message()->SetProps(1, &prop, NULL)==S_OK); -} - -int CMAPIObject::GetMessageEditorFormat() -{ - return GetPropertyValue(PR_MSG_EDITOR_FORMAT, EDITOR_FORMAT_DONTKNOW); -} - -BOOL CMAPIObject::SetMessageEditorFormat(int nFormat) -{ - SPropValue prop; - prop.ulPropTag=PR_MSG_EDITOR_FORMAT; - prop.Value.l=nFormat; - return (m_pItem && m_pItem->SetProps(1, &prop, NULL)==S_OK); -} - -BOOL CMAPIObject::Create(CMAPIEx* pMAPI, CMAPIFolder* pFolder) -{ - if(!pMAPI) return FALSE; - if(!pFolder) pFolder=pMAPI->GetFolder(); - if(!pFolder) return FALSE; - Close(); - m_pMAPI=pMAPI; - if(pFolder->Folder()->CreateMessage(NULL, 0, (LPMESSAGE*)&m_pItem)==S_OK) - { - LPSPropValue pProp; - if(GetProperty(PR_ENTRYID, pProp)==S_OK) - { - SetEntryID(&pProp->Value.bin); - MAPIFreeBuffer(pProp); - } - return TRUE; - } - return FALSE; -} - -HRESULT CMAPIObject::GetProperty(ULONG ulProperty, LPSPropValue& pProp) -{ - if(!m_pItem) return E_INVALIDARG; - ULONG ulPropCount; - ULONG p[2]={ 1, ulProperty }; - return m_pItem->GetProps((LPSPropTagArray)p, CMAPIEx::cm_nMAPICode, &ulPropCount, &pProp); -} - -BOOL CMAPIObject::GetPropertyString(ULONG ulProperty, CString& strProperty, BOOL bStream) -{ - strProperty=_T(""); - if(bStream) - { - IStream* pStream; - if(Message()->OpenProperty(ulProperty, &IID_IStream, STGM_READ, NULL, (LPUNKNOWN*)&pStream)==S_OK) - { - const int BUF_SIZE=16384; - TCHAR szBuf[BUF_SIZE+1]; - ULONG ulNumChars; - - do - { - pStream->Read(szBuf, BUF_SIZE*sizeof(TCHAR), &ulNumChars); - ulNumChars/=sizeof(TCHAR); - szBuf[min(BUF_SIZE,ulNumChars)]=0; - strProperty+=szBuf; - } while(ulNumChars>=BUF_SIZE); - - RELEASE(pStream); - return TRUE; - } - } - else - { - if (ulProperty==PR_ENTRYID) - { - return GetEntryIDString(strProperty); - } - - LPSPropValue pProp; - if(GetProperty(ulProperty, pProp)==S_OK) - { - strProperty=CMAPIEx::GetValidString(*pProp); - MAPIFreeBuffer(pProp); - return TRUE; - } - } - return FALSE; -} - -int CMAPIObject::GetPropertyValue(ULONG ulProperty, int nDefaultValue) -{ - LPSPropValue pProp; - if(GetProperty(ulProperty, pProp)==S_OK) - { - nDefaultValue=pProp->Value.l; - MAPIFreeBuffer(pProp); - } - return nDefaultValue; -} - -const GUID GUIDPublicStrings={ 0x00020329, 0x0000, 0x0000, 0xC0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46 }; - -BOOL CMAPIObject::GetPropTagArray(LPCTSTR szFieldName, LPSPropTagArray& lppPropTags, int& nFieldType, BOOL bCreate) -{ - if(!m_pItem) return FALSE; - - MAPINAMEID nameID; - nameID.lpguid=(GUID*)&GUIDPublicStrings; - nameID.ulKind=MNID_STRING; -#ifdef UNICODE - nFieldType=PT_UNICODE; - nameID.Kind.lpwstrName=(LPWSTR)szFieldName; -#else - nFieldType=PT_STRING8; - WCHAR wszFieldName[256]; - MultiByteToWideChar(CP_ACP, 0, szFieldName, -1, wszFieldName, 255); - nameID.Kind.lpwstrName=wszFieldName; -#endif - - LPMAPINAMEID lpNameID[1]={ &nameID }; - - HRESULT hr=m_pItem->GetIDsFromNames(1, lpNameID, bCreate ? MAPI_CREATE : 0, &lppPropTags); - return (hr==S_OK); -} - -BOOL CMAPIObject::GetNamedProperty(LPCTSTR szFieldName, LPSPropValue &pProp) -{ - LPSPropTagArray lppPropTags; - int nFieldType; - if(!GetPropTagArray(szFieldName, lppPropTags, nFieldType, FALSE)) return FALSE; - - ULONG ulPropCount; - HRESULT hr=m_pItem->GetProps(lppPropTags, CMAPIEx::cm_nMAPICode, &ulPropCount, &pProp); - MAPIFreeBuffer(lppPropTags); - return (hr==S_OK); -} - -BOOL CMAPIObject::GetNamedProperty(LPCTSTR szFieldName, CString& strField) -{ - LPSPropValue pProp; - if(GetNamedProperty(szFieldName, pProp)) - { - strField=CMAPIEx::GetValidString(*pProp); - MAPIFreeBuffer(pProp); - return TRUE; - } - return FALSE; -} - -BOOL CMAPIObject::GetOutlookPropTagArray(ULONG ulData, ULONG ulProperty, LPSPropTagArray& lppPropTags, int& nFieldType, BOOL bCreate) -{ - if(!m_pItem) return FALSE; - - const GUID guidOutlookEmail1={ulData, 0x0000, 0x0000, 0xC0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46 }; - - MAPINAMEID nameID; - nameID.lpguid=(GUID*)&guidOutlookEmail1; - nameID.ulKind=MNID_ID; - nameID.Kind.lID=ulProperty; - -#ifdef UNICODE - nFieldType=PT_UNICODE; -#else - nFieldType=PT_STRING8; -#endif - - LPMAPINAMEID lpNameID[1]={ &nameID }; - - HRESULT hr=m_pItem->GetIDsFromNames(1, lpNameID, bCreate ? MAPI_CREATE : 0, &lppPropTags); - return (hr==S_OK); -} - -// gets a custom outlook property (ie EmailAddress1 of a contact) -BOOL CMAPIObject::GetOutlookProperty(ULONG ulData, ULONG ulProperty, LPSPropValue& pProp) -{ - LPSPropTagArray lppPropTags; - int nFieldType; - if(!GetOutlookPropTagArray(ulData,ulProperty, lppPropTags, nFieldType, FALSE)) return FALSE; - - ULONG ulPropCount; - HRESULT hr=m_pItem->GetProps(lppPropTags, CMAPIEx::cm_nMAPICode, &ulPropCount, &pProp); - MAPIFreeBuffer(lppPropTags); - return (hr==S_OK); -} - -// gets a custom outlook property value -BOOL CMAPIObject::GetOutlookPropertyValue(ULONG ulData, ULONG ulProperty, int& nValue) -{ - LPSPropValue pProp; - if(GetOutlookProperty(ulData, ulProperty, pProp)) - { - nValue=pProp->Value.i; - MAPIFreeBuffer(pProp); - return TRUE; - } - return FALSE; -} - -// gets a custom outlook property string (ie EmailAddress1 of a contact) -BOOL CMAPIObject::GetOutlookPropertyString(ULONG ulData, ULONG ulProperty, CString& strProperty) -{ - LPSPropValue pProp; - if(GetOutlookProperty(ulData, ulProperty, pProp)) - { - strProperty=CMAPIEx::GetValidString(*pProp); - MAPIFreeBuffer(pProp); - return TRUE; - } - return FALSE; -} - -BOOL CMAPIObject::SetPropertyString(ULONG ulProperty, LPCTSTR szProperty, BOOL bStream) -{ - if(m_pItem && szProperty) - { - if(bStream) - { - LPSTREAM pStream=NULL; - if(m_pItem->OpenProperty(ulProperty, &IID_IStream, 0, MAPI_MODIFY | MAPI_CREATE, (LPUNKNOWN*)&pStream)==S_OK) - { - pStream->Write(szProperty, (ULONG)(_tcslen(szProperty)+1)*sizeof(TCHAR), NULL); - RELEASE(pStream); - return TRUE; - } - } - else - { - SPropValue prop; - prop.ulPropTag=ulProperty; - prop.Value.LPSZ=(LPTSTR)szProperty; - return (m_pItem->SetProps(1, &prop, NULL)==S_OK); - } - } - return FALSE; -} - -BOOL CMAPIObject::SetPropertyValue(ULONG ulProperty, int nValue) -{ - if(m_pItem) - { - SPropValue prop; - prop.ulPropTag=ulProperty; - prop.Value.l=nValue; - return (m_pItem->SetProps(1, &prop, NULL)==S_OK); - } - return FALSE; -} - -// if bCreate is true, the property will be created if necessary otherwise if not present will return FALSE -BOOL CMAPIObject::SetNamedProperty(LPCTSTR szFieldName, LPCTSTR szField, BOOL bCreate) -{ - LPSPropTagArray lppPropTags; - int nFieldType; - if(!GetPropTagArray(szFieldName, lppPropTags, nFieldType, bCreate)) return FALSE; - - SPropValue prop; - prop.ulPropTag=(lppPropTags->aulPropTag[0]|nFieldType); - prop.Value.LPSZ=(LPTSTR)szField; - HRESULT hr=m_pItem->SetProps(1, &prop, NULL); - MAPIFreeBuffer(lppPropTags); - return (hr==S_OK); -} - -BOOL CMAPIObject::SetNamedMVProperty(LPCTSTR szFieldName, LPCTSTR* arCategories, int nCount, LPSPropValue &pProp, BOOL bCreate) -{ - LPSPropTagArray lppPropTags; - int nFieldType; - if(!GetPropTagArray(szFieldName, lppPropTags, nFieldType, bCreate)) return FALSE; - - HRESULT hr=MAPIAllocateBuffer(sizeof(SPropValue), (LPVOID*)&pProp); - if(hr==S_OK) - { - pProp->ulPropTag=(lppPropTags->aulPropTag[0]|nFieldType|MV_FLAG); - pProp->Value.MVi.cValues=nCount; - if(PROP_TYPE(pProp->ulPropTag)==PT_MV_STRING8) - { - hr=MAPIAllocateMore(sizeof(LPSTR)*nCount, pProp, (LPVOID*)&pProp->Value.MVszA.lppszA); - } - else - { - // PT_MV_UNICODE - hr=MAPIAllocateMore(sizeof(LPSTR)*nCount, pProp, (LPVOID*)&pProp->Value.MVszW.lppszW); - } - if(hr==S_OK) - { - for(int i=0;iValue.MVSZ.LPPSZ[i]=(LPTSTR)arCategories[i]; - hr=m_pItem->SetProps(1, pProp, NULL); - } - if(hr!=S_OK) MAPIFreeBuffer(pProp); - } - return (hr==S_OK); -} - -BOOL CMAPIObject::SetOutlookProperty(ULONG ulData, ULONG ulProperty, LPCTSTR szField) -{ - LPSPropTagArray lppPropTags; - int nFieldType; - if(!GetOutlookPropTagArray(ulData, ulProperty, lppPropTags, nFieldType, FALSE)) return FALSE; - - SPropValue prop; - prop.ulPropTag=(lppPropTags->aulPropTag[0]|nFieldType); - prop.Value.LPSZ=(LPTSTR)szField; - HRESULT hr=m_pItem->SetProps(1, &prop, NULL); - MAPIFreeBuffer(lppPropTags); - return (hr==S_OK); -} - -BOOL CMAPIObject::SetOutlookProperty(ULONG ulData, ULONG ulProperty, int nField, int nFieldType) -{ - LPSPropTagArray lppPropTags; - int nIgnored; - if(!GetOutlookPropTagArray(ulData, ulProperty, lppPropTags, nIgnored, FALSE)) return FALSE; - - SPropValue prop; - prop.ulPropTag=(lppPropTags->aulPropTag[0]|nFieldType); - prop.Value.l=nField; - HRESULT hr=m_pItem->SetProps(1, &prop, NULL); - MAPIFreeBuffer(lppPropTags); - return (hr==S_OK); -} - -BOOL CMAPIObject::SetOutlookProperty(ULONG ulData, ULONG ulProperty, FILETIME ftField) -{ - LPSPropTagArray lppPropTags; - int nFieldType; - if(!GetOutlookPropTagArray(ulData,ulProperty, lppPropTags, nFieldType, FALSE)) return FALSE; - nFieldType=PT_SYSTIME; - - SPropValue prop; - prop.ulPropTag=(lppPropTags->aulPropTag[0]|nFieldType); - prop.Value.ft=ftField; - HRESULT hr=m_pItem->SetProps(1, &prop, NULL); - MAPIFreeBuffer(lppPropTags); - return (hr==S_OK); -} - -BOOL CMAPIObject::DeleteNamedProperty(LPCTSTR szFieldName) -{ - LPSPropTagArray lppPropTags; - int nFieldType; - if(!GetPropTagArray(szFieldName, lppPropTags, nFieldType, FALSE)) return FALSE; - - HRESULT hr=m_pItem->DeleteProps(lppPropTags, NULL); - MAPIFreeBuffer(lppPropTags); - return (hr==S_OK); -} - -int CMAPIObject::GetAttachmentCount() -{ - ULONG ulCount=0; - LPMAPITABLE pAttachTable; - if(Message()->GetAttachmentTable(0, &pAttachTable)==S_OK) - { -#ifndef _WIN32_WCE - if(pAttachTable->GetRowCount(0, &ulCount)!=S_OK) ulCount=0; -#else - enum { PROP_ATTACH_CONTENT_ID, ATTACH_COLS }; - static SizedSPropTagArray(ATTACH_COLS, Columns)={ATTACH_COLS, PR_ATTACH_CONTENT_ID }; - if(pAttachTable->SetColumns((LPSPropTagArray)&Columns, 0)==S_OK) - { - ULONG cRows; - do { - LPSRowSet pRows=NULL; - if(pAttachTable->QueryRows(1, 0, &pRows)!=S_OK) - { - MAPIFreeBuffer(pRows); - break; - } - cRows=pRows->cRows; - ulCount+=cRows; - FreeProws(pRows); - } while(cRows); - } -#endif - RELEASE(pAttachTable); - } - return ulCount; -} - -BOOL CMAPIObject::GetAttachment(CMAPIAttachment& attachment, int nIndex) -{ - return attachment.Open(Message(), nIndex); -} - -BOOL CMAPIObject::AddAttachment(CMAPIAttachment& attachment) -{ - return attachment.Create(Message()); -} - -BOOL CMAPIObject::AddAttachment(LPCTSTR szPath, LPCTSTR szName, LPCTSTR szCID) -{ - CFile file; - if(!file.Open(szPath, CFile::modeRead)) return FALSE; - file.Close(); - - LPTSTR szFileName=(LPTSTR)szName; - if(!szFileName) - { - szFileName=(LPTSTR)szPath; - for(int i=(int)_tcsclen(szPath)-1;i>=0;i--) if(szPath[i]=='\\' || szPath[i]=='/') - { - szFileName=(LPTSTR)&szPath[i+1]; - break; - } - } - - CMAPIAttachment attachment; - if(attachment.Create(Message())) - { - if(!szCID || _tcscmp(szCID, CONTACT_PICTURE)) - { - attachment.SetFileName(szFileName); - attachment.SetLongFileName(szFileName); - if(szCID) attachment.SetCID(szCID); - } - else - { - attachment.SetFileName(szCID); - attachment.SetLongFileName(szCID); - attachment.SetPropertyValue(PR_ATTACHMENT_UNKNOWN, TRUE); - } - if(attachment.LoadAttachment(szPath)) - { - attachment.Save(); - return TRUE; - } - } - return FALSE; -} - -// use nIndex of -1 to delete all attachments -BOOL CMAPIObject::DeleteAttachment(int nIndex) -{ - LPMAPITABLE pAttachTable=NULL; - if(Message()->GetAttachmentTable(0, &pAttachTable)!=S_OK) return FALSE; - - BOOL bResult=FALSE; - enum { PROP_ATTACH_NUM, ATTACH_COLS }; - static SizedSPropTagArray(ATTACH_COLS, Columns)={ATTACH_COLS, PR_ATTACH_NUM }; - if(pAttachTable->SetColumns((LPSPropTagArray)&Columns, 0)==S_OK) - { - int i=0; - LPSRowSet pRows=NULL; - while(TRUE) - { - if(pAttachTable->QueryRows(1, 0, &pRows)==S_OK) - { - if(!pRows->cRows) break; - else if(iDeleteAttach(pRows->aRow[0].lpProps[PROP_ATTACH_NUM].Value.ul, 0, NULL, 0)==S_OK); - } - FreeProws(pRows); - if(!bResult || nIndex==i) break; - } - break; - } - } - RELEASE(pAttachTable); - return bResult; -} - -// use nIndex of -1 to save all attachments to szFolder -BOOL CMAPIObject::SaveAttachment(LPCTSTR szFolder, int nIndex, LPCTSTR szFileName) -{ - LPMAPITABLE pAttachTable=NULL; - if(Message()->GetAttachmentTable(0, &pAttachTable)!=S_OK) return FALSE; - - CString strPath; - BOOL bResult=FALSE; - enum { PROP_ATTACH_NUM, PROP_ATTACH_LONG_FILENAME, PROP_ATTACH_FILENAME, ATTACH_COLS }; - static SizedSPropTagArray(ATTACH_COLS, Columns)={ATTACH_COLS, PR_ATTACH_NUM, PR_ATTACH_LONG_FILENAME, PR_ATTACH_FILENAME }; - if(pAttachTable->SetColumns((LPSPropTagArray)&Columns, 0)==S_OK) - { - LPSRowSet pRows=NULL; - CMAPIAttachment attachment; - while(TRUE) - { - if(nIndex>=0 && pAttachTable->SeekRow(BOOKMARK_BEGINNING, nIndex, NULL)!=S_OK) break; - if(pAttachTable->QueryRows(1, 0, &pRows)==S_OK) - { - if(!pRows->cRows) break; - LPATTACH pAttachment; - if(Message()->OpenAttach(pRows->aRow[0].lpProps[PROP_ATTACH_NUM].Value.bin.cb, NULL, 0, &pAttachment)==S_OK) - { - if (szFileName != NULL) - { - strPath.Format(_T("%s\\%s"), szFolder, szFileName); - } - else - { - if(CMAPIEx::GetValidString(pRows->aRow[0].lpProps[PROP_ATTACH_LONG_FILENAME])) strPath.Format(_T("%s\\%s"), szFolder, pRows->aRow[0].lpProps[PROP_ATTACH_LONG_FILENAME].Value.LPSZ); - else if(CMAPIEx::GetValidString(pRows->aRow[0].lpProps[PROP_ATTACH_FILENAME])) strPath.Format(_T("%s\\%s"), szFolder, pRows->aRow[0].lpProps[PROP_ATTACH_FILENAME].Value.LPSZ); - else strPath.Format(_T("%s\\Attachment.dat"), szFolder); - } - attachment.Attach(pAttachment); - attachment.SaveAttachment(strPath); - bResult=attachment.SaveAttachment(strPath); - } - } - FreeProws(pRows); - if(nIndex>=0) break; - } - } - RELEASE(pAttachTable); - return bResult; -} - -// Gets the body of the item, if bAutoDetect is set, uses the MessageEditorFormat to try to determine which property to return -BOOL CMAPIObject::GetBody(CString& strBody, BOOL bAutoDetect) -{ - if(bAutoDetect) - { - int nFormat=GetMessageEditorFormat(); - if(nFormat==EDITOR_FORMAT_DONTKNOW || nFormat==EDITOR_FORMAT_RTF) return GetRTF(strBody); - else if(nFormat==EDITOR_FORMAT_HTML) return GetHTML(strBody); - } - return GetPropertyString(PR_BODY, strBody, TRUE); -} - -BOOL CMAPIObject::SetBody(LPCTSTR szBody) -{ - if(SetPropertyString(PR_BODY, szBody, TRUE)) - { - SetMessageEditorFormat(EDITOR_FORMAT_PLAINTEXT); - return TRUE; - } - return FALSE; -} - -BOOL CMAPIObject::GetHTML(CString& strHTML) -{ - return GetPropertyString(PR_BODY_HTML, strHTML, TRUE); -} - -BOOL CMAPIObject::SetHTML(LPCTSTR szHTML) -{ - if(szHTML) - { - // does this Message Store support HTML directly? - ULONG ulSupport=m_pMAPI ? m_pMAPI->GetMessageStoreSupport() : 0; - if(ulSupport&STORE_HTML_OK) - { - if(SetPropertyString(PR_BODY_HTML, szHTML, TRUE)) - { - SetMessageEditorFormat(EDITOR_FORMAT_HTML); - return TRUE; - } - } - else - { - // otherwise lets encode it into RTF - TCHAR szCodePage[6]=_T("1252"); // default codepage is ANSI - Latin I - GetLocaleInfo(LOCALE_SYSTEM_DEFAULT, LOCALE_IDEFAULTANSICODEPAGE, szCodePage, sizeof(szCodePage)); - - CString strRTF; - strRTF.Format(_T("{\\rtf1\\ansi\\ansicpg%s\\fromhtml1 {\\*\\htmltag1 "), szCodePage); - strRTF+=szHTML; - strRTF+=_T(" }}"); - - return SetRTF(strRTF); - } - } - return FALSE; -} - -BOOL CMAPIObject::GetRTF(CString& strRTF) -{ - strRTF=_T(""); - IStream* pStream; - - const int BUF_SIZE=16384; - char szBuf[BUF_SIZE+1]; - ULONG ulNumChars; - -#ifdef _WIN32_WCE - int nMessageStatus=GetMessageStatus(); - if(nMessageStatus & MSGSTATUS_PARTIAL) return; - - if(nMessageStatus & MSGSTATUS_HAS_PR_BODY_HTML) - { - if(Message()->OpenProperty(PR_BODY_HTML_A, &IID_IStream, STGM_READ, NULL, (LPUNKNOWN*)&pStream)!=S_OK) return FALSE; - - do - { - pStream->Read(szBuf, BUF_SIZE, &ulNumChars); - szBuf[min(BUF_SIZE,ulNumChars)]=0; - strRTF+=szBuf; - } while(ulNumChars>=BUF_SIZE); - - RELEASE(pStream); - } - else if(nMessageStatus & MSGSTATUS_HAS_PR_BODY) - { - if(Message()->OpenProperty(PR_BODY_A, &IID_IStream, STGM_READ, NULL, (LPUNKNOWN*)&pStream)!=S_OK) return FALSE; - - do - { - pStream->Read(szBuf, BUF_SIZE, &ulNumChars); - szBuf[min(BUF_SIZE,ulNumChars)]=0; - strRTF+=szBuf; - } while(ulNumChars>=BUF_SIZE); - - RELEASE(pStream); - } -#else - if(Message()->OpenProperty(PR_RTF_COMPRESSED, &IID_IStream, STGM_READ, 0, (LPUNKNOWN*)&pStream)!=S_OK) return FALSE; - - IStream *pUncompressed; - if(WrapCompressedRTFStream(pStream, 0, &pUncompressed)==S_OK) - { - do - { - pUncompressed->Read(szBuf, BUF_SIZE, &ulNumChars); - szBuf[min(BUF_SIZE,ulNumChars)]=0; - strRTF+=szBuf; - } while(ulNumChars>=BUF_SIZE); - RELEASE(pUncompressed); - } - - RELEASE(pStream); -#endif - - // does this RTF contain encoded HTML, or text? - if(strRTF.Find(_T("\\fromhtml"))!=-1) - { - return GetHTML(strRTF); - } - else if(strRTF.Find(_T("\\fromtext"))!=-1) - { - return GetBody(strRTF, FALSE); - } - - return TRUE; -} - -BOOL CMAPIObject::SetRTF(LPCTSTR szRTF) -{ - LPSTREAM pStream=NULL; - if(Message()->OpenProperty(PR_RTF_COMPRESSED, &IID_IStream, STGM_CREATE | STGM_WRITE, MAPI_MODIFY | MAPI_CREATE, (LPUNKNOWN*)&pStream)==S_OK) - { -#ifndef _WIN32_WCE - IStream *pUncompressed; - if(WrapCompressedRTFStream(pStream,MAPI_MODIFY, &pUncompressed)==S_OK) - { - pUncompressed->Write(szRTF, (ULONG)_tcslen(szRTF)*sizeof(TCHAR), NULL); - if(pUncompressed->Commit(STGC_DEFAULT)==S_OK) pStream->Commit(STGC_DEFAULT); - RELEASE(pUncompressed); - } -#endif - RELEASE(pStream); - SetMessageEditorFormat(EDITOR_FORMAT_RTF); - return TRUE; - } - return FALSE; -} - -BOOL CMAPIObject::GetLastModified(SYSTEMTIME& tmLastModified) -{ - LPSPropValue pProp; - if(GetProperty(PR_LAST_MODIFICATION_TIME, pProp)==S_OK) - { - SYSTEMTIME tm; - FileTimeToSystemTime(&pProp->Value.ft, &tm); - SystemTimeToTzSpecificLocalTime(NULL, &tm, &tmLastModified); - - MAPIFreeBuffer(pProp); - return TRUE; - } - return FALSE; -} - -BOOL CMAPIObject::GetLastModified(CString& strLastModified, LPCTSTR szFormat) -{ - SYSTEMTIME tm; - if(GetLastModified(tm)) - { - TCHAR szDate[256]; - if(!szFormat) szFormat=_T("MM/dd/yyyy"); - GetDateFormat(LOCALE_SYSTEM_DEFAULT, 0, &tm, szFormat, szDate, 256); - strLastModified=szDate; - return TRUE; - } - return FALSE; -} - -BOOL CMAPIObject::SetLastModified(SYSTEMTIME& tmLastModified) -{ - SPropValue prop; - prop.ulPropTag=PR_LAST_MODIFICATION_TIME; - SystemTimeToFileTime(&tmLastModified, &prop.Value.ft); - return (m_pItem && m_pItem->SetProps(1, &prop, NULL)==S_OK); -} diff --git a/bazaar/MAPIEx/plugin/MAPIObject.h b/bazaar/MAPIEx/plugin/MAPIObject.h deleted file mode 100644 index 1ea129741..000000000 --- a/bazaar/MAPIEx/plugin/MAPIObject.h +++ /dev/null @@ -1,105 +0,0 @@ -#ifndef __MAPIOBJECT_H__ -#define __MAPIOBJECT_H__ - -//////////////////////////////////////////////////////////////////////////////////////////////////////////// -// -// File: MAPIObject.h -// Description: Base class for code common to MAPI Items (messages, contacts etc) -// -// Copyright (C) 2005-2011, Noel Dillabough -// -// This source code is free to use and modify provided this notice remains intact and that any enhancements -// or bug fixes are posted to the CodeProject page hosting this class for the community to benefit. -// -// Usage: see the CodeProject article at http://www.codeproject.com/internet/CMapiEx.asp -// -//////////////////////////////////////////////////////////////////////////////////////////////////////////// - -class CMAPIEx; -class CMAPIFolder; -class CMAPIAttachment; - -///////////////////////////////////////////////////////////// -// CMAPIObject - -class AFX_EXT_CLASS CMAPIObject : public CObject -{ -public: - CMAPIObject(); - ~CMAPIObject(); - -// Attributes -protected: - CMAPIEx* m_pMAPI; - IMAPIProp* m_pItem; - SBinary m_entryID; - -// Operations -public: - inline LPMESSAGE Message() { return (LPMESSAGE)m_pItem; } - - SBinary* GetEntryID() { return &m_entryID; } - BOOL GetHexString(CString& strHex, SBinary bin); - BOOL GetEntryIDString(CString& strEntryID); - void SetEntryID(SBinary* pEntryID=NULL); - int GetMessageFlags(); - BOOL SetMessageFlags(int nFlags); - int GetSensitivity(); - BOOL SetSensitivity(int nSensitivity); - int GetImportance(); - BOOL SetImportance(int nImportance); - BOOL GetMessageClass(CString& strMessageClass); - BOOL SetMessageClass(LPCTSTR szMessageClass); - int GetMessageEditorFormat(); - BOOL SetMessageEditorFormat(int nFormat); - - virtual BOOL Open(CMAPIEx* pMAPI, SBinary entry); - virtual void Close(); - virtual BOOL Save(BOOL bClose=TRUE); - - // Properties - virtual BOOL GetPropertyString(ULONG ulProperty, CString& strProperty, BOOL bStream=FALSE); - int GetPropertyValue(ULONG ulProperty, int nDefaultValue); - BOOL GetNamedProperty(LPCTSTR szFieldName, LPSPropValue& pProp); - BOOL GetNamedProperty(LPCTSTR szFieldName, CString& strField); - BOOL GetOutlookProperty(ULONG ulData, ULONG ulProperty, LPSPropValue& pProp); - BOOL GetOutlookPropertyValue(ULONG ulData, ULONG ulProperty, int& nValue); - BOOL GetOutlookPropertyString(ULONG ulData, ULONG ulProperty, CString& strProperty); - virtual BOOL SetPropertyString(ULONG ulProperty, LPCTSTR szProperty, BOOL bStream=FALSE); - BOOL SetPropertyValue(ULONG ulProperty, int nValue); - BOOL SetNamedProperty(LPCTSTR szFieldName, LPCTSTR szField, BOOL bCreate=TRUE); - BOOL SetNamedMVProperty(LPCTSTR szFieldName, LPCTSTR* arCategories, int nCount, LPSPropValue &pProp, BOOL bCreate=TRUE); - BOOL SetOutlookProperty(ULONG ulData, ULONG ulProperty, LPCTSTR szField); - BOOL SetOutlookProperty(ULONG ulData, ULONG ulProperty, int nField, int nFieldType=PT_LONG); - BOOL SetOutlookProperty(ULONG ulData, ULONG ulProperty, FILETIME ftField); - BOOL DeleteNamedProperty(LPCTSTR szFieldName); - - // Attachments - int GetAttachmentCount(); - BOOL GetAttachment(CMAPIAttachment& attachment, int nIndex); - BOOL AddAttachment(CMAPIAttachment& attachment); - BOOL AddAttachment(LPCTSTR szPath, LPCTSTR szName=NULL, LPCTSTR szCID=NULL); - BOOL DeleteAttachment(int nIndex=-1); - BOOL SaveAttachment(LPCTSTR szFolder, int nIndex=-1, LPCTSTR szFileName=NULL); - - // Body - BOOL GetBody(CString& strBody, BOOL bAutoDetect=TRUE); - BOOL SetBody(LPCTSTR szBody); - BOOL GetHTML(CString& strHTML); - BOOL SetHTML(LPCTSTR szHTML); - BOOL GetRTF(CString& strRTF); - BOOL SetRTF(LPCTSTR szRTF); - - // Misc - BOOL GetLastModified(SYSTEMTIME& tmLastModified); - BOOL GetLastModified(CString& strLastModified, LPCTSTR szFormat=NULL); // NULL defaults to "MM/dd/yyyy" - BOOL SetLastModified(SYSTEMTIME& tmLastModified); - -protected: - BOOL Create(CMAPIEx* pMAPI, CMAPIFolder* pFolder); - HRESULT GetProperty(ULONG ulProperty, LPSPropValue &prop); - BOOL GetPropTagArray(LPCTSTR szFieldName, LPSPropTagArray& lppPropTags, int& nFieldType, BOOL bCreate); - BOOL GetOutlookPropTagArray(ULONG ulData, ULONG ulProperty, LPSPropTagArray& lppPropTags, int& nFieldType, BOOL bCreate); -}; - -#endif diff --git a/bazaar/MAPIEx/plugin/MAPISink.cpp b/bazaar/MAPIEx/plugin/MAPISink.cpp deleted file mode 100644 index 46a4041ca..000000000 --- a/bazaar/MAPIEx/plugin/MAPISink.cpp +++ /dev/null @@ -1,56 +0,0 @@ -//////////////////////////////////////////////////////////////////////////////////////////////////////////// -// -// File: MAPISink.cpp -// Description: MAPI Advise Sink Wrapper -// -// Copyright (C) 2005-2011, Noel Dillabough -// -// This source code is free to use and modify provided this notice remains intact and that any enhancements -// or bug fixes are posted to the CodeProject page hosting this class for the community to benefit. -// -// Usage: see the CodeProject article at http://www.codeproject.com/internet/CMapiEx.asp -// -//////////////////////////////////////////////////////////////////////////////////////////////////////////// - -#include "MAPIExPCH.h" -#include "MAPISink.h" - -//////////////////////////////////////////////////////////////////////////////////////////////////////////// -// CMAPISink - -CMAPISink::CMAPISink(LPNOTIFCALLBACK lpfnCallback, LPVOID lpvContext) -{ - m_lpfnCallback=lpfnCallback; - m_lpvContext=lpvContext; - m_nRef=0; -} - -HRESULT CMAPISink::QueryInterface(REFIID riid, LPVOID FAR* ppvObj) -{ - if(riid==IID_IUnknown) - { - *ppvObj=this; - AddRef(); - return S_OK; - } - return E_NOINTERFACE; -} - -ULONG CMAPISink::AddRef() -{ - return InterlockedIncrement(&m_nRef); -} - -ULONG CMAPISink::Release() -{ - ULONG ul=InterlockedDecrement(&m_nRef); - if(!ul) delete this; - return ul; -} - -ULONG CMAPISink::OnNotify(ULONG cNotification, LPNOTIFICATION lpNotifications) -{ - if(m_lpfnCallback) m_lpfnCallback(m_lpvContext, cNotification, lpNotifications); - return 0; -} - diff --git a/bazaar/MAPIEx/plugin/MAPISink.h b/bazaar/MAPIEx/plugin/MAPISink.h deleted file mode 100644 index b905e68d6..000000000 --- a/bazaar/MAPIEx/plugin/MAPISink.h +++ /dev/null @@ -1,44 +0,0 @@ -#ifndef __MAPISINK_H__ -#define __MAPISINK_H__ - -//////////////////////////////////////////////////////////////////////////////////////////////////////////// -// -// File: MAPISink.h -// Description: MAPI Advise Sink Wrapper -// -// Copyright (C) 2005-2011, Noel Dillabough -// -// This source code is free to use and modify provided this notice remains intact and that any enhancements -// or bug fixes are posted to the CodeProject page hosting this class for the community to benefit. -// -// Usage: see the CodeProject article at http://www.codeproject.com/internet/CMapiEx.asp -// -//////////////////////////////////////////////////////////////////////////////////////////////////////////// - - -//////////////////////////////////////////////////////////////////////////////////////////////////////////// -// CMAPISink - -class CMAPISink : public IMAPIAdviseSink -{ -public: - CMAPISink(LPNOTIFCALLBACK lpfnCallback, LPVOID lpvContext); - -// Attributes -protected: - LPNOTIFCALLBACK m_lpfnCallback; - LPVOID m_lpvContext; - LONG m_nRef; - -// IUnknown -public: - STDMETHOD(QueryInterface)(REFIID riid, LPVOID FAR* ppvObj); - STDMETHOD_(ULONG, AddRef)(); - STDMETHOD_(ULONG, Release)(); - -// IMAPIAdviseSink -public: - STDMETHOD_(ULONG, OnNotify)(ULONG cNotification, LPNOTIFICATION lpNotifications); -}; - -#endif diff --git a/bazaar/MAPIEx/plugin/Test/MAPIService/MAPIService.cpp b/bazaar/MAPIEx/plugin/Test/MAPIService/MAPIService.cpp deleted file mode 100644 index 3a4162779..000000000 --- a/bazaar/MAPIEx/plugin/Test/MAPIService/MAPIService.cpp +++ /dev/null @@ -1,132 +0,0 @@ -//////////////////////////////////////////////////////////////////////////////////////////////////////////// -// -// File: MAPIService.cpp -// Description: Example of using CMAPIEx in a windows service -// -// Copyright (C) 2005-2011, Noel Dillabough -// -// This source code is free to use and modify provided this notice remains intact and that any enhancements -// or bug fixes are posted to the CodeProject page hosting this class for the community to benefit. -// -//////////////////////////////////////////////////////////////////////////////////////////////////////////// - -#include "MAPIService.h" - -// To make deploying the service easier, I'm linking MAPIEx as a library; to use the DLL instead comment out the following lines -// and change the dependency to MAPIEx -#undef AFX_EXT_CLASS -#define AFX_EXT_CLASS - -#include "../../MAPIEx.h" - -// Service globals -#define SERVICE_NAME _T("MAPIExService") -SERVICE_STATUS status; -SERVICE_STATUS_HANDLE hStatus; -CMAPIEx mapi; - -#ifdef UNICODE -#define PRINTF wprintf -#else -#define PRINTF printf -#endif - -void SetStatus(DWORD dwStatus, DWORD dwExitCode=0) -{ - status.dwCurrentState=dwStatus; - status.dwWin32ExitCode=dwExitCode; - SetServiceStatus(hStatus, &status); -} - -void ControlHandler(DWORD dwControl) -{ - if(dwControl==SERVICE_CONTROL_STOP || dwControl==SERVICE_CONTROL_SHUTDOWN) - { - SetStatus(SERVICE_STOPPED); - mapi.Logout(); - CMAPIEx::Term(); - } -} - -BOOL InstallService(SC_HANDLE hManager) -{ - TCHAR szPath[_MAX_PATH]; - GetModuleFileName(GetModuleHandle(NULL), szPath, _MAX_PATH); - - SC_HANDLE hService=CreateService(hManager, SERVICE_NAME, SERVICE_NAME, SERVICE_ALL_ACCESS, SERVICE_WIN32_OWN_PROCESS, SERVICE_DEMAND_START, SERVICE_ERROR_NORMAL, szPath, NULL, NULL, NULL, NULL, NULL); - if(!hService) return FALSE; - - SERVICE_DESCRIPTION desc; - desc.lpDescription=_T("MAPIEx sample service"); - ChangeServiceConfig2(hService, SERVICE_CONFIG_DESCRIPTION, &desc); - CloseServiceHandle(hService); - return TRUE; -} - -long CALLBACK OnNewMessage(LPVOID lpvContext, ULONG cNotification, LPNOTIFICATION lpNotifications) -{ - // I'm just doing a beep here when a new mail arrives - MessageBeep(-1); - return 0; -} - -void ServiceMain(int argc, char** argv) -{ - memset(&status, 0, sizeof(SERVICE_STATUS)); - status.dwServiceType=SERVICE_WIN32; - status.dwCurrentState=SERVICE_START_PENDING; - status.dwControlsAccepted=SERVICE_ACCEPT_STOP | SERVICE_ACCEPT_SHUTDOWN; - - hStatus=RegisterServiceCtrlHandler(SERVICE_NAME, (LPHANDLER_FUNCTION)ControlHandler); - if(!hStatus) return; - - // initialize MAPI, and turn on notifications for new mail - if(!CMAPIEx::Init(0, TRUE) || !mapi.Login(NULL, 0, TRUE) || !mapi.OpenMessageStore() || !mapi.Notify(OnNewMessage, NULL, fnevNewMail)) - { - SetStatus(SERVICE_STOPPED, -1); - return; - } - - // sleep while running, checking every few seconds - SetStatus(SERVICE_RUNNING); - while(status.dwCurrentState==SERVICE_RUNNING) - { - Sleep(4000); - } - ControlHandler(SERVICE_CONTROL_SHUTDOWN); -} - -void main(int argc, char* argv[]) -{ - if(argc>1) - { - SC_HANDLE hManager=OpenSCManager(NULL, NULL, SC_MANAGER_ALL_ACCESS); - if(hManager) - { - SC_HANDLE hService=OpenService(hManager, SERVICE_NAME, SERVICE_ALL_ACCESS); - - if(!_tcscmp(argv[1], _T("-i"))) - { - if(InstallService(hManager)) PRINTF("Installed %s successfully.\n", SERVICE_NAME); - else PRINTF("Failed to install %s.\n", SERVICE_NAME); - } else if(!_tcscmp(argv[1], _T("-u"))) - { - if(hService && DeleteService(hService)) PRINTF("Uninstalled %s successfully.\n", SERVICE_NAME); - else PRINTF("Failed to uninstall %s.\n", SERVICE_NAME); - } else { - PRINTF(_T("Usage:\n")); - PRINTF(_T("\t-i\tInstall Service\n")); - PRINTF(_T("\t-u\tUninstall Service\n")); - } - if(hService) CloseServiceHandle(hService); - CloseServiceHandle(hManager); - } - return; - } - - SERVICE_TABLE_ENTRY table[]={ - { SERVICE_NAME, (LPSERVICE_MAIN_FUNCTION)ServiceMain }, - { NULL, NULL } - }; - StartServiceCtrlDispatcher(table); -} diff --git a/bazaar/MAPIEx/plugin/Test/MAPIService/MAPIService.h b/bazaar/MAPIEx/plugin/Test/MAPIService/MAPIService.h deleted file mode 100644 index 5905883cb..000000000 --- a/bazaar/MAPIEx/plugin/Test/MAPIService/MAPIService.h +++ /dev/null @@ -1,8 +0,0 @@ -#ifndef __TESTMAPI_H__ -#define __TESTMAPI_H__ - -#define VC_EXTRALEAN // Exclude rarely-used stuff from Windows headers -#include // MFC core and standard components -#include - -#endif diff --git a/bazaar/MAPIEx/plugin/Test/MAPIService/MAPIService.rc b/bazaar/MAPIEx/plugin/Test/MAPIService/MAPIService.rc deleted file mode 100644 index d0a2b67f6..000000000 --- a/bazaar/MAPIEx/plugin/Test/MAPIService/MAPIService.rc +++ /dev/null @@ -1 +0,0 @@ -1001 ICON "..\\MAPIEx.ico" diff --git a/bazaar/MAPIEx/plugin/Test/TestMAPI/TestMAPI.cpp b/bazaar/MAPIEx/plugin/Test/TestMAPI/TestMAPI.cpp deleted file mode 100644 index f54d088ce..000000000 --- a/bazaar/MAPIEx/plugin/Test/TestMAPI/TestMAPI.cpp +++ /dev/null @@ -1,538 +0,0 @@ -//////////////////////////////////////////////////////////////////////////////////////////////////////////// -// -// File: TestMAPI.cpp -// Description: Simple program for testing CMapiEx -// -// Copyright (C) 2005-2011, Noel Dillabough -// -// This source code is free to use and modify provided this notice remains intact and that any enhancements -// or bug fixes are posted to the CodeProject page hosting this class for the community to benefit. -// -//////////////////////////////////////////////////////////////////////////////////////////////////////////// - -#include "TestMAPI.h" - -// To make deploying this console app easier, I'm linking MAPIEx as a library; to use the DLL instead comment out the following lines -// and change the dependency to MAPIEx -#undef AFX_EXT_CLASS -#define AFX_EXT_CLASS - -#include "../../MAPIEx.h" -#include - -// you may want to change these to valid settings before testing -#define FROM_NAME _T("Support") -#define FROM_EMAIL _T("support@nospam.com") -#define MSG_ATTACHMENT _T("c:\\temp\\pic.jpg") -#define MSG_PATH _T("c:\\temp\\message.msg") -#define TO_EMAIL _T("noel@nospam.com") -#define TO_EMAIL2 _T("noel2@nospam.com") -#define COPY_MSG_FOLDER _T("TestFolder") -#define PERSONAL_FOLDERS _T("Personal Folders") -#define DEFAULT_BUFFER_SIZE 4096 - -#ifdef UNICODE -#define PRINTF wprintf -#else -#define PRINTF printf -#endif - -//////////////////////////////////////////////////////////////////////////////////////////////////////////// -// -// To send a message: -// -first open up a MAPI session and login -// -then open the message store you want to access (NULL is the default store) -// -then open the outbox -// -create a new message, set its priority if you like -// -set its properties, recipients and attachments -// -call send -// -//////////////////////////////////////////////////////////////////////////////////////////////////////////// - -void SendTest(CMAPIEx& mapi) -{ - if(mapi.OpenOutbox()) - { - CMAPIMessage message; - if(message.Create(&mapi, IMPORTANCE_LOW)) - { - // setting sender on an exchange server where the user doesn't exist will cause message.Send() to fail - message.SetSender(FROM_NAME, FROM_EMAIL); - message.SetSubject(_T("Subject")); - - // user SetBody for ANSI text, SetRTF for HTML and Rich Text - message.SetBody(_T("Body")); - - // here's an HTML body (uncomment to test) - //message.SetHTML(_T("Body")); - - // here's an RTF body (uncomment to test) - //message.SetRTF(_T("{\\rtf1\\ansi\\ansicpg1252\\deff0\\deflang1033{\\fonttbl{\\f0\\fnil\\fcharset0 Times New Roman;}}{\\colortbl ;\\red255\\green0\\blue0;}{\\*\\generator Msftedit 5.41.15.1507;}\\viewkind4\\uc1\\pard\\cf1\\lang3082\\b\\f0\\fs20 Body\\cf0\\lang1033\\b0\\par}")); - - message.AddRecipient(TO_EMAIL); - message.AddRecipient(TO_EMAIL2); - message.AddAttachment(MSG_ATTACHMENT); - - if(message.Send()) PRINTF(_T("Sent successfully\n")); - } - } -} - -//////////////////////////////////////////////////////////////////////////////////////////////////////////// -// -// To embed images inside of HTML text: -// -send a message as usual, setting its HTML text -// -add an \"\""); - message.SetRTF(strImage); - - message.AddRecipient(TO_EMAIL); - message.AddAttachment(MSG_ATTACHMENT, NULL, strCID); - - if(message.Send()) PRINTF(_T("Sent successfully\n")); - } - } -} - -//////////////////////////////////////////////////////////////////////////////////////////////////////////// -// -// To receive a message: -// -first open up a MAPI session and login -// -then open the message store you want to access (NULL is the default store) -// -then open the inbox and get the contents table -// -iterate through the message using GetNextMessage() (sample below gets only unread messages) -// -save attachments (if any) using SaveAttachments() if you like -// -//////////////////////////////////////////////////////////////////////////////////////////////////////////// - -void ReceiveTest(CMAPIEx& mapi) -{ - if(mapi.OpenInbox() && mapi.GetContents()) - { - // use SortContents to sort the messages, default is ascending by PR_MESSAGE_DELIVERY_TIME - mapi.SortContents(TABLE_SORT_DESCEND); - mapi.SetUnreadOnly(); - - CMAPIMessage message; - while(mapi.GetNextMessage(message)) - { - CString strReceivedTime; - message.GetReceivedTime(strReceivedTime); - PRINTF(_T("Message from '%s' (%s) subject '%s', received: %s\n"), message.GetSenderName(), message.GetSenderEmail(), message.GetSubject(), strReceivedTime); - - // use message.GetBody() to get the ANSI text body - // use message.GetRTF() to get the RTF or decoded HTML email - - PRINTF(_T("Attachments: %d\n"), message.GetAttachmentCount()); - } - } -} - -//////////////////////////////////////////////////////////////////////////////////////////////////////////// -// -// To iterate through folders: -// -first open up a MAPI session and login -// -then open the message store you want to access (NULL is the default store) -// -then open the folder and get the hierarchy table -// -iterate through the folders using GetNextFolder() -// -OpenSubFolder() is a high level shortcut and will use Depth First Search to find a sub folder -// also if you use this shortcut there is no need to RELEASE as it handles the folders internally -// -//////////////////////////////////////////////////////////////////////////////////////////////////////////// - -void EnumerateSubFolders(CMAPIEx& mapi, CMAPIFolder& folder) -{ - if (folder.GetHierarchy()) - { - CString strFolder; - CMAPIFolder subFolder; - while(folder.GetNextSubFolder(subFolder, strFolder)) - { - PRINTF(_T("Folder: %s\n"), strFolder); - EnumerateSubFolders(mapi, subFolder); - } - } -} - -void FolderTest(CMAPIEx& mapi) -{ - if(mapi.OpenRootFolder() && mapi.GetHierarchy()) - { - CString strFolder; - CMAPIFolder folder; - while(mapi.GetNextSubFolder(folder, strFolder)) - { - PRINTF(_T("Folder: %s\n"), strFolder); - EnumerateSubFolders(mapi, folder); - } - } -} - -//////////////////////////////////////////////////////////////////////////////////////////////////////////// -// -// This function creates a folder (opens if exists) and copies the first unread message if any to this folder -// -// To do this: -// -first open up a MAPI session and login -// -then open the message store you want to access (NULL is the default store) -// -then open the folder (probably inbox) and get the contents table -// -open the message you want to move -// -create (open if exists) the folder you want to move to -// -copy the message -// -// You can also move and delete the message, but I wanted the sample to be non destructive just in case -// -//////////////////////////////////////////////////////////////////////////////////////////////////////////// - -void CopyMessageTest(CMAPIEx& mapi) -{ - if(mapi.OpenInbox() && mapi.GetContents()) - { - mapi.SetUnreadOnly(); - - CMAPIMessage message; - if(mapi.GetNextMessage(message)) - { - PRINTF(_T("Copying message from '%s' subject '%s'\n"),message.GetSenderName(),message.GetSubject()); - CMAPIFolder* pSubFolder=mapi.GetFolder()->CreateSubFolder(COPY_MSG_FOLDER); - if(pSubFolder) - { - mapi.GetFolder()->CopyMessage(message, pSubFolder); - delete pSubFolder; - } - } - } -} - -//////////////////////////////////////////////////////////////////////////////////////////////////////////// -// -// This function saves the first email maessage to MSG_PATH -// -// To do this: -// -first open up a MAPI session and login -// -then open the message store you want to access (NULL is the default store) -// -then open the folder (probably Inbox) and get the contents table -// -open the message -// -save the message -// -//////////////////////////////////////////////////////////////////////////////////////////////////////////// - -void SaveMessageTest(CMAPIEx& mapi) -{ - if(mapi.OpenInbox() && mapi.GetContents()) - { - mapi.SortContents(TABLE_SORT_DESCEND); - - CMAPIMessage message; - if(mapi.GetNextMessage(message)) - { - PRINTF(_T("Saving message '%s'\n"), message.GetSubject()); - message.SaveAsMsg(MSG_PATH); - } - } -} - -//////////////////////////////////////////////////////////////////////////////////////////////////////////// -// -// These functions wait for a notification of a new message -// -// To do this: -// -first open up a MAPI session and login -// -then open the message store you want to access (NULL is the default store) -// -call Notify with the callback and a context pointer (default ulEventMask is fnevNewMail) -// -// When a new mail arrives, the OnNewMessage function will be called with the context you passed in. -// Note that since this test program is a single threaded console app I need to pump messages, usually in -// a windows app this would be done automatically as part of the run loop. -// -// Obviously you'll have to send yourself a mail or two during this test, also note that the notification -// will probably arrive a little while after the message arrives, depending on your exchange server's setup -// -// You can also call Notify with a different even mask to capture say when the user deletes something etc -// -//////////////////////////////////////////////////////////////////////////////////////////////////////////// - -long CALLBACK OnNewMessage(LPVOID lpvContext, ULONG cNotification, LPNOTIFICATION lpNotifications) -{ - PRINTF(_T("Recieved New Message\n")); - return 0; -} - -void NotificationTest(CMAPIEx& mapi) -{ - if(mapi.Notify(OnNewMessage, NULL, fnevNewMail)) - { - PRINTF(_T("Waiting for a new incoming message... (hit a key to cancel)\n")); - while(!_kbhit()) Sleep(100); - } -} - -//////////////////////////////////////////////////////////////////////////////////////////////////////////// -// -// This function displays your first contact in your Contacts folder -// -// To do this: -// -first open up a MAPI session and login -// -then open the message store you want to access (NULL is the default store) -// -open your contacts folder -// -// Use GetName to get the name (default DISPLAY NAME, but can be Initials, First Name etc) -// Use GetEmail to get the email address (named property) -// Use GetAddress to get the mailing address of CContactAddress::AddressType -// Use GetPhoneNumber supplying a phone number property (ie PR_BUSINESS_TELEPHONE_NUMBER) -// Use GetNotes to get the notes in either plain text (default) or RTF -// -//////////////////////////////////////////////////////////////////////////////////////////////////////////// - -void ContactsTest(CMAPIEx& mapi) -{ - if(mapi.OpenContacts() && mapi.GetContents()) - { - // sort by name (stored in PR_SUBJECT) - mapi.SortContents(TABLE_SORT_ASCEND, PR_SUBJECT); - - CString strText; - CMAPIContact contact; - CContactAddress address; - if(mapi.GetNextContact(contact)) - { - if(contact.GetName(strText)) PRINTF(_T("Name: '%s'\n"), strText); - if(contact.GetBirthday(strText)) PRINTF(_T("Birthday: %s\n"), strText); - if(contact.GetAnniversary(strText)) PRINTF(_T("Anniversary: %s\n"), strText); - if(contact.GetCategories(strText)) PRINTF(_T("Categories: '%s'\n"), strText); - if(contact.GetCompany(strText)) PRINTF(_T("Company: '%s'\n"), strText); - if(contact.GetEmail(strText)) PRINTF(_T("Email: '%s'\n"), strText); - if(contact.GetHomePage(strText)) PRINTF(_T("HomePage: '%s'\n"), strText); - if(contact.GetIMAddress(strText)) PRINTF(_T("IM Address: '%s'\n"), strText); - if(contact.GetAddress(address, CContactAddress::BUSINESS)) PRINTF(_T("%s\n%s\n%s\n%s\n%s\n"),address.m_strStreet,address.m_strCity,address.m_strStateOrProvince,address.m_strCountry,address.m_strPostalCode); - if(contact.GetAddress(address, CContactAddress::HOME)) PRINTF(_T("%s\n%s\n%s\n%s\n%s\n"),address.m_strStreet,address.m_strCity,address.m_strStateOrProvince,address.m_strCountry,address.m_strPostalCode); - if(contact.GetPhoneNumber(strText, PR_BUSINESS_TELEPHONE_NUMBER)) PRINTF(_T("Phone: %s\n"), strText); - if(contact.GetBody(strText)) PRINTF(_T("Notes: %s\n"), strText); - - if(contact.HasPicture()) - { - // shows how to read the bytes in, could save this or stream it to memory etc - CMAPIAttachment attachment; - if(contact.GetAttachment(attachment, 0)) - { - if(attachment.OpenStream()) - { - BYTE buf[DEFAULT_BUFFER_SIZE]; - int nRead, nSize=0; - - do - { - nRead=attachment.Read(buf, DEFAULT_BUFFER_SIZE); - if(nRead>0) nSize+=nRead; - } - while (nRead>0); - attachment.CloseStream(); - PRINTF(_T("Contact has picture (%d bytes)\n"), nSize); - } - } - } - } - } -} - -//////////////////////////////////////////////////////////////////////////////////////////////////////////// -// -// This function creates a message in the drafts folder and opens it up using the default IMessage form -// -// To do this: -// -first open up a MAPI session and login -// -then open the message store you want to access (NULL is the default store) -// -open your drafts folder -// -set the properties of the message and ShowForm -// -// NOTE: on new messages if ShowForm returns IDOK, the message was sent, the message will not be valid anymore, -// if it returns IDCANCEL, the user closed the dialog and you must save the message or it will be lost -// -//////////////////////////////////////////////////////////////////////////////////////////////////////////// - -void CreateDraftTest(CMAPIEx& mapi) -{ - if(mapi.OpenDrafts()) - { - CMAPIMessage message; - if(message.Create(&mapi, IMPORTANCE_LOW)) - { - message.SetSender(FROM_NAME, FROM_EMAIL); - message.SetSubject(_T("Subject")); - message.AddRecipient(TO_EMAIL); - - int nResult=message.ShowForm(&mapi); - if(nResult==IDOK) - { - PRINTF(_T("Draft sent successfully\n")); - } - else if(nResult==IDCANCEL) - { - message.Save(); - PRINTF(_T("Draft created successfully\n")); - } - } - } -} - -//////////////////////////////////////////////////////////////////////////////////////////////////////////// -// -// This function shows the address book and prints out the email addresses of the chosen recipients -// -// To do this: -// -first open up a MAPI session and login -// -then use ShowAddressBook to open the dialog -// -if IDOK is returned, iterate through the email addresses returned -// -// NOTE: you can also use CMAPIMessage::AddRecipients with pAddressList as the argument on a new email -// -//////////////////////////////////////////////////////////////////////////////////////////////////////////// - -void ShowAddressBookTest(CMAPIEx& mapi) -{ - LPADRLIST pAddressList; - if(mapi.ShowAddressBook(pAddressList, _T("ShowAddressBookTest"))==IDOK) - { - CString strEmail; - for(ULONG i=0;icEntries;i++) - { - if(mapi.GetEmail(pAddressList->aEntries[i], strEmail)) - { - PRINTF(_T("AddressBook recipient %d: %s\n"), i+1, strEmail); - } - } - CMAPIEx::ReleaseAddressList(pAddressList); - } -} - -//////////////////////////////////////////////////////////////////////////////////////////////////////////// -// -// This function creates a contact and sets its name and email -// -// To do this: -// -first open up a MAPI session and login -// -then open the message store you want to access (NULL is the default store) -// -open your contacts folder -// -create the contact -// -set the properties of the contact -// -optionally call UpdateDisplayName after filling in name fields (will set initials, File As etc) -// -save your changes -// -//////////////////////////////////////////////////////////////////////////////////////////////////////////// - -void CreateContactTest(CMAPIEx& mapi) -{ - if(mapi.OpenContacts()) - { - CMAPIContact contact; - if(contact.Create(&mapi)) - { - contact.SetDisplayNamePrefix(_T("Mr.")); - contact.SetName(FROM_NAME, PR_GIVEN_NAME); - contact.UpdateDisplayName(); - contact.SetEmail(FROM_EMAIL, 1); - if(contact.Save()) PRINTF(_T("Contact created successfully\n")); - } - } -} - -//////////////////////////////////////////////////////////////////////////////////////////////////////////// -// -// This function opens the first subfolder under contacts and if successful displays the -// first contact if any -// -//////////////////////////////////////////////////////////////////////////////////////////////////////////// - -void ContactSubFolderTest(CMAPIEx& mapi) -{ - if(mapi.OpenContacts() && mapi.GetHierarchy()) - { - CString strFolder; - CMAPIFolder folder; - if(mapi.GetNextSubFolder(folder, strFolder)) - { - PRINTF(_T("Contact Sub Folder: %s\n"), strFolder); - if(folder.GetContents()) - { - CString strText; - CMAPIContact contact; - CContactAddress address; - if(folder.GetNextContact(contact)) - { - if(contact.GetName(strText)) PRINTF(_T("Contact Name '%s'\n"), strText); - } - } - } - } -} - -void AppointmentTest(CMAPIEx& mapi) -{ - if(mapi.OpenCalendar() && mapi.GetContents()) - { - CString strText; - CMAPIAppointment appointment; - if (mapi.GetNextAppointment(appointment)) - { - if(appointment.GetSubject(strText)) PRINTF(_T("%s\n"), strText); - if(appointment.GetLocation(strText)) PRINTF(_T("%s\n"), strText); - if(appointment.GetStartTime(strText, NULL)) PRINTF(_T("%s\n"), strText); - if(appointment.GetEndTime(strText, NULL)) PRINTF(_T("%s\n"), strText); - } - } -} - -// this example works on unread messages, so send yourself a message and don't open it before trying this test -// If you have "autopreview" set turn it off to run this sample, you may want to run step by step as well. -void main(int argc, char* argv[]) -{ - CMAPIEx mapi; - if(!CMAPIEx::Init() || !mapi.Login() || !mapi.OpenMessageStore()) - { - PRINTF(_T("Failed to initialize MAPI\n")); - return; - } - - // you can use this profile name as an argument for Login() when no MAPI provider is open (ie "Outlook") - CString strText; - if(mapi.GetProfileName(strText)) PRINTF(_T("Profile Name: %s\n"), strText); - if(mapi.GetProfileEmail(strText)) PRINTF(_T("Profile Email: %s\n"), strText); - - int nCount = mapi.GetMessageStoreCount(); - PRINTF(_T("MessageStore Count: %d\n"), nCount); - - // uncomment the functions you're interested in and/or step through these to see how each thing works. -// ShowAddressBookTest(mapi); -// ContactsTest(mapi); -// CreateDraftTest(mapi); -// SendTest(mapi); -// SendCIDTest(mapi); -// FolderTest(mapi); - ReceiveTest(mapi); -// CopyMessageTest(mapi); -// SaveMessageTest(mapi); -// NotificationTest(mapi); -// CreateContactTest(mapi); -// ContactSubFolderTest(mapi); -// AppointmentTest(mapi); - - mapi.Logout(); - CMAPIEx::Term(); -} diff --git a/bazaar/MAPIEx/plugin/Test/TestMAPI/TestMAPI.h b/bazaar/MAPIEx/plugin/Test/TestMAPI/TestMAPI.h deleted file mode 100644 index fb35e8de7..000000000 --- a/bazaar/MAPIEx/plugin/Test/TestMAPI/TestMAPI.h +++ /dev/null @@ -1,7 +0,0 @@ -#ifndef __TESTMAPI_H__ -#define __TESTMAPI_H__ - -#define VC_EXTRALEAN // Exclude rarely-used stuff from Windows headers -#include // MFC core and standard components - -#endif diff --git a/bazaar/MAPIEx/plugin/Test/TestMAPI/TestMAPI.rc b/bazaar/MAPIEx/plugin/Test/TestMAPI/TestMAPI.rc deleted file mode 100644 index d0a2b67f6..000000000 --- a/bazaar/MAPIEx/plugin/Test/TestMAPI/TestMAPI.rc +++ /dev/null @@ -1 +0,0 @@ -1001 ICON "..\\MAPIEx.ico" diff --git a/bazaar/MAPIEx/plugin/include_MINGW32/imessage.h b/bazaar/MAPIEx/plugin/include_MINGW32/imessage.h new file mode 100644 index 000000000..5a44b1cb6 --- /dev/null +++ b/bazaar/MAPIEx/plugin/include_MINGW32/imessage.h @@ -0,0 +1,46 @@ +/** + * This file has no copyright assigned and is placed in the Public Domain. + * This file is part of the mingw-w64 runtime package. + * No warranty is given; refer to the file DISCLAIMER.PD within this package. + */ +#ifndef _IMESSAGE_H_ +#define _IMESSAGE_H_ + +#include "mapidefs.h" + +#ifdef __cplusplus +extern "C" { +#endif + + typedef struct _MSGSESS *LPMSGSESS; + typedef void (WINAPI MSGCALLRELEASE)(ULONG ulCallerData,LPMESSAGE lpMessage); + + STDAPI_(SCODE) OpenIMsgSession(LPMALLOC lpMalloc,ULONG ulFlags,LPMSGSESS *lppMsgSess); + STDAPI_(void) CloseIMsgSession(LPMSGSESS lpMsgSess); + STDAPI_(SCODE) OpenIMsgOnIStg(LPMSGSESS lpMsgSess,LPALLOCATEBUFFER lpAllocateBuffer,LPALLOCATEMORE lpAllocateMore,LPFREEBUFFER lpFreeBuffer,LPMALLOC lpMalloc,LPVOID lpMapiSup,LPSTORAGE lpStg,MSGCALLRELEASE *lpfMsgCallRelease,ULONG ulCallerData,ULONG ulFlags,LPMESSAGE *lppMsg); + +#define IMSG_NO_ISTG_COMMIT ((ULONG) 0x00000001) + +#define PROPATTR_MANDATORY ((ULONG) 0x00000001) +#define PROPATTR_READABLE ((ULONG) 0x00000002) +#define PROPATTR_WRITEABLE ((ULONG) 0x00000004) + +#define PROPATTR_NOT_PRESENT ((ULONG) 0x00000008) + + typedef struct _SPropAttrArray { + ULONG cValues; + ULONG aPropAttr[MAPI_DIM]; + } SPropAttrArray,*LPSPropAttrArray; + +#define CbNewSPropAttrArray(_cattr) (offsetof(SPropAttrArray,aPropAttr) + (_cattr)*sizeof(ULONG)) +#define CbSPropAttrArray(_lparray) (offsetof(SPropAttrArray,aPropAttr) + (UINT)((_lparray)->cValues)*sizeof(ULONG)) +#define SizedSPropAttrArray(_cattr,_name) struct _SPropAttrArray_ ## _name { ULONG cValues; ULONG aPropAttr[_cattr]; } _name + + STDAPI GetAttribIMsgOnIStg(LPVOID lpObject,LPSPropTagArray lpPropTagArray,LPSPropAttrArray *lppPropAttrArray); + STDAPI SetAttribIMsgOnIStg(LPVOID lpObject,LPSPropTagArray lpPropTags,LPSPropAttrArray lpPropAttrs,LPSPropProblemArray *lppPropProblems); + STDAPI_(SCODE) MapStorageSCode(SCODE StgSCode); + +#ifdef __cplusplus +} +#endif +#endif diff --git a/bazaar/MAPIEx/plugin/include_MINGW32/mapicode.h b/bazaar/MAPIEx/plugin/include_MINGW32/mapicode.h new file mode 100644 index 000000000..4955fb194 --- /dev/null +++ b/bazaar/MAPIEx/plugin/include_MINGW32/mapicode.h @@ -0,0 +1,105 @@ +/** + * This file has no copyright assigned and is placed in the Public Domain. + * This file is part of the mingw-w64 runtime package. + * No warranty is given; refer to the file DISCLAIMER.PD within this package. + */ +#ifndef MAPICODE_H +#define MAPICODE_H + +#include + +#define MAKE_MAPI_SCODE(sev,fac,code) ((SCODE) (((unsigned __LONG32)(sev)<<31) | ((unsigned __LONG32)(fac)<<16) | ((unsigned __LONG32)(code)))) + +#define MAKE_MAPI_E(err) (MAKE_MAPI_SCODE(1,FACILITY_ITF,err)) +#define MAKE_MAPI_S(warn) (MAKE_MAPI_SCODE(0,FACILITY_ITF,warn)) + +#ifdef SUCCESS_SUCCESS +#undef SUCCESS_SUCCESS +#endif +#define SUCCESS_SUCCESS __MSABI_LONG(0) + +#define MAPI_E_CALL_FAILED E_FAIL +#define MAPI_E_NOT_ENOUGH_MEMORY E_OUTOFMEMORY +#define MAPI_E_INVALID_PARAMETER E_INVALIDARG +#define MAPI_E_INTERFACE_NOT_SUPPORTED E_NOINTERFACE +#define MAPI_E_NO_ACCESS E_ACCESSDENIED + +#define MAPI_E_NO_SUPPORT MAKE_MAPI_E(0x102) +#define MAPI_E_BAD_CHARWIDTH MAKE_MAPI_E(0x103) +#define MAPI_E_STRING_TOO_LONG MAKE_MAPI_E(0x105) +#define MAPI_E_UNKNOWN_FLAGS MAKE_MAPI_E(0x106) +#define MAPI_E_INVALID_ENTRYID MAKE_MAPI_E(0x107) +#define MAPI_E_INVALID_OBJECT MAKE_MAPI_E(0x108) +#define MAPI_E_OBJECT_CHANGED MAKE_MAPI_E(0x109) +#define MAPI_E_OBJECT_DELETED MAKE_MAPI_E(0x10A) +#define MAPI_E_BUSY MAKE_MAPI_E(0x10B) +#define MAPI_E_NOT_ENOUGH_DISK MAKE_MAPI_E(0x10D) +#define MAPI_E_NOT_ENOUGH_RESOURCES MAKE_MAPI_E(0x10E) +#define MAPI_E_NOT_FOUND MAKE_MAPI_E(0x10F) +#define MAPI_E_VERSION MAKE_MAPI_E(0x110) +#define MAPI_E_LOGON_FAILED MAKE_MAPI_E(0x111) +#define MAPI_E_SESSION_LIMIT MAKE_MAPI_E(0x112) +#define MAPI_E_USER_CANCEL MAKE_MAPI_E(0x113) +#define MAPI_E_UNABLE_TO_ABORT MAKE_MAPI_E(0x114) +#define MAPI_E_NETWORK_ERROR MAKE_MAPI_E(0x115) +#define MAPI_E_DISK_ERROR MAKE_MAPI_E(0x116) +#define MAPI_E_TOO_COMPLEX MAKE_MAPI_E(0x117) +#define MAPI_E_BAD_COLUMN MAKE_MAPI_E(0x118) +#define MAPI_E_EXTENDED_ERROR MAKE_MAPI_E(0x119) +#define MAPI_E_COMPUTED MAKE_MAPI_E(0x11A) +#define MAPI_E_CORRUPT_DATA MAKE_MAPI_E(0x11B) +#define MAPI_E_UNCONFIGURED MAKE_MAPI_E(0x11C) +#define MAPI_E_FAILONEPROVIDER MAKE_MAPI_E(0x11D) +#define MAPI_E_UNKNOWN_CPID MAKE_MAPI_E(0x11E) +#define MAPI_E_UNKNOWN_LCID MAKE_MAPI_E(0x11F) +#define MAPI_E_PASSWORD_CHANGE_REQUIRED MAKE_MAPI_E(0x120) +#define MAPI_E_PASSWORD_EXPIRED MAKE_MAPI_E(0x121) +#define MAPI_E_INVALID_WORKSTATION_ACCOUNT MAKE_MAPI_E(0x122) +#define MAPI_E_INVALID_ACCESS_TIME MAKE_MAPI_E(0x123) +#define MAPI_E_ACCOUNT_DISABLED MAKE_MAPI_E(0x124) +#define MAPI_E_END_OF_SESSION MAKE_MAPI_E(0x200) +#define MAPI_E_UNKNOWN_ENTRYID MAKE_MAPI_E(0x201) +#define MAPI_E_MISSING_REQUIRED_COLUMN MAKE_MAPI_E(0x202) +#define MAPI_W_NO_SERVICE MAKE_MAPI_S(0x203) +#define MAPI_E_BAD_VALUE MAKE_MAPI_E(0x301) +#define MAPI_E_INVALID_TYPE MAKE_MAPI_E(0x302) +#define MAPI_E_TYPE_NO_SUPPORT MAKE_MAPI_E(0x303) +#define MAPI_E_UNEXPECTED_TYPE MAKE_MAPI_E(0x304) +#define MAPI_E_TOO_BIG MAKE_MAPI_E(0x305) +#define MAPI_E_DECLINE_COPY MAKE_MAPI_E(0x306) +#define MAPI_E_UNEXPECTED_ID MAKE_MAPI_E(0x307) +#define MAPI_W_ERRORS_RETURNED MAKE_MAPI_S(0x380) +#define MAPI_E_UNABLE_TO_COMPLETE MAKE_MAPI_E(0x400) +#define MAPI_E_TIMEOUT MAKE_MAPI_E(0x401) +#define MAPI_E_TABLE_EMPTY MAKE_MAPI_E(0x402) +#define MAPI_E_TABLE_TOO_BIG MAKE_MAPI_E(0x403) +#define MAPI_E_INVALID_BOOKMARK MAKE_MAPI_E(0x405) +#define MAPI_W_POSITION_CHANGED MAKE_MAPI_S(0x481) +#define MAPI_W_APPROX_COUNT MAKE_MAPI_S(0x482) +#define MAPI_E_WAIT MAKE_MAPI_E(0x500) +#define MAPI_E_CANCEL MAKE_MAPI_E(0x501) +#define MAPI_E_NOT_ME MAKE_MAPI_E(0x502) +#define MAPI_W_CANCEL_MESSAGE MAKE_MAPI_S(0x580) +#define MAPI_E_CORRUPT_STORE MAKE_MAPI_E(0x600) +#define MAPI_E_NOT_IN_QUEUE MAKE_MAPI_E(0x601) +#define MAPI_E_NO_SUPPRESS MAKE_MAPI_E(0x602) +#define MAPI_E_COLLISION MAKE_MAPI_E(0x604) +#define MAPI_E_NOT_INITIALIZED MAKE_MAPI_E(0x605) +#define MAPI_E_NON_STANDARD MAKE_MAPI_E(0x606) +#define MAPI_E_NO_RECIPIENTS MAKE_MAPI_E(0x607) +#define MAPI_E_SUBMITTED MAKE_MAPI_E(0x608) +#define MAPI_E_HAS_FOLDERS MAKE_MAPI_E(0x609) +#define MAPI_E_HAS_MESSAGES MAKE_MAPI_E(0x60A) +#define MAPI_E_FOLDER_CYCLE MAKE_MAPI_E(0x60B) +#define MAPI_W_PARTIAL_COMPLETION MAKE_MAPI_S(0x680) +#define MAPI_E_AMBIGUOUS_RECIP MAKE_MAPI_E(0x700) + +#ifndef MakeResult +#define MakeResult(_s) ResultFromScode(_s) +#endif + +#ifndef HR_SUCCEEDED +#define HR_SUCCEEDED(_hr) SUCCEEDED((SCODE)(_hr)) +#define HR_FAILED(_hr) FAILED((SCODE)(_hr)) +#endif +#endif diff --git a/bazaar/MAPIEx/plugin/include_MINGW32/mapidefs.h b/bazaar/MAPIEx/plugin/include_MINGW32/mapidefs.h new file mode 100644 index 000000000..abacbd91d --- /dev/null +++ b/bazaar/MAPIEx/plugin/include_MINGW32/mapidefs.h @@ -0,0 +1,1412 @@ +/** + * This file has no copyright assigned and is placed in the Public Domain. + * This file is part of the mingw-w64 runtime package. + * No warranty is given; refer to the file DISCLAIMER.PD within this package. + */ +#ifndef MAPIDEFS_H +#define MAPIDEFS_H + +#ifndef _WINDOWS_ +#define INC_OLE2 +#define INC_RPC +#define _OLE_H_ +#include +#endif + +#ifndef _OLEERROR_H_ +#include +#endif +#include +#include + +#ifndef MAPI_DIM +#define MAPI_DIM 1 +#endif + +#ifndef STDMAPIINITCALLTYPE +#define STDMAPIINITCALLTYPE __cdecl +#define STDINITMETHODIMP HRESULT __cdecl +#define STDINITMETHODIMP_(type) type __cdecl +#endif + +#define MAPI_NT_SERVICE ((ULONG) 0x00010000) + +#ifdef __cplusplus +extern "C" { +#endif + +#ifndef __WCHAR_DEFINED +#define __WCHAR_DEFINED + typedef wchar_t WCHAR; +#endif + +#if defined(UNICODE) + typedef WCHAR TCHAR; +#else + typedef char TCHAR; +#endif + + typedef WCHAR *LPWSTR; + typedef const WCHAR *LPCWSTR; + typedef TCHAR *LPTSTR; + typedef const TCHAR *LPCTSTR; + typedef BYTE *LPBYTE; + typedef ULONG *LPULONG; + +#ifndef __LHANDLE +#define __LHANDLE + typedef ULONG_PTR LHANDLE,*LPLHANDLE; +#endif + +#if !defined(_WINBASE_) && !defined(_FILETIME_) +#define _FILETIME_ + typedef struct _FILETIME { + DWORD dwLowDateTime; + DWORD dwHighDateTime; + } FILETIME,*LPFILETIME; +#endif + +#ifndef BEGIN_INTERFACE +#define BEGIN_INTERFACE +#endif + +#define MAPI_MODIFY ((ULONG) 0x00000001) + +#define MAPI_ACCESS_MODIFY ((ULONG) 0x00000001) +#define MAPI_ACCESS_READ ((ULONG) 0x00000002) +#define MAPI_ACCESS_DELETE ((ULONG) 0x00000004) +#define MAPI_ACCESS_CREATE_HIERARCHY ((ULONG) 0x00000008) +#define MAPI_ACCESS_CREATE_CONTENTS ((ULONG) 0x00000010) +#define MAPI_ACCESS_CREATE_ASSOCIATED ((ULONG) 0x00000020) + +#define MAPI_UNICODE ((ULONG) 0x80000000) + +#if defined(UNICODE) +#define fMapiUnicode MAPI_UNICODE +#else +#define fMapiUnicode 0 +#endif + +#define hrSuccess 0 + +#ifndef MAPI_ORIG +#define MAPI_ORIG 0 +#define MAPI_TO 1 +#define MAPI_CC 2 +#define MAPI_BCC 3 +#define MAPI_P1 0x10000000 +#define MAPI_SUBMITTED 0x80000000 +#endif + +#define MAPI_SHORTTERM 0x80 +#define MAPI_NOTRECIP 0x40 +#define MAPI_THISSESSION 0x20 +#define MAPI_NOW 0x10 +#define MAPI_NOTRESERVED 0x08 + +#define MAPI_COMPOUND 0x80 + + typedef struct { + BYTE abFlags[4]; + BYTE ab[MAPI_DIM]; + } ENTRYID,*LPENTRYID; + +#define CbNewENTRYID(_cb) (offsetof(ENTRYID,ab) + (_cb)) +#define CbENTRYID(_cb) (offsetof(ENTRYID,ab) + (_cb)) +#define SizedENTRYID(_cb,_name) struct _ENTRYID_ ## _name { BYTE abFlags[4]; BYTE ab[_cb]; } _name + + typedef struct _MAPIUID { + BYTE ab[16]; + } MAPIUID,*LPMAPIUID; + +#define IsEqualMAPIUID(lpuid1,lpuid2) (!memcmp(lpuid1,lpuid2,sizeof(MAPIUID))) + +#define MAPI_ONE_OFF_UID { 0x81,0x2b,0x1f,0xa4,0xbe,0xa3,0x10,0x19,0x9d,0x6e,0x00,0xdd,0x01,0x0f,0x54,0x02 } +#define MAPI_ONE_OFF_UNICODE 0x8000 +#define MAPI_ONE_OFF_NO_RICH_INFO 0x0001 + +#define MAPI_STORE ((ULONG) 0x00000001) +#define MAPI_ADDRBOOK ((ULONG) 0x00000002) +#define MAPI_FOLDER ((ULONG) 0x00000003) +#define MAPI_ABCONT ((ULONG) 0x00000004) +#define MAPI_MESSAGE ((ULONG) 0x00000005) +#define MAPI_MAILUSER ((ULONG) 0x00000006) +#define MAPI_ATTACH ((ULONG) 0x00000007) +#define MAPI_DISTLIST ((ULONG) 0x00000008) +#define MAPI_PROFSECT ((ULONG) 0x00000009) +#define MAPI_STATUS ((ULONG) 0x0000000A) +#define MAPI_SESSION ((ULONG) 0x0000000B) +#define MAPI_FORMINFO ((ULONG) 0x0000000C) + +#ifndef cchProfileNameMax +#define cchProfileNameMax 64 +#define cchProfilePassMax 64 +#endif + +#define MV_FLAG 0x1000 + +#define PT_UNSPECIFIED ((ULONG) 0) +#define PT_NULL ((ULONG) 1) +#define PT_I2 ((ULONG) 2) +#define PT_LONG ((ULONG) 3) +#define PT_R4 ((ULONG) 4) +#define PT_DOUBLE ((ULONG) 5) +#define PT_CURRENCY ((ULONG) 6) +#define PT_APPTIME ((ULONG) 7) +#define PT_ERROR ((ULONG) 10) +#define PT_BOOLEAN ((ULONG) 11) +#define PT_OBJECT ((ULONG) 13) +#define PT_I8 ((ULONG) 20) +#define PT_STRING8 ((ULONG) 30) +#define PT_UNICODE ((ULONG) 31) +#define PT_SYSTIME ((ULONG) 64) +#define PT_CLSID ((ULONG) 72) +#define PT_BINARY ((ULONG) 258) + +#define PT_SHORT PT_I2 +#define PT_I4 PT_LONG +#define PT_FLOAT PT_R4 +#define PT_R8 PT_DOUBLE +#define PT_LONGLONG PT_I8 + +#if defined(UNICODE) +#define PT_TSTRING PT_UNICODE +#define PT_MV_TSTRING (MV_FLAG|PT_UNICODE) +#define LPSZ lpszW +#define LPPSZ lppszW +#define MVSZ MVszW +#else +#define PT_TSTRING PT_STRING8 +#define PT_MV_TSTRING (MV_FLAG|PT_STRING8) +#define LPSZ lpszA +#define LPPSZ lppszA +#define MVSZ MVszA +#endif + +#define PROP_TYPE_MASK ((ULONG)0x0000FFFF) +#define PROP_TYPE(ulPropTag) (((ULONG)(ulPropTag))&PROP_TYPE_MASK) +#define PROP_ID(ulPropTag) (((ULONG)(ulPropTag))>>16) +#define PROP_TAG(ulPropType,ulPropID) ((((ULONG)(ulPropID))<<16)|((ULONG)(ulPropType))) +#define PROP_ID_NULL 0 +#define PROP_ID_INVALID 0xFFFF +#define PR_NULL PROP_TAG(PT_NULL,PROP_ID_NULL) +#define CHANGE_PROP_TYPE(ulPropTag,ulPropType) (((ULONG)0xFFFF0000 & ulPropTag) | ulPropType) + +#define PT_MV_I2 (MV_FLAG|PT_I2) +#define PT_MV_LONG (MV_FLAG|PT_LONG) +#define PT_MV_R4 (MV_FLAG|PT_R4) +#define PT_MV_DOUBLE (MV_FLAG|PT_DOUBLE) +#define PT_MV_CURRENCY (MV_FLAG|PT_CURRENCY) +#define PT_MV_APPTIME (MV_FLAG|PT_APPTIME) +#define PT_MV_SYSTIME (MV_FLAG|PT_SYSTIME) +#define PT_MV_STRING8 (MV_FLAG|PT_STRING8) +#define PT_MV_BINARY (MV_FLAG|PT_BINARY) +#define PT_MV_UNICODE (MV_FLAG|PT_UNICODE) +#define PT_MV_CLSID (MV_FLAG|PT_CLSID) +#define PT_MV_I8 (MV_FLAG|PT_I8) + +#define PT_MV_SHORT PT_MV_I2 +#define PT_MV_I4 PT_MV_LONG +#define PT_MV_FLOAT PT_MV_R4 +#define PT_MV_R8 PT_MV_DOUBLE +#define PT_MV_LONGLONG PT_MV_I8 + +#define MV_INSTANCE 0x2000 +#define MVI_FLAG (MV_FLAG | MV_INSTANCE) +#define MVI_PROP(tag) ((tag) | MVI_FLAG) + + typedef struct _SPropTagArray { + ULONG cValues; + ULONG aulPropTag[MAPI_DIM]; + } SPropTagArray,*LPSPropTagArray; + +#define CbNewSPropTagArray(_ctag) (offsetof(SPropTagArray,aulPropTag) + (_ctag)*sizeof(ULONG)) +#define CbSPropTagArray(_lparray) (offsetof(SPropTagArray,aulPropTag) + (UINT)((_lparray)->cValues)*sizeof(ULONG)) +#define SizedSPropTagArray(_ctag,_name) struct _SPropTagArray_ ## _name { ULONG cValues; ULONG aulPropTag[_ctag]; } _name + + typedef struct _SPropValue SPropValue; + +#ifndef _tagCY_DEFINED +#define _tagCY_DEFINED +#define _CY_DEFINED + typedef union tagCY { + struct { + unsigned __LONG32 Lo; + __LONG32 Hi; + }; + LONGLONG int64; + } CY; +#endif + + typedef CY CURRENCY; + + typedef struct _SBinary { + ULONG cb; + LPBYTE lpb; + } SBinary,*LPSBinary; + + typedef struct _SShortArray { + ULONG cValues; + short int *lpi; + } SShortArray; + + typedef struct _SGuidArray { + ULONG cValues; + GUID *lpguid; + } SGuidArray; + + typedef struct _SRealArray { + ULONG cValues; + float *lpflt; + } SRealArray; + + typedef struct _SLongArray { + ULONG cValues; + LONG *lpl; + } SLongArray; + + typedef struct _SLargeIntegerArray { + ULONG cValues; + LARGE_INTEGER *lpli; + } SLargeIntegerArray; + + typedef struct _SDateTimeArray { + ULONG cValues; + FILETIME *lpft; + } SDateTimeArray; + + typedef struct _SAppTimeArray { + ULONG cValues; + double *lpat; + } SAppTimeArray; + + typedef struct _SCurrencyArray { + ULONG cValues; + CURRENCY *lpcur; + } SCurrencyArray; + + typedef struct _SBinaryArray { + ULONG cValues; + SBinary *lpbin; + } SBinaryArray; + + typedef struct _SDoubleArray { + ULONG cValues; + double *lpdbl; + } SDoubleArray; + + typedef struct _SWStringArray { + ULONG cValues; + LPWSTR *lppszW; + } SWStringArray; + + typedef struct _SLPSTRArray { + ULONG cValues; + LPSTR *lppszA; + } SLPSTRArray; + + typedef union _PV { + short int i; + LONG l; + ULONG ul; + float flt; + double dbl; + unsigned short int b; + CURRENCY cur; + double at; + FILETIME ft; + LPSTR lpszA; + SBinary bin; + LPWSTR lpszW; + LPGUID lpguid; + LARGE_INTEGER li; + SShortArray MVi; + SLongArray MVl; + SRealArray MVflt; + SDoubleArray MVdbl; + SCurrencyArray MVcur; + SAppTimeArray MVat; + SDateTimeArray MVft; + SBinaryArray MVbin; + SLPSTRArray MVszA; + SWStringArray MVszW; + SGuidArray MVguid; + SLargeIntegerArray MVli; + SCODE err; + LONG x; + } __UPV; + + typedef struct _SPropValue { + ULONG ulPropTag; + ULONG dwAlignPad; + union _PV Value; + } SPropValue,*LPSPropValue; + + typedef struct _SPropProblem { + ULONG ulIndex; + ULONG ulPropTag; + SCODE scode; + } SPropProblem,*LPSPropProblem; + + typedef struct _SPropProblemArray { + ULONG cProblem; + SPropProblem aProblem[MAPI_DIM]; + } SPropProblemArray,*LPSPropProblemArray; + +#define CbNewSPropProblemArray(_cprob) (offsetof(SPropProblemArray,aProblem) + (_cprob)*sizeof(SPropProblem)) +#define CbSPropProblemArray(_lparray) (offsetof(SPropProblemArray,aProblem) + (UINT) ((_lparray)->cProblem*sizeof(SPropProblem))) +#define SizedSPropProblemArray(_cprob,_name) struct _SPropProblemArray_ ## _name { ULONG cProblem; SPropProblem aProblem[_cprob]; } _name + + typedef SBinaryArray ENTRYLIST,*LPENTRYLIST; + typedef struct { + ULONG cb; + BYTE abEntry[MAPI_DIM]; + } FLATENTRY,*LPFLATENTRY; + + typedef struct { + ULONG cEntries; + ULONG cbEntries; + BYTE abEntries[MAPI_DIM]; + } FLATENTRYLIST,*LPFLATENTRYLIST; + + typedef struct { + ULONG cb; + BYTE ab[MAPI_DIM]; + } MTSID,*LPMTSID; + + typedef struct { + ULONG cMTSIDs; + ULONG cbMTSIDs; + BYTE abMTSIDs[MAPI_DIM]; + } FLATMTSIDLIST,*LPFLATMTSIDLIST; + +#define CbNewFLATENTRY(_cb) (offsetof(FLATENTRY,abEntry) + (_cb)) +#define CbFLATENTRY(_lpentry) (offsetof(FLATENTRY,abEntry) + (_lpentry)->cb) +#define CbNewFLATENTRYLIST(_cb) (offsetof(FLATENTRYLIST,abEntries) + (_cb)) +#define CbFLATENTRYLIST(_lplist) (offsetof(FLATENTRYLIST,abEntries) + (_lplist)->cbEntries) +#define CbNewMTSID(_cb) (offsetof(MTSID,ab) + (_cb)) +#define CbMTSID(_lpentry) (offsetof(MTSID,ab) + (_lpentry)->cb) +#define CbNewFLATMTSIDLIST(_cb) (offsetof(FLATMTSIDLIST,abMTSIDs) + (_cb)) +#define CbFLATMTSIDLIST(_lplist) (offsetof(FLATMTSIDLIST,abMTSIDs) + (_lplist)->cbMTSIDs) + + typedef struct _ADRENTRY { + ULONG ulReserved1; + ULONG cValues; + LPSPropValue rgPropVals; + } ADRENTRY,*LPADRENTRY; + + typedef struct _ADRLIST { + ULONG cEntries; + ADRENTRY aEntries[MAPI_DIM]; + } ADRLIST,*LPADRLIST; + +#define CbNewADRLIST(_centries) (offsetof(ADRLIST,aEntries) + (_centries)*sizeof(ADRENTRY)) +#define CbADRLIST(_lpadrlist) (offsetof(ADRLIST,aEntries) + (UINT)(_lpadrlist)->cEntries*sizeof(ADRENTRY)) +#define SizedADRLIST(_centries,_name) struct _ADRLIST_ ## _name { ULONG cEntries; ADRENTRY aEntries[_centries]; } _name + + typedef struct _SRow { + ULONG ulAdrEntryPad; + ULONG cValues; + LPSPropValue lpProps; + } SRow,*LPSRow; + + typedef struct _SRowSet { + ULONG cRows; + SRow aRow[MAPI_DIM]; + } SRowSet,*LPSRowSet; + +#define CbNewSRowSet(_crow) (offsetof(SRowSet,aRow) + (_crow)*sizeof(SRow)) +#define CbSRowSet(_lprowset) (offsetof(SRowSet,aRow) + (UINT)((_lprowset)->cRows*sizeof(SRow))) +#define SizedSRowSet(_crow,_name) struct _SRowSet_ ## _name { ULONG cRows; SRow aRow[_crow]; } _name + + typedef SCODE (WINAPI ALLOCATEBUFFER)(ULONG cbSize,LPVOID *lppBuffer); + typedef SCODE (WINAPI ALLOCATEMORE)(ULONG cbSize,LPVOID lpObject,LPVOID *lppBuffer); + typedef ULONG (WINAPI FREEBUFFER)(LPVOID lpBuffer); + + typedef ALLOCATEBUFFER *LPALLOCATEBUFFER; + typedef ALLOCATEMORE *LPALLOCATEMORE; + typedef FREEBUFFER *LPFREEBUFFER; + +#if defined(MAPI_IF) && (!defined(__cplusplus) || defined(CINTERFACE)) +#define DECLARE_MAPI_INTERFACE(iface) typedef struct iface##Vtbl iface##Vtbl,*iface; struct iface##Vtbl +#define DECLARE_MAPI_INTERFACE_(iface,baseiface) DECLARE_MAPI_INTERFACE(iface) +#define DECLARE_MAPI_INTERFACE_PTR(iface,piface) typedef struct iface##Vtbl iface##Vtbl,*iface,**piface; +#else +#define DECLARE_MAPI_INTERFACE(iface) DECLARE_INTERFACE(iface) +#define DECLARE_MAPI_INTERFACE_(iface,baseiface) DECLARE_INTERFACE_(iface,baseiface) +#ifdef __cplusplus +#define DECLARE_MAPI_INTERFACE_PTR(iface,piface) struct iface; typedef iface *piface +#else +#define DECLARE_MAPI_INTERFACE_PTR(iface,piface) typedef struct iface iface,*piface +#endif +#endif + +#define MAPIMETHOD(method) MAPIMETHOD_(HRESULT,method) +#define MAPIMETHOD_(type,method) STDMETHOD_(type,method) +#define MAPIMETHOD_DECLARE(type,method,prefix) STDMETHODIMP_(type) prefix##method +#define MAPIMETHOD_TYPEDEF(type,method,prefix) typedef type (WINAPI prefix##method##_METHOD) + +#define MAPI_IUNKNOWN_METHODS(IPURE) MAPIMETHOD(QueryInterface) (THIS_ REFIID riid,LPVOID *ppvObj) IPURE; MAPIMETHOD_(ULONG,AddRef) (THIS) IPURE; MAPIMETHOD_(ULONG,Release) (THIS) IPURE; +#undef IMPL +#define IMPL + + typedef const IID *LPCIID; + + DECLARE_MAPI_INTERFACE_PTR(IMsgStore,LPMDB); + DECLARE_MAPI_INTERFACE_PTR(IMAPIFolder,LPMAPIFOLDER); + DECLARE_MAPI_INTERFACE_PTR(IMessage,LPMESSAGE); + DECLARE_MAPI_INTERFACE_PTR(IAttach,LPATTACH); + DECLARE_MAPI_INTERFACE_PTR(IAddrBook,LPADRBOOK); + DECLARE_MAPI_INTERFACE_PTR(IABContainer,LPABCONT); + DECLARE_MAPI_INTERFACE_PTR(IMailUser,LPMAILUSER); + DECLARE_MAPI_INTERFACE_PTR(IDistList,LPDISTLIST); + DECLARE_MAPI_INTERFACE_PTR(IMAPIStatus,LPMAPISTATUS); + DECLARE_MAPI_INTERFACE_PTR(IMAPITable,LPMAPITABLE); + DECLARE_MAPI_INTERFACE_PTR(IProfSect,LPPROFSECT); + DECLARE_MAPI_INTERFACE_PTR(IMAPIProp,LPMAPIPROP); + DECLARE_MAPI_INTERFACE_PTR(IMAPIContainer,LPMAPICONTAINER); + DECLARE_MAPI_INTERFACE_PTR(IMAPIAdviseSink,LPMAPIADVISESINK); + DECLARE_MAPI_INTERFACE_PTR(IMAPIProgress,LPMAPIPROGRESS); + DECLARE_MAPI_INTERFACE_PTR(IProviderAdmin,LPPROVIDERADMIN); + + typedef struct _MAPIERROR { + ULONG ulVersion; + LPTSTR lpszError; + LPTSTR lpszComponent; + ULONG ulLowLevelError; + ULONG ulContext; + } MAPIERROR,*LPMAPIERROR; + +#define fnevCriticalError ((ULONG) 0x00000001) +#define fnevNewMail ((ULONG) 0x00000002) +#define fnevObjectCreated ((ULONG) 0x00000004) +#define fnevObjectDeleted ((ULONG) 0x00000008) +#define fnevObjectModified ((ULONG) 0x00000010) +#define fnevObjectMoved ((ULONG) 0x00000020) +#define fnevObjectCopied ((ULONG) 0x00000040) +#define fnevSearchComplete ((ULONG) 0x00000080) +#define fnevTableModified ((ULONG) 0x00000100) +#define fnevStatusObjectModified ((ULONG) 0x00000200) +#define fnevReservedForMapi ((ULONG) 0x40000000) +#define fnevExtended ((ULONG) 0x80000000) + +#define TABLE_CHANGED 1 +#define TABLE_ERROR 2 +#define TABLE_ROW_ADDED 3 +#define TABLE_ROW_DELETED 4 +#define TABLE_ROW_MODIFIED 5 +#define TABLE_SORT_DONE 6 +#define TABLE_RESTRICT_DONE 7 +#define TABLE_SETCOL_DONE 8 +#define TABLE_RELOAD 9 + + typedef struct _ERROR_NOTIFICATION { + ULONG cbEntryID; + LPENTRYID lpEntryID; + SCODE scode; + ULONG ulFlags; + LPMAPIERROR lpMAPIError; + } ERROR_NOTIFICATION; + + typedef struct _NEWMAIL_NOTIFICATION { + ULONG cbEntryID; + LPENTRYID lpEntryID; + ULONG cbParentID; + LPENTRYID lpParentID; + ULONG ulFlags; + LPTSTR lpszMessageClass; + ULONG ulMessageFlags; + } NEWMAIL_NOTIFICATION; + + typedef struct _OBJECT_NOTIFICATION { + ULONG cbEntryID; + LPENTRYID lpEntryID; + ULONG ulObjType; + ULONG cbParentID; + LPENTRYID lpParentID; + ULONG cbOldID; + LPENTRYID lpOldID; + ULONG cbOldParentID; + LPENTRYID lpOldParentID; + LPSPropTagArray lpPropTagArray; + } OBJECT_NOTIFICATION; + + typedef struct _TABLE_NOTIFICATION { + ULONG ulTableEvent; + HRESULT hResult; + SPropValue propIndex; + SPropValue propPrior; + SRow row; + ULONG ulPad; + } TABLE_NOTIFICATION; + + typedef struct _EXTENDED_NOTIFICATION { + ULONG ulEvent; + ULONG cb; + LPBYTE pbEventParameters; + } EXTENDED_NOTIFICATION; + + typedef struct { + ULONG cbEntryID; + LPENTRYID lpEntryID; + ULONG cValues; + LPSPropValue lpPropVals; + } STATUS_OBJECT_NOTIFICATION; + + typedef struct _NOTIFICATION { + ULONG ulEventType; + ULONG ulAlignPad; + union { + ERROR_NOTIFICATION err; + NEWMAIL_NOTIFICATION newmail; + OBJECT_NOTIFICATION obj; + TABLE_NOTIFICATION tab; + EXTENDED_NOTIFICATION ext; + STATUS_OBJECT_NOTIFICATION statobj; + } info; + } NOTIFICATION,*LPNOTIFICATION; + +#define MAPI_IMAPIADVISESINK_METHODS(IPURE) MAPIMETHOD_(ULONG,OnNotify) (THIS_ ULONG cNotif,LPNOTIFICATION lpNotifications) IPURE; +#undef INTERFACE +#define INTERFACE IMAPIAdviseSink + DECLARE_MAPI_INTERFACE_(IMAPIAdviseSink,IUnknown) { + BEGIN_INTERFACE + MAPI_IUNKNOWN_METHODS(PURE) + MAPI_IMAPIADVISESINK_METHODS(PURE) + }; + + typedef __LONG32 (WINAPI NOTIFCALLBACK) (LPVOID lpvContext,ULONG cNotification,LPNOTIFICATION lpNotifications); + typedef NOTIFCALLBACK *LPNOTIFCALLBACK; + +#define szMAPINotificationMsg "MAPI Notify window message" +#define MAPI_TOP_LEVEL ((ULONG) 0x00000001) +#define MAPI_IMAPIPROGRESS_METHODS(IPURE) MAPIMETHOD(Progress) (THIS_ ULONG ulValue,ULONG ulCount,ULONG ulTotal) IPURE; MAPIMETHOD(GetFlags) (THIS_ ULONG *lpulFlags) IPURE; MAPIMETHOD(GetMax) (THIS_ ULONG *lpulMax) IPURE; MAPIMETHOD(GetMin) (THIS_ ULONG *lpulMin) IPURE; MAPIMETHOD(SetLimits) (THIS_ LPULONG lpulMin,LPULONG lpulMax,LPULONG lpulFlags) IPURE; +#undef INTERFACE +#define INTERFACE IMAPIProgress + DECLARE_MAPI_INTERFACE_(IMAPIProgress,IUnknown) { + BEGIN_INTERFACE + MAPI_IUNKNOWN_METHODS(PURE) + MAPI_IMAPIPROGRESS_METHODS(PURE) + }; + +#define MAPI_ERROR_VERSION __MSABI_LONG(0x00000000) + +#define KEEP_OPEN_READONLY ((ULONG) 0x00000001) +#define KEEP_OPEN_READWRITE ((ULONG) 0x00000002) +#define FORCE_SAVE ((ULONG) 0x00000004) + +#define MAPI_CREATE ((ULONG) 0x00000002) +#define STREAM_APPEND ((ULONG) 0x00000004) + +#define MAPI_MOVE ((ULONG) 0x00000001) +#define MAPI_NOREPLACE ((ULONG) 0x00000002) +#define MAPI_DECLINE_OK ((ULONG) 0x00000004) + +#ifndef MAPI_DIALOG +#define MAPI_DIALOG ((ULONG) 0x00000008) +#endif + +#ifndef MAPI_USE_DEFAULT +#define MAPI_USE_DEFAULT 0x00000040 +#endif + +#define MAPI_NO_STRINGS ((ULONG) 0x00000001) +#define MAPI_NO_IDS ((ULONG) 0x00000002) + +#define MNID_ID 0 +#define MNID_STRING 1 + typedef struct _MAPINAMEID { + LPGUID lpguid; + ULONG ulKind; + union { + LONG lID; + LPWSTR lpwstrName; + } Kind; + } MAPINAMEID,*LPMAPINAMEID; + +#define MAPI_IMAPIPROP_METHODS(IPURE) MAPIMETHOD(GetLastError) (THIS_ HRESULT hResult,ULONG ulFlags,LPMAPIERROR *lppMAPIError) IPURE; MAPIMETHOD(SaveChanges) (THIS_ ULONG ulFlags) IPURE; MAPIMETHOD(GetProps) (THIS_ LPSPropTagArray lpPropTagArray,ULONG ulFlags,ULONG *lpcValues,LPSPropValue *lppPropArray) IPURE; MAPIMETHOD(GetPropList) (THIS_ ULONG ulFlags,LPSPropTagArray *lppPropTagArray) IPURE; MAPIMETHOD(OpenProperty) (THIS_ ULONG ulPropTag,LPCIID lpiid,ULONG ulInterfaceOptions,ULONG ulFlags,LPUNKNOWN *lppUnk) IPURE; MAPIMETHOD(SetProps) (THIS_ ULONG cValues,LPSPropValue lpPropArray,LPSPropProblemArray *lppProblems) IPURE; MAPIMETHOD(DeleteProps) (THIS_ LPSPropTagArray lpPropTagArray,LPSPropProblemArray *lppProblems) IPURE; MAPIMETHOD(CopyTo) (THIS_ ULONG ciidExclude,LPCIID rgiidExclude,LPSPropTagArray lpExcludeProps,ULONG ulUIParam,LPMAPIPROGRESS lpProgress,LPCIID lpInterface,LPVOID lpDestObj,ULONG ulFlags,LPSPropProblemArray *lppProblems) IPURE; MAPIMETHOD(CopyProps) (THIS_ LPSPropTagArray lpIncludeProps,ULONG ulUIParam,LPMAPIPROGRESS lpProgress,LPCIID lpInterface,LPVOID lpDestObj,ULONG ulFlags,LPSPropProblemArray *lppProblems) IPURE; MAPIMETHOD(GetNamesFromIDs) (THIS_ LPSPropTagArray *lppPropTags,LPGUID lpPropSetGuid,ULONG ulFlags,ULONG *lpcPropNames,LPMAPINAMEID **lpppPropNames) IPURE; MAPIMETHOD(GetIDsFromNames) (THIS_ ULONG cPropNames,LPMAPINAMEID *lppPropNames,ULONG ulFlags,LPSPropTagArray *lppPropTags) IPURE; +#undef INTERFACE +#define INTERFACE IMAPIProp + DECLARE_MAPI_INTERFACE_(IMAPIProp,IUnknown) { + BEGIN_INTERFACE + MAPI_IUNKNOWN_METHODS(PURE) + MAPI_IMAPIPROP_METHODS(PURE) + }; + +#define TBLSTAT_COMPLETE ((ULONG) 0) +#define TBLSTAT_QCHANGED ((ULONG) 7) +#define TBLSTAT_SORTING ((ULONG) 9) +#define TBLSTAT_SORT_ERROR ((ULONG) 10) +#define TBLSTAT_SETTING_COLS ((ULONG) 11) +#define TBLSTAT_SETCOL_ERROR ((ULONG) 13) +#define TBLSTAT_RESTRICTING ((ULONG) 14) +#define TBLSTAT_RESTRICT_ERROR ((ULONG) 15) + +#define TBLTYPE_SNAPSHOT ((ULONG) 0) +#define TBLTYPE_KEYSET ((ULONG) 1) +#define TBLTYPE_DYNAMIC ((ULONG) 2) + +#define TABLE_SORT_ASCEND ((ULONG) 0x00000000) +#define TABLE_SORT_DESCEND ((ULONG) 0x00000001) +#define TABLE_SORT_COMBINE ((ULONG) 0x00000002) + + typedef struct _SSortOrder { + ULONG ulPropTag; + ULONG ulOrder; + } SSortOrder,*LPSSortOrder; + + typedef struct _SSortOrderSet { + ULONG cSorts; + ULONG cCategories; + ULONG cExpanded; + SSortOrder aSort[MAPI_DIM]; + } SSortOrderSet,*LPSSortOrderSet; + +#define CbNewSSortOrderSet(_csort) (offsetof(SSortOrderSet,aSort) + (_csort)*sizeof(SSortOrder)) +#define CbSSortOrderSet(_lpset) (offsetof(SSortOrderSet,aSort) + (UINT)((_lpset)->cSorts*sizeof(SSortOrder))) +#define SizedSSortOrderSet(_csort,_name) struct _SSortOrderSet_ ## _name { ULONG cSorts; ULONG cCategories; ULONG cExpanded; SSortOrder aSort[_csort]; } _name + + typedef ULONG BOOKMARK; + +#define BOOKMARK_BEGINNING ((BOOKMARK) 0) +#define BOOKMARK_CURRENT ((BOOKMARK) 1) +#define BOOKMARK_END ((BOOKMARK) 2) + +#define FL_FULLSTRING ((ULONG) 0x00000000) +#define FL_SUBSTRING ((ULONG) 0x00000001) +#define FL_PREFIX ((ULONG) 0x00000002) + +#define FL_IGNORECASE ((ULONG) 0x00010000) +#define FL_IGNORENONSPACE ((ULONG) 0x00020000) +#define FL_LOOSE ((ULONG) 0x00040000) + + typedef struct _SRestriction *LPSRestriction; + +#define RES_AND ((ULONG) 0x00000000) +#define RES_OR ((ULONG) 0x00000001) +#define RES_NOT ((ULONG) 0x00000002) +#define RES_CONTENT ((ULONG) 0x00000003) +#define RES_PROPERTY ((ULONG) 0x00000004) +#define RES_COMPAREPROPS ((ULONG) 0x00000005) +#define RES_BITMASK ((ULONG) 0x00000006) +#define RES_SIZE ((ULONG) 0x00000007) +#define RES_EXIST ((ULONG) 0x00000008) +#define RES_SUBRESTRICTION ((ULONG) 0x00000009) +#define RES_COMMENT ((ULONG) 0x0000000A) + +#define RELOP_LT ((ULONG) 0) +#define RELOP_LE ((ULONG) 1) +#define RELOP_GT ((ULONG) 2) +#define RELOP_GE ((ULONG) 3) +#define RELOP_EQ ((ULONG) 4) +#define RELOP_NE ((ULONG) 5) +#define RELOP_RE ((ULONG) 6) + +#define BMR_EQZ ((ULONG) 0) +#define BMR_NEZ ((ULONG) 1) + + typedef struct _SAndRestriction { + ULONG cRes; + LPSRestriction lpRes; + } SAndRestriction; + + typedef struct _SOrRestriction { + ULONG cRes; + LPSRestriction lpRes; + } SOrRestriction; + + typedef struct _SNotRestriction { + ULONG ulReserved; + LPSRestriction lpRes; + } SNotRestriction; + + typedef struct _SContentRestriction { + ULONG ulFuzzyLevel; + ULONG ulPropTag; + LPSPropValue lpProp; + } SContentRestriction; + + typedef struct _SBitMaskRestriction { + ULONG relBMR; + ULONG ulPropTag; + ULONG ulMask; + } SBitMaskRestriction; + + typedef struct _SPropertyRestriction { + ULONG relop; + ULONG ulPropTag; + LPSPropValue lpProp; + } SPropertyRestriction; + + typedef struct _SComparePropsRestriction { + ULONG relop; + ULONG ulPropTag1; + ULONG ulPropTag2; + } SComparePropsRestriction; + + typedef struct _SSizeRestriction { + ULONG relop; + ULONG ulPropTag; + ULONG cb; + } SSizeRestriction; + + typedef struct _SExistRestriction { + ULONG ulReserved1; + ULONG ulPropTag; + ULONG ulReserved2; + } SExistRestriction; + + typedef struct _SSubRestriction { + ULONG ulSubObject; + LPSRestriction lpRes; + } SSubRestriction; + + typedef struct _SCommentRestriction { + ULONG cValues; + LPSRestriction lpRes; + LPSPropValue lpProp; + } SCommentRestriction; + + typedef struct _SRestriction { + ULONG rt; + union { + SComparePropsRestriction resCompareProps; + SAndRestriction resAnd; + SOrRestriction resOr; + SNotRestriction resNot; + SContentRestriction resContent; + SPropertyRestriction resProperty; + SBitMaskRestriction resBitMask; + SSizeRestriction resSize; + SExistRestriction resExist; + SSubRestriction resSub; + SCommentRestriction resComment; + } res; + } SRestriction; + +#define TBL_ALL_COLUMNS ((ULONG) 0x00000001) + +#define TBL_LEAF_ROW ((ULONG) 1) +#define TBL_EMPTY_CATEGORY ((ULONG) 2) +#define TBL_EXPANDED_CATEGORY ((ULONG) 3) +#define TBL_COLLAPSED_CATEGORY ((ULONG) 4) + +#define TBL_NOWAIT ((ULONG) 0x00000001) + +#define TBL_ASYNC ((ULONG) 0x00000001) +#define TBL_BATCH ((ULONG) 0x00000002) + +#define DIR_BACKWARD ((ULONG) 0x00000001) + +#define TBL_NOADVANCE ((ULONG) 0x00000001) + +#define MAPI_IMAPITABLE_METHODS(IPURE) MAPIMETHOD(GetLastError) (THIS_ HRESULT hResult,ULONG ulFlags,LPMAPIERROR *lppMAPIError) IPURE; MAPIMETHOD(Advise) (THIS_ ULONG ulEventMask,LPMAPIADVISESINK lpAdviseSink,ULONG *lpulConnection) IPURE; MAPIMETHOD(Unadvise) (THIS_ ULONG ulConnection) IPURE; MAPIMETHOD(GetStatus) (THIS_ ULONG *lpulTableStatus,ULONG *lpulTableType) IPURE; MAPIMETHOD(SetColumns) (THIS_ LPSPropTagArray lpPropTagArray,ULONG ulFlags) IPURE; MAPIMETHOD(QueryColumns) (THIS_ ULONG ulFlags,LPSPropTagArray *lpPropTagArray) IPURE; MAPIMETHOD(GetRowCount) (THIS_ ULONG ulFlags,ULONG *lpulCount) IPURE; MAPIMETHOD(SeekRow) (THIS_ BOOKMARK bkOrigin,LONG lRowCount,LONG *lplRowsSought) IPURE; MAPIMETHOD(SeekRowApprox) (THIS_ ULONG ulNumerator,ULONG ulDenominator) IPURE; MAPIMETHOD(QueryPosition) (THIS_ ULONG *lpulRow,ULONG *lpulNumerator,ULONG *lpulDenominator) IPURE; MAPIMETHOD(FindRow) (THIS_ LPSRestriction lpRestriction,BOOKMARK bkOrigin,ULONG ulFlags) IPURE; MAPIMETHOD(Restrict) (THIS_ LPSRestriction lpRestriction,ULONG ulFlags) IPURE; MAPIMETHOD(CreateBookmark) (THIS_ BOOKMARK *lpbkPosition) IPURE; MAPIMETHOD(FreeBookmark) (THIS_ BOOKMARK bkPosition) IPURE; MAPIMETHOD(SortTable) (THIS_ LPSSortOrderSet lpSortCriteria,ULONG ulFlags) IPURE; MAPIMETHOD(QuerySortOrder) (THIS_ LPSSortOrderSet *lppSortCriteria) IPURE; MAPIMETHOD(QueryRows) (THIS_ LONG lRowCount,ULONG ulFlags,LPSRowSet *lppRows) IPURE; MAPIMETHOD(Abort) (THIS) IPURE; MAPIMETHOD(ExpandRow) (THIS_ ULONG cbInstanceKey,LPBYTE pbInstanceKey,ULONG ulRowCount,ULONG ulFlags,LPSRowSet *lppRows,ULONG *lpulMoreRows) IPURE; MAPIMETHOD(CollapseRow) (THIS_ ULONG cbInstanceKey,LPBYTE pbInstanceKey,ULONG ulFlags,ULONG *lpulRowCount) IPURE; MAPIMETHOD(WaitForCompletion) (THIS_ ULONG ulFlags,ULONG ulTimeout,ULONG *lpulTableStatus) IPURE; MAPIMETHOD(GetCollapseState) (THIS_ ULONG ulFlags,ULONG cbInstanceKey,LPBYTE lpbInstanceKey,ULONG *lpcbCollapseState,LPBYTE *lppbCollapseState) IPURE; MAPIMETHOD(SetCollapseState) (THIS_ ULONG ulFlags,ULONG cbCollapseState,LPBYTE pbCollapseState,BOOKMARK *lpbkLocation) IPURE; +#undef INTERFACE +#define INTERFACE IMAPITable + DECLARE_MAPI_INTERFACE_(IMAPITable,IUnknown) { + BEGIN_INTERFACE + MAPI_IUNKNOWN_METHODS(PURE) + MAPI_IMAPITABLE_METHODS(PURE) + }; + +#define PS_PROFILE_PROPERTIES_INIT { 0x98,0x15,0xAC,0x08,0xAA,0xB0,0x10,0x1A,0x8C,0x93,0x08,0x00,0x2B,0x2A,0x56,0xC2 } + +#define MAPI_IPROFSECT_METHODS(IPURE) + +#undef INTERFACE +#define INTERFACE IProfSect + DECLARE_MAPI_INTERFACE_(IProfSect,IMAPIProp) { + BEGIN_INTERFACE + MAPI_IUNKNOWN_METHODS(PURE) + MAPI_IMAPIPROP_METHODS(PURE) + MAPI_IPROFSECT_METHODS(PURE) + }; + +#define MAPI_STORE_PROVIDER ((ULONG) 33) +#define MAPI_AB ((ULONG) 34) +#define MAPI_AB_PROVIDER ((ULONG) 35) +#define MAPI_TRANSPORT_PROVIDER ((ULONG) 36) +#define MAPI_SPOOLER ((ULONG) 37) +#define MAPI_PROFILE_PROVIDER ((ULONG) 38) +#define MAPI_SUBSYSTEM ((ULONG) 39) +#define MAPI_HOOK_PROVIDER ((ULONG) 40) + +#define STATUS_VALIDATE_STATE ((ULONG) 0x00000001) +#define STATUS_SETTINGS_DIALOG ((ULONG) 0x00000002) +#define STATUS_CHANGE_PASSWORD ((ULONG) 0x00000004) +#define STATUS_FLUSH_QUEUES ((ULONG) 0x00000008) + +#define STATUS_DEFAULT_OUTBOUND ((ULONG) 0x00000001) +#define STATUS_DEFAULT_STORE ((ULONG) 0x00000002) +#define STATUS_PRIMARY_IDENTITY ((ULONG) 0x00000004) +#define STATUS_SIMPLE_STORE ((ULONG) 0x00000008) +#define STATUS_XP_PREFER_LAST ((ULONG) 0x00000010) +#define STATUS_NO_PRIMARY_IDENTITY ((ULONG) 0x00000020) +#define STATUS_NO_DEFAULT_STORE ((ULONG) 0x00000040) +#define STATUS_TEMP_SECTION ((ULONG) 0x00000080) +#define STATUS_OWN_STORE ((ULONG) 0x00000100) + +#define STATUS_NEED_IPM_TREE ((ULONG) 0x00000800) +#define STATUS_PRIMARY_STORE ((ULONG) 0x00001000) +#define STATUS_SECONDARY_STORE ((ULONG) 0x00002000) + +#define STATUS_AVAILABLE ((ULONG) 0x00000001) +#define STATUS_OFFLINE ((ULONG) 0x00000002) +#define STATUS_FAILURE ((ULONG) 0x00000004) + +#define STATUS_INBOUND_ENABLED ((ULONG) 0x00010000) +#define STATUS_INBOUND_ACTIVE ((ULONG) 0x00020000) +#define STATUS_INBOUND_FLUSH ((ULONG) 0x00040000) +#define STATUS_OUTBOUND_ENABLED ((ULONG) 0x00100000) +#define STATUS_OUTBOUND_ACTIVE ((ULONG) 0x00200000) +#define STATUS_OUTBOUND_FLUSH ((ULONG) 0x00400000) +#define STATUS_REMOTE_ACCESS ((ULONG) 0x00800000) + +#define SUPPRESS_UI ((ULONG) 0x00000001) +#define REFRESH_XP_HEADER_CACHE ((ULONG) 0x00010000) +#define PROCESS_XP_HEADER_CACHE ((ULONG) 0x00020000) +#define FORCE_XP_CONNECT ((ULONG) 0x00040000) +#define FORCE_XP_DISCONNECT ((ULONG) 0x00080000) +#define CONFIG_CHANGED ((ULONG) 0x00100000) +#define ABORT_XP_HEADER_OPERATION ((ULONG) 0x00200000) +#define SHOW_XP_SESSION_UI ((ULONG) 0x00400000) + +#define UI_READONLY ((ULONG) 0x00000001) + +#define FLUSH_UPLOAD ((ULONG) 0x00000002) +#define FLUSH_DOWNLOAD ((ULONG) 0x00000004) +#define FLUSH_FORCE ((ULONG) 0x00000008) +#define FLUSH_NO_UI ((ULONG) 0x00000010) +#define FLUSH_ASYNC_OK ((ULONG) 0x00000020) + +#define MAPI_IMAPISTATUS_METHODS(IPURE) MAPIMETHOD(ValidateState) (THIS_ ULONG ulUIParam,ULONG ulFlags) IPURE; MAPIMETHOD(SettingsDialog) (THIS_ ULONG ulUIParam,ULONG ulFlags) IPURE; MAPIMETHOD(ChangePassword) (THIS_ LPTSTR lpOldPass,LPTSTR lpNewPass,ULONG ulFlags) IPURE; MAPIMETHOD(FlushQueues) (THIS_ ULONG ulUIParam,ULONG cbTargetTransport,LPENTRYID lpTargetTransport,ULONG ulFlags) IPURE; +#undef INTERFACE +#define INTERFACE IMAPIStatus + DECLARE_MAPI_INTERFACE_(IMAPIStatus,IMAPIProp) { + BEGIN_INTERFACE + MAPI_IUNKNOWN_METHODS(PURE) + MAPI_IMAPIPROP_METHODS(PURE) + MAPI_IMAPISTATUS_METHODS(PURE) + }; + +#define MAPI_BEST_ACCESS ((ULONG) 0x00000010) + +#define CONVENIENT_DEPTH ((ULONG) 0x00000001) + +#define SEARCH_RUNNING ((ULONG) 0x00000001) +#define SEARCH_REBUILD ((ULONG) 0x00000002) +#define SEARCH_RECURSIVE ((ULONG) 0x00000004) +#define SEARCH_FOREGROUND ((ULONG) 0x00000008) + +#define STOP_SEARCH ((ULONG) 0x00000001) +#define RESTART_SEARCH ((ULONG) 0x00000002) +#define RECURSIVE_SEARCH ((ULONG) 0x00000004) +#define SHALLOW_SEARCH ((ULONG) 0x00000008) +#define FOREGROUND_SEARCH ((ULONG) 0x00000010) +#define BACKGROUND_SEARCH ((ULONG) 0x00000020) + +#define MAPI_IMAPICONTAINER_METHODS(IPURE) MAPIMETHOD(GetContentsTable) (THIS_ ULONG ulFlags,LPMAPITABLE *lppTable) IPURE; MAPIMETHOD(GetHierarchyTable) (THIS_ ULONG ulFlags,LPMAPITABLE *lppTable) IPURE; MAPIMETHOD(OpenEntry) (THIS_ ULONG cbEntryID,LPENTRYID lpEntryID,LPCIID lpInterface,ULONG ulFlags,ULONG *lpulObjType,LPUNKNOWN *lppUnk) IPURE; MAPIMETHOD(SetSearchCriteria) (THIS_ LPSRestriction lpRestriction,LPENTRYLIST lpContainerList,ULONG ulSearchFlags) IPURE; MAPIMETHOD(GetSearchCriteria) (THIS_ ULONG ulFlags,LPSRestriction *lppRestriction,LPENTRYLIST *lppContainerList,ULONG *lpulSearchState)IPURE; +#undef INTERFACE +#define INTERFACE IMAPIContainer + DECLARE_MAPI_INTERFACE_(IMAPIContainer,IMAPIProp) { + BEGIN_INTERFACE + MAPI_IUNKNOWN_METHODS(PURE) + MAPI_IMAPIPROP_METHODS(PURE) + MAPI_IMAPICONTAINER_METHODS(PURE) + }; + + typedef struct _flaglist { + ULONG cFlags; + ULONG ulFlag[MAPI_DIM]; + } FlagList,*LPFlagList; + +#define AB_RECIPIENTS ((ULONG) 0x00000001) +#define AB_SUBCONTAINERS ((ULONG) 0x00000002) +#define AB_MODIFIABLE ((ULONG) 0x00000004) +#define AB_UNMODIFIABLE ((ULONG) 0x00000008) +#define AB_FIND_ON_OPEN ((ULONG) 0x00000010) +#define AB_NOT_DEFAULT ((ULONG) 0x00000020) + +#define CREATE_CHECK_DUP_STRICT ((ULONG) 0x00000001) +#define CREATE_CHECK_DUP_LOOSE ((ULONG) 0x00000002) +#define CREATE_REPLACE ((ULONG) 0x00000004) + +#define MAPI_UNRESOLVED ((ULONG) 0x00000000) +#define MAPI_AMBIGUOUS ((ULONG) 0x00000001) +#define MAPI_RESOLVED ((ULONG) 0x00000002) + +#define MAPI_IABCONTAINER_METHODS(IPURE) MAPIMETHOD(CreateEntry) (THIS_ ULONG cbEntryID,LPENTRYID lpEntryID,ULONG ulCreateFlags,LPMAPIPROP *lppMAPIPropEntry) IPURE; MAPIMETHOD(CopyEntries) (THIS_ LPENTRYLIST lpEntries,ULONG ulUIParam,LPMAPIPROGRESS lpProgress,ULONG ulFlags) IPURE; MAPIMETHOD(DeleteEntries) (THIS_ LPENTRYLIST lpEntries,ULONG ulFlags) IPURE; MAPIMETHOD(ResolveNames) (THIS_ LPSPropTagArray lpPropTagArray,ULONG ulFlags,LPADRLIST lpAdrList,LPFlagList lpFlagList) IPURE; +#undef INTERFACE +#define INTERFACE IABContainer + DECLARE_MAPI_INTERFACE_(IABContainer,IMAPIContainer) { + BEGIN_INTERFACE + MAPI_IUNKNOWN_METHODS(PURE) + MAPI_IMAPIPROP_METHODS(PURE) + MAPI_IMAPICONTAINER_METHODS(PURE) + MAPI_IABCONTAINER_METHODS(PURE) + }; + +#define MAPI_SEND_NO_RICH_INFO ((ULONG) 0x00010000) + +#define MAPI_DIAG(_code) ((LONG) _code) + +#define MAPI_DIAG_NO_DIAGNOSTIC MAPI_DIAG(-1) +#define MAPI_DIAG_OR_NAME_UNRECOGNIZED MAPI_DIAG(0) +#define MAPI_DIAG_OR_NAME_AMBIGUOUS MAPI_DIAG(1) +#define MAPI_DIAG_MTS_CONGESTED MAPI_DIAG(2) +#define MAPI_DIAG_LOOP_DETECTED MAPI_DIAG(3) +#define MAPI_DIAG_RECIPIENT_UNAVAILABLE MAPI_DIAG(4) +#define MAPI_DIAG_MAXIMUM_TIME_EXPIRED MAPI_DIAG(5) +#define MAPI_DIAG_EITS_UNSUPPORTED MAPI_DIAG(6) +#define MAPI_DIAG_CONTENT_TOO_LONG MAPI_DIAG(7) +#define MAPI_DIAG_IMPRACTICAL_TO_CONVERT MAPI_DIAG(8) +#define MAPI_DIAG_PROHIBITED_TO_CONVERT MAPI_DIAG(9) +#define MAPI_DIAG_CONVERSION_UNSUBSCRIBED MAPI_DIAG(10) +#define MAPI_DIAG_PARAMETERS_INVALID MAPI_DIAG(11) +#define MAPI_DIAG_CONTENT_SYNTAX_IN_ERROR MAPI_DIAG(12) +#define MAPI_DIAG_LENGTH_CONSTRAINT_VIOLATD MAPI_DIAG(13) +#define MAPI_DIAG_NUMBER_CONSTRAINT_VIOLATD MAPI_DIAG(14) +#define MAPI_DIAG_CONTENT_TYPE_UNSUPPORTED MAPI_DIAG(15) +#define MAPI_DIAG_TOO_MANY_RECIPIENTS MAPI_DIAG(16) +#define MAPI_DIAG_NO_BILATERAL_AGREEMENT MAPI_DIAG(17) +#define MAPI_DIAG_CRITICAL_FUNC_UNSUPPORTED MAPI_DIAG(18) +#define MAPI_DIAG_CONVERSION_LOSS_PROHIB MAPI_DIAG(19) +#define MAPI_DIAG_LINE_TOO_LONG MAPI_DIAG(20) +#define MAPI_DIAG_PAGE_TOO_LONG MAPI_DIAG(21) +#define MAPI_DIAG_PICTORIAL_SYMBOL_LOST MAPI_DIAG(22) +#define MAPI_DIAG_PUNCTUATION_SYMBOL_LOST MAPI_DIAG(23) +#define MAPI_DIAG_ALPHABETIC_CHARACTER_LOST MAPI_DIAG(24) +#define MAPI_DIAG_MULTIPLE_INFO_LOSSES MAPI_DIAG(25) +#define MAPI_DIAG_REASSIGNMENT_PROHIBITED MAPI_DIAG(26) +#define MAPI_DIAG_REDIRECTION_LOOP_DETECTED MAPI_DIAG(27) +#define MAPI_DIAG_EXPANSION_PROHIBITED MAPI_DIAG(28) +#define MAPI_DIAG_SUBMISSION_PROHIBITED MAPI_DIAG(29) +#define MAPI_DIAG_EXPANSION_FAILED MAPI_DIAG(30) +#define MAPI_DIAG_RENDITION_UNSUPPORTED MAPI_DIAG(31) +#define MAPI_DIAG_MAIL_ADDRESS_INCORRECT MAPI_DIAG(32) +#define MAPI_DIAG_MAIL_OFFICE_INCOR_OR_INVD MAPI_DIAG(33) +#define MAPI_DIAG_MAIL_ADDRESS_INCOMPLETE MAPI_DIAG(34) +#define MAPI_DIAG_MAIL_RECIPIENT_UNKNOWN MAPI_DIAG(35) +#define MAPI_DIAG_MAIL_RECIPIENT_DECEASED MAPI_DIAG(36) +#define MAPI_DIAG_MAIL_ORGANIZATION_EXPIRED MAPI_DIAG(37) +#define MAPI_DIAG_MAIL_REFUSED MAPI_DIAG(38) +#define MAPI_DIAG_MAIL_UNCLAIMED MAPI_DIAG(39) +#define MAPI_DIAG_MAIL_RECIPIENT_MOVED MAPI_DIAG(40) +#define MAPI_DIAG_MAIL_RECIPIENT_TRAVELLING MAPI_DIAG(41) +#define MAPI_DIAG_MAIL_RECIPIENT_DEPARTED MAPI_DIAG(42) +#define MAPI_DIAG_MAIL_NEW_ADDRESS_UNKNOWN MAPI_DIAG(43) +#define MAPI_DIAG_MAIL_FORWARDING_UNWANTED MAPI_DIAG(44) +#define MAPI_DIAG_MAIL_FORWARDING_PROHIB MAPI_DIAG(45) +#define MAPI_DIAG_SECURE_MESSAGING_ERROR MAPI_DIAG(46) +#define MAPI_DIAG_DOWNGRADING_IMPOSSIBLE MAPI_DIAG(47) + +#define MAPI_MH_DP_PUBLIC_UA ((ULONG) 0) +#define MAPI_MH_DP_PRIVATE_UA ((ULONG) 1) +#define MAPI_MH_DP_MS ((ULONG) 2) +#define MAPI_MH_DP_ML ((ULONG) 3) +#define MAPI_MH_DP_PDAU ((ULONG) 4) +#define MAPI_MH_DP_PDS_PATRON ((ULONG) 5) +#define MAPI_MH_DP_OTHER_AU ((ULONG) 6) + +#define MAPI_IMAILUSER_METHODS(IPURE) + +#undef INTERFACE +#define INTERFACE IMailUser + DECLARE_MAPI_INTERFACE_(IMailUser,IMAPIProp) { + BEGIN_INTERFACE + MAPI_IUNKNOWN_METHODS(PURE) + MAPI_IMAPIPROP_METHODS(PURE) + MAPI_IMAILUSER_METHODS(PURE) + }; + +#define MAPI_IDISTLIST_METHODS(IPURE) MAPIMETHOD(CreateEntry) (THIS_ ULONG cbEntryID,LPENTRYID lpEntryID,ULONG ulCreateFlags,LPMAPIPROP *lppMAPIPropEntry) IPURE; MAPIMETHOD(CopyEntries) (THIS_ LPENTRYLIST lpEntries,ULONG ulUIParam,LPMAPIPROGRESS lpProgress,ULONG ulFlags) IPURE; MAPIMETHOD(DeleteEntries) (THIS_ LPENTRYLIST lpEntries,ULONG ulFlags) IPURE; MAPIMETHOD(ResolveNames) (THIS_ LPSPropTagArray lpPropTagArray,ULONG ulFlags,LPADRLIST lpAdrList,LPFlagList lpFlagList) IPURE; +#undef INTERFACE +#define INTERFACE IDistList + DECLARE_MAPI_INTERFACE_(IDistList,IMAPIContainer) { + BEGIN_INTERFACE + MAPI_IUNKNOWN_METHODS(PURE) + MAPI_IMAPIPROP_METHODS(PURE) + MAPI_IMAPICONTAINER_METHODS(PURE) + MAPI_IDISTLIST_METHODS(PURE) + }; + +#define FOLDER_ROOT ((ULONG) 0x00000000) +#define FOLDER_GENERIC ((ULONG) 0x00000001) +#define FOLDER_SEARCH ((ULONG) 0x00000002) + +#define MESSAGE_MOVE ((ULONG) 0x00000001) +#define MESSAGE_DIALOG ((ULONG) 0x00000002) + +#define OPEN_IF_EXISTS ((ULONG) 0x00000001) + +#define DEL_MESSAGES ((ULONG) 0x00000001) +#define FOLDER_DIALOG ((ULONG) 0x00000002) +#define DEL_FOLDERS ((ULONG) 0x00000004) + +#define DEL_ASSOCIATED ((ULONG) 0x00000008) + +#define FOLDER_MOVE ((ULONG) 0x00000001) + +#define COPY_SUBFOLDERS ((ULONG) 0x00000010) + +#define MSGSTATUS_HIGHLIGHTED ((ULONG) 0x00000001) +#define MSGSTATUS_TAGGED ((ULONG) 0x00000002) +#define MSGSTATUS_HIDDEN ((ULONG) 0x00000004) +#define MSGSTATUS_DELMARKED ((ULONG) 0x00000008) + +#define MSGSTATUS_REMOTE_DOWNLOAD ((ULONG) 0x00001000) +#define MSGSTATUS_REMOTE_DELETE ((ULONG) 0x00002000) + +#define RECURSIVE_SORT ((ULONG) 0x00000002) + +#define FLDSTATUS_HIGHLIGHTED ((ULONG) 0x00000001) +#define FLDSTATUS_TAGGED ((ULONG) 0x00000002) +#define FLDSTATUS_HIDDEN ((ULONG) 0x00000004) +#define FLDSTATUS_DELMARKED ((ULONG) 0x00000008) + +#define MAPI_IMAPIFOLDER_METHODS(IPURE) MAPIMETHOD(CreateMessage) (THIS_ LPCIID lpInterface,ULONG ulFlags,LPMESSAGE *lppMessage) IPURE; MAPIMETHOD(CopyMessages) (THIS_ LPENTRYLIST lpMsgList,LPCIID lpInterface,LPVOID lpDestFolder,ULONG ulUIParam,LPMAPIPROGRESS lpProgress,ULONG ulFlags) IPURE; MAPIMETHOD(DeleteMessages) (THIS_ LPENTRYLIST lpMsgList,ULONG ulUIParam,LPMAPIPROGRESS lpProgress,ULONG ulFlags) IPURE; MAPIMETHOD(CreateFolder) (THIS_ ULONG ulFolderType,LPTSTR lpszFolderName,LPTSTR lpszFolderComment,LPCIID lpInterface,ULONG ulFlags,LPMAPIFOLDER *lppFolder) IPURE; MAPIMETHOD(CopyFolder) (THIS_ ULONG cbEntryID,LPENTRYID lpEntryID,LPCIID lpInterface,LPVOID lpDestFolder,LPTSTR lpszNewFolderName,ULONG ulUIParam,LPMAPIPROGRESS lpProgress,ULONG ulFlags) IPURE; MAPIMETHOD(DeleteFolder) (THIS_ ULONG cbEntryID,LPENTRYID lpEntryID,ULONG ulUIParam,LPMAPIPROGRESS lpProgress,ULONG ulFlags) IPURE; MAPIMETHOD(SetReadFlags) (THIS_ LPENTRYLIST lpMsgList,ULONG ulUIParam,LPMAPIPROGRESS lpProgress,ULONG ulFlags) IPURE; MAPIMETHOD(GetMessageStatus) (THIS_ ULONG cbEntryID,LPENTRYID lpEntryID,ULONG ulFlags,ULONG *lpulMessageStatus) IPURE; MAPIMETHOD(SetMessageStatus) (THIS_ ULONG cbEntryID,LPENTRYID lpEntryID,ULONG ulNewStatus,ULONG ulNewStatusMask,ULONG *lpulOldStatus) IPURE; MAPIMETHOD(SaveContentsSort) (THIS_ LPSSortOrderSet lpSortCriteria,ULONG ulFlags) IPURE; MAPIMETHOD(EmptyFolder) (THIS_ ULONG ulUIParam,LPMAPIPROGRESS lpProgress,ULONG ulFlags) IPURE; +#undef INTERFACE +#define INTERFACE IMAPIFolder + DECLARE_MAPI_INTERFACE_(IMAPIFolder,IMAPIContainer) { + BEGIN_INTERFACE + MAPI_IUNKNOWN_METHODS(PURE) + MAPI_IMAPIPROP_METHODS(PURE) + MAPI_IMAPICONTAINER_METHODS(PURE) + MAPI_IMAPIFOLDER_METHODS(PURE) + }; + +#define STORE_ENTRYID_UNIQUE ((ULONG) 0x00000001) +#define STORE_READONLY ((ULONG) 0x00000002) +#define STORE_SEARCH_OK ((ULONG) 0x00000004) +#define STORE_MODIFY_OK ((ULONG) 0x00000008) +#define STORE_CREATE_OK ((ULONG) 0x00000010) +#define STORE_ATTACH_OK ((ULONG) 0x00000020) +#define STORE_OLE_OK ((ULONG) 0x00000040) +#define STORE_SUBMIT_OK ((ULONG) 0x00000080) +#define STORE_NOTIFY_OK ((ULONG) 0x00000100) +#define STORE_MV_PROPS_OK ((ULONG) 0x00000200) +#define STORE_CATEGORIZE_OK ((ULONG) 0x00000400) +#define STORE_RTF_OK ((ULONG) 0x00000800) +#define STORE_RESTRICTION_OK ((ULONG) 0x00001000) +#define STORE_SORT_OK ((ULONG) 0x00002000) +#define STORE_PUBLIC_FOLDERS ((ULONG) 0x00004000) +#define STORE_UNCOMPRESSED_RTF ((ULONG) 0x00008000) + +#define STORE_HAS_SEARCHES ((ULONG) 0x01000000) + +#define LOGOFF_NO_WAIT ((ULONG) 0x00000001) +#define LOGOFF_ORDERLY ((ULONG) 0x00000002) +#define LOGOFF_PURGE ((ULONG) 0x00000004) +#define LOGOFF_ABORT ((ULONG) 0x00000008) +#define LOGOFF_QUIET ((ULONG) 0x00000010) + +#define LOGOFF_COMPLETE ((ULONG) 0x00010000) +#define LOGOFF_INBOUND ((ULONG) 0x00020000) +#define LOGOFF_OUTBOUND ((ULONG) 0x00040000) +#define LOGOFF_OUTBOUND_QUEUE ((ULONG) 0x00080000) + +#define MSG_LOCKED ((ULONG) 0x00000001) +#define MSG_UNLOCKED ((ULONG) 0x00000000) + +#define FOLDER_IPM_SUBTREE_VALID ((ULONG) 0x00000001) +#define FOLDER_IPM_INBOX_VALID ((ULONG) 0x00000002) +#define FOLDER_IPM_OUTBOX_VALID ((ULONG) 0x00000004) +#define FOLDER_IPM_WASTEBASKET_VALID ((ULONG) 0x00000008) +#define FOLDER_IPM_SENTMAIL_VALID ((ULONG) 0x00000010) +#define FOLDER_VIEWS_VALID ((ULONG) 0x00000020) +#define FOLDER_COMMON_VIEWS_VALID ((ULONG) 0x00000040) +#define FOLDER_FINDER_VALID ((ULONG) 0x00000080) + +#define MAPI_IMSGSTORE_METHODS(IPURE) MAPIMETHOD(Advise) (THIS_ ULONG cbEntryID,LPENTRYID lpEntryID,ULONG ulEventMask,LPMAPIADVISESINK lpAdviseSink,ULONG *lpulConnection) IPURE; MAPIMETHOD(Unadvise) (THIS_ ULONG ulConnection) IPURE; MAPIMETHOD(CompareEntryIDs) (THIS_ ULONG cbEntryID1,LPENTRYID lpEntryID1,ULONG cbEntryID2,LPENTRYID lpEntryID2,ULONG ulFlags,ULONG *lpulResult) IPURE; MAPIMETHOD(OpenEntry) (THIS_ ULONG cbEntryID,LPENTRYID lpEntryID,LPCIID lpInterface,ULONG ulFlags,ULONG *lpulObjType,LPUNKNOWN *lppUnk) IPURE; MAPIMETHOD(SetReceiveFolder) (THIS_ LPTSTR lpszMessageClass,ULONG ulFlags,ULONG cbEntryID,LPENTRYID lpEntryID) IPURE; MAPIMETHOD(GetReceiveFolder) (THIS_ LPTSTR lpszMessageClass,ULONG ulFlags,ULONG *lpcbEntryID,LPENTRYID *lppEntryID,LPTSTR *lppszExplicitClass) IPURE; MAPIMETHOD(GetReceiveFolderTable) (THIS_ ULONG ulFlags,LPMAPITABLE *lppTable) IPURE; MAPIMETHOD(StoreLogoff) (THIS_ ULONG *lpulFlags) IPURE; MAPIMETHOD(AbortSubmit) (THIS_ ULONG cbEntryID,LPENTRYID lpEntryID,ULONG ulFlags) IPURE; MAPIMETHOD(GetOutgoingQueue) (THIS_ ULONG ulFlags,LPMAPITABLE *lppTable) IPURE; MAPIMETHOD(SetLockState) (THIS_ LPMESSAGE lpMessage,ULONG ulLockState) IPURE; MAPIMETHOD(FinishedMsg) (THIS_ ULONG ulFlags,ULONG cbEntryID,LPENTRYID lpEntryID) IPURE; MAPIMETHOD(NotifyNewMail) (THIS_ LPNOTIFICATION lpNotification) IPURE; +#undef INTERFACE +#define INTERFACE IMsgStore + DECLARE_MAPI_INTERFACE_(IMsgStore,IMAPIProp) { + BEGIN_INTERFACE + MAPI_IUNKNOWN_METHODS(PURE) + MAPI_IMAPIPROP_METHODS(PURE) + MAPI_IMSGSTORE_METHODS(PURE) + }; + +#define FORCE_SUBMIT ((ULONG) 0x00000001) + +#define MSGFLAG_READ ((ULONG) 0x00000001) +#define MSGFLAG_UNMODIFIED ((ULONG) 0x00000002) +#define MSGFLAG_SUBMIT ((ULONG) 0x00000004) +#define MSGFLAG_UNSENT ((ULONG) 0x00000008) +#define MSGFLAG_HASATTACH ((ULONG) 0x00000010) +#define MSGFLAG_FROMME ((ULONG) 0x00000020) +#define MSGFLAG_ASSOCIATED ((ULONG) 0x00000040) +#define MSGFLAG_RESEND ((ULONG) 0x00000080) +#define MSGFLAG_RN_PENDING ((ULONG) 0x00000100) +#define MSGFLAG_NRN_PENDING ((ULONG) 0x00000200) + +#define SUBMITFLAG_LOCKED ((ULONG) 0x00000001) +#define SUBMITFLAG_PREPROCESS ((ULONG) 0x00000002) + +#define MODRECIP_ADD ((ULONG) 0x00000002) +#define MODRECIP_MODIFY ((ULONG) 0x00000004) +#define MODRECIP_REMOVE ((ULONG) 0x00000008) + +#define SUPPRESS_RECEIPT ((ULONG) 0x00000001) +#define CLEAR_READ_FLAG ((ULONG) 0x00000004) + +#define GENERATE_RECEIPT_ONLY ((ULONG) 0x00000010) +#define CLEAR_RN_PENDING ((ULONG) 0x00000020) +#define CLEAR_NRN_PENDING ((ULONG) 0x00000040) + +#define ATTACH_DIALOG ((ULONG) 0x00000001) + +#define SECURITY_SIGNED ((ULONG) 0x00000001) +#define SECURITY_ENCRYPTED ((ULONG) 0x00000002) + +#define PRIO_URGENT ((__LONG32) 1) +#define PRIO_NORMAL ((__LONG32) 0) +#define PRIO_NONURGENT ((__LONG32) -1) + +#define SENSITIVITY_NONE ((ULONG) 0x00000000) +#define SENSITIVITY_PERSONAL ((ULONG) 0x00000001) +#define SENSITIVITY_PRIVATE ((ULONG) 0x00000002) +#define SENSITIVITY_COMPANY_CONFIDENTIAL ((ULONG) 0x00000003) + +#define IMPORTANCE_LOW ((__LONG32) 0) +#define IMPORTANCE_NORMAL ((__LONG32) 1) +#define IMPORTANCE_HIGH ((__LONG32) 2) + +#define MAPI_IMESSAGE_METHODS(IPURE) MAPIMETHOD(GetAttachmentTable) (THIS_ ULONG ulFlags,LPMAPITABLE *lppTable) IPURE; MAPIMETHOD(OpenAttach) (THIS_ ULONG ulAttachmentNum,LPCIID lpInterface,ULONG ulFlags,LPATTACH *lppAttach) IPURE; MAPIMETHOD(CreateAttach) (THIS_ LPCIID lpInterface,ULONG ulFlags,ULONG *lpulAttachmentNum,LPATTACH *lppAttach) IPURE; MAPIMETHOD(DeleteAttach) (THIS_ ULONG ulAttachmentNum,ULONG ulUIParam,LPMAPIPROGRESS lpProgress,ULONG ulFlags) IPURE; MAPIMETHOD(GetRecipientTable) (THIS_ ULONG ulFlags,LPMAPITABLE *lppTable) IPURE; MAPIMETHOD(ModifyRecipients) (THIS_ ULONG ulFlags,LPADRLIST lpMods) IPURE; MAPIMETHOD(SubmitMessage) (THIS_ ULONG ulFlags) IPURE; MAPIMETHOD(SetReadFlag) (THIS_ ULONG ulFlags) IPURE; +#undef INTERFACE +#define INTERFACE IMessage + DECLARE_MAPI_INTERFACE_(IMessage,IMAPIProp) { + BEGIN_INTERFACE + MAPI_IUNKNOWN_METHODS(PURE) + MAPI_IMAPIPROP_METHODS(PURE) + MAPI_IMESSAGE_METHODS(PURE) + }; + +#define NO_ATTACHMENT ((ULONG) 0x00000000) +#define ATTACH_BY_VALUE ((ULONG) 0x00000001) +#define ATTACH_BY_REFERENCE ((ULONG) 0x00000002) +#define ATTACH_BY_REF_RESOLVE ((ULONG) 0x00000003) +#define ATTACH_BY_REF_ONLY ((ULONG) 0x00000004) +#define ATTACH_EMBEDDED_MSG ((ULONG) 0x00000005) +#define ATTACH_OLE ((ULONG) 0x00000006) + +#define MAPI_IATTACH_METHODS(IPURE) + +#undef INTERFACE +#define INTERFACE IAttach + DECLARE_MAPI_INTERFACE_(IAttach,IMAPIProp) { + BEGIN_INTERFACE + MAPI_IUNKNOWN_METHODS(PURE) + MAPI_IMAPIPROP_METHODS(PURE) + MAPI_IATTACH_METHODS(PURE) + }; + +#define GET_ADRPARM_VERSION(ulFlags) (((ULONG)ulFlags) & 0xF0000000) +#define SET_ADRPARM_VERSION(ulFlags,ulVersion) (((ULONG)ulVersion) | (((ULONG)ulFlags) & 0x0FFFFFFF)) + +#define ADRPARM_HELP_CTX ((ULONG) 0x00000000) + +#define DIALOG_MODAL ((ULONG) 0x00000001) +#define DIALOG_SDI ((ULONG) 0x00000002) +#define DIALOG_OPTIONS ((ULONG) 0x00000004) +#define ADDRESS_ONE ((ULONG) 0x00000008) +#define AB_SELECTONLY ((ULONG) 0x00000010) +#define AB_RESOLVE ((ULONG) 0x00000020) + +#define DT_MAILUSER ((ULONG) 0x00000000) +#define DT_DISTLIST ((ULONG) 0x00000001) +#define DT_FORUM ((ULONG) 0x00000002) +#define DT_AGENT ((ULONG) 0x00000003) +#define DT_ORGANIZATION ((ULONG) 0x00000004) +#define DT_PRIVATE_DISTLIST ((ULONG) 0x00000005) +#define DT_REMOTE_MAILUSER ((ULONG) 0x00000006) + +#define DT_MODIFIABLE ((ULONG) 0x00010000) +#define DT_GLOBAL ((ULONG) 0x00020000) +#define DT_LOCAL ((ULONG) 0x00030000) +#define DT_WAN ((ULONG) 0x00040000) +#define DT_NOT_SPECIFIC ((ULONG) 0x00050000) + +#define DT_FOLDER ((ULONG) 0x01000000) +#define DT_FOLDER_LINK ((ULONG) 0x02000000) +#define DT_FOLDER_SPECIAL ((ULONG) 0x04000000) + + typedef WINBOOL (WINAPI ACCELERATEABSDI)(ULONG ulUIParam,LPVOID lpvmsg); + typedef ACCELERATEABSDI *LPFNABSDI; + typedef void (WINAPI DISMISSMODELESS)(ULONG ulUIParam,LPVOID lpvContext); + typedef DISMISSMODELESS *LPFNDISMISS; + typedef SCODE (WINAPI *LPFNBUTTON)(ULONG ulUIParam,LPVOID lpvContext,ULONG cbEntryID,LPENTRYID lpSelection,ULONG ulFlags); + + typedef struct _ADRPARM { + ULONG cbABContEntryID; + LPENTRYID lpABContEntryID; + ULONG ulFlags; + LPVOID lpReserved; + ULONG ulHelpContext; + LPTSTR lpszHelpFileName; + LPFNABSDI lpfnABSDI; + LPFNDISMISS lpfnDismiss; + LPVOID lpvDismissContext; + LPTSTR lpszCaption; + LPTSTR lpszNewEntryTitle; + LPTSTR lpszDestWellsTitle; + ULONG cDestFields; + ULONG nDestFieldFocus; + LPTSTR *lppszDestTitles; + ULONG *lpulDestComps; + LPSRestriction lpContRestriction; + LPSRestriction lpHierRestriction; + } ADRPARM,*LPADRPARM; + +#define MAPI_DEFERRED_ERRORS ((ULONG) 0x00000008) + +#define MAPI_ASSOCIATED ((ULONG) 0x00000040) + +#define MDB_NO_DIALOG ((ULONG) 0x00000001) +#define MDB_WRITE ((ULONG) 0x00000004) + +#define MDB_TEMPORARY ((ULONG) 0x00000020) +#define MDB_NO_MAIL ((ULONG) 0x00000080) + +#define AB_NO_DIALOG ((ULONG) 0x00000001) + +#define MAPI_ENABLED ((ULONG) 0x00000000) +#define MAPI_DISABLED ((ULONG) 0x00000001) + +#define MAPI_IMAPICONTROL_METHODS(IPURE) MAPIMETHOD(GetLastError) (THIS_ HRESULT hResult,ULONG ulFlags,LPMAPIERROR *lppMAPIError) IPURE; MAPIMETHOD(Activate) (THIS_ ULONG ulFlags,ULONG ulUIParam) IPURE; MAPIMETHOD(GetState) (THIS_ ULONG ulFlags,ULONG *lpulState) IPURE; +#undef INTERFACE +#define INTERFACE IMAPIControl + DECLARE_MAPI_INTERFACE_(IMAPIControl,IUnknown) { + BEGIN_INTERFACE + MAPI_IUNKNOWN_METHODS(PURE) + MAPI_IMAPICONTROL_METHODS(PURE) + }; + + DECLARE_MAPI_INTERFACE_PTR(IMAPIControl,LPMAPICONTROL); + +#define DT_MULTILINE ((ULONG) 0x00000001) +#define DT_EDITABLE ((ULONG) 0x00000002) +#define DT_REQUIRED ((ULONG) 0x00000004) +#define DT_SET_IMMEDIATE ((ULONG) 0x00000008) +#define DT_PASSWORD_EDIT ((ULONG) 0x00000010) +#define DT_ACCEPT_DBCS ((ULONG) 0x00000020) +#define DT_SET_SELECTION ((ULONG) 0x00000040) + +#define DTCT_LABEL ((ULONG) 0x00000000) +#define DTCT_EDIT ((ULONG) 0x00000001) +#define DTCT_LBX ((ULONG) 0x00000002) +#define DTCT_COMBOBOX ((ULONG) 0x00000003) +#define DTCT_DDLBX ((ULONG) 0x00000004) +#define DTCT_CHECKBOX ((ULONG) 0x00000005) +#define DTCT_GROUPBOX ((ULONG) 0x00000006) +#define DTCT_BUTTON ((ULONG) 0x00000007) +#define DTCT_PAGE ((ULONG) 0x00000008) +#define DTCT_RADIOBUTTON ((ULONG) 0x00000009) +#define DTCT_MVLISTBOX ((ULONG) 0x0000000B) +#define DTCT_MVDDLBX ((ULONG) 0x0000000C) + + typedef struct _DTBLLABEL { + ULONG ulbLpszLabelName; + ULONG ulFlags; + } DTBLLABEL,*LPDTBLLABEL; +#define SizedDtblLabel(n,u) struct _DTBLLABEL_ ## u { DTBLLABEL dtbllabel; TCHAR lpszLabelName[n]; } u + + typedef struct _DTBLEDIT { + ULONG ulbLpszCharsAllowed; + ULONG ulFlags; + ULONG ulNumCharsAllowed; + ULONG ulPropTag; + } DTBLEDIT,*LPDTBLEDIT; +#define SizedDtblEdit(n,u) struct _DTBLEDIT_ ## u { DTBLEDIT dtbledit; TCHAR lpszCharsAllowed[n]; } u + +#define MAPI_NO_HBAR ((ULONG) 0x00000001) +#define MAPI_NO_VBAR ((ULONG) 0x00000002) + + typedef struct _DTBLLBX { + ULONG ulFlags; + ULONG ulPRSetProperty; + ULONG ulPRTableName; + } DTBLLBX,*LPDTBLLBX; + + typedef struct _DTBLCOMBOBOX { + ULONG ulbLpszCharsAllowed; + ULONG ulFlags; + ULONG ulNumCharsAllowed; + ULONG ulPRPropertyName; + ULONG ulPRTableName; + } DTBLCOMBOBOX,*LPDTBLCOMBOBOX; +#define SizedDtblComboBox(n,u) struct _DTBLCOMBOBOX_ ## u { DTBLCOMBOBOX dtblcombobox; TCHAR lpszCharsAllowed[n]; } u + + typedef struct _DTBLDDLBX { + ULONG ulFlags; + ULONG ulPRDisplayProperty; + ULONG ulPRSetProperty; + ULONG ulPRTableName; + } DTBLDDLBX,*LPDTBLDDLBX; + + typedef struct _DTBLCHECKBOX { + ULONG ulbLpszLabel; + ULONG ulFlags; + ULONG ulPRPropertyName; + } DTBLCHECKBOX,*LPDTBLCHECKBOX; +#define SizedDtblCheckBox(n,u) struct _DTBLCHECKBOX_ ## u { DTBLCHECKBOX dtblcheckbox; TCHAR lpszLabel[n]; } u + + typedef struct _DTBLGROUPBOX { + ULONG ulbLpszLabel; + ULONG ulFlags; + } DTBLGROUPBOX,*LPDTBLGROUPBOX; +#define SizedDtblGroupBox(n,u) struct _DTBLGROUPBOX_ ## u { DTBLGROUPBOX dtblgroupbox; TCHAR lpszLabel[n]; } u + + typedef struct _DTBLBUTTON { + ULONG ulbLpszLabel; + ULONG ulFlags; + ULONG ulPRControl; + } DTBLBUTTON,*LPDTBLBUTTON; +#define SizedDtblButton(n,u) struct _DTBLBUTTON_ ## u { DTBLBUTTON dtblbutton; TCHAR lpszLabel[n]; } u + + typedef struct _DTBLPAGE { + ULONG ulbLpszLabel; + ULONG ulFlags; + ULONG ulbLpszComponent; + ULONG ulContext; + } DTBLPAGE,*LPDTBLPAGE; +#define SizedDtblPage(n,n1,u) struct _DTBLPAGE_ ## u { DTBLPAGE dtblpage; TCHAR lpszLabel[n]; TCHAR lpszComponent[n1]; } u + + typedef struct _DTBLRADIOBUTTON { + ULONG ulbLpszLabel; + ULONG ulFlags; + ULONG ulcButtons; + ULONG ulPropTag; + __LONG32 lReturnValue; + } DTBLRADIOBUTTON,*LPDTBLRADIOBUTTON; +#define SizedDtblRadioButton(n,u) struct _DTBLRADIOBUTTON_ ## u { DTBLRADIOBUTTON dtblradiobutton; TCHAR lpszLabel[n]; } u + + typedef struct _DTBLMVLISTBOX { + ULONG ulFlags; + ULONG ulMVPropTag; + } DTBLMVLISTBOX,*LPDTBLMVLISTBOX; + + typedef struct _DTBLMVDDLBX { + ULONG ulFlags; + ULONG ulMVPropTag; + } DTBLMVDDLBX,*LPDTBLMVDDLBX; + +#define UI_SERVICE 0x00000002 +#define SERVICE_UI_ALWAYS 0x00000002 +#define SERVICE_UI_ALLOWED 0x00000010 +#define UI_CURRENT_PROVIDER_FIRST 0x00000004 + +#define MAPI_IPROVIDERADMIN_METHODS(IPURE) MAPIMETHOD(GetLastError) (THIS_ HRESULT hResult,ULONG ulFlags,LPMAPIERROR *lppMAPIError) IPURE; MAPIMETHOD(GetProviderTable) (THIS_ ULONG ulFlags,LPMAPITABLE *lppTable) IPURE; MAPIMETHOD(CreateProvider) (THIS_ LPTSTR lpszProvider,ULONG cValues,LPSPropValue lpProps,ULONG ulUIParam,ULONG ulFlags,MAPIUID *lpUID) IPURE; MAPIMETHOD(DeleteProvider) (THIS_ LPMAPIUID lpUID) IPURE; MAPIMETHOD(OpenProfileSection) (THIS_ LPMAPIUID lpUID,LPCIID lpInterface,ULONG ulFlags,LPPROFSECT *lppProfSect) IPURE; + +#undef INTERFACE +#define INTERFACE IProviderAdmin + DECLARE_MAPI_INTERFACE_(IProviderAdmin,IUnknown) { + BEGIN_INTERFACE + MAPI_IUNKNOWN_METHODS(PURE) + MAPI_IPROVIDERADMIN_METHODS(PURE) + }; + +#ifdef __cplusplus +} +#endif +#endif diff --git a/bazaar/MAPIEx/plugin/include_MINGW32/mapiguid.h b/bazaar/MAPIEx/plugin/include_MINGW32/mapiguid.h new file mode 100644 index 000000000..aa6712497 --- /dev/null +++ b/bazaar/MAPIEx/plugin/include_MINGW32/mapiguid.h @@ -0,0 +1,182 @@ +/** + * This file has no copyright assigned and is placed in the Public Domain. + * This file is part of the mingw-w64 runtime package. + * No warranty is given; refer to the file DISCLAIMER.PD within this package. + */ +#ifndef MAPIGUID_H +#ifdef INITGUID +#define MAPIGUID_H +#endif + +#if !defined(INITGUID) || defined(USES_IID_IMAPISession) +DEFINE_OLEGUID(IID_IMAPISession,0x00020300,0,0); +#endif +#if !defined(INITGUID) || defined(USES_IID_IMAPITable) +DEFINE_OLEGUID(IID_IMAPITable,0x00020301,0,0); +#endif +#if !defined(INITGUID) || defined(USES_IID_IMAPIAdviseSink) +DEFINE_OLEGUID(IID_IMAPIAdviseSink,0x00020302,0,0); +#endif +#if !defined(INITGUID) || defined(USES_IID_IMAPIControl) +DEFINE_OLEGUID(IID_IMAPIControl,0x0002031B,0,0); +#endif +#if !defined(INITGUID) || defined(USES_IID_IProfAdmin) +DEFINE_OLEGUID(IID_IProfAdmin,0x0002031C,0,0); +#endif +#if !defined(INITGUID) || defined(USES_IID_IMsgServiceAdmin) +DEFINE_OLEGUID(IID_IMsgServiceAdmin,0x0002031D,0,0); +#endif +#if !defined(INITGUID) || defined(USES_IID_IProviderAdmin) +DEFINE_OLEGUID(IID_IProviderAdmin,0x00020325,0,0); +#endif +#if !defined(INITGUID) || defined(USES_IID_IMAPIProgress) +DEFINE_OLEGUID(IID_IMAPIProgress,0x0002031F,0,0); +#endif + +#if !defined(INITGUID) || defined(USES_IID_IMAPIProp) +DEFINE_OLEGUID(IID_IMAPIProp,0x00020303,0,0); +#endif +#if !defined(INITGUID) || defined(USES_IID_IProfSect) +DEFINE_OLEGUID(IID_IProfSect,0x00020304,0,0); +#endif +#if !defined(INITGUID) || defined(USES_IID_IMAPIStatus) +DEFINE_OLEGUID(IID_IMAPIStatus,0x00020305,0,0); +#endif +#if !defined(INITGUID) || defined(USES_IID_IMsgStore) +DEFINE_OLEGUID(IID_IMsgStore,0x00020306,0,0); +#endif +#if !defined(INITGUID) || defined(USES_IID_IMessage) +DEFINE_OLEGUID(IID_IMessage,0x00020307,0,0); +#endif +#if !defined(INITGUID) || defined(USES_IID_IAttachment) +DEFINE_OLEGUID(IID_IAttachment,0x00020308,0,0); +#endif +#if !defined(INITGUID) || defined(USES_IID_IAddrBook) +DEFINE_OLEGUID(IID_IAddrBook,0x00020309,0,0); +#endif +#if !defined(INITGUID) || defined(USES_IID_IMailUser) +DEFINE_OLEGUID(IID_IMailUser,0x0002030A,0,0); +#endif + +#if !defined(INITGUID) || defined(USES_IID_IMAPIContainer) +DEFINE_OLEGUID(IID_IMAPIContainer,0x0002030B,0,0); +#endif +#if !defined(INITGUID) || defined(USES_IID_IMAPIFolder) +DEFINE_OLEGUID(IID_IMAPIFolder,0x0002030C,0,0); +#endif +#if !defined(INITGUID) || defined(USES_IID_IABContainer) +DEFINE_OLEGUID(IID_IABContainer,0x0002030D,0,0); +#endif +#if !defined(INITGUID) || defined(USES_IID_IDistList) +DEFINE_OLEGUID(IID_IDistList,0x0002030E,0,0); +#endif +#if !defined(INITGUID) || defined(USES_IID_IMAPISup) +DEFINE_OLEGUID(IID_IMAPISup,0x0002030F,0,0); +#endif +#if !defined(INITGUID) || defined(USES_IID_IMSProvider) +DEFINE_OLEGUID(IID_IMSProvider,0x00020310,0,0); +#endif +#if !defined(INITGUID) || defined(USES_IID_IABProvider) +DEFINE_OLEGUID(IID_IABProvider,0x00020311,0,0); +#endif +#if !defined(INITGUID) || defined(USES_IID_IXPProvider) +DEFINE_OLEGUID(IID_IXPProvider,0x00020312,0,0); +#endif +#if !defined(INITGUID) || defined(USES_IID_IMSLogon) +DEFINE_OLEGUID(IID_IMSLogon,0x00020313,0,0); +#endif +#if !defined(INITGUID) || defined(USES_IID_IABLogon) +DEFINE_OLEGUID(IID_IABLogon,0x00020314,0,0); +#endif +#if !defined(INITGUID) || defined(USES_IID_IXPLogon) +DEFINE_OLEGUID(IID_IXPLogon,0x00020315,0,0); +#endif +#if !defined(INITGUID) || defined(USES_IID_IMAPITableData) +DEFINE_OLEGUID(IID_IMAPITableData,0x00020316,0,0); +#endif +#if !defined(INITGUID) || defined(USES_IID_IMAPISpoolerInit) +DEFINE_OLEGUID(IID_IMAPISpoolerInit,0x00020317,0,0); +#endif +#if !defined(INITGUID) || defined(USES_IID_IMAPISpoolerSession) +DEFINE_OLEGUID(IID_IMAPISpoolerSession,0x00020318,0,0); +#endif +#if !defined(INITGUID) || defined(USES_IID_ITNEF) +DEFINE_OLEGUID(IID_ITNEF,0x00020319,0,0); +#endif +#if !defined(INITGUID) || defined(USES_IID_IMAPIPropData) +DEFINE_OLEGUID(IID_IMAPIPropData,0x0002031A,0,0); +#endif +#if !defined(INITGUID) || defined(USES_IID_ISpoolerHook) +DEFINE_OLEGUID(IID_ISpoolerHook,0x00020320,0,0); +#endif +#if !defined(INITGUID) || defined(USES_IID_IMAPISpoolerService) +DEFINE_OLEGUID(IID_IMAPISpoolerService,0x0002031E,0,0); +#endif +#if !defined(INITGUID) || defined(USES_IID_IMAPIViewContext) +DEFINE_OLEGUID(IID_IMAPIViewContext,0x00020321,0,0); +#endif +#if !defined(INITGUID) || defined(USES_IID_IMAPIFormMgr) +DEFINE_OLEGUID(IID_IMAPIFormMgr,0x00020322,0,0); +#endif +#if !defined(INITGUID) || defined(USES_IID_IEnumMAPIFormProp) +DEFINE_OLEGUID(IID_IEnumMAPIFormProp,0x00020323,0,0); +#endif +#if !defined(INITGUID) || defined(USES_IID_IMAPIFormInfo) +DEFINE_OLEGUID(IID_IMAPIFormInfo,0x00020324,0,0); +#endif +#if !defined(INITGUID) || defined(USES_IID_IMAPIForm) +DEFINE_OLEGUID(IID_IMAPIForm,0x00020327,0,0); +#endif +#if !defined(INITGUID) || defined(USES_PS_MAPI) +DEFINE_OLEGUID(PS_MAPI,0x00020328,0,0); +#endif +#if !defined(INITGUID) || defined(USES_PS_PUBLIC_STRINGS) +DEFINE_OLEGUID(PS_PUBLIC_STRINGS,0x00020329,0,0); +#endif +#if !defined(INITGUID) || defined(USES_IID_IPersistMessage) +DEFINE_OLEGUID(IID_IPersistMessage,0x0002032A,0,0); +#endif +#if !defined(INITGUID) || defined(USES_IID_IMAPIViewAdviseSink) +DEFINE_OLEGUID(IID_IMAPIViewAdviseSink,0x0002032B,0,0); +#endif +#if !defined(INITGUID) || defined(USES_IID_IStreamDocfile) +DEFINE_OLEGUID(IID_IStreamDocfile,0x0002032C,0,0); +#endif +#if !defined(INITGUID) || defined(USES_IID_IMAPIFormProp) +DEFINE_OLEGUID(IID_IMAPIFormProp,0x0002032D,0,0); +#endif +#if !defined(INITGUID) || defined(USES_IID_IMAPIFormContainer) +DEFINE_OLEGUID(IID_IMAPIFormContainer,0x0002032E,0,0); +#endif +#if !defined(INITGUID) || defined(USES_IID_IMAPIFormAdviseSink) +DEFINE_OLEGUID(IID_IMAPIFormAdviseSink,0x0002032F,0,0); +#endif +#if !defined(INITGUID) || defined(USES_IID_IStreamTnef) +DEFINE_OLEGUID(IID_IStreamTnef,0x00020330,0,0); +#endif +#if !defined(INITGUID) || defined(USES_IID_IMAPIFormFactory) +DEFINE_OLEGUID(IID_IMAPIFormFactory,0x00020350,0,0); +#endif +#if !defined(INITGUID) || defined(USES_IID_IMAPIMessageSite) +DEFINE_OLEGUID(IID_IMAPIMessageSite,0x00020370,0,0); +#endif +#if !defined(INITGUID) || defined(USES_PS_ROUTING_EMAIL_ADDRESSES) +DEFINE_OLEGUID(PS_ROUTING_EMAIL_ADDRESSES,0x00020380,0,0); +#endif +#if !defined(INITGUID) || defined(USES_PS_ROUTING_ADDRTYPE) +DEFINE_OLEGUID(PS_ROUTING_ADDRTYPE,0x00020381,0,0); +#endif +#if !defined(INITGUID) || defined(USES_PS_ROUTING_DISPLAY_NAME) +DEFINE_OLEGUID(PS_ROUTING_DISPLAY_NAME,0x00020382,0,0); +#endif +#if !defined(INITGUID) || defined(USES_PS_ROUTING_ENTRYID) +DEFINE_OLEGUID(PS_ROUTING_ENTRYID,0x00020383,0,0); +#endif +#if !defined(INITGUID) || defined(USES_PS_ROUTING_SEARCH_KEY) +DEFINE_OLEGUID(PS_ROUTING_SEARCH_KEY,0x00020384,0,0); +#endif + +#if !defined(INITGUID) || defined(USES_MUID_PROFILE_INSTANCE) +DEFINE_OLEGUID(MUID_PROFILE_INSTANCE,0x00020385,0,0); +#endif +#endif diff --git a/bazaar/MAPIEx/plugin/include_MINGW32/mapitags.h b/bazaar/MAPIEx/plugin/include_MINGW32/mapitags.h new file mode 100644 index 000000000..a3eac0acb --- /dev/null +++ b/bazaar/MAPIEx/plugin/include_MINGW32/mapitags.h @@ -0,0 +1,822 @@ +/** + * This file has no copyright assigned and is placed in the Public Domain. + * This file is part of the mingw-w64 runtime package. + * No warranty is given; refer to the file DISCLAIMER.PD within this package. + */ +#ifndef MAPITAGS_H +#define MAPITAGS_H + +#define FIsTransmittable(ulPropTag) ((PROP_ID (ulPropTag) < (ULONG)0x0E00) || (PROP_ID (ulPropTag) >= (ULONG)0x8000) || ((PROP_ID (ulPropTag) >= (ULONG)0x1000) && (PROP_ID (ulPropTag) < (ULONG)0x6000)) || ((PROP_ID (ulPropTag) >= (ULONG)0x6800) && (PROP_ID (ulPropTag) < (ULONG)0x7C00))) + +#define PR_ACKNOWLEDGEMENT_MODE PROP_TAG(PT_LONG,0x0001) +#define PR_ALTERNATE_RECIPIENT_ALLOWED PROP_TAG(PT_BOOLEAN,0x0002) +#define PR_AUTHORIZING_USERS PROP_TAG(PT_BINARY,0x0003) +#define PR_AUTO_FORWARD_COMMENT PROP_TAG(PT_TSTRING,0x0004) +#define PR_AUTO_FORWARD_COMMENT_W PROP_TAG(PT_UNICODE,0x0004) +#define PR_AUTO_FORWARD_COMMENT_A PROP_TAG(PT_STRING8,0x0004) +#define PR_AUTO_FORWARDED PROP_TAG(PT_BOOLEAN,0x0005) +#define PR_CONTENT_CONFIDENTIALITY_ALGORITHM_ID PROP_TAG(PT_BINARY,0x0006) +#define PR_CONTENT_CORRELATOR PROP_TAG(PT_BINARY,0x0007) +#define PR_CONTENT_IDENTIFIER PROP_TAG(PT_TSTRING,0x0008) +#define PR_CONTENT_IDENTIFIER_W PROP_TAG(PT_UNICODE,0x0008) +#define PR_CONTENT_IDENTIFIER_A PROP_TAG(PT_STRING8,0x0008) +#define PR_CONTENT_LENGTH PROP_TAG(PT_LONG,0x0009) +#define PR_CONTENT_RETURN_REQUESTED PROP_TAG(PT_BOOLEAN,0x000A) +#define PR_CONVERSATION_KEY PROP_TAG(PT_BINARY,0x000B) +#define PR_CONVERSION_EITS PROP_TAG(PT_BINARY,0x000C) +#define PR_CONVERSION_WITH_LOSS_PROHIBITED PROP_TAG(PT_BOOLEAN,0x000D) +#define PR_CONVERTED_EITS PROP_TAG(PT_BINARY,0x000E) +#define PR_DEFERRED_DELIVERY_TIME PROP_TAG(PT_SYSTIME,0x000F) +#define PR_DELIVER_TIME PROP_TAG(PT_SYSTIME,0x0010) +#define PR_DISCARD_REASON PROP_TAG(PT_LONG,0x0011) +#define PR_DISCLOSURE_OF_RECIPIENTS PROP_TAG(PT_BOOLEAN,0x0012) +#define PR_DL_EXPANSION_HISTORY PROP_TAG(PT_BINARY,0x0013) +#define PR_DL_EXPANSION_PROHIBITED PROP_TAG(PT_BOOLEAN,0x0014) +#define PR_EXPIRY_TIME PROP_TAG(PT_SYSTIME,0x0015) +#define PR_IMPLICIT_CONVERSION_PROHIBITED PROP_TAG(PT_BOOLEAN,0x0016) +#define PR_IMPORTANCE PROP_TAG(PT_LONG,0x0017) +#define PR_IPM_ID PROP_TAG(PT_BINARY,0x0018) +#define PR_LATEST_DELIVERY_TIME PROP_TAG(PT_SYSTIME,0x0019) +#define PR_MESSAGE_CLASS PROP_TAG(PT_TSTRING,0x001A) +#define PR_MESSAGE_CLASS_W PROP_TAG(PT_UNICODE,0x001A) +#define PR_MESSAGE_CLASS_A PROP_TAG(PT_STRING8,0x001A) +#define PR_MESSAGE_DELIVERY_ID PROP_TAG(PT_BINARY,0x001B) +#define PR_MESSAGE_SECURITY_LABEL PROP_TAG(PT_BINARY,0x001E) +#define PR_OBSOLETED_IPMS PROP_TAG(PT_BINARY,0x001F) +#define PR_ORIGINALLY_INTENDED_RECIPIENT_NAME PROP_TAG(PT_BINARY,0x0020) +#define PR_ORIGINAL_EITS PROP_TAG(PT_BINARY,0x0021) +#define PR_ORIGINATOR_CERTIFICATE PROP_TAG(PT_BINARY,0x0022) +#define PR_ORIGINATOR_DELIVERY_REPORT_REQUESTED PROP_TAG(PT_BOOLEAN,0x0023) +#define PR_ORIGINATOR_RETURN_ADDRESS PROP_TAG(PT_BINARY,0x0024) +#define PR_PARENT_KEY PROP_TAG(PT_BINARY,0x0025) +#define PR_PRIORITY PROP_TAG(PT_LONG,0x0026) +#define PR_ORIGIN_CHECK PROP_TAG(PT_BINARY,0x0027) +#define PR_PROOF_OF_SUBMISSION_REQUESTED PROP_TAG(PT_BOOLEAN,0x0028) +#define PR_READ_RECEIPT_REQUESTED PROP_TAG(PT_BOOLEAN,0x0029) +#define PR_RECEIPT_TIME PROP_TAG(PT_SYSTIME,0x002A) +#define PR_RECIPIENT_REASSIGNMENT_PROHIBITED PROP_TAG(PT_BOOLEAN,0x002B) +#define PR_REDIRECTION_HISTORY PROP_TAG(PT_BINARY,0x002C) +#define PR_RELATED_IPMS PROP_TAG(PT_BINARY,0x002D) +#define PR_ORIGINAL_SENSITIVITY PROP_TAG(PT_LONG,0x002E) +#define PR_LANGUAGES PROP_TAG(PT_TSTRING,0x002F) +#define PR_LANGUAGES_W PROP_TAG(PT_UNICODE,0x002F) +#define PR_LANGUAGES_A PROP_TAG(PT_STRING8,0x002F) +#define PR_REPLY_TIME PROP_TAG(PT_SYSTIME,0x0030) +#define PR_REPORT_TAG PROP_TAG(PT_BINARY,0x0031) +#define PR_REPORT_TIME PROP_TAG(PT_SYSTIME,0x0032) +#define PR_RETURNED_IPM PROP_TAG(PT_BOOLEAN,0x0033) +#define PR_SECURITY PROP_TAG(PT_LONG,0x0034) +#define PR_INCOMPLETE_COPY PROP_TAG(PT_BOOLEAN,0x0035) +#define PR_SENSITIVITY PROP_TAG(PT_LONG,0x0036) +#define PR_SUBJECT PROP_TAG(PT_TSTRING,0x0037) +#define PR_SUBJECT_W PROP_TAG(PT_UNICODE,0x0037) +#define PR_SUBJECT_A PROP_TAG(PT_STRING8,0x0037) +#define PR_SUBJECT_IPM PROP_TAG(PT_BINARY,0x0038) +#define PR_CLIENT_SUBMIT_TIME PROP_TAG(PT_SYSTIME,0x0039) +#define PR_REPORT_NAME PROP_TAG(PT_TSTRING,0x003A) +#define PR_REPORT_NAME_W PROP_TAG(PT_UNICODE,0x003A) +#define PR_REPORT_NAME_A PROP_TAG(PT_STRING8,0x003A) +#define PR_SENT_REPRESENTING_SEARCH_KEY PROP_TAG(PT_BINARY,0x003B) +#define PR_X400_CONTENT_TYPE PROP_TAG(PT_BINARY,0x003C) +#define PR_SUBJECT_PREFIX PROP_TAG(PT_TSTRING,0x003D) +#define PR_SUBJECT_PREFIX_W PROP_TAG(PT_UNICODE,0x003D) +#define PR_SUBJECT_PREFIX_A PROP_TAG(PT_STRING8,0x003D) +#define PR_NON_RECEIPT_REASON PROP_TAG(PT_LONG,0x003E) +#define PR_RECEIVED_BY_ENTRYID PROP_TAG(PT_BINARY,0x003F) +#define PR_RECEIVED_BY_NAME PROP_TAG(PT_TSTRING,0x0040) +#define PR_RECEIVED_BY_NAME_W PROP_TAG(PT_UNICODE,0x0040) +#define PR_RECEIVED_BY_NAME_A PROP_TAG(PT_STRING8,0x0040) +#define PR_SENT_REPRESENTING_ENTRYID PROP_TAG(PT_BINARY,0x0041) +#define PR_SENT_REPRESENTING_NAME PROP_TAG(PT_TSTRING,0x0042) +#define PR_SENT_REPRESENTING_NAME_W PROP_TAG(PT_UNICODE,0x0042) +#define PR_SENT_REPRESENTING_NAME_A PROP_TAG(PT_STRING8,0x0042) +#define PR_RCVD_REPRESENTING_ENTRYID PROP_TAG(PT_BINARY,0x0043) +#define PR_RCVD_REPRESENTING_NAME PROP_TAG(PT_TSTRING,0x0044) +#define PR_RCVD_REPRESENTING_NAME_W PROP_TAG(PT_UNICODE,0x0044) +#define PR_RCVD_REPRESENTING_NAME_A PROP_TAG(PT_STRING8,0x0044) +#define PR_REPORT_ENTRYID PROP_TAG(PT_BINARY,0x0045) +#define PR_READ_RECEIPT_ENTRYID PROP_TAG(PT_BINARY,0x0046) +#define PR_MESSAGE_SUBMISSION_ID PROP_TAG(PT_BINARY,0x0047) +#define PR_PROVIDER_SUBMIT_TIME PROP_TAG(PT_SYSTIME,0x0048) +#define PR_ORIGINAL_SUBJECT PROP_TAG(PT_TSTRING,0x0049) +#define PR_ORIGINAL_SUBJECT_W PROP_TAG(PT_UNICODE,0x0049) +#define PR_ORIGINAL_SUBJECT_A PROP_TAG(PT_STRING8,0x0049) +#define PR_DISC_VAL PROP_TAG(PT_BOOLEAN,0x004A) +#define PR_ORIG_MESSAGE_CLASS PROP_TAG(PT_TSTRING,0x004B) +#define PR_ORIG_MESSAGE_CLASS_W PROP_TAG(PT_UNICODE,0x004B) +#define PR_ORIG_MESSAGE_CLASS_A PROP_TAG(PT_STRING8,0x004B) +#define PR_ORIGINAL_AUTHOR_ENTRYID PROP_TAG(PT_BINARY,0x004C) +#define PR_ORIGINAL_AUTHOR_NAME PROP_TAG(PT_TSTRING,0x004D) +#define PR_ORIGINAL_AUTHOR_NAME_W PROP_TAG(PT_UNICODE,0x004D) +#define PR_ORIGINAL_AUTHOR_NAME_A PROP_TAG(PT_STRING8,0x004D) +#define PR_ORIGINAL_SUBMIT_TIME PROP_TAG(PT_SYSTIME,0x004E) +#define PR_REPLY_RECIPIENT_ENTRIES PROP_TAG(PT_BINARY,0x004F) +#define PR_REPLY_RECIPIENT_NAMES PROP_TAG(PT_TSTRING,0x0050) +#define PR_REPLY_RECIPIENT_NAMES_W PROP_TAG(PT_UNICODE,0x0050) +#define PR_REPLY_RECIPIENT_NAMES_A PROP_TAG(PT_STRING8,0x0050) +#define PR_RECEIVED_BY_SEARCH_KEY PROP_TAG(PT_BINARY,0x0051) +#define PR_RCVD_REPRESENTING_SEARCH_KEY PROP_TAG(PT_BINARY,0x0052) +#define PR_READ_RECEIPT_SEARCH_KEY PROP_TAG(PT_BINARY,0x0053) +#define PR_REPORT_SEARCH_KEY PROP_TAG(PT_BINARY,0x0054) +#define PR_ORIGINAL_DELIVERY_TIME PROP_TAG(PT_SYSTIME,0x0055) +#define PR_ORIGINAL_AUTHOR_SEARCH_KEY PROP_TAG(PT_BINARY,0x0056) +#define PR_MESSAGE_TO_ME PROP_TAG(PT_BOOLEAN,0x0057) +#define PR_MESSAGE_CC_ME PROP_TAG(PT_BOOLEAN,0x0058) +#define PR_MESSAGE_RECIP_ME PROP_TAG(PT_BOOLEAN,0x0059) +#define PR_ORIGINAL_SENDER_NAME PROP_TAG(PT_TSTRING,0x005A) +#define PR_ORIGINAL_SENDER_NAME_W PROP_TAG(PT_UNICODE,0x005A) +#define PR_ORIGINAL_SENDER_NAME_A PROP_TAG(PT_STRING8,0x005A) +#define PR_ORIGINAL_SENDER_ENTRYID PROP_TAG(PT_BINARY,0x005B) +#define PR_ORIGINAL_SENDER_SEARCH_KEY PROP_TAG(PT_BINARY,0x005C) +#define PR_ORIGINAL_SENT_REPRESENTING_NAME PROP_TAG(PT_TSTRING,0x005D) +#define PR_ORIGINAL_SENT_REPRESENTING_NAME_W PROP_TAG(PT_UNICODE,0x005D) +#define PR_ORIGINAL_SENT_REPRESENTING_NAME_A PROP_TAG(PT_STRING8,0x005D) +#define PR_ORIGINAL_SENT_REPRESENTING_ENTRYID PROP_TAG(PT_BINARY,0x005E) +#define PR_ORIGINAL_SENT_REPRESENTING_SEARCH_KEY PROP_TAG(PT_BINARY,0x005F) +#define PR_START_DATE PROP_TAG(PT_SYSTIME,0x0060) +#define PR_END_DATE PROP_TAG(PT_SYSTIME,0x0061) +#define PR_OWNER_APPT_ID PROP_TAG(PT_LONG,0x0062) +#define PR_RESPONSE_REQUESTED PROP_TAG(PT_BOOLEAN,0x0063) +#define PR_SENT_REPRESENTING_ADDRTYPE PROP_TAG(PT_TSTRING,0x0064) +#define PR_SENT_REPRESENTING_ADDRTYPE_W PROP_TAG(PT_UNICODE,0x0064) +#define PR_SENT_REPRESENTING_ADDRTYPE_A PROP_TAG(PT_STRING8,0x0064) +#define PR_SENT_REPRESENTING_EMAIL_ADDRESS PROP_TAG(PT_TSTRING,0x0065) +#define PR_SENT_REPRESENTING_EMAIL_ADDRESS_W PROP_TAG(PT_UNICODE,0x0065) +#define PR_SENT_REPRESENTING_EMAIL_ADDRESS_A PROP_TAG(PT_STRING8,0x0065) +#define PR_ORIGINAL_SENDER_ADDRTYPE PROP_TAG(PT_TSTRING,0x0066) +#define PR_ORIGINAL_SENDER_ADDRTYPE_W PROP_TAG(PT_UNICODE,0x0066) +#define PR_ORIGINAL_SENDER_ADDRTYPE_A PROP_TAG(PT_STRING8,0x0066) +#define PR_ORIGINAL_SENDER_EMAIL_ADDRESS PROP_TAG(PT_TSTRING,0x0067) +#define PR_ORIGINAL_SENDER_EMAIL_ADDRESS_W PROP_TAG(PT_UNICODE,0x0067) +#define PR_ORIGINAL_SENDER_EMAIL_ADDRESS_A PROP_TAG(PT_STRING8,0x0067) +#define PR_ORIGINAL_SENT_REPRESENTING_ADDRTYPE PROP_TAG(PT_TSTRING,0x0068) +#define PR_ORIGINAL_SENT_REPRESENTING_ADDRTYPE_W PROP_TAG(PT_UNICODE,0x0068) +#define PR_ORIGINAL_SENT_REPRESENTING_ADDRTYPE_A PROP_TAG(PT_STRING8,0x0068) +#define PR_ORIGINAL_SENT_REPRESENTING_EMAIL_ADDRESS PROP_TAG(PT_TSTRING,0x0069) +#define PR_ORIGINAL_SENT_REPRESENTING_EMAIL_ADDRESS_W PROP_TAG(PT_UNICODE,0x0069) +#define PR_ORIGINAL_SENT_REPRESENTING_EMAIL_ADDRESS_A PROP_TAG(PT_STRING8,0x0069) +#define PR_CONVERSATION_TOPIC PROP_TAG(PT_TSTRING,0x0070) +#define PR_CONVERSATION_TOPIC_W PROP_TAG(PT_UNICODE,0x0070) +#define PR_CONVERSATION_TOPIC_A PROP_TAG(PT_STRING8,0x0070) +#define PR_CONVERSATION_INDEX PROP_TAG(PT_BINARY,0x0071) +#define PR_ORIGINAL_DISPLAY_BCC PROP_TAG(PT_TSTRING,0x0072) +#define PR_ORIGINAL_DISPLAY_BCC_W PROP_TAG(PT_UNICODE,0x0072) +#define PR_ORIGINAL_DISPLAY_BCC_A PROP_TAG(PT_STRING8,0x0072) +#define PR_ORIGINAL_DISPLAY_CC PROP_TAG(PT_TSTRING,0x0073) +#define PR_ORIGINAL_DISPLAY_CC_W PROP_TAG(PT_UNICODE,0x0073) +#define PR_ORIGINAL_DISPLAY_CC_A PROP_TAG(PT_STRING8,0x0073) +#define PR_ORIGINAL_DISPLAY_TO PROP_TAG(PT_TSTRING,0x0074) +#define PR_ORIGINAL_DISPLAY_TO_W PROP_TAG(PT_UNICODE,0x0074) +#define PR_ORIGINAL_DISPLAY_TO_A PROP_TAG(PT_STRING8,0x0074) +#define PR_RECEIVED_BY_ADDRTYPE PROP_TAG(PT_TSTRING,0x0075) +#define PR_RECEIVED_BY_ADDRTYPE_W PROP_TAG(PT_UNICODE,0x0075) +#define PR_RECEIVED_BY_ADDRTYPE_A PROP_TAG(PT_STRING8,0x0075) +#define PR_RECEIVED_BY_EMAIL_ADDRESS PROP_TAG(PT_TSTRING,0x0076) +#define PR_RECEIVED_BY_EMAIL_ADDRESS_W PROP_TAG(PT_UNICODE,0x0076) +#define PR_RECEIVED_BY_EMAIL_ADDRESS_A PROP_TAG(PT_STRING8,0x0076) +#define PR_RCVD_REPRESENTING_ADDRTYPE PROP_TAG(PT_TSTRING,0x0077) +#define PR_RCVD_REPRESENTING_ADDRTYPE_W PROP_TAG(PT_UNICODE,0x0077) +#define PR_RCVD_REPRESENTING_ADDRTYPE_A PROP_TAG(PT_STRING8,0x0077) +#define PR_RCVD_REPRESENTING_EMAIL_ADDRESS PROP_TAG(PT_TSTRING,0x0078) +#define PR_RCVD_REPRESENTING_EMAIL_ADDRESS_W PROP_TAG(PT_UNICODE,0x0078) +#define PR_RCVD_REPRESENTING_EMAIL_ADDRESS_A PROP_TAG(PT_STRING8,0x0078) +#define PR_ORIGINAL_AUTHOR_ADDRTYPE PROP_TAG(PT_TSTRING,0x0079) +#define PR_ORIGINAL_AUTHOR_ADDRTYPE_W PROP_TAG(PT_UNICODE,0x0079) +#define PR_ORIGINAL_AUTHOR_ADDRTYPE_A PROP_TAG(PT_STRING8,0x0079) +#define PR_ORIGINAL_AUTHOR_EMAIL_ADDRESS PROP_TAG(PT_TSTRING,0x007A) +#define PR_ORIGINAL_AUTHOR_EMAIL_ADDRESS_W PROP_TAG(PT_UNICODE,0x007A) +#define PR_ORIGINAL_AUTHOR_EMAIL_ADDRESS_A PROP_TAG(PT_STRING8,0x007A) +#define PR_ORIGINALLY_INTENDED_RECIP_ADDRTYPE PROP_TAG(PT_TSTRING,0x007B) +#define PR_ORIGINALLY_INTENDED_RECIP_ADDRTYPE_W PROP_TAG(PT_UNICODE,0x007B) +#define PR_ORIGINALLY_INTENDED_RECIP_ADDRTYPE_A PROP_TAG(PT_STRING8,0x007B) +#define PR_ORIGINALLY_INTENDED_RECIP_EMAIL_ADDRESS PROP_TAG(PT_TSTRING,0x007C) +#define PR_ORIGINALLY_INTENDED_RECIP_EMAIL_ADDRESS_W PROP_TAG(PT_UNICODE,0x007C) +#define PR_ORIGINALLY_INTENDED_RECIP_EMAIL_ADDRESS_A PROP_TAG(PT_STRING8,0x007C) +#define PR_TRANSPORT_MESSAGE_HEADERS PROP_TAG(PT_TSTRING,0x007D) +#define PR_TRANSPORT_MESSAGE_HEADERS_W PROP_TAG(PT_UNICODE,0x007D) +#define PR_TRANSPORT_MESSAGE_HEADERS_A PROP_TAG(PT_STRING8,0x007D) +#define PR_DELEGATION PROP_TAG(PT_BINARY,0x007E) +#define PR_TNEF_CORRELATION_KEY PROP_TAG(PT_BINARY,0x007F) + +#define PR_BODY PROP_TAG(PT_TSTRING,0x1000) +#define PR_BODY_W PROP_TAG(PT_UNICODE,0x1000) +#define PR_BODY_A PROP_TAG(PT_STRING8,0x1000) +#define PR_REPORT_TEXT PROP_TAG(PT_TSTRING,0x1001) +#define PR_REPORT_TEXT_W PROP_TAG(PT_UNICODE,0x1001) +#define PR_REPORT_TEXT_A PROP_TAG(PT_STRING8,0x1001) +#define PR_ORIGINATOR_AND_DL_EXPANSION_HISTORY PROP_TAG(PT_BINARY,0x1002) +#define PR_REPORTING_DL_NAME PROP_TAG(PT_BINARY,0x1003) +#define PR_REPORTING_MTA_CERTIFICATE PROP_TAG(PT_BINARY,0x1004) +#define PR_RTF_SYNC_BODY_CRC PROP_TAG(PT_LONG,0x1006) +#define PR_RTF_SYNC_BODY_COUNT PROP_TAG(PT_LONG,0x1007) +#define PR_RTF_SYNC_BODY_TAG PROP_TAG(PT_TSTRING,0x1008) +#define PR_RTF_SYNC_BODY_TAG_W PROP_TAG(PT_UNICODE,0x1008) +#define PR_RTF_SYNC_BODY_TAG_A PROP_TAG(PT_STRING8,0x1008) +#define PR_RTF_COMPRESSED PROP_TAG(PT_BINARY,0x1009) +#define PR_RTF_SYNC_PREFIX_COUNT PROP_TAG(PT_LONG,0x1010) +#define PR_RTF_SYNC_TRAILING_COUNT PROP_TAG(PT_LONG,0x1011) +#define PR_ORIGINALLY_INTENDED_RECIP_ENTRYID PROP_TAG(PT_BINARY,0x1012) + +#define PR_CONTENT_INTEGRITY_CHECK PROP_TAG(PT_BINARY,0x0C00) +#define PR_EXPLICIT_CONVERSION PROP_TAG(PT_LONG,0x0C01) +#define PR_IPM_RETURN_REQUESTED PROP_TAG(PT_BOOLEAN,0x0C02) +#define PR_MESSAGE_TOKEN PROP_TAG(PT_BINARY,0x0C03) +#define PR_NDR_REASON_CODE PROP_TAG(PT_LONG,0x0C04) +#define PR_NDR_DIAG_CODE PROP_TAG(PT_LONG,0x0C05) +#define PR_NON_RECEIPT_NOTIFICATION_REQUESTED PROP_TAG(PT_BOOLEAN,0x0C06) +#define PR_DELIVERY_POINT PROP_TAG(PT_LONG,0x0C07) + +#define PR_ORIGINATOR_NON_DELIVERY_REPORT_REQUESTED PROP_TAG(PT_BOOLEAN,0x0C08) +#define PR_ORIGINATOR_REQUESTED_ALTERNATE_RECIPIENT PROP_TAG(PT_BINARY,0x0C09) +#define PR_PHYSICAL_DELIVERY_BUREAU_FAX_DELIVERY PROP_TAG(PT_BOOLEAN,0x0C0A) +#define PR_PHYSICAL_DELIVERY_MODE PROP_TAG(PT_LONG,0x0C0B) +#define PR_PHYSICAL_DELIVERY_REPORT_REQUEST PROP_TAG(PT_LONG,0x0C0C) +#define PR_PHYSICAL_FORWARDING_ADDRESS PROP_TAG(PT_BINARY,0x0C0D) +#define PR_PHYSICAL_FORWARDING_ADDRESS_REQUESTED PROP_TAG(PT_BOOLEAN,0x0C0E) +#define PR_PHYSICAL_FORWARDING_PROHIBITED PROP_TAG(PT_BOOLEAN,0x0C0F) +#define PR_PHYSICAL_RENDITION_ATTRIBUTES PROP_TAG(PT_BINARY,0x0C10) +#define PR_PROOF_OF_DELIVERY PROP_TAG(PT_BINARY,0x0C11) +#define PR_PROOF_OF_DELIVERY_REQUESTED PROP_TAG(PT_BOOLEAN,0x0C12) +#define PR_RECIPIENT_CERTIFICATE PROP_TAG(PT_BINARY,0x0C13) +#define PR_RECIPIENT_NUMBER_FOR_ADVICE PROP_TAG(PT_TSTRING,0x0C14) +#define PR_RECIPIENT_NUMBER_FOR_ADVICE_W PROP_TAG(PT_UNICODE,0x0C14) +#define PR_RECIPIENT_NUMBER_FOR_ADVICE_A PROP_TAG(PT_STRING8,0x0C14) +#define PR_RECIPIENT_TYPE PROP_TAG(PT_LONG,0x0C15) +#define PR_REGISTERED_MAIL_TYPE PROP_TAG(PT_LONG,0x0C16) +#define PR_REPLY_REQUESTED PROP_TAG(PT_BOOLEAN,0x0C17) +#define PR_REQUESTED_DELIVERY_METHOD PROP_TAG(PT_LONG,0x0C18) +#define PR_SENDER_ENTRYID PROP_TAG(PT_BINARY,0x0C19) +#define PR_SENDER_NAME PROP_TAG(PT_TSTRING,0x0C1A) +#define PR_SENDER_NAME_W PROP_TAG(PT_UNICODE,0x0C1A) +#define PR_SENDER_NAME_A PROP_TAG(PT_STRING8,0x0C1A) +#define PR_SUPPLEMENTARY_INFO PROP_TAG(PT_TSTRING,0x0C1B) +#define PR_SUPPLEMENTARY_INFO_W PROP_TAG(PT_UNICODE,0x0C1B) +#define PR_SUPPLEMENTARY_INFO_A PROP_TAG(PT_STRING8,0x0C1B) +#define PR_TYPE_OF_MTS_USER PROP_TAG(PT_LONG,0x0C1C) +#define PR_SENDER_SEARCH_KEY PROP_TAG(PT_BINARY,0x0C1D) +#define PR_SENDER_ADDRTYPE PROP_TAG(PT_TSTRING,0x0C1E) +#define PR_SENDER_ADDRTYPE_W PROP_TAG(PT_UNICODE,0x0C1E) +#define PR_SENDER_ADDRTYPE_A PROP_TAG(PT_STRING8,0x0C1E) +#define PR_SENDER_EMAIL_ADDRESS PROP_TAG(PT_TSTRING,0x0C1F) +#define PR_SENDER_EMAIL_ADDRESS_W PROP_TAG(PT_UNICODE,0x0C1F) +#define PR_SENDER_EMAIL_ADDRESS_A PROP_TAG(PT_STRING8,0x0C1F) + +#define PR_CURRENT_VERSION PROP_TAG(PT_I8,0x0E00) +#define PR_DELETE_AFTER_SUBMIT PROP_TAG(PT_BOOLEAN,0x0E01) +#define PR_DISPLAY_BCC PROP_TAG(PT_TSTRING,0x0E02) +#define PR_DISPLAY_BCC_W PROP_TAG(PT_UNICODE,0x0E02) +#define PR_DISPLAY_BCC_A PROP_TAG(PT_STRING8,0x0E02) +#define PR_DISPLAY_CC PROP_TAG(PT_TSTRING,0x0E03) +#define PR_DISPLAY_CC_W PROP_TAG(PT_UNICODE,0x0E03) +#define PR_DISPLAY_CC_A PROP_TAG(PT_STRING8,0x0E03) +#define PR_DISPLAY_TO PROP_TAG(PT_TSTRING,0x0E04) +#define PR_DISPLAY_TO_W PROP_TAG(PT_UNICODE,0x0E04) +#define PR_DISPLAY_TO_A PROP_TAG(PT_STRING8,0x0E04) +#define PR_PARENT_DISPLAY PROP_TAG(PT_TSTRING,0x0E05) +#define PR_PARENT_DISPLAY_W PROP_TAG(PT_UNICODE,0x0E05) +#define PR_PARENT_DISPLAY_A PROP_TAG(PT_STRING8,0x0E05) +#define PR_MESSAGE_DELIVERY_TIME PROP_TAG(PT_SYSTIME,0x0E06) +#define PR_MESSAGE_FLAGS PROP_TAG(PT_LONG,0x0E07) +#define PR_MESSAGE_SIZE PROP_TAG(PT_LONG,0x0E08) +#define PR_PARENT_ENTRYID PROP_TAG(PT_BINARY,0x0E09) +#define PR_SENTMAIL_ENTRYID PROP_TAG(PT_BINARY,0x0E0A) +#define PR_CORRELATE PROP_TAG(PT_BOOLEAN,0x0E0C) +#define PR_CORRELATE_MTSID PROP_TAG(PT_BINARY,0x0E0D) +#define PR_DISCRETE_VALUES PROP_TAG(PT_BOOLEAN,0x0E0E) +#define PR_RESPONSIBILITY PROP_TAG(PT_BOOLEAN,0x0E0F) +#define PR_SPOOLER_STATUS PROP_TAG(PT_LONG,0x0E10) +#define PR_TRANSPORT_STATUS PROP_TAG(PT_LONG,0x0E11) +#define PR_MESSAGE_RECIPIENTS PROP_TAG(PT_OBJECT,0x0E12) +#define PR_MESSAGE_ATTACHMENTS PROP_TAG(PT_OBJECT,0x0E13) +#define PR_SUBMIT_FLAGS PROP_TAG(PT_LONG,0x0E14) +#define PR_RECIPIENT_STATUS PROP_TAG(PT_LONG,0x0E15) +#define PR_TRANSPORT_KEY PROP_TAG(PT_LONG,0x0E16) +#define PR_MSG_STATUS PROP_TAG(PT_LONG,0x0E17) +#define PR_MESSAGE_DOWNLOAD_TIME PROP_TAG(PT_LONG,0x0E18) +#define PR_CREATION_VERSION PROP_TAG(PT_I8,0x0E19) +#define PR_MODIFY_VERSION PROP_TAG(PT_I8,0x0E1A) +#define PR_HASATTACH PROP_TAG(PT_BOOLEAN,0x0E1B) +#define PR_BODY_CRC PROP_TAG(PT_LONG,0x0E1C) +#define PR_NORMALIZED_SUBJECT PROP_TAG(PT_TSTRING,0x0E1D) +#define PR_NORMALIZED_SUBJECT_W PROP_TAG(PT_UNICODE,0x0E1D) +#define PR_NORMALIZED_SUBJECT_A PROP_TAG(PT_STRING8,0x0E1D) +#define PR_RTF_IN_SYNC PROP_TAG(PT_BOOLEAN,0x0E1F) +#define PR_ATTACH_SIZE PROP_TAG(PT_LONG,0x0E20) +#define PR_ATTACH_NUM PROP_TAG(PT_LONG,0x0E21) +#define PR_PREPROCESS PROP_TAG(PT_BOOLEAN,0x0E22) + +#define PR_ORIGINATING_MTA_CERTIFICATE PROP_TAG(PT_BINARY,0x0E25) +#define PR_PROOF_OF_SUBMISSION PROP_TAG(PT_BINARY,0x0E26) + +#define PR_ENTRYID PROP_TAG(PT_BINARY,0x0FFF) +#define PR_OBJECT_TYPE PROP_TAG(PT_LONG,0x0FFE) +#define PR_ICON PROP_TAG(PT_BINARY,0x0FFD) +#define PR_MINI_ICON PROP_TAG(PT_BINARY,0x0FFC) +#define PR_STORE_ENTRYID PROP_TAG(PT_BINARY,0x0FFB) +#define PR_STORE_RECORD_KEY PROP_TAG(PT_BINARY,0x0FFA) +#define PR_RECORD_KEY PROP_TAG(PT_BINARY,0x0FF9) +#define PR_MAPPING_SIGNATURE PROP_TAG(PT_BINARY,0x0FF8) +#define PR_ACCESS_LEVEL PROP_TAG(PT_LONG,0x0FF7) +#define PR_INSTANCE_KEY PROP_TAG(PT_BINARY,0x0FF6) +#define PR_ROW_TYPE PROP_TAG(PT_LONG,0x0FF5) +#define PR_ACCESS PROP_TAG(PT_LONG,0x0FF4) + +#define PR_ROWID PROP_TAG(PT_LONG,0x3000) +#define PR_DISPLAY_NAME PROP_TAG(PT_TSTRING,0x3001) +#define PR_DISPLAY_NAME_W PROP_TAG(PT_UNICODE,0x3001) +#define PR_DISPLAY_NAME_A PROP_TAG(PT_STRING8,0x3001) +#define PR_ADDRTYPE PROP_TAG(PT_TSTRING,0x3002) +#define PR_ADDRTYPE_W PROP_TAG(PT_UNICODE,0x3002) +#define PR_ADDRTYPE_A PROP_TAG(PT_STRING8,0x3002) +#define PR_EMAIL_ADDRESS PROP_TAG(PT_TSTRING,0x3003) +#define PR_EMAIL_ADDRESS_W PROP_TAG(PT_UNICODE,0x3003) +#define PR_EMAIL_ADDRESS_A PROP_TAG(PT_STRING8,0x3003) +#define PR_COMMENT PROP_TAG(PT_TSTRING,0x3004) +#define PR_COMMENT_W PROP_TAG(PT_UNICODE,0x3004) +#define PR_COMMENT_A PROP_TAG(PT_STRING8,0x3004) +#define PR_DEPTH PROP_TAG(PT_LONG,0x3005) +#define PR_PROVIDER_DISPLAY PROP_TAG(PT_TSTRING,0x3006) +#define PR_PROVIDER_DISPLAY_W PROP_TAG(PT_UNICODE,0x3006) +#define PR_PROVIDER_DISPLAY_A PROP_TAG(PT_STRING8,0x3006) +#define PR_CREATION_TIME PROP_TAG(PT_SYSTIME,0x3007) +#define PR_LAST_MODIFICATION_TIME PROP_TAG(PT_SYSTIME,0x3008) +#define PR_RESOURCE_FLAGS PROP_TAG(PT_LONG,0x3009) +#define PR_PROVIDER_DLL_NAME PROP_TAG(PT_TSTRING,0x300A) +#define PR_PROVIDER_DLL_NAME_W PROP_TAG(PT_UNICODE,0x300A) +#define PR_PROVIDER_DLL_NAME_A PROP_TAG(PT_STRING8,0x300A) +#define PR_SEARCH_KEY PROP_TAG(PT_BINARY,0x300B) +#define PR_PROVIDER_UID PROP_TAG(PT_BINARY,0x300C) +#define PR_PROVIDER_ORDINAL PROP_TAG(PT_LONG,0x300D) + +#define PR_FORM_VERSION PROP_TAG(PT_TSTRING,0x3301) +#define PR_FORM_VERSION_W PROP_TAG(PT_UNICODE,0x3301) +#define PR_FORM_VERSION_A PROP_TAG(PT_STRING8,0x3301) +#define PR_FORM_CLSID PROP_TAG(PT_CLSID,0x3302) +#define PR_FORM_CONTACT_NAME PROP_TAG(PT_TSTRING,0x3303) +#define PR_FORM_CONTACT_NAME_W PROP_TAG(PT_UNICODE,0x3303) +#define PR_FORM_CONTACT_NAME_A PROP_TAG(PT_STRING8,0x3303) +#define PR_FORM_CATEGORY PROP_TAG(PT_TSTRING,0x3304) +#define PR_FORM_CATEGORY_W PROP_TAG(PT_UNICODE,0x3304) +#define PR_FORM_CATEGORY_A PROP_TAG(PT_STRING8,0x3304) +#define PR_FORM_CATEGORY_SUB PROP_TAG(PT_TSTRING,0x3305) +#define PR_FORM_CATEGORY_SUB_W PROP_TAG(PT_UNICODE,0x3305) +#define PR_FORM_CATEGORY_SUB_A PROP_TAG(PT_STRING8,0x3305) +#define PR_FORM_HOST_MAP PROP_TAG(PT_MV_LONG,0x3306) +#define PR_FORM_HIDDEN PROP_TAG(PT_BOOLEAN,0x3307) +#define PR_FORM_DESIGNER_NAME PROP_TAG(PT_TSTRING,0x3308) +#define PR_FORM_DESIGNER_NAME_W PROP_TAG(PT_UNICODE,0x3308) +#define PR_FORM_DESIGNER_NAME_A PROP_TAG(PT_STRING8,0x3308) +#define PR_FORM_DESIGNER_GUID PROP_TAG(PT_CLSID,0x3309) +#define PR_FORM_MESSAGE_BEHAVIOR PROP_TAG(PT_LONG,0x330A) + +#define PR_DEFAULT_STORE PROP_TAG(PT_BOOLEAN,0x3400) +#define PR_STORE_SUPPORT_MASK PROP_TAG(PT_LONG,0x340D) +#define PR_STORE_STATE PROP_TAG(PT_LONG,0x340E) + +#define PR_IPM_SUBTREE_SEARCH_KEY PROP_TAG(PT_BINARY,0x3410) +#define PR_IPM_OUTBOX_SEARCH_KEY PROP_TAG(PT_BINARY,0x3411) +#define PR_IPM_WASTEBASKET_SEARCH_KEY PROP_TAG(PT_BINARY,0x3412) +#define PR_IPM_SENTMAIL_SEARCH_KEY PROP_TAG(PT_BINARY,0x3413) +#define PR_MDB_PROVIDER PROP_TAG(PT_BINARY,0x3414) +#define PR_RECEIVE_FOLDER_SETTINGS PROP_TAG(PT_OBJECT,0x3415) + +#define PR_VALID_FOLDER_MASK PROP_TAG(PT_LONG,0x35DF) +#define PR_IPM_SUBTREE_ENTRYID PROP_TAG(PT_BINARY,0x35E0) + +#define PR_IPM_OUTBOX_ENTRYID PROP_TAG(PT_BINARY,0x35E2) +#define PR_IPM_WASTEBASKET_ENTRYID PROP_TAG(PT_BINARY,0x35E3) +#define PR_IPM_SENTMAIL_ENTRYID PROP_TAG(PT_BINARY,0x35E4) +#define PR_VIEWS_ENTRYID PROP_TAG(PT_BINARY,0x35E5) +#define PR_COMMON_VIEWS_ENTRYID PROP_TAG(PT_BINARY,0x35E6) +#define PR_FINDER_ENTRYID PROP_TAG(PT_BINARY,0x35E7) + +#define PR_CONTAINER_FLAGS PROP_TAG(PT_LONG,0x3600) +#define PR_FOLDER_TYPE PROP_TAG(PT_LONG,0x3601) +#define PR_CONTENT_COUNT PROP_TAG(PT_LONG,0x3602) +#define PR_CONTENT_UNREAD PROP_TAG(PT_LONG,0x3603) +#define PR_CREATE_TEMPLATES PROP_TAG(PT_OBJECT,0x3604) +#define PR_DETAILS_TABLE PROP_TAG(PT_OBJECT,0x3605) +#define PR_SEARCH PROP_TAG(PT_OBJECT,0x3607) +#define PR_SELECTABLE PROP_TAG(PT_BOOLEAN,0x3609) +#define PR_SUBFOLDERS PROP_TAG(PT_BOOLEAN,0x360A) +#define PR_STATUS PROP_TAG(PT_LONG,0x360B) +#define PR_ANR PROP_TAG(PT_TSTRING,0x360C) +#define PR_ANR_W PROP_TAG(PT_UNICODE,0x360C) +#define PR_ANR_A PROP_TAG(PT_STRING8,0x360C) +#define PR_CONTENTS_SORT_ORDER PROP_TAG(PT_MV_LONG,0x360D) +#define PR_CONTAINER_HIERARCHY PROP_TAG(PT_OBJECT,0x360E) +#define PR_CONTAINER_CONTENTS PROP_TAG(PT_OBJECT,0x360F) +#define PR_FOLDER_ASSOCIATED_CONTENTS PROP_TAG(PT_OBJECT,0x3610) +#define PR_DEF_CREATE_DL PROP_TAG(PT_BINARY,0x3611) +#define PR_DEF_CREATE_MAILUSER PROP_TAG(PT_BINARY,0x3612) +#define PR_CONTAINER_CLASS PROP_TAG(PT_TSTRING,0x3613) +#define PR_CONTAINER_CLASS_W PROP_TAG(PT_UNICODE,0x3613) +#define PR_CONTAINER_CLASS_A PROP_TAG(PT_STRING8,0x3613) +#define PR_CONTAINER_MODIFY_VERSION PROP_TAG(PT_I8,0x3614) +#define PR_AB_PROVIDER_ID PROP_TAG(PT_BINARY,0x3615) +#define PR_DEFAULT_VIEW_ENTRYID PROP_TAG(PT_BINARY,0x3616) +#define PR_ASSOC_CONTENT_COUNT PROP_TAG(PT_LONG,0x3617) + +#define PR_ATTACHMENT_X400_PARAMETERS PROP_TAG(PT_BINARY,0x3700) +#define PR_ATTACH_DATA_OBJ PROP_TAG(PT_OBJECT,0x3701) +#define PR_ATTACH_DATA_BIN PROP_TAG(PT_BINARY,0x3701) +#define PR_ATTACH_ENCODING PROP_TAG(PT_BINARY,0x3702) +#define PR_ATTACH_EXTENSION PROP_TAG(PT_TSTRING,0x3703) +#define PR_ATTACH_EXTENSION_W PROP_TAG(PT_UNICODE,0x3703) +#define PR_ATTACH_EXTENSION_A PROP_TAG(PT_STRING8,0x3703) +#define PR_ATTACH_FILENAME PROP_TAG(PT_TSTRING,0x3704) +#define PR_ATTACH_FILENAME_W PROP_TAG(PT_UNICODE,0x3704) +#define PR_ATTACH_FILENAME_A PROP_TAG(PT_STRING8,0x3704) +#define PR_ATTACH_METHOD PROP_TAG(PT_LONG,0x3705) +#define PR_ATTACH_LONG_FILENAME PROP_TAG(PT_TSTRING,0x3707) +#define PR_ATTACH_LONG_FILENAME_W PROP_TAG(PT_UNICODE,0x3707) +#define PR_ATTACH_LONG_FILENAME_A PROP_TAG(PT_STRING8,0x3707) +#define PR_ATTACH_PATHNAME PROP_TAG(PT_TSTRING,0x3708) +#define PR_ATTACH_PATHNAME_W PROP_TAG(PT_UNICODE,0x3708) +#define PR_ATTACH_PATHNAME_A PROP_TAG(PT_STRING8,0x3708) +#define PR_ATTACH_RENDERING PROP_TAG(PT_BINARY,0x3709) +#define PR_ATTACH_TAG PROP_TAG(PT_BINARY,0x370A) +#define PR_RENDERING_POSITION PROP_TAG(PT_LONG,0x370B) +#define PR_ATTACH_TRANSPORT_NAME PROP_TAG(PT_TSTRING,0x370C) +#define PR_ATTACH_TRANSPORT_NAME_W PROP_TAG(PT_UNICODE,0x370C) +#define PR_ATTACH_TRANSPORT_NAME_A PROP_TAG(PT_STRING8,0x370C) +#define PR_ATTACH_LONG_PATHNAME PROP_TAG(PT_TSTRING,0x370D) +#define PR_ATTACH_LONG_PATHNAME_W PROP_TAG(PT_UNICODE,0x370D) +#define PR_ATTACH_LONG_PATHNAME_A PROP_TAG(PT_STRING8,0x370D) +#define PR_ATTACH_MIME_TAG PROP_TAG(PT_TSTRING,0x370E) +#define PR_ATTACH_MIME_TAG_W PROP_TAG(PT_UNICODE,0x370E) +#define PR_ATTACH_MIME_TAG_A PROP_TAG(PT_STRING8,0x370E) +#define PR_ATTACH_ADDITIONAL_INFO PROP_TAG(PT_BINARY,0x370F) + +#define PR_DISPLAY_TYPE PROP_TAG(PT_LONG,0x3900) +#define PR_TEMPLATEID PROP_TAG(PT_BINARY,0x3902) +#define PR_PRIMARY_CAPABILITY PROP_TAG(PT_BINARY,0x3904) + +#define PR_7BIT_DISPLAY_NAME PROP_TAG(PT_STRING8,0x39FF) +#define PR_ACCOUNT PROP_TAG(PT_TSTRING,0x3A00) +#define PR_ACCOUNT_W PROP_TAG(PT_UNICODE,0x3A00) +#define PR_ACCOUNT_A PROP_TAG(PT_STRING8,0x3A00) +#define PR_ALTERNATE_RECIPIENT PROP_TAG(PT_BINARY,0x3A01) +#define PR_CALLBACK_TELEPHONE_NUMBER PROP_TAG(PT_TSTRING,0x3A02) +#define PR_CALLBACK_TELEPHONE_NUMBER_W PROP_TAG(PT_UNICODE,0x3A02) +#define PR_CALLBACK_TELEPHONE_NUMBER_A PROP_TAG(PT_STRING8,0x3A02) +#define PR_CONVERSION_PROHIBITED PROP_TAG(PT_BOOLEAN,0x3A03) +#define PR_DISCLOSE_RECIPIENTS PROP_TAG(PT_BOOLEAN,0x3A04) +#define PR_GENERATION PROP_TAG(PT_TSTRING,0x3A05) +#define PR_GENERATION_W PROP_TAG(PT_UNICODE,0x3A05) +#define PR_GENERATION_A PROP_TAG(PT_STRING8,0x3A05) +#define PR_GIVEN_NAME PROP_TAG(PT_TSTRING,0x3A06) +#define PR_GIVEN_NAME_W PROP_TAG(PT_UNICODE,0x3A06) +#define PR_GIVEN_NAME_A PROP_TAG(PT_STRING8,0x3A06) +#define PR_GOVERNMENT_ID_NUMBER PROP_TAG(PT_TSTRING,0x3A07) +#define PR_GOVERNMENT_ID_NUMBER_W PROP_TAG(PT_UNICODE,0x3A07) +#define PR_GOVERNMENT_ID_NUMBER_A PROP_TAG(PT_STRING8,0x3A07) +#define PR_BUSINESS_TELEPHONE_NUMBER PROP_TAG(PT_TSTRING,0x3A08) +#define PR_BUSINESS_TELEPHONE_NUMBER_W PROP_TAG(PT_UNICODE,0x3A08) +#define PR_BUSINESS_TELEPHONE_NUMBER_A PROP_TAG(PT_STRING8,0x3A08) +#define PR_OFFICE_TELEPHONE_NUMBER PR_BUSINESS_TELEPHONE_NUMBER +#define PR_OFFICE_TELEPHONE_NUMBER_W PR_BUSINESS_TELEPHONE_NUMBER_W +#define PR_OFFICE_TELEPHONE_NUMBER_A PR_BUSINESS_TELEPHONE_NUMBER_A +#define PR_HOME_TELEPHONE_NUMBER PROP_TAG(PT_TSTRING,0x3A09) +#define PR_HOME_TELEPHONE_NUMBER_W PROP_TAG(PT_UNICODE,0x3A09) +#define PR_HOME_TELEPHONE_NUMBER_A PROP_TAG(PT_STRING8,0x3A09) +#define PR_INITIALS PROP_TAG(PT_TSTRING,0x3A0A) +#define PR_INITIALS_W PROP_TAG(PT_UNICODE,0x3A0A) +#define PR_INITIALS_A PROP_TAG(PT_STRING8,0x3A0A) +#define PR_KEYWORD PROP_TAG(PT_TSTRING,0x3A0B) +#define PR_KEYWORD_W PROP_TAG(PT_UNICODE,0x3A0B) +#define PR_KEYWORD_A PROP_TAG(PT_STRING8,0x3A0B) +#define PR_LANGUAGE PROP_TAG(PT_TSTRING,0x3A0C) +#define PR_LANGUAGE_W PROP_TAG(PT_UNICODE,0x3A0C) +#define PR_LANGUAGE_A PROP_TAG(PT_STRING8,0x3A0C) +#define PR_LOCATION PROP_TAG(PT_TSTRING,0x3A0D) +#define PR_LOCATION_W PROP_TAG(PT_UNICODE,0x3A0D) +#define PR_LOCATION_A PROP_TAG(PT_STRING8,0x3A0D) +#define PR_MAIL_PERMISSION PROP_TAG(PT_BOOLEAN,0x3A0E) +#define PR_MHS_COMMON_NAME PROP_TAG(PT_TSTRING,0x3A0F) +#define PR_MHS_COMMON_NAME_W PROP_TAG(PT_UNICODE,0x3A0F) +#define PR_MHS_COMMON_NAME_A PROP_TAG(PT_STRING8,0x3A0F) +#define PR_ORGANIZATIONAL_ID_NUMBER PROP_TAG(PT_TSTRING,0x3A10) +#define PR_ORGANIZATIONAL_ID_NUMBER_W PROP_TAG(PT_UNICODE,0x3A10) +#define PR_ORGANIZATIONAL_ID_NUMBER_A PROP_TAG(PT_STRING8,0x3A10) +#define PR_SURNAME PROP_TAG(PT_TSTRING,0x3A11) +#define PR_SURNAME_W PROP_TAG(PT_UNICODE,0x3A11) +#define PR_SURNAME_A PROP_TAG(PT_STRING8,0x3A11) +#define PR_ORIGINAL_ENTRYID PROP_TAG(PT_BINARY,0x3A12) +#define PR_ORIGINAL_DISPLAY_NAME PROP_TAG(PT_TSTRING,0x3A13) +#define PR_ORIGINAL_DISPLAY_NAME_W PROP_TAG(PT_UNICODE,0x3A13) +#define PR_ORIGINAL_DISPLAY_NAME_A PROP_TAG(PT_STRING8,0x3A13) +#define PR_ORIGINAL_SEARCH_KEY PROP_TAG(PT_BINARY,0x3A14) +#define PR_POSTAL_ADDRESS PROP_TAG(PT_TSTRING,0x3A15) +#define PR_POSTAL_ADDRESS_W PROP_TAG(PT_UNICODE,0x3A15) +#define PR_POSTAL_ADDRESS_A PROP_TAG(PT_STRING8,0x3A15) +#define PR_COMPANY_NAME PROP_TAG(PT_TSTRING,0x3A16) +#define PR_COMPANY_NAME_W PROP_TAG(PT_UNICODE,0x3A16) +#define PR_COMPANY_NAME_A PROP_TAG(PT_STRING8,0x3A16) +#define PR_TITLE PROP_TAG(PT_TSTRING,0x3A17) +#define PR_TITLE_W PROP_TAG(PT_UNICODE,0x3A17) +#define PR_TITLE_A PROP_TAG(PT_STRING8,0x3A17) +#define PR_DEPARTMENT_NAME PROP_TAG(PT_TSTRING,0x3A18) +#define PR_DEPARTMENT_NAME_W PROP_TAG(PT_UNICODE,0x3A18) +#define PR_DEPARTMENT_NAME_A PROP_TAG(PT_STRING8,0x3A18) +#define PR_OFFICE_LOCATION PROP_TAG(PT_TSTRING,0x3A19) +#define PR_OFFICE_LOCATION_W PROP_TAG(PT_UNICODE,0x3A19) +#define PR_OFFICE_LOCATION_A PROP_TAG(PT_STRING8,0x3A19) +#define PR_PRIMARY_TELEPHONE_NUMBER PROP_TAG(PT_TSTRING,0x3A1A) +#define PR_PRIMARY_TELEPHONE_NUMBER_W PROP_TAG(PT_UNICODE,0x3A1A) +#define PR_PRIMARY_TELEPHONE_NUMBER_A PROP_TAG(PT_STRING8,0x3A1A) +#define PR_BUSINESS2_TELEPHONE_NUMBER PROP_TAG(PT_TSTRING,0x3A1B) +#define PR_BUSINESS2_TELEPHONE_NUMBER_W PROP_TAG(PT_UNICODE,0x3A1B) +#define PR_BUSINESS2_TELEPHONE_NUMBER_A PROP_TAG(PT_STRING8,0x3A1B) +#define PR_OFFICE2_TELEPHONE_NUMBER PR_BUSINESS2_TELEPHONE_NUMBER +#define PR_OFFICE2_TELEPHONE_NUMBER_W PR_BUSINESS2_TELEPHONE_NUMBER_W +#define PR_OFFICE2_TELEPHONE_NUMBER_A PR_BUSINESS2_TELEPHONE_NUMBER_A +#define PR_MOBILE_TELEPHONE_NUMBER PROP_TAG(PT_TSTRING,0x3A1C) +#define PR_MOBILE_TELEPHONE_NUMBER_W PROP_TAG(PT_UNICODE,0x3A1C) +#define PR_MOBILE_TELEPHONE_NUMBER_A PROP_TAG(PT_STRING8,0x3A1C) +#define PR_CELLULAR_TELEPHONE_NUMBER PR_MOBILE_TELEPHONE_NUMBER +#define PR_CELLULAR_TELEPHONE_NUMBER_W PR_MOBILE_TELEPHONE_NUMBER_W +#define PR_CELLULAR_TELEPHONE_NUMBER_A PR_MOBILE_TELEPHONE_NUMBER_A +#define PR_RADIO_TELEPHONE_NUMBER PROP_TAG(PT_TSTRING,0x3A1D) +#define PR_RADIO_TELEPHONE_NUMBER_W PROP_TAG(PT_UNICODE,0x3A1D) +#define PR_RADIO_TELEPHONE_NUMBER_A PROP_TAG(PT_STRING8,0x3A1D) +#define PR_CAR_TELEPHONE_NUMBER PROP_TAG(PT_TSTRING,0x3A1E) +#define PR_CAR_TELEPHONE_NUMBER_W PROP_TAG(PT_UNICODE,0x3A1E) +#define PR_CAR_TELEPHONE_NUMBER_A PROP_TAG(PT_STRING8,0x3A1E) +#define PR_OTHER_TELEPHONE_NUMBER PROP_TAG(PT_TSTRING,0x3A1F) +#define PR_OTHER_TELEPHONE_NUMBER_W PROP_TAG(PT_UNICODE,0x3A1F) +#define PR_OTHER_TELEPHONE_NUMBER_A PROP_TAG(PT_STRING8,0x3A1F) +#define PR_TRANSMITABLE_DISPLAY_NAME PROP_TAG(PT_TSTRING,0x3A20) +#define PR_TRANSMITABLE_DISPLAY_NAME_W PROP_TAG(PT_UNICODE,0x3A20) +#define PR_TRANSMITABLE_DISPLAY_NAME_A PROP_TAG(PT_STRING8,0x3A20) +#define PR_PAGER_TELEPHONE_NUMBER PROP_TAG(PT_TSTRING,0x3A21) +#define PR_PAGER_TELEPHONE_NUMBER_W PROP_TAG(PT_UNICODE,0x3A21) +#define PR_PAGER_TELEPHONE_NUMBER_A PROP_TAG(PT_STRING8,0x3A21) +#define PR_BEEPER_TELEPHONE_NUMBER PR_PAGER_TELEPHONE_NUMBER +#define PR_BEEPER_TELEPHONE_NUMBER_W PR_PAGER_TELEPHONE_NUMBER_W +#define PR_BEEPER_TELEPHONE_NUMBER_A PR_PAGER_TELEPHONE_NUMBER_A +#define PR_USER_CERTIFICATE PROP_TAG(PT_BINARY,0x3A22) +#define PR_PRIMARY_FAX_NUMBER PROP_TAG(PT_TSTRING,0x3A23) +#define PR_PRIMARY_FAX_NUMBER_W PROP_TAG(PT_UNICODE,0x3A23) +#define PR_PRIMARY_FAX_NUMBER_A PROP_TAG(PT_STRING8,0x3A23) +#define PR_BUSINESS_FAX_NUMBER PROP_TAG(PT_TSTRING,0x3A24) +#define PR_BUSINESS_FAX_NUMBER_W PROP_TAG(PT_UNICODE,0x3A24) +#define PR_BUSINESS_FAX_NUMBER_A PROP_TAG(PT_STRING8,0x3A24) +#define PR_HOME_FAX_NUMBER PROP_TAG(PT_TSTRING,0x3A25) +#define PR_HOME_FAX_NUMBER_W PROP_TAG(PT_UNICODE,0x3A25) +#define PR_HOME_FAX_NUMBER_A PROP_TAG(PT_STRING8,0x3A25) +#define PR_COUNTRY PROP_TAG(PT_TSTRING,0x3A26) +#define PR_COUNTRY_W PROP_TAG(PT_UNICODE,0x3A26) +#define PR_COUNTRY_A PROP_TAG(PT_STRING8,0x3A26) +#define PR_BUSINESS_ADDRESS_COUNTRY PR_COUNTRY +#define PR_BUSINESS_ADDRESS_COUNTRY_W PR_COUNTRY_W +#define PR_BUSINESS_ADDRESS_COUNTRY_A PR_COUNTRY_A + +#define PR_LOCALITY PROP_TAG(PT_TSTRING,0x3A27) +#define PR_LOCALITY_W PROP_TAG(PT_UNICODE,0x3A27) +#define PR_LOCALITY_A PROP_TAG(PT_STRING8,0x3A27) +#define PR_BUSINESS_ADDRESS_CITY PR_LOCALITY +#define PR_BUSINESS_ADDRESS_CITY_W PR_LOCALITY_W +#define PR_BUSINESS_ADDRESS_CITY_A PR_LOCALITY_A + +#define PR_STATE_OR_PROVINCE PROP_TAG(PT_TSTRING,0x3A28) +#define PR_STATE_OR_PROVINCE_W PROP_TAG(PT_UNICODE,0x3A28) +#define PR_STATE_OR_PROVINCE_A PROP_TAG(PT_STRING8,0x3A28) +#define PR_BUSINESS_ADDRESS_STATE_OR_PROVINCE PR_STATE_OR_PROVINCE +#define PR_BUSINESS_ADDRESS_STATE_OR_PROVINCE_W PR_STATE_OR_PROVINCE_W +#define PR_BUSINESS_ADDRESS_STATE_OR_PROVINCE_A PR_STATE_OR_PROVINCE_A + +#define PR_STREET_ADDRESS PROP_TAG(PT_TSTRING,0x3A29) +#define PR_STREET_ADDRESS_W PROP_TAG(PT_UNICODE,0x3A29) +#define PR_STREET_ADDRESS_A PROP_TAG(PT_STRING8,0x3A29) +#define PR_BUSINESS_ADDRESS_STREET PR_STREET_ADDRESS +#define PR_BUSINESS_ADDRESS_STREET_W PR_STREET_ADDRESS_W +#define PR_BUSINESS_ADDRESS_STREET_A PR_STREET_ADDRESS_A + +#define PR_POSTAL_CODE PROP_TAG(PT_TSTRING,0x3A2A) +#define PR_POSTAL_CODE_W PROP_TAG(PT_UNICODE,0x3A2A) +#define PR_POSTAL_CODE_A PROP_TAG(PT_STRING8,0x3A2A) +#define PR_BUSINESS_ADDRESS_POSTAL_CODE PR_POSTAL_CODE +#define PR_BUSINESS_ADDRESS_POSTAL_CODE_W PR_POSTAL_CODE_W +#define PR_BUSINESS_ADDRESS_POSTAL_CODE_A PR_POSTAL_CODE_A + +#define PR_POST_OFFICE_BOX PROP_TAG(PT_TSTRING,0x3A2B) +#define PR_POST_OFFICE_BOX_W PROP_TAG(PT_UNICODE,0x3A2B) +#define PR_POST_OFFICE_BOX_A PROP_TAG(PT_STRING8,0x3A2B) +#define PR_BUSINESS_ADDRESS_POST_OFFICE_BOX PR_POST_OFFICE_BOX +#define PR_BUSINESS_ADDRESS_POST_OFFICE_BOX_W PR_POST_OFFICE_BOX_W +#define PR_BUSINESS_ADDRESS_POST_OFFICE_BOX_A PR_POST_OFFICE_BOX_A + +#define PR_TELEX_NUMBER PROP_TAG(PT_TSTRING,0x3A2C) +#define PR_TELEX_NUMBER_W PROP_TAG(PT_UNICODE,0x3A2C) +#define PR_TELEX_NUMBER_A PROP_TAG(PT_STRING8,0x3A2C) +#define PR_ISDN_NUMBER PROP_TAG(PT_TSTRING,0x3A2D) +#define PR_ISDN_NUMBER_W PROP_TAG(PT_UNICODE,0x3A2D) +#define PR_ISDN_NUMBER_A PROP_TAG(PT_STRING8,0x3A2D) +#define PR_ASSISTANT_TELEPHONE_NUMBER PROP_TAG(PT_TSTRING,0x3A2E) +#define PR_ASSISTANT_TELEPHONE_NUMBER_W PROP_TAG(PT_UNICODE,0x3A2E) +#define PR_ASSISTANT_TELEPHONE_NUMBER_A PROP_TAG(PT_STRING8,0x3A2E) +#define PR_HOME2_TELEPHONE_NUMBER PROP_TAG(PT_TSTRING,0x3A2F) +#define PR_HOME2_TELEPHONE_NUMBER_W PROP_TAG(PT_UNICODE,0x3A2F) +#define PR_HOME2_TELEPHONE_NUMBER_A PROP_TAG(PT_STRING8,0x3A2F) +#define PR_ASSISTANT PROP_TAG(PT_TSTRING,0x3A30) +#define PR_ASSISTANT_W PROP_TAG(PT_UNICODE,0x3A30) +#define PR_ASSISTANT_A PROP_TAG(PT_STRING8,0x3A30) +#define PR_SEND_RICH_INFO PROP_TAG(PT_BOOLEAN,0x3A40) + +#define PR_WEDDING_ANNIVERSARY PROP_TAG(PT_SYSTIME,0x3A41) +#define PR_BIRTHDAY PROP_TAG(PT_SYSTIME,0x3A42) + +#define PR_HOBBIES PROP_TAG(PT_TSTRING,0x3A43) +#define PR_HOBBIES_W PROP_TAG(PT_UNICODE,0x3A43) +#define PR_HOBBIES_A PROP_TAG(PT_STRING8,0x3A43) + +#define PR_MIDDLE_NAME PROP_TAG(PT_TSTRING,0x3A44) +#define PR_MIDDLE_NAME_W PROP_TAG(PT_UNICODE,0x3A44) +#define PR_MIDDLE_NAME_A PROP_TAG(PT_STRING8,0x3A44) + +#define PR_DISPLAY_NAME_PREFIX PROP_TAG(PT_TSTRING,0x3A45) +#define PR_DISPLAY_NAME_PREFIX_W PROP_TAG(PT_UNICODE,0x3A45) +#define PR_DISPLAY_NAME_PREFIX_A PROP_TAG(PT_STRING8,0x3A45) + +#define PR_PROFESSION PROP_TAG(PT_TSTRING,0x3A46) +#define PR_PROFESSION_W PROP_TAG(PT_UNICODE,0x3A46) +#define PR_PROFESSION_A PROP_TAG(PT_STRING8,0x3A46) + +#define PR_PREFERRED_BY_NAME PROP_TAG(PT_TSTRING,0x3A47) +#define PR_PREFERRED_BY_NAME_W PROP_TAG(PT_UNICODE,0x3A47) +#define PR_PREFERRED_BY_NAME_A PROP_TAG(PT_STRING8,0x3A47) + +#define PR_SPOUSE_NAME PROP_TAG(PT_TSTRING,0x3A48) +#define PR_SPOUSE_NAME_W PROP_TAG(PT_UNICODE,0x3A48) +#define PR_SPOUSE_NAME_A PROP_TAG(PT_STRING8,0x3A48) + +#define PR_COMPUTER_NETWORK_NAME PROP_TAG(PT_TSTRING,0x3A49) +#define PR_COMPUTER_NETWORK_NAME_W PROP_TAG(PT_UNICODE,0x3A49) +#define PR_COMPUTER_NETWORK_NAME_A PROP_TAG(PT_STRING8,0x3A49) + +#define PR_CUSTOMER_ID PROP_TAG(PT_TSTRING,0x3A4A) +#define PR_CUSTOMER_ID_W PROP_TAG(PT_UNICODE,0x3A4A) +#define PR_CUSTOMER_ID_A PROP_TAG(PT_STRING8,0x3A4A) + +#define PR_TTYTDD_PHONE_NUMBER PROP_TAG(PT_TSTRING,0x3A4B) +#define PR_TTYTDD_PHONE_NUMBER_W PROP_TAG(PT_UNICODE,0x3A4B) +#define PR_TTYTDD_PHONE_NUMBER_A PROP_TAG(PT_STRING8,0x3A4B) + +#define PR_FTP_SITE PROP_TAG(PT_TSTRING,0x3A4C) +#define PR_FTP_SITE_W PROP_TAG(PT_UNICODE,0x3A4C) +#define PR_FTP_SITE_A PROP_TAG(PT_STRING8,0x3A4C) + +#define PR_GENDER PROP_TAG(PT_SHORT,0x3A4D) + +#define PR_MANAGER_NAME PROP_TAG(PT_TSTRING,0x3A4E) +#define PR_MANAGER_NAME_W PROP_TAG(PT_UNICODE,0x3A4E) +#define PR_MANAGER_NAME_A PROP_TAG(PT_STRING8,0x3A4E) + +#define PR_NICKNAME PROP_TAG(PT_TSTRING,0x3A4F) +#define PR_NICKNAME_W PROP_TAG(PT_UNICODE,0x3A4F) +#define PR_NICKNAME_A PROP_TAG(PT_STRING8,0x3A4F) + +#define PR_PERSONAL_HOME_PAGE PROP_TAG(PT_TSTRING,0x3A50) +#define PR_PERSONAL_HOME_PAGE_W PROP_TAG(PT_UNICODE,0x3A50) +#define PR_PERSONAL_HOME_PAGE_A PROP_TAG(PT_STRING8,0x3A50) + +#define PR_BUSINESS_HOME_PAGE PROP_TAG(PT_TSTRING,0x3A51) +#define PR_BUSINESS_HOME_PAGE_W PROP_TAG(PT_UNICODE,0x3A51) +#define PR_BUSINESS_HOME_PAGE_A PROP_TAG(PT_STRING8,0x3A51) + +#define PR_CONTACT_VERSION PROP_TAG(PT_CLSID,0x3A52) +#define PR_CONTACT_ENTRYIDS PROP_TAG(PT_MV_BINARY,0x3A53) + +#define PR_CONTACT_ADDRTYPES PROP_TAG(PT_MV_TSTRING,0x3A54) +#define PR_CONTACT_ADDRTYPES_W PROP_TAG(PT_MV_UNICODE,0x3A54) +#define PR_CONTACT_ADDRTYPES_A PROP_TAG(PT_MV_STRING8,0x3A54) + +#define PR_CONTACT_DEFAULT_ADDRESS_INDEX PROP_TAG(PT_LONG,0x3A55) + +#define PR_CONTACT_EMAIL_ADDRESSES PROP_TAG(PT_MV_TSTRING,0x3A56) +#define PR_CONTACT_EMAIL_ADDRESSES_W PROP_TAG(PT_MV_UNICODE,0x3A56) +#define PR_CONTACT_EMAIL_ADDRESSES_A PROP_TAG(PT_MV_STRING8,0x3A56) + +#define PR_COMPANY_MAIN_PHONE_NUMBER PROP_TAG(PT_TSTRING,0x3A57) +#define PR_COMPANY_MAIN_PHONE_NUMBER_W PROP_TAG(PT_UNICODE,0x3A57) +#define PR_COMPANY_MAIN_PHONE_NUMBER_A PROP_TAG(PT_STRING8,0x3A57) + +#define PR_CHILDRENS_NAMES PROP_TAG(PT_MV_TSTRING,0x3A58) +#define PR_CHILDRENS_NAMES_W PROP_TAG(PT_MV_UNICODE,0x3A58) +#define PR_CHILDRENS_NAMES_A PROP_TAG(PT_MV_STRING8,0x3A58) + +#define PR_HOME_ADDRESS_CITY PROP_TAG(PT_TSTRING,0x3A59) +#define PR_HOME_ADDRESS_CITY_W PROP_TAG(PT_UNICODE,0x3A59) +#define PR_HOME_ADDRESS_CITY_A PROP_TAG(PT_STRING8,0x3A59) + +#define PR_HOME_ADDRESS_COUNTRY PROP_TAG(PT_TSTRING,0x3A5A) +#define PR_HOME_ADDRESS_COUNTRY_W PROP_TAG(PT_UNICODE,0x3A5A) +#define PR_HOME_ADDRESS_COUNTRY_A PROP_TAG(PT_STRING8,0x3A5A) + +#define PR_HOME_ADDRESS_POSTAL_CODE PROP_TAG(PT_TSTRING,0x3A5B) +#define PR_HOME_ADDRESS_POSTAL_CODE_W PROP_TAG(PT_UNICODE,0x3A5B) +#define PR_HOME_ADDRESS_POSTAL_CODE_A PROP_TAG(PT_STRING8,0x3A5B) + +#define PR_HOME_ADDRESS_STATE_OR_PROVINCE PROP_TAG(PT_TSTRING,0x3A5C) +#define PR_HOME_ADDRESS_STATE_OR_PROVINCE_W PROP_TAG(PT_UNICODE,0x3A5C) +#define PR_HOME_ADDRESS_STATE_OR_PROVINCE_A PROP_TAG(PT_STRING8,0x3A5C) + +#define PR_HOME_ADDRESS_STREET PROP_TAG(PT_TSTRING,0x3A5D) +#define PR_HOME_ADDRESS_STREET_W PROP_TAG(PT_UNICODE,0x3A5D) +#define PR_HOME_ADDRESS_STREET_A PROP_TAG(PT_STRING8,0x3A5D) + +#define PR_HOME_ADDRESS_POST_OFFICE_BOX PROP_TAG(PT_TSTRING,0x3A5E) +#define PR_HOME_ADDRESS_POST_OFFICE_BOX_W PROP_TAG(PT_UNICODE,0x3A5E) +#define PR_HOME_ADDRESS_POST_OFFICE_BOX_A PROP_TAG(PT_STRING8,0x3A5E) + +#define PR_OTHER_ADDRESS_CITY PROP_TAG(PT_TSTRING,0x3A5F) +#define PR_OTHER_ADDRESS_CITY_W PROP_TAG(PT_UNICODE,0x3A5F) +#define PR_OTHER_ADDRESS_CITY_A PROP_TAG(PT_STRING8,0x3A5F) + +#define PR_OTHER_ADDRESS_COUNTRY PROP_TAG(PT_TSTRING,0x3A60) +#define PR_OTHER_ADDRESS_COUNTRY_W PROP_TAG(PT_UNICODE,0x3A60) +#define PR_OTHER_ADDRESS_COUNTRY_A PROP_TAG(PT_STRING8,0x3A60) + +#define PR_OTHER_ADDRESS_POSTAL_CODE PROP_TAG(PT_TSTRING,0x3A61) +#define PR_OTHER_ADDRESS_POSTAL_CODE_W PROP_TAG(PT_UNICODE,0x3A61) +#define PR_OTHER_ADDRESS_POSTAL_CODE_A PROP_TAG(PT_STRING8,0x3A61) + +#define PR_OTHER_ADDRESS_STATE_OR_PROVINCE PROP_TAG(PT_TSTRING,0x3A62) +#define PR_OTHER_ADDRESS_STATE_OR_PROVINCE_W PROP_TAG(PT_UNICODE,0x3A62) +#define PR_OTHER_ADDRESS_STATE_OR_PROVINCE_A PROP_TAG(PT_STRING8,0x3A62) + +#define PR_OTHER_ADDRESS_STREET PROP_TAG(PT_TSTRING,0x3A63) +#define PR_OTHER_ADDRESS_STREET_W PROP_TAG(PT_UNICODE,0x3A63) +#define PR_OTHER_ADDRESS_STREET_A PROP_TAG(PT_STRING8,0x3A63) + +#define PR_OTHER_ADDRESS_POST_OFFICE_BOX PROP_TAG(PT_TSTRING,0x3A64) +#define PR_OTHER_ADDRESS_POST_OFFICE_BOX_W PROP_TAG(PT_UNICODE,0x3A64) +#define PR_OTHER_ADDRESS_POST_OFFICE_BOX_A PROP_TAG(PT_STRING8,0x3A64) + +#define PR_STORE_PROVIDERS PROP_TAG(PT_BINARY,0x3D00) +#define PR_AB_PROVIDERS PROP_TAG(PT_BINARY,0x3D01) +#define PR_TRANSPORT_PROVIDERS PROP_TAG(PT_BINARY,0x3D02) + +#define PR_DEFAULT_PROFILE PROP_TAG(PT_BOOLEAN,0x3D04) +#define PR_AB_SEARCH_PATH PROP_TAG(PT_MV_BINARY,0x3D05) +#define PR_AB_DEFAULT_DIR PROP_TAG(PT_BINARY,0x3D06) +#define PR_AB_DEFAULT_PAB PROP_TAG(PT_BINARY,0x3D07) + +#define PR_FILTERING_HOOKS PROP_TAG(PT_BINARY,0x3D08) +#define PR_SERVICE_NAME PROP_TAG(PT_TSTRING,0x3D09) +#define PR_SERVICE_NAME_W PROP_TAG(PT_UNICODE,0x3D09) +#define PR_SERVICE_NAME_A PROP_TAG(PT_STRING8,0x3D09) +#define PR_SERVICE_DLL_NAME PROP_TAG(PT_TSTRING,0x3D0A) +#define PR_SERVICE_DLL_NAME_W PROP_TAG(PT_UNICODE,0x3D0A) +#define PR_SERVICE_DLL_NAME_A PROP_TAG(PT_STRING8,0x3D0A) +#define PR_SERVICE_ENTRY_NAME PROP_TAG(PT_STRING8,0x3D0B) +#define PR_SERVICE_UID PROP_TAG(PT_BINARY,0x3D0C) +#define PR_SERVICE_EXTRA_UIDS PROP_TAG(PT_BINARY,0x3D0D) +#define PR_SERVICES PROP_TAG(PT_BINARY,0x3D0E) +#define PR_SERVICE_SUPPORT_FILES PROP_TAG(PT_MV_TSTRING,0x3D0F) +#define PR_SERVICE_SUPPORT_FILES_W PROP_TAG(PT_MV_UNICODE,0x3D0F) +#define PR_SERVICE_SUPPORT_FILES_A PROP_TAG(PT_MV_STRING8,0x3D0F) +#define PR_SERVICE_DELETE_FILES PROP_TAG(PT_MV_TSTRING,0x3D10) +#define PR_SERVICE_DELETE_FILES_W PROP_TAG(PT_MV_UNICODE,0x3D10) +#define PR_SERVICE_DELETE_FILES_A PROP_TAG(PT_MV_STRING8,0x3D10) +#define PR_AB_SEARCH_PATH_UPDATE PROP_TAG(PT_BINARY,0x3D11) +#define PR_PROFILE_NAME PROP_TAG(PT_TSTRING,0x3D12) +#define PR_PROFILE_NAME_A PROP_TAG(PT_STRING8,0x3D12) +#define PR_PROFILE_NAME_W PROP_TAG(PT_UNICODE,0x3D12) + +#define PR_IDENTITY_DISPLAY PROP_TAG(PT_TSTRING,0x3E00) +#define PR_IDENTITY_DISPLAY_W PROP_TAG(PT_UNICODE,0x3E00) +#define PR_IDENTITY_DISPLAY_A PROP_TAG(PT_STRING8,0x3E00) +#define PR_IDENTITY_ENTRYID PROP_TAG(PT_BINARY,0x3E01) +#define PR_RESOURCE_METHODS PROP_TAG(PT_LONG,0x3E02) +#define PR_RESOURCE_TYPE PROP_TAG(PT_LONG,0x3E03) +#define PR_STATUS_CODE PROP_TAG(PT_LONG,0x3E04) +#define PR_IDENTITY_SEARCH_KEY PROP_TAG(PT_BINARY,0x3E05) +#define PR_OWN_STORE_ENTRYID PROP_TAG(PT_BINARY,0x3E06) +#define PR_RESOURCE_PATH PROP_TAG(PT_TSTRING,0x3E07) +#define PR_RESOURCE_PATH_W PROP_TAG(PT_UNICODE,0x3E07) +#define PR_RESOURCE_PATH_A PROP_TAG(PT_STRING8,0x3E07) +#define PR_STATUS_STRING PROP_TAG(PT_TSTRING,0x3E08) +#define PR_STATUS_STRING_W PROP_TAG(PT_UNICODE,0x3E08) +#define PR_STATUS_STRING_A PROP_TAG(PT_STRING8,0x3E08) +#define PR_X400_DEFERRED_DELIVERY_CANCEL PROP_TAG(PT_BOOLEAN,0x3E09) +#define PR_HEADER_FOLDER_ENTRYID PROP_TAG(PT_BINARY,0x3E0A) +#define PR_REMOTE_PROGRESS PROP_TAG(PT_LONG,0x3E0B) +#define PR_REMOTE_PROGRESS_TEXT PROP_TAG(PT_TSTRING,0x3E0C) +#define PR_REMOTE_PROGRESS_TEXT_W PROP_TAG(PT_UNICODE,0x3E0C) +#define PR_REMOTE_PROGRESS_TEXT_A PROP_TAG(PT_STRING8,0x3E0C) +#define PR_REMOTE_VALIDATE_OK PROP_TAG(PT_BOOLEAN,0x3E0D) +#define PR_CONTROL_FLAGS PROP_TAG(PT_LONG,0x3F00) +#define PR_CONTROL_STRUCTURE PROP_TAG(PT_BINARY,0x3F01) +#define PR_CONTROL_TYPE PROP_TAG(PT_LONG,0x3F02) +#define PR_DELTAX PROP_TAG(PT_LONG,0x3F03) +#define PR_DELTAY PROP_TAG(PT_LONG,0x3F04) +#define PR_XPOS PROP_TAG(PT_LONG,0x3F05) +#define PR_YPOS PROP_TAG(PT_LONG,0x3F06) +#define PR_CONTROL_ID PROP_TAG(PT_BINARY,0x3F07) +#define PR_INITIAL_DETAILS_PANE PROP_TAG(PT_LONG,0x3F08) + +#define PROP_ID_SECURE_MIN 0x67F0 +#define PROP_ID_SECURE_MAX 0x67FF +#endif diff --git a/bazaar/MAPIEx/plugin/include_MINGW32/mapiutil.h b/bazaar/MAPIEx/plugin/include_MINGW32/mapiutil.h new file mode 100644 index 000000000..a1704c6e6 --- /dev/null +++ b/bazaar/MAPIEx/plugin/include_MINGW32/mapiutil.h @@ -0,0 +1,235 @@ +/** + * This file has no copyright assigned and is placed in the Public Domain. + * This file is part of the mingw-w64 runtime package. + * No warranty is given; refer to the file DISCLAIMER.PD within this package. + */ +#ifndef _MAPIUTIL_H_ +#define _MAPIUTIL_H_ + +#ifdef __cplusplus +extern "C" { +#endif + +#include + +#ifndef BEGIN_INTERFACE +#define BEGIN_INTERFACE +#endif + + DECLARE_MAPI_INTERFACE_PTR(ITableData,LPTABLEDATA); + + typedef void (WINAPI CALLERRELEASE)(ULONG ulCallerData,LPTABLEDATA lpTblData,LPMAPITABLE lpVue); + +#define MAPI_ITABLEDATA_METHODS(IPURE) MAPIMETHOD(HrGetView) (THIS_ LPSSortOrderSet lpSSortOrderSet,CALLERRELEASE *lpfCallerRelease,ULONG ulCallerData,LPMAPITABLE *lppMAPITable) IPURE; MAPIMETHOD(HrModifyRow) (THIS_ LPSRow) IPURE; MAPIMETHOD(HrDeleteRow) (THIS_ LPSPropValue lpSPropValue) IPURE; MAPIMETHOD(HrQueryRow) (THIS_ LPSPropValue lpsPropValue,LPSRow *lppSRow,ULONG *lpuliRow) IPURE; MAPIMETHOD(HrEnumRow) (THIS_ ULONG ulRowNumber,LPSRow *lppSRow) IPURE; MAPIMETHOD(HrNotify) (THIS_ ULONG ulFlags,ULONG cValues,LPSPropValue lpSPropValue) IPURE; MAPIMETHOD(HrInsertRow) (THIS_ ULONG uliRow,LPSRow lpSRow) IPURE; MAPIMETHOD(HrModifyRows) (THIS_ ULONG ulFlags,LPSRowSet lpSRowSet) IPURE; MAPIMETHOD(HrDeleteRows) (THIS_ ULONG ulFlags,LPSRowSet lprowsetToDelete,ULONG *cRowsDeleted) IPURE; +#undef INTERFACE +#define INTERFACE ITableData + DECLARE_MAPI_INTERFACE_(ITableData,IUnknown) { + BEGIN_INTERFACE + MAPI_IUNKNOWN_METHODS(PURE) + MAPI_ITABLEDATA_METHODS(PURE) + }; + + STDAPI_(SCODE) CreateTable(LPCIID lpInterface,ALLOCATEBUFFER *lpAllocateBuffer,ALLOCATEMORE *lpAllocateMore,FREEBUFFER *lpFreeBuffer,LPVOID lpvReserved,ULONG ulTableType,ULONG ulPropTagIndexColumn,LPSPropTagArray lpSPropTagArrayColumns,LPTABLEDATA *lppTableData); + +#define TAD_ALL_ROWS 1 + +#define MAPI_IPROPDATA_METHODS(IPURE) MAPIMETHOD(HrSetObjAccess) (THIS_ ULONG ulAccess) IPURE; MAPIMETHOD(HrSetPropAccess) (THIS_ LPSPropTagArray lpPropTagArray,ULONG *rgulAccess) IPURE; MAPIMETHOD(HrGetPropAccess) (THIS_ LPSPropTagArray *lppPropTagArray,ULONG **lprgulAccess) IPURE; MAPIMETHOD(HrAddObjProps) (THIS_ LPSPropTagArray lppPropTagArray,LPSPropProblemArray *lprgulAccess) IPURE; + +#undef INTERFACE +#define INTERFACE IPropData + DECLARE_MAPI_INTERFACE_(IPropData,IMAPIProp) { + BEGIN_INTERFACE + MAPI_IUNKNOWN_METHODS(PURE) + MAPI_IMAPIPROP_METHODS(PURE) + MAPI_IPROPDATA_METHODS(PURE) + }; + + DECLARE_MAPI_INTERFACE_PTR(IPropData,LPPROPDATA); + + STDAPI_(SCODE) CreateIProp(LPCIID lpInterface,ALLOCATEBUFFER *lpAllocateBuffer,ALLOCATEMORE *lpAllocateMore,FREEBUFFER *lpFreeBuffer,LPVOID lpvReserved,LPPROPDATA *lppPropData); + +#define IPROP_READONLY ((ULONG) 0x00000001) +#define IPROP_READWRITE ((ULONG) 0x00000002) +#define IPROP_CLEAN ((ULONG) 0x00010000) +#define IPROP_DIRTY ((ULONG) 0x00020000) + +#ifndef NOIDLEENGINE + +#define PRILOWEST -32768 +#define PRIHIGHEST 32767 +#define PRIUSER 0 + +#define IRONULL ((USHORT) 0x0000) +#define FIROWAIT ((USHORT) 0x0001) +#define FIROINTERVAL ((USHORT) 0x0002) +#define FIROPERBLOCK ((USHORT) 0x0004) +#define FIRODISABLED ((USHORT) 0x0020) +#define FIROONCEONLY ((USHORT) 0x0040) + +#define IRCNULL ((USHORT) 0x0000) +#define FIRCPFN ((USHORT) 0x0001) +#define FIRCPV ((USHORT) 0x0002) +#define FIRCPRI ((USHORT) 0x0004) +#define FIRCCSEC ((USHORT) 0x0008) +#define FIRCIRO ((USHORT) 0x0010) + + typedef WINBOOL (WINAPI FNIDLE) (LPVOID); + typedef FNIDLE *PFNIDLE; + typedef void *FTG; + typedef FTG *PFTG; +#define FTGNULL ((FTG) NULL) + + STDAPI_(LONG) MAPIInitIdle (LPVOID lpvReserved); + STDAPI_(VOID) MAPIDeinitIdle (VOID); + STDAPI_(FTG) FtgRegisterIdleRoutine (PFNIDLE lpfnIdle,LPVOID lpvIdleParam,short priIdle,ULONG csecIdle,USHORT iroIdle); + STDAPI_(void) DeregisterIdleRoutine (FTG ftg); + STDAPI_(void) EnableIdleRoutine (FTG ftg,WINBOOL fEnable); + STDAPI_(void) ChangeIdleRoutine (FTG ftg,PFNIDLE lpfnIdle,LPVOID lpvIdleParam,short priIdle,ULONG csecIdle,USHORT iroIdle,USHORT ircIdle); +#endif + + STDAPI_(LPMALLOC) MAPIGetDefaultMalloc(VOID); + +#define SOF_UNIQUEFILENAME ((ULONG) 0x80000000) + + STDMETHODIMP OpenStreamOnFile(LPALLOCATEBUFFER lpAllocateBuffer,LPFREEBUFFER lpFreeBuffer,ULONG ulFlags,LPTSTR lpszFileName,LPTSTR lpszPrefix,LPSTREAM *lppStream); + + typedef HRESULT (WINAPI *LPOPENSTREAMONFILE) (LPALLOCATEBUFFER lpAllocateBuffer,LPFREEBUFFER lpFreeBuffer,ULONG ulFlags,LPTSTR lpszFileName,LPTSTR lpszPrefix,LPSTREAM *lppStream); + +#define OPENSTREAMONFILE "OpenStreamOnFile" + + STDAPI_(SCODE) PropCopyMore(LPSPropValue lpSPropValueDest,LPSPropValue lpSPropValueSrc,ALLOCATEMORE *lpfAllocMore,LPVOID lpvObject); + STDAPI_(ULONG) UlPropSize(LPSPropValue lpSPropValue); + STDAPI_(WINBOOL) FEqualNames(LPMAPINAMEID lpName1,LPMAPINAMEID lpName2); + +#if !defined(_WINNT) && !defined(_WIN95) +#define _WINNT +#endif + + STDAPI_(void) GetInstance(LPSPropValue lpPropMv,LPSPropValue lpPropSv,ULONG uliInst); + + extern char rgchCsds[]; + extern char rgchCids[]; + extern char rgchCsdi[]; + extern char rgchCidi[]; + + STDAPI_(WINBOOL) FPropContainsProp(LPSPropValue lpSPropValueDst,LPSPropValue lpSPropValueSrc,ULONG ulFuzzyLevel); + STDAPI_(WINBOOL) FPropCompareProp(LPSPropValue lpSPropValue1,ULONG ulRelOp,LPSPropValue lpSPropValue2); + STDAPI_(LONG) LPropCompareProp(LPSPropValue lpSPropValueA,LPSPropValue lpSPropValueB); + STDAPI_(HRESULT) HrAddColumns(LPMAPITABLE lptbl,LPSPropTagArray lpproptagColumnsNew,LPALLOCATEBUFFER lpAllocateBuffer,LPFREEBUFFER lpFreeBuffer); + STDAPI_(HRESULT) HrAddColumnsEx(LPMAPITABLE lptbl,LPSPropTagArray lpproptagColumnsNew,LPALLOCATEBUFFER lpAllocateBuffer,LPFREEBUFFER lpFreeBuffer,void (*lpfnFilterColumns)(LPSPropTagArray ptaga)); + STDAPI HrAllocAdviseSink(LPNOTIFCALLBACK lpfnCallback,LPVOID lpvContext,LPMAPIADVISESINK *lppAdviseSink); + STDAPI HrThisThreadAdviseSink(LPMAPIADVISESINK lpAdviseSink,LPMAPIADVISESINK *lppAdviseSink); + STDAPI HrDispatchNotifications(ULONG ulFlags); + + typedef struct { + ULONG ulCtlType; + ULONG ulCtlFlags; + LPBYTE lpbNotif; + ULONG cbNotif; + LPTSTR lpszFilter; + ULONG ulItemID; + union { + LPVOID lpv; + LPDTBLLABEL lplabel; + LPDTBLEDIT lpedit; + LPDTBLLBX lplbx; + LPDTBLCOMBOBOX lpcombobox; + LPDTBLDDLBX lpddlbx; + LPDTBLCHECKBOX lpcheckbox; + LPDTBLGROUPBOX lpgroupbox; + LPDTBLBUTTON lpbutton; + LPDTBLRADIOBUTTON lpradiobutton; + LPDTBLMVLISTBOX lpmvlbx; + LPDTBLMVDDLBX lpmvddlbx; + LPDTBLPAGE lppage; + } ctl; + } DTCTL,*LPDTCTL; + + typedef struct { + ULONG cctl; + LPTSTR lpszResourceName; + __C89_NAMELESS union { + LPTSTR lpszComponent; + ULONG ulItemID; + }; + LPDTCTL lpctl; + } DTPAGE,*LPDTPAGE; + + STDAPI BuildDisplayTable(LPALLOCATEBUFFER lpAllocateBuffer,LPALLOCATEMORE lpAllocateMore,LPFREEBUFFER lpFreeBuffer,LPMALLOC lpMalloc,HINSTANCE hInstance,UINT cPages,LPDTPAGE lpPage,ULONG ulFlags,LPMAPITABLE *lppTable,LPTABLEDATA *lppTblData); + STDAPI_(SCODE) ScCountNotifications(int cNotifications,LPNOTIFICATION lpNotifications,ULONG *lpcb); + STDAPI_(SCODE) ScCopyNotifications(int cNotification,LPNOTIFICATION lpNotifications,LPVOID lpvDst,ULONG *lpcb); + STDAPI_(SCODE) ScRelocNotifications(int cNotification,LPNOTIFICATION lpNotifications,LPVOID lpvBaseOld,LPVOID lpvBaseNew,ULONG *lpcb); + STDAPI_(SCODE) ScCountProps(int cValues,LPSPropValue lpPropArray,ULONG *lpcb); + STDAPI_(LPSPropValue) LpValFindProp(ULONG ulPropTag,ULONG cValues,LPSPropValue lpPropArray); + STDAPI_(SCODE) ScCopyProps(int cValues,LPSPropValue lpPropArray,LPVOID lpvDst,ULONG *lpcb); + STDAPI_(SCODE) ScRelocProps(int cValues,LPSPropValue lpPropArray,LPVOID lpvBaseOld,LPVOID lpvBaseNew,ULONG *lpcb); + STDAPI_(SCODE) ScDupPropset(int cValues,LPSPropValue lpPropArray,LPALLOCATEBUFFER lpAllocateBuffer,LPSPropValue *lppPropArray); + STDAPI_(ULONG) UlAddRef(LPVOID lpunk); + STDAPI_(ULONG) UlRelease(LPVOID lpunk); + STDAPI HrGetOneProp(LPMAPIPROP lpMapiProp,ULONG ulPropTag,LPSPropValue *lppProp); + STDAPI HrSetOneProp(LPMAPIPROP lpMapiProp,LPSPropValue lpProp); + STDAPI_(WINBOOL) FPropExists(LPMAPIPROP lpMapiProp,ULONG ulPropTag); + STDAPI_(LPSPropValue) PpropFindProp(LPSPropValue lpPropArray,ULONG cValues,ULONG ulPropTag); + STDAPI_(void) FreePadrlist(LPADRLIST lpAdrlist); + STDAPI_(void) FreeProws(LPSRowSet lpRows); + STDAPI HrQueryAllRows(LPMAPITABLE lpTable,LPSPropTagArray lpPropTags,LPSRestriction lpRestriction,LPSSortOrderSet lpSortOrderSet,LONG crowsMax,LPSRowSet *lppRows); + +#define MAPI_FORCE_CREATE 1 +#define MAPI_FULL_IPM_TREE 2 + + STDAPI HrValidateIPMSubtree(LPMDB lpMDB,ULONG ulFlags,ULONG *lpcValues,LPSPropValue *lppValues,LPMAPIERROR *lpperr); + STDAPI_(WINBOOL) FBinFromHex(LPTSTR lpsz,LPBYTE lpb); + STDAPI_(SCODE) ScBinFromHexBounded(LPTSTR lpsz,LPBYTE lpb,ULONG cb); + STDAPI_(void) HexFromBin(LPBYTE lpb,int cb,LPTSTR lpsz); + STDAPI_(ULONG) UlFromSzHex(LPCTSTR lpsz); + STDAPI HrEntryIDFromSz(LPTSTR lpsz,ULONG *lpcb,LPENTRYID *lppEntryID); + STDAPI HrSzFromEntryID(ULONG cb,LPENTRYID lpEntryID,LPTSTR *lpsz); + STDAPI HrComposeEID(LPMAPISESSION lpSession,ULONG cbStoreRecordKey,LPBYTE lpStoreRecordKey,ULONG cbMsgEntryID,LPENTRYID lpMsgEntryID,ULONG *lpcbEID,LPENTRYID *lppEntryID); + STDAPI HrDecomposeEID(LPMAPISESSION lpSession,ULONG cbEntryID,LPENTRYID lpEntryID,ULONG *lpcbStoreEntryID,LPENTRYID *lppStoreEntryID,ULONG *lpcbMsgEntryID,LPENTRYID *lppMsgEntryID); + STDAPI HrComposeMsgID(LPMAPISESSION lpSession,ULONG cbStoreSearchKey,LPBYTE pStoreSearchKey,ULONG cbMsgEntryID,LPENTRYID lpMsgEntryID,LPTSTR *lpszMsgID); + STDAPI HrDecomposeMsgID(LPMAPISESSION lpSession,LPTSTR lpszMsgID,ULONG *lpcbStoreEntryID,LPENTRYID *lppStoreEntryID,ULONG *lppcbMsgEntryID,LPENTRYID *lppMsgEntryID); + STDAPI_(LPTSTR) SzFindCh(LPCTSTR lpsz,USHORT ch); + STDAPI_(LPTSTR) SzFindLastCh(LPCTSTR lpsz,USHORT ch); + STDAPI_(LPTSTR) SzFindSz(LPCTSTR lpsz,LPCTSTR lpszKey); + STDAPI_(unsigned int) UFromSz(LPCTSTR lpsz); + STDAPI_(SCODE) ScUNCFromLocalPath(LPSTR lpszLocal,LPSTR lpszUNC,UINT cchUNC); + STDAPI_(SCODE) ScLocalPathFromUNC(LPSTR lpszUNC,LPSTR lpszLocal,UINT cchLocal); + STDAPI_(FILETIME) FtAddFt(FILETIME ftAddend1,FILETIME ftAddend2); + STDAPI_(FILETIME) FtMulDwDw(DWORD ftMultiplicand,DWORD ftMultiplier); + STDAPI_(FILETIME) FtMulDw(DWORD ftMultiplier,FILETIME ftMultiplicand); + STDAPI_(FILETIME) FtSubFt(FILETIME ftMinuend,FILETIME ftSubtrahend); + STDAPI_(FILETIME) FtNegFt(FILETIME ft); + STDAPI_(SCODE) ScCreateConversationIndex(ULONG cbParent,LPBYTE lpbParent,ULONG *lpcbConvIndex,LPBYTE *lppbConvIndex); + STDAPI WrapStoreEntryID(ULONG ulFlags,LPTSTR lpszDLLName,ULONG cbOrigEntry,LPENTRYID lpOrigEntry,ULONG *lpcbWrappedEntry,LPENTRYID *lppWrappedEntry); + +#define RTF_SYNC_RTF_CHANGED ((ULONG) 0x00000001) +#define RTF_SYNC_BODY_CHANGED ((ULONG) 0x00000002) + + STDAPI_(HRESULT) RTFSync(LPMESSAGE lpMessage,ULONG ulFlags,WINBOOL *lpfMessageUpdated); + STDAPI_(HRESULT) WrapCompressedRTFStream(LPSTREAM lpCompressedRTFStream,ULONG ulFlags,LPSTREAM *lpUncompressedRTFStream); + STDAPI_(HRESULT) HrIStorageFromStream(LPUNKNOWN lpUnkIn,LPCIID lpInterface,ULONG ulFlags,LPSTORAGE *lppStorageOut); + STDAPI_(SCODE) ScInitMapiUtil(ULONG ulFlags); + STDAPI_(VOID) DeinitMapiUtil(VOID); + +#ifdef _X86_ +#define szHrDispatchNotifications "_HrDispatchNotifications@4" +#elif defined(_IA64_) +#define szHrDispatchNotifications "HrDispatchNotifications" +#endif + + typedef HRESULT (WINAPI DISPATCHNOTIFICATIONS)(ULONG ulFlags); + typedef DISPATCHNOTIFICATIONS *LPDISPATCHNOTIFICATIONS; + +#ifdef _X86_ +#define szScCreateConversationIndex "_ScCreateConversationIndex@16" +#elif defined(_IA64_) +#define szScCreateConversationIndex "ScCreateConversationIndex" +#endif + + typedef SCODE (WINAPI CREATECONVERSATIONINDEX)(ULONG cbParent,LPBYTE lpbParent,ULONG *lpcbConvIndex,LPBYTE *lppbConvIndex); + typedef CREATECONVERSATIONINDEX *LPCREATECONVERSATIONINDEX; + +#ifdef __cplusplus +} +#endif +#endif diff --git a/bazaar/MAPIEx/plugin/include_MINGW32/mapix.h b/bazaar/MAPIEx/plugin/include_MINGW32/mapix.h new file mode 100644 index 000000000..34e82a123 --- /dev/null +++ b/bazaar/MAPIEx/plugin/include_MINGW32/mapix.h @@ -0,0 +1,151 @@ +/** + * This file has no copyright assigned and is placed in the Public Domain. + * This file is part of the mingw-w64 runtime package. + * No warranty is given; refer to the file DISCLAIMER.PD within this package. + */ +#ifndef MAPIX_H +#define MAPIX_H + +#include +#include +#include +#include + +#ifdef __cplusplus +extern "C" { +#endif + +#ifndef BEGIN_INTERFACE +#define BEGIN_INTERFACE +#endif + + DECLARE_MAPI_INTERFACE_PTR(IProfAdmin,LPPROFADMIN); + DECLARE_MAPI_INTERFACE_PTR(IMsgServiceAdmin,LPSERVICEADMIN); + DECLARE_MAPI_INTERFACE_PTR(IMAPISession,LPMAPISESSION); + + typedef ULONG FLAGS; + +#define MAPI_LOGON_UI 0x00000001 +#define MAPI_NEW_SESSION 0x00000002 +#define MAPI_ALLOW_OTHERS 0x00000008 +#define MAPI_EXPLICIT_PROFILE 0x00000010 +#define MAPI_EXTENDED 0x00000020 +#define MAPI_FORCE_DOWNLOAD 0x00001000 +#define MAPI_SERVICE_UI_ALWAYS 0x00002000 +#define MAPI_NO_MAIL 0x00008000 + +#ifndef MAPI_PASSWORD_UI +#define MAPI_PASSWORD_UI 0x00020000 +#endif +#define MAPI_TIMEOUT_SHORT 0x00100000 + +#define MAPI_SIMPLE_DEFAULT (MAPI_LOGON_UI | MAPI_FORCE_DOWNLOAD | MAPI_ALLOW_OTHERS) +#define MAPI_SIMPLE_EXPLICIT (MAPI_NEW_SESSION | MAPI_FORCE_DOWNLOAD | MAPI_EXPLICIT_PROFILE) + + typedef struct { + ULONG ulVersion; + ULONG ulFlags; + } MAPIINIT_0,*LPMAPIINIT_0; + + typedef MAPIINIT_0 MAPIINIT; + typedef MAPIINIT *LPMAPIINIT; + +#define MAPI_INIT_VERSION 0 + +#define MAPI_MULTITHREAD_NOTIFICATIONS 0x00000001 + + typedef HRESULT (WINAPI MAPIINITIALIZE)(LPVOID lpMapiInit); + typedef MAPIINITIALIZE *LPMAPIINITIALIZE; + typedef void (WINAPI MAPIUNINITIALIZE)(void); + typedef MAPIUNINITIALIZE *LPMAPIUNINITIALIZE; + + MAPIINITIALIZE MAPIInitialize; + MAPIUNINITIALIZE MAPIUninitialize; + + typedef HRESULT (WINAPI MAPILOGONEX)(ULONG_PTR ulUIParam,LPTSTR lpszProfileName,LPTSTR lpszPassword,ULONG ulFlags,LPMAPISESSION *lppSession); + typedef MAPILOGONEX *LPMAPILOGONEX; + + MAPILOGONEX MAPILogonEx; + + typedef SCODE (WINAPI MAPIALLOCATEBUFFER)(ULONG cbSize,LPVOID *lppBuffer); + typedef SCODE (WINAPI MAPIALLOCATEMORE)(ULONG cbSize,LPVOID lpObject,LPVOID *lppBuffer); + typedef ULONG (WINAPI MAPIFREEBUFFER)(LPVOID lpBuffer); + typedef MAPIALLOCATEBUFFER *LPMAPIALLOCATEBUFFER; + typedef MAPIALLOCATEMORE *LPMAPIALLOCATEMORE; + typedef MAPIFREEBUFFER *LPMAPIFREEBUFFER; + + MAPIALLOCATEBUFFER MAPIAllocateBuffer; + MAPIALLOCATEMORE MAPIAllocateMore; + MAPIFREEBUFFER MAPIFreeBuffer; + + typedef HRESULT (WINAPI MAPIADMINPROFILES)(ULONG ulFlags,LPPROFADMIN *lppProfAdmin); + typedef MAPIADMINPROFILES *LPMAPIADMINPROFILES; + + MAPIADMINPROFILES MAPIAdminProfiles; + +#define MAPI_LOGOFF_SHARED 0x00000001 +#define MAPI_LOGOFF_UI 0x00000002 + +#define MAPI_DEFAULT_STORE 0x00000001 +#define MAPI_SIMPLE_STORE_TEMPORARY 0x00000002 +#define MAPI_SIMPLE_STORE_PERMANENT 0x00000003 +#define MAPI_PRIMARY_STORE 0x00000004 +#define MAPI_SECONDARY_STORE 0x00000005 + +#define MAPI_POST_MESSAGE 0x00000001 +#define MAPI_NEW_MESSAGE 0x00000002 + +#define MAPI_IMAPISESSION_METHODS(IPURE) MAPIMETHOD(GetLastError) (THIS_ HRESULT hResult,ULONG ulFlags,LPMAPIERROR *lppMAPIError) IPURE; MAPIMETHOD(GetMsgStoresTable) (THIS_ ULONG ulFlags,LPMAPITABLE *lppTable) IPURE; MAPIMETHOD(OpenMsgStore) (THIS_ ULONG_PTR ulUIParam,ULONG cbEntryID,LPENTRYID lpEntryID,LPCIID lpInterface,ULONG ulFlags,LPMDB *lppMDB) IPURE; MAPIMETHOD(OpenAddressBook) (THIS_ ULONG_PTR ulUIParam,LPCIID lpInterface,ULONG ulFlags,LPADRBOOK *lppAdrBook) IPURE; MAPIMETHOD(OpenProfileSection) (THIS_ LPMAPIUID lpUID,LPCIID lpInterface,ULONG ulFlags,LPPROFSECT *lppProfSect) IPURE; MAPIMETHOD(GetStatusTable) (THIS_ ULONG ulFlags,LPMAPITABLE *lppTable) IPURE; MAPIMETHOD(OpenEntry) (THIS_ ULONG cbEntryID,LPENTRYID lpEntryID,LPCIID lpInterface,ULONG ulFlags,ULONG *lpulObjType,LPUNKNOWN *lppUnk) IPURE; MAPIMETHOD(CompareEntryIDs) (THIS_ ULONG cbEntryID1,LPENTRYID lpEntryID1,ULONG cbEntryID2,LPENTRYID lpEntryID2,ULONG ulFlags,ULONG *lpulResult) IPURE; MAPIMETHOD(Advise) (THIS_ ULONG cbEntryID,LPENTRYID lpEntryID,ULONG ulEventMask,LPMAPIADVISESINK lpAdviseSink,ULONG *lpulConnection) IPURE; MAPIMETHOD(Unadvise) (THIS_ ULONG ulConnection) IPURE; MAPIMETHOD(MessageOptions) (THIS_ ULONG_PTR ulUIParam,ULONG ulFlags,LPTSTR lpszAdrType,LPMESSAGE lpMessage) IPURE; MAPIMETHOD(QueryDefaultMessageOpt) (THIS_ LPTSTR lpszAdrType,ULONG ulFlags,ULONG *lpcValues,LPSPropValue *lppOptions) IPURE; MAPIMETHOD(EnumAdrTypes) (THIS_ ULONG ulFlags,ULONG *lpcAdrTypes,LPTSTR **lpppszAdrTypes) IPURE; MAPIMETHOD(QueryIdentity) (THIS_ ULONG *lpcbEntryID,LPENTRYID *lppEntryID) IPURE; MAPIMETHOD(Logoff) (THIS_ ULONG_PTR ulUIParam,ULONG ulFlags,ULONG ulReserved) IPURE; MAPIMETHOD(SetDefaultStore) (THIS_ ULONG ulFlags,ULONG cbEntryID,LPENTRYID lpEntryID) IPURE; MAPIMETHOD(AdminServices) (THIS_ ULONG ulFlags,LPSERVICEADMIN *lppServiceAdmin) IPURE; MAPIMETHOD(ShowForm) (THIS_ ULONG_PTR ulUIParam,LPMDB lpMsgStore,LPMAPIFOLDER lpParentFolder,LPCIID lpInterface,ULONG ulMessageToken,LPMESSAGE lpMessageSent,ULONG ulFlags,ULONG ulMessageStatus,ULONG ulMessageFlags,ULONG ulAccess,LPSTR lpszMessageClass) IPURE; MAPIMETHOD(PrepareForm) (THIS_ LPCIID lpInterface,LPMESSAGE lpMessage,ULONG *lpulMessageToken) IPURE; + +#undef INTERFACE +#define INTERFACE IMAPISession + DECLARE_MAPI_INTERFACE_(IMAPISession,IUnknown) { + BEGIN_INTERFACE + MAPI_IUNKNOWN_METHODS(PURE) + MAPI_IMAPISESSION_METHODS(PURE) + }; + +#define MAPI_IADDRBOOK_METHODS(IPURE) MAPIMETHOD(OpenEntry) (THIS_ ULONG cbEntryID,LPENTRYID lpEntryID,LPCIID lpInterface,ULONG ulFlags,ULONG *lpulObjType,LPUNKNOWN *lppUnk) IPURE; MAPIMETHOD(CompareEntryIDs) (THIS_ ULONG cbEntryID1,LPENTRYID lpEntryID1,ULONG cbEntryID2,LPENTRYID lpEntryID2,ULONG ulFlags,ULONG *lpulResult) IPURE; MAPIMETHOD(Advise) (THIS_ ULONG cbEntryID,LPENTRYID lpEntryID,ULONG ulEventMask,LPMAPIADVISESINK lpAdviseSink,ULONG *lpulConnection) IPURE; MAPIMETHOD(Unadvise) (THIS_ ULONG ulConnection) IPURE; MAPIMETHOD(CreateOneOff) (THIS_ LPTSTR lpszName,LPTSTR lpszAdrType,LPTSTR lpszAddress,ULONG ulFlags,ULONG *lpcbEntryID,LPENTRYID *lppEntryID) IPURE; MAPIMETHOD(NewEntry) (THIS_ ULONG_PTR ulUIParam,ULONG ulFlags,ULONG cbEIDContainer,LPENTRYID lpEIDContainer,ULONG cbEIDNewEntryTpl,LPENTRYID lpEIDNewEntryTpl,ULONG *lpcbEIDNewEntry,LPENTRYID *lppEIDNewEntry) IPURE; MAPIMETHOD(ResolveName) (THIS_ ULONG_PTR ulUIParam,ULONG ulFlags,LPTSTR lpszNewEntryTitle,LPADRLIST lpAdrList) IPURE; MAPIMETHOD(Address) (THIS_ ULONG_PTR *lpulUIParam,LPADRPARM lpAdrParms,LPADRLIST *lppAdrList) IPURE; MAPIMETHOD(Details) (THIS_ ULONG *lpulUIParam,LPFNDISMISS lpfnDismiss,LPVOID lpvDismissContext,ULONG cbEntryID,LPENTRYID lpEntryID,LPFNBUTTON lpfButtonCallback,LPVOID lpvButtonContext,LPTSTR lpszButtonText,ULONG ulFlags) IPURE; MAPIMETHOD(RecipOptions) (THIS_ ULONG_PTR ulUIParam,ULONG ulFlags,LPADRENTRY lpRecip) IPURE; MAPIMETHOD(QueryDefaultRecipOpt) (THIS_ LPTSTR lpszAdrType,ULONG ulFlags,ULONG *lpcValues,LPSPropValue *lppOptions) IPURE; MAPIMETHOD(GetPAB) (THIS_ ULONG *lpcbEntryID,LPENTRYID *lppEntryID) IPURE; MAPIMETHOD(SetPAB) (THIS_ ULONG cbEntryID,LPENTRYID lpEntryID) IPURE; MAPIMETHOD(GetDefaultDir) (THIS_ ULONG *lpcbEntryID,LPENTRYID *lppEntryID) IPURE; MAPIMETHOD(SetDefaultDir) (THIS_ ULONG cbEntryID,LPENTRYID lpEntryID) IPURE; MAPIMETHOD(GetSearchPath) (THIS_ ULONG ulFlags,LPSRowSet *lppSearchPath) IPURE; MAPIMETHOD(SetSearchPath) (THIS_ ULONG ulFlags,LPSRowSet lpSearchPath) IPURE; MAPIMETHOD(PrepareRecips) (THIS_ ULONG ulFlags,LPSPropTagArray lpPropTagArray,LPADRLIST lpRecipList) IPURE; +#undef INTERFACE +#define INTERFACE IAddrBook + DECLARE_MAPI_INTERFACE_(IAddrBook,IMAPIProp) { + BEGIN_INTERFACE + MAPI_IUNKNOWN_METHODS(PURE) + MAPI_IMAPIPROP_METHODS(PURE) + MAPI_IADDRBOOK_METHODS(PURE) + }; + + DECLARE_MAPI_INTERFACE_PTR(IAddrBook,LPADRBOOK); + +#define MAPI_DEFAULT_SERVICES 0x00000001 + +#define MAPI_IPROFADMIN_METHODS(IPURE) MAPIMETHOD(GetLastError) (THIS_ HRESULT hResult,ULONG ulFlags,LPMAPIERROR *lppMAPIError) IPURE; MAPIMETHOD(GetProfileTable) (THIS_ ULONG ulFlags,LPMAPITABLE *lppTable) IPURE; MAPIMETHOD(CreateProfile) (THIS_ LPTSTR lpszProfileName,LPTSTR lpszPassword,ULONG_PTR ulUIParam,ULONG ulFlags) IPURE; MAPIMETHOD(DeleteProfile) (THIS_ LPTSTR lpszProfileName,ULONG ulFlags) IPURE; MAPIMETHOD(ChangeProfilePassword) (THIS_ LPTSTR lpszProfileName,LPTSTR lpszOldPassword,LPTSTR lpszNewPassword,ULONG ulFlags) IPURE; MAPIMETHOD(CopyProfile) (THIS_ LPTSTR lpszOldProfileName,LPTSTR lpszOldPassword,LPTSTR lpszNewProfileName,ULONG_PTR ulUIParam,ULONG ulFlags) IPURE; MAPIMETHOD(RenameProfile) (THIS_ LPTSTR lpszOldProfileName,LPTSTR lpszOldPassword,LPTSTR lpszNewProfileName,ULONG_PTR ulUIParam,ULONG ulFlags) IPURE; MAPIMETHOD(SetDefaultProfile) (THIS_ LPTSTR lpszProfileName,ULONG ulFlags) IPURE; MAPIMETHOD(AdminServices) (THIS_ LPTSTR lpszProfileName,LPTSTR lpszPassword,ULONG_PTR ulUIParam,ULONG ulFlags,LPSERVICEADMIN *lppServiceAdmin) IPURE; + +#undef INTERFACE +#define INTERFACE IProfAdmin + DECLARE_MAPI_INTERFACE_(IProfAdmin,IUnknown) { + BEGIN_INTERFACE + MAPI_IUNKNOWN_METHODS(PURE) + MAPI_IPROFADMIN_METHODS(PURE) + }; + +#define SERVICE_DEFAULT_STORE 0x00000001 +#define SERVICE_SINGLE_COPY 0x00000002 +#define SERVICE_CREATE_WITH_STORE 0x00000004 +#define SERVICE_PRIMARY_IDENTITY 0x00000008 +#define SERVICE_NO_PRIMARY_IDENTITY 0x00000020 + +#define MAPI_IMSGSERVICEADMIN_METHODS(IPURE) MAPIMETHOD(GetLastError) (THIS_ HRESULT hResult,ULONG ulFlags,LPMAPIERROR *lppMAPIError) IPURE; MAPIMETHOD(GetMsgServiceTable) (THIS_ ULONG ulFlags,LPMAPITABLE *lppTable) IPURE; MAPIMETHOD(CreateMsgService) (THIS_ LPTSTR lpszService,LPTSTR lpszDisplayName,ULONG_PTR ulUIParam,ULONG ulFlags) IPURE; MAPIMETHOD(DeleteMsgService) (THIS_ LPMAPIUID lpUID) IPURE; MAPIMETHOD(CopyMsgService) (THIS_ LPMAPIUID lpUID,LPTSTR lpszDisplayName,LPCIID lpInterfaceToCopy,LPCIID lpInterfaceDst,LPVOID lpObjectDst,ULONG_PTR ulUIParam,ULONG ulFlags) IPURE; MAPIMETHOD(RenameMsgService) (THIS_ LPMAPIUID lpUID,ULONG ulFlags,LPTSTR lpszDisplayName) IPURE; MAPIMETHOD(ConfigureMsgService) (THIS_ LPMAPIUID lpUID,ULONG_PTR ulUIParam,ULONG ulFlags,ULONG cValues,LPSPropValue lpProps) IPURE; MAPIMETHOD(OpenProfileSection) (THIS_ LPMAPIUID lpUID,LPCIID lpInterface,ULONG ulFlags,LPPROFSECT *lppProfSect) IPURE; MAPIMETHOD(MsgServiceTransportOrder) (THIS_ ULONG cUID,LPMAPIUID lpUIDList,ULONG ulFlags) IPURE; MAPIMETHOD(AdminProviders) (THIS_ LPMAPIUID lpUID,ULONG ulFlags,LPPROVIDERADMIN *lppProviderAdmin) IPURE; MAPIMETHOD(SetPrimaryIdentity) (THIS_ LPMAPIUID lpUID,ULONG ulFlags) IPURE; MAPIMETHOD(GetProviderTable) (THIS_ ULONG ulFlags,LPMAPITABLE *lppTable) IPURE; + +#undef INTERFACE +#define INTERFACE IMsgServiceAdmin + DECLARE_MAPI_INTERFACE_(IMsgServiceAdmin,IUnknown) { + BEGIN_INTERFACE + MAPI_IUNKNOWN_METHODS(PURE) + MAPI_IMSGSERVICEADMIN_METHODS(PURE) + }; + +#ifdef __cplusplus +} +#endif +#endif diff --git a/bazaar/MAPIEx/plugin/include_MINGW32/wabdefs.h b/bazaar/MAPIEx/plugin/include_MINGW32/wabdefs.h new file mode 100644 index 000000000..a6223ce4d --- /dev/null +++ b/bazaar/MAPIEx/plugin/include_MINGW32/wabdefs.h @@ -0,0 +1,1431 @@ +/** + * This file has no copyright assigned and is placed in the Public Domain. + * This file is part of the mingw-w64 runtime package. + * No warranty is given; refer to the file DISCLAIMER.PD within this package. + */ +#if !defined(MAPIDEFS_H) && !defined(WABDEFS_H) +#define WABDEFS_H +#if defined (NT) && !defined (_WINNT) +#warning NT defined but not _WINNT. You must define _WINNT to ensure " "successful compile of Windows NT code. +#define _WINNT +#endif + +#ifndef _WINDOWS_ +#define INC_OLE2 +#define INC_RPC +#define _OLE_H_ +#include +#endif + +#ifndef _OLEERROR_H_ +#include +#endif +#include +#include + +#ifndef MAPI_DIM +#define MAPI_DIM 1 +#endif + +#ifndef STDMAPIINITCALLTYPE +#define STDMAPIINITCALLTYPE __cdecl +#define STDINITMETHODIMP HRESULT __cdecl +#define STDINITMETHODIMP_(type) type __cdecl +#endif + +#ifdef __cplusplus +extern "C" { +#endif + +#ifndef __WCHAR_DEFINED +#define __WCHAR_DEFINED + typedef WORD WCHAR; +#endif + +#if defined(UNICODE) + typedef WCHAR TCHAR; +#else + typedef char TCHAR; +#endif + + typedef WCHAR *LPWSTR; + typedef const WCHAR *LPCWSTR; + typedef TCHAR *LPTSTR; + typedef const TCHAR *LPCTSTR; + typedef BYTE *LPBYTE; + typedef ULONG *LPULONG; + +#ifndef __LHANDLE +#define __LHANDLE + typedef unsigned long LHANDLE,*LPLHANDLE; +#endif + +#if !defined(_WINBASE_) && !defined(_FILETIME_) +#define _FILETIME_ + typedef struct _FILETIME { + DWORD dwLowDateTime; + DWORD dwHighDateTime; + } FILETIME,*LPFILETIME; +#endif + +#ifndef BEGIN_INTERFACE +#define BEGIN_INTERFACE +#endif + +#define MAPI_MODIFY ((ULONG) 0x00000001) + +#define MAPI_ACCESS_MODIFY ((ULONG) 0x00000001) +#define MAPI_ACCESS_READ ((ULONG) 0x00000002) +#define MAPI_ACCESS_DELETE ((ULONG) 0x00000004) +#define MAPI_ACCESS_CREATE_HIERARCHY ((ULONG) 0x00000008) +#define MAPI_ACCESS_CREATE_CONTENTS ((ULONG) 0x00000010) +#define MAPI_ACCESS_CREATE_ASSOCIATED ((ULONG) 0x00000020) +#define MAPI_UNICODE ((ULONG) 0x80000000) + +#if defined(UNICODE) +#define fMapiUnicode MAPI_UNICODE +#else +#define fMapiUnicode 0 +#endif + +#define hrSuccess 0 + +#ifndef MAPI_ORIG +#define MAPI_ORIG 0 +#define MAPI_TO 1 +#define MAPI_CC 2 +#define MAPI_BCC 3 +#define MAPI_P1 0x10000000 +#define MAPI_SUBMITTED 0x80000000 +#endif + +#define MAPI_SHORTTERM 0x80 +#define MAPI_NOTRECIP 0x40 +#define MAPI_THISSESSION 0x20 +#define MAPI_NOW 0x10 +#define MAPI_NOTRESERVED 0x08 + +#define MAPI_COMPOUND 0x80 + + typedef struct { + BYTE abFlags[4]; + BYTE ab[MAPI_DIM]; + } ENTRYID,*LPENTRYID; + +#define CbNewENTRYID(_cb) (offsetof(ENTRYID,ab) + (_cb)) +#define CbENTRYID(_cb) (offsetof(ENTRYID,ab) + (_cb)) +#define SizedENTRYID(_cb,_name) struct _ENTRYID_ ## _name { BYTE abFlags[4]; BYTE ab[_cb]; } _name + + typedef struct _MAPIUID { + BYTE ab[16]; + } MAPIUID,*LPMAPIUID; + +#define IsEqualMAPIUID(lpuid1,lpuid2) (!memcmp(lpuid1,lpuid2,sizeof(MAPIUID))) + +#define MAPI_STORE ((ULONG) 0x00000001) +#define MAPI_ADDRBOOK ((ULONG) 0x00000002) +#define MAPI_FOLDER ((ULONG) 0x00000003) +#define MAPI_ABCONT ((ULONG) 0x00000004) +#define MAPI_MESSAGE ((ULONG) 0x00000005) +#define MAPI_MAILUSER ((ULONG) 0x00000006) +#define MAPI_ATTACH ((ULONG) 0x00000007) +#define MAPI_DISTLIST ((ULONG) 0x00000008) +#define MAPI_PROFSECT ((ULONG) 0x00000009) +#define MAPI_STATUS ((ULONG) 0x0000000A) +#define MAPI_SESSION ((ULONG) 0x0000000B) +#define MAPI_FORMINFO ((ULONG) 0x0000000C) + +#ifndef cchProfileNameMax +#define cchProfileNameMax 64 +#define cchProfilePassMax 64 +#endif + +#define MV_FLAG 0x1000 + +#define PT_UNSPECIFIED ((ULONG) 0) +#define PT_NULL ((ULONG) 1) +#define PT_I2 ((ULONG) 2) +#define PT_LONG ((ULONG) 3) +#define PT_R4 ((ULONG) 4) +#define PT_DOUBLE ((ULONG) 5) +#define PT_CURRENCY ((ULONG) 6) +#define PT_APPTIME ((ULONG) 7) +#define PT_ERROR ((ULONG) 10) +#define PT_BOOLEAN ((ULONG) 11) +#define PT_OBJECT ((ULONG) 13) +#define PT_I8 ((ULONG) 20) +#define PT_STRING8 ((ULONG) 30) +#define PT_UNICODE ((ULONG) 31) +#define PT_SYSTIME ((ULONG) 64) +#define PT_CLSID ((ULONG) 72) +#define PT_BINARY ((ULONG) 258) + +#define PT_SHORT PT_I2 +#define PT_I4 PT_LONG +#define PT_FLOAT PT_R4 +#define PT_R8 PT_DOUBLE +#define PT_LONGLONG PT_I8 + +#if defined(UNICODE) +#define PT_TSTRING PT_UNICODE +#define PT_MV_TSTRING (MV_FLAG|PT_UNICODE) +#define LPSZ lpszW +#define LPPSZ lppszW +#define MVSZ MVszW +#else +#define PT_TSTRING PT_STRING8 +#define PT_MV_TSTRING (MV_FLAG|PT_STRING8) +#define LPSZ lpszA +#define LPPSZ lppszA +#define MVSZ MVszA +#endif + +#define PROP_TYPE_MASK ((ULONG)0x0000FFFF) +#define PROP_TYPE(ulPropTag) (((ULONG)(ulPropTag))&PROP_TYPE_MASK) +#define PROP_ID(ulPropTag) (((ULONG)(ulPropTag))>>16) +#define PROP_TAG(ulPropType,ulPropID) ((((ULONG)(ulPropID))<<16)|((ULONG)(ulPropType))) +#define PROP_ID_NULL 0 +#define PROP_ID_INVALID 0xFFFF +#define PR_NULL PROP_TAG(PT_NULL,PROP_ID_NULL) +#define CHANGE_PROP_TYPE(ulPropTag,ulPropType) (((ULONG)0xFFFF0000 & ulPropTag) | ulPropType) + +#define PT_MV_I2 (MV_FLAG|PT_I2) +#define PT_MV_LONG (MV_FLAG|PT_LONG) +#define PT_MV_R4 (MV_FLAG|PT_R4) +#define PT_MV_DOUBLE (MV_FLAG|PT_DOUBLE) +#define PT_MV_CURRENCY (MV_FLAG|PT_CURRENCY) +#define PT_MV_APPTIME (MV_FLAG|PT_APPTIME) +#define PT_MV_SYSTIME (MV_FLAG|PT_SYSTIME) +#define PT_MV_STRING8 (MV_FLAG|PT_STRING8) +#define PT_MV_BINARY (MV_FLAG|PT_BINARY) +#define PT_MV_UNICODE (MV_FLAG|PT_UNICODE) +#define PT_MV_CLSID (MV_FLAG|PT_CLSID) +#define PT_MV_I8 (MV_FLAG|PT_I8) + +#define PT_MV_SHORT PT_MV_I2 +#define PT_MV_I4 PT_MV_LONG +#define PT_MV_FLOAT PT_MV_R4 +#define PT_MV_R8 PT_MV_DOUBLE +#define PT_MV_LONGLONG PT_MV_I8 + +#define MV_INSTANCE 0x2000 +#define MVI_FLAG (MV_FLAG | MV_INSTANCE) +#define MVI_PROP(tag) ((tag) | MVI_FLAG) + + typedef struct _SPropTagArray { + ULONG cValues; + ULONG aulPropTag[MAPI_DIM]; + } SPropTagArray,*LPSPropTagArray; + +#define CbNewSPropTagArray(_ctag) (offsetof(SPropTagArray,aulPropTag) + (_ctag)*sizeof(ULONG)) +#define CbSPropTagArray(_lparray) (offsetof(SPropTagArray,aulPropTag) + (UINT)((_lparray)->cValues)*sizeof(ULONG)) +#define SizedSPropTagArray(_ctag,_name) struct _SPropTagArray_ ## _name { ULONG cValues; ULONG aulPropTag[_ctag]; } _name + + typedef struct _SPropValue SPropValue; + +#ifndef _tagCY_DEFINED +#define _tagCY_DEFINED +#define _CY_DEFINED + typedef union tagCY { + struct { + unsigned long Lo; + long Hi; + }; + LONGLONG int64; + } CY; +#endif + + typedef CY CURRENCY; + + typedef struct _SBinary { + ULONG cb; + LPBYTE lpb; + } SBinary,*LPSBinary; + + typedef struct _SShortArray { + ULONG cValues; + short int *lpi; + } SShortArray; + + typedef struct _SGuidArray { + ULONG cValues; + GUID *lpguid; + } SGuidArray; + + typedef struct _SRealArray { + ULONG cValues; + float *lpflt; + } SRealArray; + + typedef struct _SLongArray { + ULONG cValues; + LONG *lpl; + } SLongArray; + + typedef struct _SLargeIntegerArray { + ULONG cValues; + LARGE_INTEGER *lpli; + } SLargeIntegerArray; + + typedef struct _SDateTimeArray { + ULONG cValues; + FILETIME *lpft; + } SDateTimeArray; + + typedef struct _SAppTimeArray { + ULONG cValues; + double *lpat; + } SAppTimeArray; + + typedef struct _SCurrencyArray { + ULONG cValues; + CURRENCY *lpcur; + } SCurrencyArray; + + typedef struct _SBinaryArray { + ULONG cValues; + SBinary *lpbin; + } SBinaryArray; + + typedef struct _SDoubleArray { + ULONG cValues; + double *lpdbl; + } SDoubleArray; + + typedef struct _SWStringArray { + ULONG cValues; + LPWSTR *lppszW; + } SWStringArray; + + typedef struct _SLPSTRArray { + ULONG cValues; + LPSTR *lppszA; + } SLPSTRArray; + + typedef union _PV { + short int i; + LONG l; + ULONG ul; + float flt; + double dbl; + unsigned short int b; + CURRENCY cur; + double at; + FILETIME ft; + LPSTR lpszA; + SBinary bin; + LPWSTR lpszW; + LPGUID lpguid; + LARGE_INTEGER li; + SShortArray MVi; + SLongArray MVl; + SRealArray MVflt; + SDoubleArray MVdbl; + SCurrencyArray MVcur; + SAppTimeArray MVat; + SDateTimeArray MVft; + SBinaryArray MVbin; + SLPSTRArray MVszA; + SWStringArray MVszW; + SGuidArray MVguid; + SLargeIntegerArray MVli; + SCODE err; + LONG x; + } __UPV; + + typedef struct _SPropValue { + ULONG ulPropTag; + ULONG dwAlignPad; + union _PV Value; + } SPropValue,*LPSPropValue; + + typedef struct _SPropProblem { + ULONG ulIndex; + ULONG ulPropTag; + SCODE scode; + } SPropProblem,*LPSPropProblem; + + typedef struct _SPropProblemArray { + ULONG cProblem; + SPropProblem aProblem[MAPI_DIM]; + } SPropProblemArray,*LPSPropProblemArray; + +#define CbNewSPropProblemArray(_cprob) (offsetof(SPropProblemArray,aProblem) + (_cprob)*sizeof(SPropProblem)) +#define CbSPropProblemArray(_lparray) (offsetof(SPropProblemArray,aProblem) + (UINT) ((_lparray)->cProblem*sizeof(SPropProblem))) +#define SizedSPropProblemArray(_cprob,_name) struct _SPropProblemArray_ ## _name { ULONG cProblem; SPropProblem aProblem[_cprob]; } _name + + typedef SBinaryArray ENTRYLIST,*LPENTRYLIST; + + typedef struct { + ULONG cb; + BYTE abEntry[MAPI_DIM]; + } FLATENTRY,*LPFLATENTRY; + + typedef struct { + ULONG cEntries; + ULONG cbEntries; + BYTE abEntries[MAPI_DIM]; + } FLATENTRYLIST,*LPFLATENTRYLIST; + + typedef struct { + ULONG cb; + BYTE ab[MAPI_DIM]; + } MTSID,*LPMTSID; + + typedef struct { + ULONG cMTSIDs; + ULONG cbMTSIDs; + BYTE abMTSIDs[MAPI_DIM]; + } FLATMTSIDLIST,*LPFLATMTSIDLIST; + +#define CbNewFLATENTRY(_cb) (offsetof(FLATENTRY,abEntry) + (_cb)) +#define CbFLATENTRY(_lpentry) (offsetof(FLATENTRY,abEntry) + (_lpentry)->cb) +#define CbNewFLATENTRYLIST(_cb) (offsetof(FLATENTRYLIST,abEntries) + (_cb)) +#define CbFLATENTRYLIST(_lplist) (offsetof(FLATENTRYLIST,abEntries) + (_lplist)->cbEntries) +#define CbNewMTSID(_cb) (offsetof(MTSID,ab) + (_cb)) +#define CbMTSID(_lpentry) (offsetof(MTSID,ab) + (_lpentry)->cb) +#define CbNewFLATMTSIDLIST(_cb) (offsetof(FLATMTSIDLIST,abMTSIDs) + (_cb)) +#define CbFLATMTSIDLIST(_lplist) (offsetof(FLATMTSIDLIST,abMTSIDs) + (_lplist)->cbMTSIDs) + + typedef struct _ADRENTRY { + ULONG ulReserved1; + ULONG cValues; + LPSPropValue rgPropVals; + } ADRENTRY,*LPADRENTRY; + + typedef struct _ADRLIST { + ULONG cEntries; + ADRENTRY aEntries[MAPI_DIM]; + } ADRLIST,*LPADRLIST; + +#define CbNewADRLIST(_centries) (offsetof(ADRLIST,aEntries) + (_centries)*sizeof(ADRENTRY)) +#define CbADRLIST(_lpadrlist) (offsetof(ADRLIST,aEntries) + (UINT)(_lpadrlist)->cEntries*sizeof(ADRENTRY)) +#define SizedADRLIST(_centries,_name) struct _ADRLIST_ ## _name { ULONG cEntries; ADRENTRY aEntries[_centries]; } _name + + typedef struct _SRow { + ULONG ulAdrEntryPad; + ULONG cValues; + LPSPropValue lpProps; + } SRow,*LPSRow; + + typedef struct _SRowSet { + ULONG cRows; + SRow aRow[MAPI_DIM]; + } SRowSet,*LPSRowSet; + +#define CbNewSRowSet(_crow) (offsetof(SRowSet,aRow) + (_crow)*sizeof(SRow)) +#define CbSRowSet(_lprowset) (offsetof(SRowSet,aRow) + (UINT)((_lprowset)->cRows*sizeof(SRow))) +#define SizedSRowSet(_crow,_name) struct _SRowSet_ ## _name { ULONG cRows; SRow aRow[_crow]; } _name + + typedef SCODE (WINAPI ALLOCATEBUFFER)(ULONG cbSize,LPVOID *lppBuffer); + typedef SCODE (WINAPI ALLOCATEMORE)(ULONG cbSize,LPVOID lpObject,LPVOID *lppBuffer); + typedef ULONG (WINAPI FREEBUFFER)(LPVOID lpBuffer); + typedef ALLOCATEBUFFER *LPALLOCATEBUFFER; + typedef ALLOCATEMORE *LPALLOCATEMORE; + typedef FREEBUFFER *LPFREEBUFFER; + +#if defined(MAPI_IF) && (!defined(__cplusplus) || defined(CINTERFACE)) +#define DECLARE_MAPI_INTERFACE(iface) typedef struct iface##Vtbl iface##Vtbl,*iface; struct iface##Vtbl +#define DECLARE_MAPI_INTERFACE_(iface,baseiface) DECLARE_MAPI_INTERFACE(iface) +#define DECLARE_MAPI_INTERFACE_PTR(iface,piface) typedef struct iface##Vtbl iface##Vtbl,*iface,**piface; +#else +#define DECLARE_MAPI_INTERFACE(iface) DECLARE_INTERFACE(iface) +#define DECLARE_MAPI_INTERFACE_(iface,baseiface) DECLARE_INTERFACE_(iface,baseiface) +#ifdef __cplusplus +#define DECLARE_MAPI_INTERFACE_PTR(iface,piface) struct iface; typedef iface *piface +#else +#define DECLARE_MAPI_INTERFACE_PTR(iface,piface) typedef struct iface iface,*piface +#endif +#endif + +#define MAPIMETHOD(method) MAPIMETHOD_(HRESULT,method) +#define MAPIMETHOD_(type,method) STDMETHOD_(type,method) +#define MAPIMETHOD_DECLARE(type,method,prefix) STDMETHODIMP_(type) prefix##method +#define MAPIMETHOD_TYPEDEF(type,method,prefix) typedef type (WINAPI prefix##method##_METHOD) + +#define MAPI_IUNKNOWN_METHODS(IPURE) MAPIMETHOD(QueryInterface) (THIS_ REFIID riid,LPVOID *ppvObj) IPURE; MAPIMETHOD_(ULONG,AddRef) (THIS) IPURE; MAPIMETHOD_(ULONG,Release) (THIS) IPURE; +#undef IMPL +#define IMPL + + typedef const IID *LPCIID; + + DECLARE_MAPI_INTERFACE_PTR(IMsgStore,LPMDB); + DECLARE_MAPI_INTERFACE_PTR(IMAPIFolder,LPMAPIFOLDER); + DECLARE_MAPI_INTERFACE_PTR(IMessage,LPMESSAGE); + DECLARE_MAPI_INTERFACE_PTR(IAttach,LPATTACH); + DECLARE_MAPI_INTERFACE_PTR(IAddrBook,LPADRBOOK); + DECLARE_MAPI_INTERFACE_PTR(IABContainer,LPABCONT); + DECLARE_MAPI_INTERFACE_PTR(IMailUser,LPMAILUSER); + DECLARE_MAPI_INTERFACE_PTR(IDistList,LPDISTLIST); + DECLARE_MAPI_INTERFACE_PTR(IMAPIStatus,LPMAPISTATUS); + DECLARE_MAPI_INTERFACE_PTR(IMAPITable,LPMAPITABLE); + DECLARE_MAPI_INTERFACE_PTR(IProfSect,LPPROFSECT); + DECLARE_MAPI_INTERFACE_PTR(IMAPIProp,LPMAPIPROP); + DECLARE_MAPI_INTERFACE_PTR(IMAPIContainer,LPMAPICONTAINER); + DECLARE_MAPI_INTERFACE_PTR(IMAPIAdviseSink,LPMAPIADVISESINK); + DECLARE_MAPI_INTERFACE_PTR(IMAPIProgress,LPMAPIPROGRESS); + DECLARE_MAPI_INTERFACE_PTR(IProviderAdmin,LPPROVIDERADMIN); + + typedef struct _MAPIERROR { + ULONG ulVersion; + LPTSTR lpszError; + LPTSTR lpszComponent; + ULONG ulLowLevelError; + ULONG ulContext; + + } MAPIERROR,*LPMAPIERROR; + +#define fnevCriticalError ((ULONG) 0x00000001) +#define fnevNewMail ((ULONG) 0x00000002) +#define fnevObjectCreated ((ULONG) 0x00000004) +#define fnevObjectDeleted ((ULONG) 0x00000008) +#define fnevObjectModified ((ULONG) 0x00000010) +#define fnevObjectMoved ((ULONG) 0x00000020) +#define fnevObjectCopied ((ULONG) 0x00000040) +#define fnevSearchComplete ((ULONG) 0x00000080) +#define fnevTableModified ((ULONG) 0x00000100) +#define fnevStatusObjectModified ((ULONG) 0x00000200) +#define fnevReservedForMapi ((ULONG) 0x40000000) +#define fnevExtended ((ULONG) 0x80000000) + +#define TABLE_CHANGED 1 +#define TABLE_ERROR 2 +#define TABLE_ROW_ADDED 3 +#define TABLE_ROW_DELETED 4 +#define TABLE_ROW_MODIFIED 5 +#define TABLE_SORT_DONE 6 +#define TABLE_RESTRICT_DONE 7 +#define TABLE_SETCOL_DONE 8 +#define TABLE_RELOAD 9 + + typedef struct _ERROR_NOTIFICATION { + ULONG cbEntryID; + LPENTRYID lpEntryID; + SCODE scode; + ULONG ulFlags; + LPMAPIERROR lpMAPIError; + } ERROR_NOTIFICATION; + + typedef struct _NEWMAIL_NOTIFICATION { + ULONG cbEntryID; + LPENTRYID lpEntryID; + ULONG cbParentID; + LPENTRYID lpParentID; + ULONG ulFlags; + LPTSTR lpszMessageClass; + ULONG ulMessageFlags; + } NEWMAIL_NOTIFICATION; + + typedef struct _OBJECT_NOTIFICATION { + ULONG cbEntryID; + LPENTRYID lpEntryID; + ULONG ulObjType; + ULONG cbParentID; + LPENTRYID lpParentID; + ULONG cbOldID; + LPENTRYID lpOldID; + ULONG cbOldParentID; + LPENTRYID lpOldParentID; + LPSPropTagArray lpPropTagArray; + } OBJECT_NOTIFICATION; + + typedef struct _TABLE_NOTIFICATION { + ULONG ulTableEvent; + HRESULT hResult; + SPropValue propIndex; + SPropValue propPrior; + SRow row; + ULONG ulPad; + } TABLE_NOTIFICATION; + + typedef struct _EXTENDED_NOTIFICATION { + ULONG ulEvent; + ULONG cb; + LPBYTE pbEventParameters; + } EXTENDED_NOTIFICATION; + + typedef struct { + ULONG cbEntryID; + LPENTRYID lpEntryID; + ULONG cValues; + LPSPropValue lpPropVals; + } STATUS_OBJECT_NOTIFICATION; + + typedef struct _NOTIFICATION { + ULONG ulEventType; + ULONG ulAlignPad; + union { + ERROR_NOTIFICATION err; + NEWMAIL_NOTIFICATION newmail; + OBJECT_NOTIFICATION obj; + TABLE_NOTIFICATION tab; + EXTENDED_NOTIFICATION ext; + STATUS_OBJECT_NOTIFICATION statobj; + } info; + } NOTIFICATION,*LPNOTIFICATION; + +#define MAPI_IMAPIADVISESINK_METHODS(IPURE) MAPIMETHOD_(ULONG,OnNotify) (THIS_ ULONG cNotif,LPNOTIFICATION lpNotifications) IPURE; +#undef INTERFACE +#define INTERFACE IMAPIAdviseSink + DECLARE_MAPI_INTERFACE_(IMAPIAdviseSink,IUnknown) { + BEGIN_INTERFACE + MAPI_IUNKNOWN_METHODS(PURE) + MAPI_IMAPIADVISESINK_METHODS(PURE) + }; + + typedef long (WINAPI NOTIFCALLBACK) (LPVOID lpvContext,ULONG cNotification,LPNOTIFICATION lpNotifications); + typedef NOTIFCALLBACK *LPNOTIFCALLBACK; + +#define szMAPINotificationMsg "MAPI Notify window message" + +#define MAPI_TOP_LEVEL ((ULONG) 0x00000001) +#define MAPI_IMAPIPROGRESS_METHODS(IPURE) MAPIMETHOD(Progress) (THIS_ ULONG ulValue,ULONG ulCount,ULONG ulTotal) IPURE; MAPIMETHOD(GetFlags) (THIS_ ULONG *lpulFlags) IPURE; MAPIMETHOD(GetMax) (THIS_ ULONG *lpulMax) IPURE; MAPIMETHOD(GetMin) (THIS_ ULONG *lpulMin) IPURE; MAPIMETHOD(SetLimits) (THIS_ LPULONG lpulMin,LPULONG lpulMax,LPULONG lpulFlags) IPURE; + +#undef INTERFACE +#define INTERFACE IMAPIProgress + DECLARE_MAPI_INTERFACE_(IMAPIProgress,IUnknown) { + BEGIN_INTERFACE + MAPI_IUNKNOWN_METHODS(PURE) + MAPI_IMAPIPROGRESS_METHODS(PURE) + }; + +#define MAPI_ERROR_VERSION __MSABI_LONG(0x00000000) + +#define KEEP_OPEN_READONLY ((ULONG) 0x00000001) +#define KEEP_OPEN_READWRITE ((ULONG) 0x00000002) +#define FORCE_SAVE ((ULONG) 0x00000004) + +#define MAPI_CREATE ((ULONG) 0x00000002) +#define STREAM_APPEND ((ULONG) 0x00000004) + +#define MAPI_MOVE ((ULONG) 0x00000001) +#define MAPI_NOREPLACE ((ULONG) 0x00000002) +#define MAPI_DECLINE_OK ((ULONG) 0x00000004) + +#ifndef MAPI_DIALOG +#define MAPI_DIALOG ((ULONG) 0x00000008) +#endif + +#ifndef MAPI_USE_DEFAULT +#define MAPI_USE_DEFAULT 0x00000040 +#endif + +#define MAPI_NO_STRINGS ((ULONG) 0x00000001) +#define MAPI_NO_IDS ((ULONG) 0x00000002) + +#define MNID_ID 0 +#define MNID_STRING 1 + + typedef struct _MAPINAMEID { + LPGUID lpguid; + ULONG ulKind; + union { + LONG lID; + LPWSTR lpwstrName; + } Kind; + } MAPINAMEID,*LPMAPINAMEID; + +#define MAPI_IMAPIPROP_METHODS(IPURE) MAPIMETHOD(GetLastError) (THIS_ HRESULT hResult,ULONG ulFlags,LPMAPIERROR *lppMAPIError) IPURE; MAPIMETHOD(SaveChanges) (THIS_ ULONG ulFlags) IPURE; MAPIMETHOD(GetProps) (THIS_ LPSPropTagArray lpPropTagArray,ULONG ulFlags,ULONG *lpcValues,LPSPropValue *lppPropArray) IPURE; MAPIMETHOD(GetPropList) (THIS_ ULONG ulFlags,LPSPropTagArray *lppPropTagArray) IPURE; MAPIMETHOD(OpenProperty) (THIS_ ULONG ulPropTag,LPCIID lpiid,ULONG ulInterfaceOptions,ULONG ulFlags,LPUNKNOWN *lppUnk) IPURE; MAPIMETHOD(SetProps) (THIS_ ULONG cValues,LPSPropValue lpPropArray,LPSPropProblemArray *lppProblems) IPURE; MAPIMETHOD(DeleteProps) (THIS_ LPSPropTagArray lpPropTagArray,LPSPropProblemArray *lppProblems) IPURE; MAPIMETHOD(CopyTo) (THIS_ ULONG ciidExclude,LPCIID rgiidExclude,LPSPropTagArray lpExcludeProps,ULONG ulUIParam,LPMAPIPROGRESS lpProgress,LPCIID lpInterface,LPVOID lpDestObj,ULONG ulFlags,LPSPropProblemArray *lppProblems) IPURE; MAPIMETHOD(CopyProps) (THIS_ LPSPropTagArray lpIncludeProps,ULONG ulUIParam,LPMAPIPROGRESS lpProgress,LPCIID lpInterface,LPVOID lpDestObj,ULONG ulFlags,LPSPropProblemArray *lppProblems) IPURE; MAPIMETHOD(GetNamesFromIDs) (THIS_ LPSPropTagArray *lppPropTags,LPGUID lpPropSetGuid,ULONG ulFlags,ULONG *lpcPropNames,LPMAPINAMEID **lpppPropNames) IPURE; MAPIMETHOD(GetIDsFromNames) (THIS_ ULONG cPropNames,LPMAPINAMEID *lppPropNames,ULONG ulFlags,LPSPropTagArray *lppPropTags) IPURE; + +#undef INTERFACE +#define INTERFACE IMAPIProp + DECLARE_MAPI_INTERFACE_(IMAPIProp,IUnknown) { + BEGIN_INTERFACE + MAPI_IUNKNOWN_METHODS(PURE) + MAPI_IMAPIPROP_METHODS(PURE) + }; + +#define TBLSTAT_COMPLETE ((ULONG) 0) +#define TBLSTAT_QCHANGED ((ULONG) 7) +#define TBLSTAT_SORTING ((ULONG) 9) +#define TBLSTAT_SORT_ERROR ((ULONG) 10) +#define TBLSTAT_SETTING_COLS ((ULONG) 11) +#define TBLSTAT_SETCOL_ERROR ((ULONG) 13) +#define TBLSTAT_RESTRICTING ((ULONG) 14) +#define TBLSTAT_RESTRICT_ERROR ((ULONG) 15) + +#define TBLTYPE_SNAPSHOT ((ULONG) 0) +#define TBLTYPE_KEYSET ((ULONG) 1) +#define TBLTYPE_DYNAMIC ((ULONG) 2) + +#define TABLE_SORT_ASCEND ((ULONG) 0x00000000) +#define TABLE_SORT_DESCEND ((ULONG) 0x00000001) +#define TABLE_SORT_COMBINE ((ULONG) 0x00000002) + + typedef struct _SSortOrder { + ULONG ulPropTag; + ULONG ulOrder; + } SSortOrder,*LPSSortOrder; + + typedef struct _SSortOrderSet { + ULONG cSorts; + ULONG cCategories; + ULONG cExpanded; + SSortOrder aSort[MAPI_DIM]; + } SSortOrderSet,*LPSSortOrderSet; + +#define CbNewSSortOrderSet(_csort) (offsetof(SSortOrderSet,aSort) + (_csort)*sizeof(SSortOrder)) +#define CbSSortOrderSet(_lpset) (offsetof(SSortOrderSet,aSort) + (UINT)((_lpset)->cSorts*sizeof(SSortOrder))) +#define SizedSSortOrderSet(_csort,_name) struct _SSortOrderSet_ ## _name { ULONG cSorts; ULONG cCategories; ULONG cExpanded; SSortOrder aSort[_csort]; } _name + + typedef ULONG BOOKMARK; + +#define BOOKMARK_BEGINNING ((BOOKMARK) 0) +#define BOOKMARK_CURRENT ((BOOKMARK) 1) +#define BOOKMARK_END ((BOOKMARK) 2) + +#define FL_FULLSTRING ((ULONG) 0x00000000) +#define FL_SUBSTRING ((ULONG) 0x00000001) +#define FL_PREFIX ((ULONG) 0x00000002) + +#define FL_IGNORECASE ((ULONG) 0x00010000) +#define FL_IGNORENONSPACE ((ULONG) 0x00020000) +#define FL_LOOSE ((ULONG) 0x00040000) + + typedef struct _SRestriction *LPSRestriction; + +#define RES_AND ((ULONG) 0x00000000) +#define RES_OR ((ULONG) 0x00000001) +#define RES_NOT ((ULONG) 0x00000002) +#define RES_CONTENT ((ULONG) 0x00000003) +#define RES_PROPERTY ((ULONG) 0x00000004) +#define RES_COMPAREPROPS ((ULONG) 0x00000005) +#define RES_BITMASK ((ULONG) 0x00000006) +#define RES_SIZE ((ULONG) 0x00000007) +#define RES_EXIST ((ULONG) 0x00000008) +#define RES_SUBRESTRICTION ((ULONG) 0x00000009) +#define RES_COMMENT ((ULONG) 0x0000000A) + +#define RELOP_LT ((ULONG) 0) +#define RELOP_LE ((ULONG) 1) +#define RELOP_GT ((ULONG) 2) +#define RELOP_GE ((ULONG) 3) +#define RELOP_EQ ((ULONG) 4) +#define RELOP_NE ((ULONG) 5) +#define RELOP_RE ((ULONG) 6) + +#define BMR_EQZ ((ULONG) 0) +#define BMR_NEZ ((ULONG) 1) + + typedef struct _SAndRestriction { + ULONG cRes; + LPSRestriction lpRes; + } SAndRestriction; + + typedef struct _SOrRestriction { + ULONG cRes; + LPSRestriction lpRes; + } SOrRestriction; + + typedef struct _SNotRestriction { + ULONG ulReserved; + LPSRestriction lpRes; + } SNotRestriction; + + typedef struct _SContentRestriction { + ULONG ulFuzzyLevel; + ULONG ulPropTag; + LPSPropValue lpProp; + } SContentRestriction; + + typedef struct _SBitMaskRestriction { + ULONG relBMR; + ULONG ulPropTag; + ULONG ulMask; + } SBitMaskRestriction; + + typedef struct _SPropertyRestriction { + ULONG relop; + ULONG ulPropTag; + LPSPropValue lpProp; + } SPropertyRestriction; + + typedef struct _SComparePropsRestriction { + ULONG relop; + ULONG ulPropTag1; + ULONG ulPropTag2; + } SComparePropsRestriction; + + typedef struct _SSizeRestriction { + ULONG relop; + ULONG ulPropTag; + ULONG cb; + } SSizeRestriction; + + typedef struct _SExistRestriction { + ULONG ulReserved1; + ULONG ulPropTag; + ULONG ulReserved2; + } SExistRestriction; + + typedef struct _SSubRestriction { + ULONG ulSubObject; + LPSRestriction lpRes; + } SSubRestriction; + + typedef struct _SCommentRestriction { + ULONG cValues; + LPSRestriction lpRes; + LPSPropValue lpProp; + } SCommentRestriction; + + typedef struct _SRestriction { + ULONG rt; + union { + SComparePropsRestriction resCompareProps; + SAndRestriction resAnd; + SOrRestriction resOr; + SNotRestriction resNot; + SContentRestriction resContent; + SPropertyRestriction resProperty; + SBitMaskRestriction resBitMask; + SSizeRestriction resSize; + SExistRestriction resExist; + SSubRestriction resSub; + SCommentRestriction resComment; + } res; + } SRestriction; + +#define TBL_ALL_COLUMNS ((ULONG) 0x00000001) + +#define TBL_LEAF_ROW ((ULONG) 1) +#define TBL_EMPTY_CATEGORY ((ULONG) 2) +#define TBL_EXPANDED_CATEGORY ((ULONG) 3) +#define TBL_COLLAPSED_CATEGORY ((ULONG) 4) + +#define TBL_NOWAIT ((ULONG) 0x00000001) + +#define TBL_ASYNC ((ULONG) 0x00000001) +#define TBL_BATCH ((ULONG) 0x00000002) + +#define DIR_BACKWARD ((ULONG) 0x00000001) + +#define TBL_NOADVANCE ((ULONG) 0x00000001) + +#define MAPI_IMAPITABLE_METHODS(IPURE) MAPIMETHOD(GetLastError) (THIS_ HRESULT hResult,ULONG ulFlags,LPMAPIERROR *lppMAPIError) IPURE; MAPIMETHOD(Advise) (THIS_ ULONG ulEventMask,LPMAPIADVISESINK lpAdviseSink,ULONG *lpulConnection) IPURE; MAPIMETHOD(Unadvise) (THIS_ ULONG ulConnection) IPURE; MAPIMETHOD(GetStatus) (THIS_ ULONG *lpulTableStatus,ULONG *lpulTableType) IPURE; MAPIMETHOD(SetColumns) (THIS_ LPSPropTagArray lpPropTagArray,ULONG ulFlags) IPURE; MAPIMETHOD(QueryColumns) (THIS_ ULONG ulFlags,LPSPropTagArray *lpPropTagArray) IPURE; MAPIMETHOD(GetRowCount) (THIS_ ULONG ulFlags,ULONG *lpulCount) IPURE; MAPIMETHOD(SeekRow) (THIS_ BOOKMARK bkOrigin,LONG lRowCount,LONG *lplRowsSought) IPURE; MAPIMETHOD(SeekRowApprox) (THIS_ ULONG ulNumerator,ULONG ulDenominator) IPURE; MAPIMETHOD(QueryPosition) (THIS_ ULONG *lpulRow,ULONG *lpulNumerator,ULONG *lpulDenominator) IPURE; MAPIMETHOD(FindRow) (THIS_ LPSRestriction lpRestriction,BOOKMARK bkOrigin,ULONG ulFlags) IPURE; MAPIMETHOD(Restrict) (THIS_ LPSRestriction lpRestriction,ULONG ulFlags) IPURE; MAPIMETHOD(CreateBookmark) (THIS_ BOOKMARK *lpbkPosition) IPURE; MAPIMETHOD(FreeBookmark) (THIS_ BOOKMARK bkPosition) IPURE; MAPIMETHOD(SortTable) (THIS_ LPSSortOrderSet lpSortCriteria,ULONG ulFlags) IPURE; MAPIMETHOD(QuerySortOrder) (THIS_ LPSSortOrderSet *lppSortCriteria) IPURE; MAPIMETHOD(QueryRows) (THIS_ LONG lRowCount,ULONG ulFlags,LPSRowSet *lppRows) IPURE; MAPIMETHOD(Abort) (THIS) IPURE; MAPIMETHOD(ExpandRow) (THIS_ ULONG cbInstanceKey,LPBYTE pbInstanceKey,ULONG ulRowCount,ULONG ulFlags,LPSRowSet *lppRows,ULONG *lpulMoreRows) IPURE; MAPIMETHOD(CollapseRow) (THIS_ ULONG cbInstanceKey,LPBYTE pbInstanceKey,ULONG ulFlags,ULONG *lpulRowCount) IPURE; MAPIMETHOD(WaitForCompletion) (THIS_ ULONG ulFlags,ULONG ulTimeout,ULONG *lpulTableStatus) IPURE; MAPIMETHOD(GetCollapseState) (THIS_ ULONG ulFlags,ULONG cbInstanceKey,LPBYTE lpbInstanceKey,ULONG *lpcbCollapseState,LPBYTE *lppbCollapseState) IPURE; MAPIMETHOD(SetCollapseState) (THIS_ ULONG ulFlags,ULONG cbCollapseState,LPBYTE pbCollapseState,BOOKMARK *lpbkLocation) IPURE; + +#undef INTERFACE +#define INTERFACE IMAPITable + DECLARE_MAPI_INTERFACE_(IMAPITable,IUnknown) { + BEGIN_INTERFACE + MAPI_IUNKNOWN_METHODS(PURE) + MAPI_IMAPITABLE_METHODS(PURE) + }; + +#define PS_PROFILE_PROPERTIES_INIT { 0x98,0x15,0xAC,0x08,0xAA,0xB0,0x10,0x1A,0x8C,0x93,0x08,0x00,0x2B,0x2A,0x56,0xC2 } + +#define MAPI_IPROFSECT_METHODS(IPURE) + +#undef INTERFACE +#define INTERFACE IProfSect + DECLARE_MAPI_INTERFACE_(IProfSect,IMAPIProp) { + BEGIN_INTERFACE + MAPI_IUNKNOWN_METHODS(PURE) + MAPI_IMAPIPROP_METHODS(PURE) + MAPI_IPROFSECT_METHODS(PURE) + }; + +#define MAPI_STORE_PROVIDER ((ULONG) 33) +#define MAPI_AB ((ULONG) 34) +#define MAPI_AB_PROVIDER ((ULONG) 35) +#define MAPI_TRANSPORT_PROVIDER ((ULONG) 36) +#define MAPI_SPOOLER ((ULONG) 37) +#define MAPI_PROFILE_PROVIDER ((ULONG) 38) +#define MAPI_SUBSYSTEM ((ULONG) 39) +#define MAPI_HOOK_PROVIDER ((ULONG) 40) + +#define STATUS_VALIDATE_STATE ((ULONG) 0x00000001) +#define STATUS_SETTINGS_DIALOG ((ULONG) 0x00000002) +#define STATUS_CHANGE_PASSWORD ((ULONG) 0x00000004) +#define STATUS_FLUSH_QUEUES ((ULONG) 0x00000008) + +#define STATUS_DEFAULT_OUTBOUND ((ULONG) 0x00000001) +#define STATUS_DEFAULT_STORE ((ULONG) 0x00000002) +#define STATUS_PRIMARY_IDENTITY ((ULONG) 0x00000004) +#define STATUS_SIMPLE_STORE ((ULONG) 0x00000008) +#define STATUS_XP_PREFER_LAST ((ULONG) 0x00000010) +#define STATUS_NO_PRIMARY_IDENTITY ((ULONG) 0x00000020) +#define STATUS_NO_DEFAULT_STORE ((ULONG) 0x00000040) +#define STATUS_TEMP_SECTION ((ULONG) 0x00000080) +#define STATUS_OWN_STORE ((ULONG) 0x00000100) + +#define STATUS_NEED_IPM_TREE ((ULONG) 0x00000800) +#define STATUS_PRIMARY_STORE ((ULONG) 0x00001000) +#define STATUS_SECONDARY_STORE ((ULONG) 0x00002000) + +#define STATUS_AVAILABLE ((ULONG) 0x00000001) +#define STATUS_OFFLINE ((ULONG) 0x00000002) +#define STATUS_FAILURE ((ULONG) 0x00000004) + +#define STATUS_INBOUND_ENABLED ((ULONG) 0x00010000) +#define STATUS_INBOUND_ACTIVE ((ULONG) 0x00020000) +#define STATUS_INBOUND_FLUSH ((ULONG) 0x00040000) +#define STATUS_OUTBOUND_ENABLED ((ULONG) 0x00100000) +#define STATUS_OUTBOUND_ACTIVE ((ULONG) 0x00200000) +#define STATUS_OUTBOUND_FLUSH ((ULONG) 0x00400000) +#define STATUS_REMOTE_ACCESS ((ULONG) 0x00800000) + +#define SUPPRESS_UI ((ULONG) 0x00000001) +#define REFRESH_XP_HEADER_CACHE ((ULONG) 0x00010000) +#define PROCESS_XP_HEADER_CACHE ((ULONG) 0x00020000) +#define FORCE_XP_CONNECT ((ULONG) 0x00040000) +#define FORCE_XP_DISCONNECT ((ULONG) 0x00080000) +#define CONFIG_CHANGED ((ULONG) 0x00100000) +#define ABORT_XP_HEADER_OPERATION ((ULONG) 0x00200000) +#define SHOW_XP_SESSION_UI ((ULONG) 0x00400000) + +#define UI_READONLY ((ULONG) 0x00000001) + +#define FLUSH_UPLOAD ((ULONG) 0x00000002) +#define FLUSH_DOWNLOAD ((ULONG) 0x00000004) +#define FLUSH_FORCE ((ULONG) 0x00000008) +#define FLUSH_NO_UI ((ULONG) 0x00000010) +#define FLUSH_ASYNC_OK ((ULONG) 0x00000020) + +#define MAPI_IMAPISTATUS_METHODS(IPURE) MAPIMETHOD(ValidateState) (THIS_ ULONG ulUIParam,ULONG ulFlags) IPURE; MAPIMETHOD(SettingsDialog) (THIS_ ULONG ulUIParam,ULONG ulFlags) IPURE; MAPIMETHOD(ChangePassword) (THIS_ LPTSTR lpOldPass,LPTSTR lpNewPass,ULONG ulFlags) IPURE; MAPIMETHOD(FlushQueues) (THIS_ ULONG ulUIParam,ULONG cbTargetTransport,LPENTRYID lpTargetTransport,ULONG ulFlags) IPURE; + +#undef INTERFACE +#define INTERFACE IMAPIStatus + DECLARE_MAPI_INTERFACE_(IMAPIStatus,IMAPIProp) { + BEGIN_INTERFACE + MAPI_IUNKNOWN_METHODS(PURE) + MAPI_IMAPIPROP_METHODS(PURE) + MAPI_IMAPISTATUS_METHODS(PURE) + }; + +#define MAPI_BEST_ACCESS ((ULONG) 0x00000010) + +#define WAB_LOCAL_CONTAINERS 0x00100000 +#define WAB_PROFILE_CONTENTS 0x00200000 + +#define CONVENIENT_DEPTH ((ULONG) 0x00000001) + +#define SEARCH_RUNNING ((ULONG) 0x00000001) +#define SEARCH_REBUILD ((ULONG) 0x00000002) +#define SEARCH_RECURSIVE ((ULONG) 0x00000004) +#define SEARCH_FOREGROUND ((ULONG) 0x00000008) + +#define STOP_SEARCH ((ULONG) 0x00000001) +#define RESTART_SEARCH ((ULONG) 0x00000002) +#define RECURSIVE_SEARCH ((ULONG) 0x00000004) +#define SHALLOW_SEARCH ((ULONG) 0x00000008) +#define FOREGROUND_SEARCH ((ULONG) 0x00000010) +#define BACKGROUND_SEARCH ((ULONG) 0x00000020) + +#define MAPI_IMAPICONTAINER_METHODS(IPURE) MAPIMETHOD(GetContentsTable) (THIS_ ULONG ulFlags,LPMAPITABLE *lppTable) IPURE; MAPIMETHOD(GetHierarchyTable) (THIS_ ULONG ulFlags,LPMAPITABLE *lppTable) IPURE; MAPIMETHOD(OpenEntry) (THIS_ ULONG cbEntryID,LPENTRYID lpEntryID,LPCIID lpInterface,ULONG ulFlags,ULONG *lpulObjType,LPUNKNOWN *lppUnk) IPURE; MAPIMETHOD(SetSearchCriteria) (THIS_ LPSRestriction lpRestriction,LPENTRYLIST lpContainerList,ULONG ulSearchFlags) IPURE; MAPIMETHOD(GetSearchCriteria) (THIS_ ULONG ulFlags,LPSRestriction *lppRestriction,LPENTRYLIST *lppContainerList,ULONG *lpulSearchState)IPURE; + +#undef INTERFACE +#define INTERFACE IMAPIContainer + DECLARE_MAPI_INTERFACE_(IMAPIContainer,IMAPIProp) { + BEGIN_INTERFACE + MAPI_IUNKNOWN_METHODS(PURE) + MAPI_IMAPIPROP_METHODS(PURE) + MAPI_IMAPICONTAINER_METHODS(PURE) + }; + + typedef struct _flaglist { + ULONG cFlags; + ULONG ulFlag[MAPI_DIM]; + } FlagList,*LPFlagList; + +#define AB_RECIPIENTS ((ULONG) 0x00000001) +#define AB_SUBCONTAINERS ((ULONG) 0x00000002) +#define AB_MODIFIABLE ((ULONG) 0x00000004) +#define AB_UNMODIFIABLE ((ULONG) 0x00000008) +#define AB_FIND_ON_OPEN ((ULONG) 0x00000010) +#define AB_NOT_DEFAULT ((ULONG) 0x00000020) + +#define CREATE_CHECK_DUP_STRICT ((ULONG) 0x00000001) +#define CREATE_CHECK_DUP_LOOSE ((ULONG) 0x00000002) +#define CREATE_REPLACE ((ULONG) 0x00000004) +#define CREATE_MERGE ((ULONG) 0x00000008) + +#define WAB_IGNORE_PROFILES 0x00800000 + +#define MAPI_UNRESOLVED ((ULONG) 0x00000000) +#define MAPI_AMBIGUOUS ((ULONG) 0x00000001) +#define MAPI_RESOLVED ((ULONG) 0x00000002) + +#define MAPI_IABCONTAINER_METHODS(IPURE) MAPIMETHOD(CreateEntry) (THIS_ ULONG cbEntryID,LPENTRYID lpEntryID,ULONG ulCreateFlags,LPMAPIPROP *lppMAPIPropEntry) IPURE; MAPIMETHOD(CopyEntries) (THIS_ LPENTRYLIST lpEntries,ULONG ulUIParam,LPMAPIPROGRESS lpProgress,ULONG ulFlags) IPURE; MAPIMETHOD(DeleteEntries) (THIS_ LPENTRYLIST lpEntries,ULONG ulFlags) IPURE; MAPIMETHOD(ResolveNames) (THIS_ LPSPropTagArray lpPropTagArray,ULONG ulFlags,LPADRLIST lpAdrList,LPFlagList lpFlagList) IPURE; + +#undef INTERFACE +#define INTERFACE IABContainer + DECLARE_MAPI_INTERFACE_(IABContainer,IMAPIContainer) { + BEGIN_INTERFACE + MAPI_IUNKNOWN_METHODS(PURE) + MAPI_IMAPIPROP_METHODS(PURE) + MAPI_IMAPICONTAINER_METHODS(PURE) + MAPI_IABCONTAINER_METHODS(PURE) + }; + +#define MAPI_SEND_NO_RICH_INFO ((ULONG) 0x00010000) + +#define MAPI_DIAG(_code) ((LONG) _code) +#define MAPI_DIAG_NO_DIAGNOSTIC MAPI_DIAG(-1) +#define MAPI_DIAG_OR_NAME_UNRECOGNIZED MAPI_DIAG(0) +#define MAPI_DIAG_OR_NAME_AMBIGUOUS MAPI_DIAG(1) +#define MAPI_DIAG_MTS_CONGESTED MAPI_DIAG(2) +#define MAPI_DIAG_LOOP_DETECTED MAPI_DIAG(3) +#define MAPI_DIAG_RECIPIENT_UNAVAILABLE MAPI_DIAG(4) +#define MAPI_DIAG_MAXIMUM_TIME_EXPIRED MAPI_DIAG(5) +#define MAPI_DIAG_EITS_UNSUPPORTED MAPI_DIAG(6) +#define MAPI_DIAG_CONTENT_TOO_LONG MAPI_DIAG(7) +#define MAPI_DIAG_IMPRACTICAL_TO_CONVERT MAPI_DIAG(8) +#define MAPI_DIAG_PROHIBITED_TO_CONVERT MAPI_DIAG(9) +#define MAPI_DIAG_CONVERSION_UNSUBSCRIBED MAPI_DIAG(10) +#define MAPI_DIAG_PARAMETERS_INVALID MAPI_DIAG(11) +#define MAPI_DIAG_CONTENT_SYNTAX_IN_ERROR MAPI_DIAG(12) +#define MAPI_DIAG_LENGTH_CONSTRAINT_VIOLATD MAPI_DIAG(13) +#define MAPI_DIAG_NUMBER_CONSTRAINT_VIOLATD MAPI_DIAG(14) +#define MAPI_DIAG_CONTENT_TYPE_UNSUPPORTED MAPI_DIAG(15) +#define MAPI_DIAG_TOO_MANY_RECIPIENTS MAPI_DIAG(16) +#define MAPI_DIAG_NO_BILATERAL_AGREEMENT MAPI_DIAG(17) +#define MAPI_DIAG_CRITICAL_FUNC_UNSUPPORTED MAPI_DIAG(18) +#define MAPI_DIAG_CONVERSION_LOSS_PROHIB MAPI_DIAG(19) +#define MAPI_DIAG_LINE_TOO_LONG MAPI_DIAG(20) +#define MAPI_DIAG_PAGE_TOO_LONG MAPI_DIAG(21) +#define MAPI_DIAG_PICTORIAL_SYMBOL_LOST MAPI_DIAG(22) +#define MAPI_DIAG_PUNCTUATION_SYMBOL_LOST MAPI_DIAG(23) +#define MAPI_DIAG_ALPHABETIC_CHARACTER_LOST MAPI_DIAG(24) +#define MAPI_DIAG_MULTIPLE_INFO_LOSSES MAPI_DIAG(25) +#define MAPI_DIAG_REASSIGNMENT_PROHIBITED MAPI_DIAG(26) +#define MAPI_DIAG_REDIRECTION_LOOP_DETECTED MAPI_DIAG(27) +#define MAPI_DIAG_EXPANSION_PROHIBITED MAPI_DIAG(28) +#define MAPI_DIAG_SUBMISSION_PROHIBITED MAPI_DIAG(29) +#define MAPI_DIAG_EXPANSION_FAILED MAPI_DIAG(30) +#define MAPI_DIAG_RENDITION_UNSUPPORTED MAPI_DIAG(31) +#define MAPI_DIAG_MAIL_ADDRESS_INCORRECT MAPI_DIAG(32) +#define MAPI_DIAG_MAIL_OFFICE_INCOR_OR_INVD MAPI_DIAG(33) +#define MAPI_DIAG_MAIL_ADDRESS_INCOMPLETE MAPI_DIAG(34) +#define MAPI_DIAG_MAIL_RECIPIENT_UNKNOWN MAPI_DIAG(35) +#define MAPI_DIAG_MAIL_RECIPIENT_DECEASED MAPI_DIAG(36) +#define MAPI_DIAG_MAIL_ORGANIZATION_EXPIRED MAPI_DIAG(37) +#define MAPI_DIAG_MAIL_REFUSED MAPI_DIAG(38) +#define MAPI_DIAG_MAIL_UNCLAIMED MAPI_DIAG(39) +#define MAPI_DIAG_MAIL_RECIPIENT_MOVED MAPI_DIAG(40) +#define MAPI_DIAG_MAIL_RECIPIENT_TRAVELLING MAPI_DIAG(41) +#define MAPI_DIAG_MAIL_RECIPIENT_DEPARTED MAPI_DIAG(42) +#define MAPI_DIAG_MAIL_NEW_ADDRESS_UNKNOWN MAPI_DIAG(43) +#define MAPI_DIAG_MAIL_FORWARDING_UNWANTED MAPI_DIAG(44) +#define MAPI_DIAG_MAIL_FORWARDING_PROHIB MAPI_DIAG(45) +#define MAPI_DIAG_SECURE_MESSAGING_ERROR MAPI_DIAG(46) +#define MAPI_DIAG_DOWNGRADING_IMPOSSIBLE MAPI_DIAG(47) + +#define MAPI_IMAILUSER_METHODS(IPURE) + +#undef INTERFACE +#define INTERFACE IMailUser + DECLARE_MAPI_INTERFACE_(IMailUser,IMAPIProp) { + BEGIN_INTERFACE + MAPI_IUNKNOWN_METHODS(PURE) + MAPI_IMAPIPROP_METHODS(PURE) + MAPI_IMAILUSER_METHODS(PURE) + }; + +#define MAPI_IDISTLIST_METHODS(IPURE) MAPIMETHOD(CreateEntry) (THIS_ ULONG cbEntryID,LPENTRYID lpEntryID,ULONG ulCreateFlags,LPMAPIPROP *lppMAPIPropEntry) IPURE; MAPIMETHOD(CopyEntries) (THIS_ LPENTRYLIST lpEntries,ULONG ulUIParam,LPMAPIPROGRESS lpProgress,ULONG ulFlags) IPURE; MAPIMETHOD(DeleteEntries) (THIS_ LPENTRYLIST lpEntries,ULONG ulFlags) IPURE; MAPIMETHOD(ResolveNames) (THIS_ LPSPropTagArray lpPropTagArray,ULONG ulFlags,LPADRLIST lpAdrList,LPFlagList lpFlagList) IPURE; + +#undef INTERFACE +#define INTERFACE IDistList + DECLARE_MAPI_INTERFACE_(IDistList,IMAPIContainer) { + BEGIN_INTERFACE + MAPI_IUNKNOWN_METHODS(PURE) + MAPI_IMAPIPROP_METHODS(PURE) + MAPI_IMAPICONTAINER_METHODS(PURE) + MAPI_IDISTLIST_METHODS(PURE) + }; + +#define FOLDER_ROOT ((ULONG) 0x00000000) +#define FOLDER_GENERIC ((ULONG) 0x00000001) +#define FOLDER_SEARCH ((ULONG) 0x00000002) + +#define MESSAGE_MOVE ((ULONG) 0x00000001) +#define MESSAGE_DIALOG ((ULONG) 0x00000002) + +#define OPEN_IF_EXISTS ((ULONG) 0x00000001) + +#define DEL_MESSAGES ((ULONG) 0x00000001) +#define FOLDER_DIALOG ((ULONG) 0x00000002) +#define DEL_FOLDERS ((ULONG) 0x00000004) + +#define DEL_ASSOCIATED ((ULONG) 0x00000008) + +#define FOLDER_MOVE ((ULONG) 0x00000001) + +#define COPY_SUBFOLDERS ((ULONG) 0x00000010) + +#define GENERATE_RECEIPT_ONLY ((ULONG) 0x00000010) + +#define MSGSTATUS_HIGHLIGHTED ((ULONG) 0x00000001) +#define MSGSTATUS_TAGGED ((ULONG) 0x00000002) +#define MSGSTATUS_HIDDEN ((ULONG) 0x00000004) +#define MSGSTATUS_DELMARKED ((ULONG) 0x00000008) + +#define MSGSTATUS_REMOTE_DOWNLOAD ((ULONG) 0x00001000) +#define MSGSTATUS_REMOTE_DELETE ((ULONG) 0x00002000) + +#define RECURSIVE_SORT ((ULONG) 0x00000002) + +#define FLDSTATUS_HIGHLIGHTED ((ULONG) 0x00000001) +#define FLDSTATUS_TAGGED ((ULONG) 0x00000002) +#define FLDSTATUS_HIDDEN ((ULONG) 0x00000004) +#define FLDSTATUS_DELMARKED ((ULONG) 0x00000008) + +#define MAPI_IMAPIFOLDER_METHODS(IPURE) MAPIMETHOD(CreateMessage) (THIS_ LPCIID lpInterface,ULONG ulFlags,LPMESSAGE *lppMessage) IPURE; MAPIMETHOD(CopyMessages) (THIS_ LPENTRYLIST lpMsgList,LPCIID lpInterface,LPVOID lpDestFolder,ULONG ulUIParam,LPMAPIPROGRESS lpProgress,ULONG ulFlags) IPURE; MAPIMETHOD(DeleteMessages) (THIS_ LPENTRYLIST lpMsgList,ULONG ulUIParam,LPMAPIPROGRESS lpProgress,ULONG ulFlags) IPURE; MAPIMETHOD(CreateFolder) (THIS_ ULONG ulFolderType,LPTSTR lpszFolderName,LPTSTR lpszFolderComment,LPCIID lpInterface,ULONG ulFlags,LPMAPIFOLDER *lppFolder) IPURE; MAPIMETHOD(CopyFolder) (THIS_ ULONG cbEntryID,LPENTRYID lpEntryID,LPCIID lpInterface,LPVOID lpDestFolder,LPTSTR lpszNewFolderName,ULONG ulUIParam,LPMAPIPROGRESS lpProgress,ULONG ulFlags) IPURE; MAPIMETHOD(DeleteFolder) (THIS_ ULONG cbEntryID,LPENTRYID lpEntryID,ULONG ulUIParam,LPMAPIPROGRESS lpProgress,ULONG ulFlags) IPURE; MAPIMETHOD(SetReadFlags) (THIS_ LPENTRYLIST lpMsgList,ULONG ulUIParam,LPMAPIPROGRESS lpProgress,ULONG ulFlags) IPURE; MAPIMETHOD(GetMessageStatus) (THIS_ ULONG cbEntryID,LPENTRYID lpEntryID,ULONG ulFlags,ULONG *lpulMessageStatus) IPURE; MAPIMETHOD(SetMessageStatus) (THIS_ ULONG cbEntryID,LPENTRYID lpEntryID,ULONG ulNewStatus,ULONG ulNewStatusMask,ULONG *lpulOldStatus) IPURE; MAPIMETHOD(SaveContentsSort) (THIS_ LPSSortOrderSet lpSortCriteria,ULONG ulFlags) IPURE; MAPIMETHOD(EmptyFolder) (THIS_ ULONG ulUIParam,LPMAPIPROGRESS lpProgress,ULONG ulFlags) IPURE; + +#undef INTERFACE +#define INTERFACE IMAPIFolder + DECLARE_MAPI_INTERFACE_(IMAPIFolder,IMAPIContainer) { + BEGIN_INTERFACE + MAPI_IUNKNOWN_METHODS(PURE) + MAPI_IMAPIPROP_METHODS(PURE) + MAPI_IMAPICONTAINER_METHODS(PURE) + MAPI_IMAPIFOLDER_METHODS(PURE) + }; + +#define STORE_ENTRYID_UNIQUE ((ULONG) 0x00000001) +#define STORE_READONLY ((ULONG) 0x00000002) +#define STORE_SEARCH_OK ((ULONG) 0x00000004) +#define STORE_MODIFY_OK ((ULONG) 0x00000008) +#define STORE_CREATE_OK ((ULONG) 0x00000010) +#define STORE_ATTACH_OK ((ULONG) 0x00000020) +#define STORE_OLE_OK ((ULONG) 0x00000040) +#define STORE_SUBMIT_OK ((ULONG) 0x00000080) +#define STORE_NOTIFY_OK ((ULONG) 0x00000100) +#define STORE_MV_PROPS_OK ((ULONG) 0x00000200) +#define STORE_CATEGORIZE_OK ((ULONG) 0x00000400) +#define STORE_RTF_OK ((ULONG) 0x00000800) +#define STORE_RESTRICTION_OK ((ULONG) 0x00001000) +#define STORE_SORT_OK ((ULONG) 0x00002000) + +#define STORE_HAS_SEARCHES ((ULONG) 0x01000000) + +#define LOGOFF_NO_WAIT ((ULONG) 0x00000001) +#define LOGOFF_ORDERLY ((ULONG) 0x00000002) +#define LOGOFF_PURGE ((ULONG) 0x00000004) +#define LOGOFF_ABORT ((ULONG) 0x00000008) +#define LOGOFF_QUIET ((ULONG) 0x00000010) + +#define LOGOFF_COMPLETE ((ULONG) 0x00010000) +#define LOGOFF_INBOUND ((ULONG) 0x00020000) +#define LOGOFF_OUTBOUND ((ULONG) 0x00040000) +#define LOGOFF_OUTBOUND_QUEUE ((ULONG) 0x00080000) + +#define MSG_LOCKED ((ULONG) 0x00000001) +#define MSG_UNLOCKED ((ULONG) 0x00000000) + +#define FOLDER_IPM_SUBTREE_VALID ((ULONG) 0x00000001) +#define FOLDER_IPM_INBOX_VALID ((ULONG) 0x00000002) +#define FOLDER_IPM_OUTBOX_VALID ((ULONG) 0x00000004) +#define FOLDER_IPM_WASTEBASKET_VALID ((ULONG) 0x00000008) +#define FOLDER_IPM_SENTMAIL_VALID ((ULONG) 0x00000010) +#define FOLDER_VIEWS_VALID ((ULONG) 0x00000020) +#define FOLDER_COMMON_VIEWS_VALID ((ULONG) 0x00000040) +#define FOLDER_FINDER_VALID ((ULONG) 0x00000080) + +#define MAPI_IMSGSTORE_METHODS(IPURE) MAPIMETHOD(Advise) (THIS_ ULONG cbEntryID,LPENTRYID lpEntryID,ULONG ulEventMask,LPMAPIADVISESINK lpAdviseSink,ULONG *lpulConnection) IPURE; MAPIMETHOD(Unadvise) (THIS_ ULONG ulConnection) IPURE; MAPIMETHOD(CompareEntryIDs) (THIS_ ULONG cbEntryID1,LPENTRYID lpEntryID1,ULONG cbEntryID2,LPENTRYID lpEntryID2,ULONG ulFlags,ULONG *lpulResult) IPURE; MAPIMETHOD(OpenEntry) (THIS_ ULONG cbEntryID,LPENTRYID lpEntryID,LPCIID lpInterface,ULONG ulFlags,ULONG *lpulObjType,LPUNKNOWN *lppUnk) IPURE; MAPIMETHOD(SetReceiveFolder) (THIS_ LPTSTR lpszMessageClass,ULONG ulFlags,ULONG cbEntryID,LPENTRYID lpEntryID) IPURE; MAPIMETHOD(GetReceiveFolder) (THIS_ LPTSTR lpszMessageClass,ULONG ulFlags,ULONG *lpcbEntryID,LPENTRYID *lppEntryID,LPTSTR *lppszExplicitClass) IPURE; MAPIMETHOD(GetReceiveFolderTable) (THIS_ ULONG ulFlags,LPMAPITABLE *lppTable) IPURE; MAPIMETHOD(StoreLogoff) (THIS_ ULONG *lpulFlags) IPURE; MAPIMETHOD(AbortSubmit) (THIS_ ULONG cbEntryID,LPENTRYID lpEntryID,ULONG ulFlags) IPURE; MAPIMETHOD(GetOutgoingQueue) (THIS_ ULONG ulFlags,LPMAPITABLE *lppTable) IPURE; MAPIMETHOD(SetLockState) (THIS_ LPMESSAGE lpMessage,ULONG ulLockState) IPURE; MAPIMETHOD(FinishedMsg) (THIS_ ULONG ulFlags,ULONG cbEntryID,LPENTRYID lpEntryID) IPURE; MAPIMETHOD(NotifyNewMail) (THIS_ LPNOTIFICATION lpNotification) IPURE; + +#undef INTERFACE +#define INTERFACE IMsgStore + DECLARE_MAPI_INTERFACE_(IMsgStore,IMAPIProp) { + BEGIN_INTERFACE + MAPI_IUNKNOWN_METHODS(PURE) + MAPI_IMAPIPROP_METHODS(PURE) + MAPI_IMSGSTORE_METHODS(PURE) + }; + +#define FORCE_SUBMIT ((ULONG) 0x00000001) + +#define MSGFLAG_READ ((ULONG) 0x00000001) +#define MSGFLAG_UNMODIFIED ((ULONG) 0x00000002) +#define MSGFLAG_SUBMIT ((ULONG) 0x00000004) +#define MSGFLAG_UNSENT ((ULONG) 0x00000008) +#define MSGFLAG_HASATTACH ((ULONG) 0x00000010) +#define MSGFLAG_FROMME ((ULONG) 0x00000020) +#define MSGFLAG_ASSOCIATED ((ULONG) 0x00000040) +#define MSGFLAG_RESEND ((ULONG) 0x00000080) +#define MSGFLAG_RN_PENDING ((ULONG) 0x00000100) +#define MSGFLAG_NRN_PENDING ((ULONG) 0x00000200) + +#define SUBMITFLAG_LOCKED ((ULONG) 0x00000001) +#define SUBMITFLAG_PREPROCESS ((ULONG) 0x00000002) + +#define MODRECIP_ADD ((ULONG) 0x00000002) +#define MODRECIP_MODIFY ((ULONG) 0x00000004) +#define MODRECIP_REMOVE ((ULONG) 0x00000008) + +#define SUPPRESS_RECEIPT ((ULONG) 0x00000001) +#define CLEAR_READ_FLAG ((ULONG) 0x00000004) + +#define GENERATE_RECEIPT_ONLY ((ULONG) 0x00000010) +#define CLEAR_RN_PENDING ((ULONG) 0x00000020) +#define CLEAR_NRN_PENDING ((ULONG) 0x00000040) + +#define ATTACH_DIALOG ((ULONG) 0x00000001) + +#define SECURITY_SIGNED ((ULONG) 0x00000001) +#define SECURITY_ENCRYPTED ((ULONG) 0x00000002) + +#define PRIO_URGENT ((long) 1) +#define PRIO_NORMAL ((long) 0) +#define PRIO_NONURGENT ((long) -1) + +#define SENSITIVITY_NONE ((ULONG) 0x00000000) +#define SENSITIVITY_PERSONAL ((ULONG) 0x00000001) +#define SENSITIVITY_PRIVATE ((ULONG) 0x00000002) +#define SENSITIVITY_COMPANY_CONFIDENTIAL ((ULONG) 0x00000003) + +#define IMPORTANCE_LOW ((long) 0) +#define IMPORTANCE_NORMAL ((long) 1) +#define IMPORTANCE_HIGH ((long) 2) + +#define MAPI_IMESSAGE_METHODS(IPURE) MAPIMETHOD(GetAttachmentTable) (THIS_ ULONG ulFlags,LPMAPITABLE *lppTable) IPURE; MAPIMETHOD(OpenAttach) (THIS_ ULONG ulAttachmentNum,LPCIID lpInterface,ULONG ulFlags,LPATTACH *lppAttach) IPURE; MAPIMETHOD(CreateAttach) (THIS_ LPCIID lpInterface,ULONG ulFlags,ULONG *lpulAttachmentNum,LPATTACH *lppAttach) IPURE; MAPIMETHOD(DeleteAttach) (THIS_ ULONG ulAttachmentNum,ULONG ulUIParam,LPMAPIPROGRESS lpProgress,ULONG ulFlags) IPURE; MAPIMETHOD(GetRecipientTable) (THIS_ ULONG ulFlags,LPMAPITABLE *lppTable) IPURE; MAPIMETHOD(ModifyRecipients) (THIS_ ULONG ulFlags,LPADRLIST lpMods) IPURE; MAPIMETHOD(SubmitMessage) (THIS_ ULONG ulFlags) IPURE; MAPIMETHOD(SetReadFlag) (THIS_ ULONG ulFlags) IPURE; +#undef INTERFACE +#define INTERFACE IMessage + DECLARE_MAPI_INTERFACE_(IMessage,IMAPIProp) { + BEGIN_INTERFACE + MAPI_IUNKNOWN_METHODS(PURE) + MAPI_IMAPIPROP_METHODS(PURE) + MAPI_IMESSAGE_METHODS(PURE) + }; + +#define NO_ATTACHMENT ((ULONG) 0x00000000) +#define ATTACH_BY_VALUE ((ULONG) 0x00000001) +#define ATTACH_BY_REFERENCE ((ULONG) 0x00000002) +#define ATTACH_BY_REF_RESOLVE ((ULONG) 0x00000003) +#define ATTACH_BY_REF_ONLY ((ULONG) 0x00000004) +#define ATTACH_EMBEDDED_MSG ((ULONG) 0x00000005) +#define ATTACH_OLE ((ULONG) 0x00000006) + +#define MAPI_IATTACH_METHODS(IPURE) + +#undef INTERFACE +#define INTERFACE IAttach + DECLARE_MAPI_INTERFACE_(IAttach,IMAPIProp) { + BEGIN_INTERFACE + MAPI_IUNKNOWN_METHODS(PURE) + MAPI_IMAPIPROP_METHODS(PURE) + MAPI_IATTACH_METHODS(PURE) + }; + +#define GET_ADRPARM_VERSION(ulFlags) (((ULONG)ulFlags) & 0xF0000000) +#define SET_ADRPARM_VERSION(ulFlags,ulVersion) (((ULONG)ulVersion) | (((ULONG)ulFlags) & 0x0FFFFFFF)) + +#define ADRPARM_HELP_CTX ((ULONG) 0x00000000) + +#define DIALOG_MODAL ((ULONG) 0x00000001) +#define DIALOG_SDI ((ULONG) 0x00000002) +#define DIALOG_OPTIONS ((ULONG) 0x00000004) +#define ADDRESS_ONE ((ULONG) 0x00000008) +#define AB_SELECTONLY ((ULONG) 0x00000010) +#define AB_RESOLVE ((ULONG) 0x00000020) + +#define DT_MAILUSER ((ULONG) 0x00000000) +#define DT_DISTLIST ((ULONG) 0x00000001) +#define DT_FORUM ((ULONG) 0x00000002) +#define DT_AGENT ((ULONG) 0x00000003) +#define DT_ORGANIZATION ((ULONG) 0x00000004) +#define DT_PRIVATE_DISTLIST ((ULONG) 0x00000005) +#define DT_REMOTE_MAILUSER ((ULONG) 0x00000006) + +#define DT_MODIFIABLE ((ULONG) 0x00010000) +#define DT_GLOBAL ((ULONG) 0x00020000) +#define DT_LOCAL ((ULONG) 0x00030000) +#define DT_WAN ((ULONG) 0x00040000) +#define DT_NOT_SPECIFIC ((ULONG) 0x00050000) + +#define DT_FOLDER ((ULONG) 0x01000000) +#define DT_FOLDER_LINK ((ULONG) 0x02000000) + + typedef WINBOOL (WINAPI ACCELERATEABSDI)(ULONG ulUIParam,LPVOID lpvmsg); + typedef ACCELERATEABSDI *LPFNABSDI; + typedef void (WINAPI DISMISSMODELESS)(ULONG ulUIParam,LPVOID lpvContext); + typedef DISMISSMODELESS *LPFNDISMISS; + typedef SCODE (WINAPI *LPFNBUTTON)(ULONG ulUIParam,LPVOID lpvContext,ULONG cbEntryID,LPENTRYID lpSelection,ULONG ulFlags); + + typedef struct _ADRPARM { + ULONG cbABContEntryID; + LPENTRYID lpABContEntryID; + ULONG ulFlags; + LPVOID lpReserved; + ULONG ulHelpContext; + LPTSTR lpszHelpFileName; + LPFNABSDI lpfnABSDI; + LPFNDISMISS lpfnDismiss; + LPVOID lpvDismissContext; + LPTSTR lpszCaption; + LPTSTR lpszNewEntryTitle; + LPTSTR lpszDestWellsTitle; + ULONG cDestFields; + ULONG nDestFieldFocus; + LPTSTR *lppszDestTitles; + ULONG *lpulDestComps; + LPSRestriction lpContRestriction; + LPSRestriction lpHierRestriction; + } ADRPARM,*LPADRPARM; + +#define MAPI_ONE_OFF_NO_RICH_INFO 0x0001 +#define MAPI_DEFERRED_ERRORS ((ULONG) 0x00000008) +#define MAPI_ASSOCIATED ((ULONG) 0x00000040) + +#define MDB_NO_DIALOG ((ULONG) 0x00000001) +#define MDB_WRITE ((ULONG) 0x00000004) + +#define MDB_TEMPORARY ((ULONG) 0x00000020) +#define MDB_NO_MAIL ((ULONG) 0x00000080) + +#define AB_NO_DIALOG ((ULONG) 0x00000001) + +#define MAPI_ENABLED ((ULONG) 0x00000000) +#define MAPI_DISABLED ((ULONG) 0x00000001) + +#define MAPI_IMAPICONTROL_METHODS(IPURE) MAPIMETHOD(GetLastError) (THIS_ HRESULT hResult,ULONG ulFlags,LPMAPIERROR *lppMAPIError) IPURE; MAPIMETHOD(Activate) (THIS_ ULONG ulFlags,ULONG ulUIParam) IPURE; MAPIMETHOD(GetState) (THIS_ ULONG ulFlags,ULONG *lpulState) IPURE; +#undef INTERFACE +#define INTERFACE IMAPIControl + DECLARE_MAPI_INTERFACE_(IMAPIControl,IUnknown) { + BEGIN_INTERFACE + MAPI_IUNKNOWN_METHODS(PURE) + MAPI_IMAPICONTROL_METHODS(PURE) + }; + + DECLARE_MAPI_INTERFACE_PTR(IMAPIControl,LPMAPICONTROL); + +#define DT_MULTILINE ((ULONG) 0x00000001) +#define DT_EDITABLE ((ULONG) 0x00000002) +#define DT_REQUIRED ((ULONG) 0x00000004) +#define DT_SET_IMMEDIATE ((ULONG) 0x00000008) +#define DT_PASSWORD_EDIT ((ULONG) 0x00000010) +#define DT_ACCEPT_DBCS ((ULONG) 0x00000020) +#define DT_SET_SELECTION ((ULONG) 0x00000040) + +#define DTCT_LABEL ((ULONG) 0x00000000) +#define DTCT_EDIT ((ULONG) 0x00000001) +#define DTCT_LBX ((ULONG) 0x00000002) +#define DTCT_COMBOBOX ((ULONG) 0x00000003) +#define DTCT_DDLBX ((ULONG) 0x00000004) +#define DTCT_CHECKBOX ((ULONG) 0x00000005) +#define DTCT_GROUPBOX ((ULONG) 0x00000006) +#define DTCT_BUTTON ((ULONG) 0x00000007) +#define DTCT_PAGE ((ULONG) 0x00000008) +#define DTCT_RADIOBUTTON ((ULONG) 0x00000009) +#define DTCT_MVLISTBOX ((ULONG) 0x0000000B) +#define DTCT_MVDDLBX ((ULONG) 0x0000000C) + + typedef struct _DTBLLABEL { + ULONG ulbLpszLabelName; + ULONG ulFlags; + } DTBLLABEL,*LPDTBLLABEL; +#define SizedDtblLabel(n,u) struct _DTBLLABEL_ ## u { DTBLLABEL dtbllabel; TCHAR lpszLabelName[n]; } u + + typedef struct _DTBLEDIT { + ULONG ulbLpszCharsAllowed; + ULONG ulFlags; + ULONG ulNumCharsAllowed; + ULONG ulPropTag; + } DTBLEDIT,*LPDTBLEDIT; +#define SizedDtblEdit(n,u) struct _DTBLEDIT_ ## u { DTBLEDIT dtbledit; TCHAR lpszCharsAllowed[n]; } u + +#define MAPI_NO_HBAR ((ULONG) 0x00000001) +#define MAPI_NO_VBAR ((ULONG) 0x00000002) + + typedef struct _DTBLLBX { + ULONG ulFlags; + ULONG ulPRSetProperty; + ULONG ulPRTableName; + } DTBLLBX,*LPDTBLLBX; + + typedef struct _DTBLCOMBOBOX { + ULONG ulbLpszCharsAllowed; + ULONG ulFlags; + ULONG ulNumCharsAllowed; + ULONG ulPRPropertyName; + ULONG ulPRTableName; + } DTBLCOMBOBOX,*LPDTBLCOMBOBOX; +#define SizedDtblComboBox(n,u) struct _DTBLCOMBOBOX_ ## u { DTBLCOMBOBOX dtblcombobox; TCHAR lpszCharsAllowed[n]; } u + + typedef struct _DTBLDDLBX { + ULONG ulFlags; + ULONG ulPRDisplayProperty; + ULONG ulPRSetProperty; + ULONG ulPRTableName; + } DTBLDDLBX,*LPDTBLDDLBX; + + typedef struct _DTBLCHECKBOX { + ULONG ulbLpszLabel; + ULONG ulFlags; + ULONG ulPRPropertyName; + } DTBLCHECKBOX,*LPDTBLCHECKBOX; +#define SizedDtblCheckBox(n,u) struct _DTBLCHECKBOX_ ## u { DTBLCHECKBOX dtblcheckbox; TCHAR lpszLabel[n]; } u + + typedef struct _DTBLGROUPBOX { + ULONG ulbLpszLabel; + ULONG ulFlags; + } DTBLGROUPBOX,*LPDTBLGROUPBOX; +#define SizedDtblGroupBox(n,u) struct _DTBLGROUPBOX_ ## u { DTBLGROUPBOX dtblgroupbox; TCHAR lpszLabel[n]; } u + + typedef struct _DTBLBUTTON { + ULONG ulbLpszLabel; + ULONG ulFlags; + ULONG ulPRControl; + } DTBLBUTTON,*LPDTBLBUTTON; +#define SizedDtblButton(n,u) struct _DTBLBUTTON_ ## u { DTBLBUTTON dtblbutton; TCHAR lpszLabel[n]; } u + + typedef struct _DTBLPAGE { + ULONG ulbLpszLabel; + ULONG ulFlags; + ULONG ulbLpszComponent; + ULONG ulContext; + } DTBLPAGE,*LPDTBLPAGE; +#define SizedDtblPage(n,n1,u) struct _DTBLPAGE_ ## u { DTBLPAGE dtblpage; TCHAR lpszLabel[n]; TCHAR lpszComponent[n1]; } u + + typedef struct _DTBLRADIOBUTTON { + ULONG ulbLpszLabel; + ULONG ulFlags; + ULONG ulcButtons; + ULONG ulPropTag; + long lReturnValue; + } DTBLRADIOBUTTON,*LPDTBLRADIOBUTTON; +#define SizedDtblRadioButton(n,u) struct _DTBLRADIOBUTTON_ ## u { DTBLRADIOBUTTON dtblradiobutton; TCHAR lpszLabel[n]; } u + + typedef struct _DTBLMVLISTBOX { + ULONG ulFlags; + ULONG ulMVPropTag; + } DTBLMVLISTBOX,*LPDTBLMVLISTBOX; + + typedef struct _DTBLMVDDLBX { + ULONG ulFlags; + ULONG ulMVPropTag; + } DTBLMVDDLBX,*LPDTBLMVDDLBX; + +#define UI_SERVICE 0x00000002 +#define SERVICE_UI_ALWAYS 0x00000002 +#define SERVICE_UI_ALLOWED 0x00000010 +#define UI_CURRENT_PROVIDER_FIRST 0x00000004 + +#define MAPI_IPROVIDERADMIN_METHODS(IPURE) MAPIMETHOD(GetLastError) (THIS_ HRESULT hResult,ULONG ulFlags,LPMAPIERROR *lppMAPIError) IPURE; MAPIMETHOD(GetProviderTable) (THIS_ ULONG ulFlags,LPMAPITABLE *lppTable) IPURE; MAPIMETHOD(CreateProvider) (THIS_ LPTSTR lpszProvider,ULONG cValues,LPSPropValue lpProps,ULONG ulUIParam,ULONG ulFlags,MAPIUID *lpUID) IPURE; MAPIMETHOD(DeleteProvider) (THIS_ LPMAPIUID lpUID) IPURE; MAPIMETHOD(OpenProfileSection) (THIS_ LPMAPIUID lpUID,LPCIID lpInterface,ULONG ulFlags,LPPROFSECT *lppProfSect) IPURE; + +#undef INTERFACE +#define INTERFACE IProviderAdmin + DECLARE_MAPI_INTERFACE_(IProviderAdmin,IUnknown) { + BEGIN_INTERFACE + MAPI_IUNKNOWN_METHODS(PURE) + MAPI_IPROVIDERADMIN_METHODS(PURE) + }; + + typedef HANDLE HANDLE_16; + typedef WPARAM WPARAM_16; + +#define EXTERN_C_16 +#define WINAPI_16 +#define CALLBACK_16 +#define EXPORT_16 +#define LOADDS_16 +#define HUGEP_16 +#define APIENTRY_16 WINAPI +#define IF_WIN16(x) +#define IF_NOT_WIN16(x) x +#define IF_WIN32(x) x + +#ifdef __cplusplus +} +#endif +#endif diff --git a/bazaar/MAPIEx/plugin/include_MINGW32/wabutil.h b/bazaar/MAPIEx/plugin/include_MINGW32/wabutil.h new file mode 100644 index 000000000..5abb7452b --- /dev/null +++ b/bazaar/MAPIEx/plugin/include_MINGW32/wabutil.h @@ -0,0 +1,221 @@ +/** + * This file has no copyright assigned and is placed in the Public Domain. + * This file is part of the mingw-w64 runtime package. + * No warranty is given; refer to the file DISCLAIMER.PD within this package. + */ +#if !defined(_MAPIUTIL_H) && !defined(_WABUTIL_H) +#define _WABUTIL_H + +#include "mapidefs.h" + +#ifdef __cplusplus +extern "C" { +#endif + +#ifndef BEGIN_INTERFACE +#define BEGIN_INTERFACE +#endif + + DECLARE_MAPI_INTERFACE_PTR(ITableData,LPTABLEDATA); + + typedef void (WINAPI CALLERRELEASE)(ULONG ulCallerData,LPTABLEDATA lpTblData,LPMAPITABLE lpVue); + +#define MAPI_ITABLEDATA_METHODS(IPURE) MAPIMETHOD(HrGetView) (THIS_ LPSSortOrderSet lpSSortOrderSet,CALLERRELEASE *lpfCallerRelease,ULONG ulCallerData,LPMAPITABLE *lppMAPITable) IPURE; MAPIMETHOD(HrModifyRow) (THIS_ LPSRow) IPURE; MAPIMETHOD(HrDeleteRow) (THIS_ LPSPropValue lpSPropValue) IPURE; MAPIMETHOD(HrQueryRow) (THIS_ LPSPropValue lpsPropValue,LPSRow *lppSRow,ULONG *lpuliRow) IPURE; MAPIMETHOD(HrEnumRow) (THIS_ ULONG ulRowNumber,LPSRow *lppSRow) IPURE; MAPIMETHOD(HrNotify) (THIS_ ULONG ulFlags,ULONG cValues,LPSPropValue lpSPropValue) IPURE; MAPIMETHOD(HrInsertRow) (THIS_ ULONG uliRow,LPSRow lpSRow) IPURE; MAPIMETHOD(HrModifyRows) (THIS_ ULONG ulFlags,LPSRowSet lpSRowSet) IPURE; MAPIMETHOD(HrDeleteRows) (THIS_ ULONG ulFlags,LPSRowSet lprowsetToDelete,ULONG *cRowsDeleted) IPURE; +#undef INTERFACE +#define INTERFACE ITableData + DECLARE_MAPI_INTERFACE_(ITableData,IUnknown) { + BEGIN_INTERFACE + MAPI_IUNKNOWN_METHODS(PURE) + MAPI_ITABLEDATA_METHODS(PURE) + }; + + STDAPI_(SCODE) CreateTable(LPCIID lpInterface,ALLOCATEBUFFER *lpAllocateBuffer,ALLOCATEMORE *lpAllocateMore,FREEBUFFER *lpFreeBuffer,LPVOID lpvReserved,ULONG ulTableType,ULONG ulPropTagIndexColumn,LPSPropTagArray lpSPropTagArrayColumns,LPTABLEDATA *lppTableData); + +#define TAD_ALL_ROWS 1 + +#define MAPI_IPROPDATA_METHODS(IPURE) MAPIMETHOD(HrSetObjAccess) (THIS_ ULONG ulAccess) IPURE; MAPIMETHOD(HrSetPropAccess) (THIS_ LPSPropTagArray lpPropTagArray,ULONG *rgulAccess) IPURE; MAPIMETHOD(HrGetPropAccess) (THIS_ LPSPropTagArray *lppPropTagArray,ULONG **lprgulAccess) IPURE; MAPIMETHOD(HrAddObjProps) (THIS_ LPSPropTagArray lppPropTagArray,LPSPropProblemArray *lprgulAccess) IPURE; + +#undef INTERFACE +#define INTERFACE IPropData + DECLARE_MAPI_INTERFACE_(IPropData,IMAPIProp) { + BEGIN_INTERFACE + MAPI_IUNKNOWN_METHODS(PURE) + MAPI_IMAPIPROP_METHODS(PURE) + MAPI_IPROPDATA_METHODS(PURE) + }; + + DECLARE_MAPI_INTERFACE_PTR(IPropData,LPPROPDATA); + +#ifndef CreateIProp + STDAPI_(SCODE) CreateIProp(LPCIID lpInterface,ALLOCATEBUFFER *lpAllocateBuffer,ALLOCATEMORE *lpAllocateMore,FREEBUFFER *lpFreeBuffer,LPVOID lpvReserved,LPPROPDATA *lppPropData); +#endif + + STDAPI_(SCODE) WABCreateIProp(LPCIID lpInterface,ALLOCATEBUFFER *lpAllocateBuffer,ALLOCATEMORE *lpAllocateMore,FREEBUFFER *lpFreeBuffer,LPVOID lpvReserved,LPPROPDATA *lppPropData); + +#define IPROP_READONLY ((ULONG) 0x00000001) +#define IPROP_READWRITE ((ULONG) 0x00000002) +#define IPROP_CLEAN ((ULONG) 0x00010000) +#define IPROP_DIRTY ((ULONG) 0x00020000) + +#ifndef NOIDLEENGINE + +#define PRILOWEST -32768 +#define PRIHIGHEST 32767 +#define PRIUSER 0 + +#define IRONULL ((USHORT) 0x0000) +#define FIROWAIT ((USHORT) 0x0001) +#define FIROINTERVAL ((USHORT) 0x0002) +#define FIROPERBLOCK ((USHORT) 0x0004) +#define FIRODISABLED ((USHORT) 0x0020) +#define FIROONCEONLY ((USHORT) 0x0040) + +#define IRCNULL ((USHORT) 0x0000) +#define FIRCPFN ((USHORT) 0x0001) +#define FIRCPV ((USHORT) 0x0002) +#define FIRCPRI ((USHORT) 0x0004) +#define FIRCCSEC ((USHORT) 0x0008) +#define FIRCIRO ((USHORT) 0x0010) + + typedef WINBOOL (WINAPI FNIDLE)(LPVOID); + typedef FNIDLE *PFNIDLE; + + typedef void *FTG; + typedef FTG *PFTG; +#define FTGNULL ((FTG) NULL) + + STDAPI_(LONG) MAPIInitIdle(LPVOID lpvReserved); + STDAPI_(VOID) MAPIDeinitIdle(VOID); + STDAPI_(FTG) FtgRegisterIdleRoutine(PFNIDLE lpfnIdle,LPVOID lpvIdleParam,short priIdle,ULONG csecIdle,USHORT iroIdle); + STDAPI_(void) DeregisterIdleRoutine(FTG ftg); + STDAPI_(void) EnableIdleRoutine(FTG ftg,WINBOOL fEnable); + STDAPI_(void) ChangeIdleRoutine(FTG ftg,PFNIDLE lpfnIdle,LPVOID lpvIdleParam,short priIdle,ULONG csecIdle,USHORT iroIdle,USHORT ircIdle); +#endif + + STDAPI_(LPMALLOC) MAPIGetDefaultMalloc(VOID); + +#define SOF_UNIQUEFILENAME ((ULONG) 0x80000000) + + STDMETHODIMP OpenStreamOnFile(LPALLOCATEBUFFER lpAllocateBuffer,LPFREEBUFFER lpFreeBuffer,ULONG ulFlags,LPTSTR lpszFileName,LPTSTR lpszPrefix,LPSTREAM *lppStream); + + typedef HRESULT (WINAPI *LPOPENSTREAMONFILE) (LPALLOCATEBUFFER lpAllocateBuffer,LPFREEBUFFER lpFreeBuffer,ULONG ulFlags,LPTSTR lpszFileName,LPTSTR lpszPrefix,LPSTREAM *lppStream); + +#define OPENSTREAMONFILE "OpenStreamOnFile" + + STDAPI_(SCODE) PropCopyMore(LPSPropValue lpSPropValueDest,LPSPropValue lpSPropValueSrc,ALLOCATEMORE *lpfAllocMore,LPVOID lpvObject); + STDAPI_(ULONG) UlPropSize(LPSPropValue lpSPropValue); + STDAPI_(WINBOOL) FEqualNames(LPMAPINAMEID lpName1,LPMAPINAMEID lpName2); + +#ifndef _WINNT +#define _WINNT +#endif + + STDAPI_(void) GetInstance(LPSPropValue lpPropMv,LPSPropValue lpPropSv,ULONG uliInst); + + extern unsigned char rgchCsds[]; + extern unsigned char rgchCids[]; + extern unsigned char rgchCsdi[]; + extern unsigned char rgchCidi[]; + + STDAPI_(WINBOOL) FPropContainsProp(LPSPropValue lpSPropValueDst,LPSPropValue lpSPropValueSrc,ULONG ulFuzzyLevel); + STDAPI_(WINBOOL) FPropCompareProp(LPSPropValue lpSPropValue1,ULONG ulRelOp,LPSPropValue lpSPropValue2); + STDAPI_(LONG) LPropCompareProp(LPSPropValue lpSPropValueA,LPSPropValue lpSPropValueB); + STDAPI_(HRESULT) HrAddColumns(LPMAPITABLE lptbl,LPSPropTagArray lpproptagColumnsNew,LPALLOCATEBUFFER lpAllocateBuffer,LPFREEBUFFER lpFreeBuffer); + STDAPI_(HRESULT) HrAddColumnsEx(LPMAPITABLE lptbl,LPSPropTagArray lpproptagColumnsNew,LPALLOCATEBUFFER lpAllocateBuffer,LPFREEBUFFER lpFreeBuffer,void (*lpfnFilterColumns)(LPSPropTagArray ptaga)); + STDAPI HrAllocAdviseSink(LPNOTIFCALLBACK lpfnCallback,LPVOID lpvContext,LPMAPIADVISESINK *lppAdviseSink); + STDAPI HrThisThreadAdviseSink(LPMAPIADVISESINK lpAdviseSink,LPMAPIADVISESINK *lppAdviseSink); + STDAPI HrDispatchNotifications(ULONG ulFlags); + + typedef struct { + ULONG ulCtlType; + ULONG ulCtlFlags; + LPBYTE lpbNotif; + ULONG cbNotif; + LPTSTR lpszFilter; + ULONG ulItemID; + union { + LPVOID lpv; + LPDTBLLABEL lplabel; + LPDTBLEDIT lpedit; + LPDTBLLBX lplbx; + LPDTBLCOMBOBOX lpcombobox; + LPDTBLDDLBX lpddlbx; + LPDTBLCHECKBOX lpcheckbox; + LPDTBLGROUPBOX lpgroupbox; + LPDTBLBUTTON lpbutton; + LPDTBLRADIOBUTTON lpradiobutton; + LPDTBLMVLISTBOX lpmvlbx; + LPDTBLMVDDLBX lpmvddlbx; + LPDTBLPAGE lppage; + } ctl; + } DTCTL,*LPDTCTL; + + typedef struct { + ULONG cctl; + LPTSTR lpszResourceName; + __C89_NAMELESS union { + LPTSTR lpszComponent; + ULONG ulItemID; + }; + LPDTCTL lpctl; + } DTPAGE,*LPDTPAGE; + + STDAPI BuildDisplayTable(LPALLOCATEBUFFER lpAllocateBuffer,LPALLOCATEMORE lpAllocateMore,LPFREEBUFFER lpFreeBuffer,LPMALLOC lpMalloc,HINSTANCE hInstance,UINT cPages,LPDTPAGE lpPage,ULONG ulFlags,LPMAPITABLE *lppTable,LPTABLEDATA *lppTblData); + STDAPI_(SCODE) ScCountNotifications(int cNotifications,LPNOTIFICATION lpNotifications,ULONG *lpcb); + STDAPI_(SCODE) ScCopyNotifications(int cNotification,LPNOTIFICATION lpNotifications,LPVOID lpvDst,ULONG *lpcb); + STDAPI_(SCODE) ScRelocNotifications(int cNotification,LPNOTIFICATION lpNotifications,LPVOID lpvBaseOld,LPVOID lpvBaseNew,ULONG *lpcb); + STDAPI_(SCODE) ScCountProps(int cValues,LPSPropValue lpPropArray,ULONG *lpcb); + STDAPI_(LPSPropValue) LpValFindProp(ULONG ulPropTag,ULONG cValues,LPSPropValue lpPropArray); + STDAPI_(SCODE) ScCopyProps(int cValues,LPSPropValue lpPropArray,LPVOID lpvDst,ULONG *lpcb); + STDAPI_(SCODE) ScRelocProps(int cValues,LPSPropValue lpPropArray,LPVOID lpvBaseOld,LPVOID lpvBaseNew,ULONG *lpcb); + STDAPI_(SCODE) ScDupPropset(int cValues,LPSPropValue lpPropArray,LPALLOCATEBUFFER lpAllocateBuffer,LPSPropValue *lppPropArray); + STDAPI_(ULONG) UlAddRef(LPVOID lpunk); + STDAPI_(ULONG) UlRelease(LPVOID lpunk); + STDAPI HrGetOneProp(LPMAPIPROP lpMapiProp,ULONG ulPropTag,LPSPropValue *lppProp); + STDAPI HrSetOneProp(LPMAPIPROP lpMapiProp,LPSPropValue lpProp); + STDAPI_(WINBOOL) FPropExists(LPMAPIPROP lpMapiProp,ULONG ulPropTag); + STDAPI_(LPSPropValue) PpropFindProp(LPSPropValue lpPropArray,ULONG cValues,ULONG ulPropTag); + STDAPI_(void) FreePadrlist(LPADRLIST lpAdrlist); + STDAPI_(void) FreeProws(LPSRowSet lpRows); + STDAPI HrQueryAllRows(LPMAPITABLE lpTable,LPSPropTagArray lpPropTags,LPSRestriction lpRestriction,LPSSortOrderSet lpSortOrderSet,LONG crowsMax,LPSRowSet *lppRows); + STDAPI_(LPTSTR) SzFindCh(LPCTSTR lpsz,USHORT ch); + STDAPI_(LPTSTR) SzFindLastCh(LPCTSTR lpsz,USHORT ch); + STDAPI_(LPTSTR) SzFindSz(LPCTSTR lpsz,LPCTSTR lpszKey); + STDAPI_(unsigned int) UFromSz(LPCTSTR lpsz); + STDAPI_(SCODE) ScUNCFromLocalPath(LPSTR lpszLocal,LPSTR lpszUNC,UINT cchUNC); + STDAPI_(SCODE) ScLocalPathFromUNC(LPSTR lpszUNC,LPSTR lpszLocal,UINT cchLocal); + STDAPI_(FILETIME) FtAddFt(FILETIME ftAddend1,FILETIME ftAddend2); + STDAPI_(FILETIME) FtMulDwDw(DWORD ftMultiplicand,DWORD ftMultiplier); + STDAPI_(FILETIME) FtMulDw(DWORD ftMultiplier,FILETIME ftMultiplicand); + STDAPI_(FILETIME) FtSubFt(FILETIME ftMinuend,FILETIME ftSubtrahend); + STDAPI_(FILETIME) FtNegFt(FILETIME ft); + STDAPI_(SCODE) ScCreateConversationIndex(ULONG cbParent,LPBYTE lpbParent,ULONG *lpcbConvIndex,LPBYTE *lppbConvIndex); + STDAPI WrapStoreEntryID(ULONG ulFlags,LPTSTR lpszDLLName,ULONG cbOrigEntry,LPENTRYID lpOrigEntry,ULONG *lpcbWrappedEntry,LPENTRYID *lppWrappedEntry); + +#define RTF_SYNC_RTF_CHANGED ((ULONG) 0x00000001) +#define RTF_SYNC_BODY_CHANGED ((ULONG) 0x00000002) + + STDAPI_(HRESULT) RTFSync (LPMESSAGE lpMessage,ULONG ulFlags,WINBOOL *lpfMessageUpdated); + STDAPI_(HRESULT) WrapCompressedRTFStream (LPSTREAM lpCompressedRTFStream,ULONG ulFlags,LPSTREAM *lpUncompressedRTFStream); + STDAPI_(HRESULT) HrIStorageFromStream (LPUNKNOWN lpUnkIn,LPCIID lpInterface,ULONG ulFlags,LPSTORAGE *lppStorageOut); + STDAPI_(SCODE) ScInitMapiUtil(ULONG ulFlags); + STDAPI_(VOID) DeinitMapiUtil(VOID); + +#ifdef _X86_ +#define szHrDispatchNotifications "_HrDispatchNotifications@4" +#endif + + typedef HRESULT (WINAPI DISPATCHNOTIFICATIONS)(ULONG ulFlags); + typedef DISPATCHNOTIFICATIONS *LPDISPATCHNOTIFICATIONS; + +#ifdef _X86_ +#define szScCreateConversationIndex "_ScCreateConversationIndex@16" +#endif + + typedef SCODE (WINAPI CREATECONVERSATIONINDEX)(ULONG cbParent,LPBYTE lpbParent,ULONG *lpcbConvIndex,LPBYTE *lppbConvIndex); + typedef CREATECONVERSATIONINDEX *LPCREATECONVERSATIONINDEX; + +#ifdef __cplusplus +} +#endif +#endif diff --git a/bazaar/MAPIEx/srcdoc.tpp/MAPIEx$en-us.tpp b/bazaar/MAPIEx/srcdoc.tpp/MAPIEx$en-us.tpp index 67583a318..5a26c33e4 100644 --- a/bazaar/MAPIEx/srcdoc.tpp/MAPIEx$en-us.tpp +++ b/bazaar/MAPIEx/srcdoc.tpp/MAPIEx$en-us.tpp @@ -36,11 +36,20 @@ removed. They have been substituted by String.]&] [s0;i150;O0; [^topic`:`/`/MAPIEx`/src`/MAPIAttachment`$en`-us^2 MAPIAttachment]&] [s0;i150;O0; [^topic`:`/`/MAPIEx`/src`/MAPIContact`$en`-us^2 MAPIContact]&] [s0;2 &] +[s0; [2 There is a ][^topic`:`/`/MAPIEx`/srcdoc`/ChangesLog`$en`-us^2 News +and changes log][2 , ][^topic`:`/`/MAPIEx`/srcdoc`/License`$en`-us^2 License][2 +and a ][^topic`:`/`/MAPIEx`/srcdoc`/ToDo`$en`-us^2 ToDo list][2 .]&] [s0;2 &] +[s0;2 &] +[s0; [*+92 Compiler support and Requirements]&] +[s0;*+92 &] [s0; [2 As MAPIEx uses internal Microsoft infrastructure, it can only work in Windows.]&] [s0;2 &] -[s0; [2 There is also a ][^topic`:`/`/MAPIEx`/srcdoc`/ChangesLog`$en`-us^2 News -and changes log][2 , ][^topic`:`/`/MAPIEx`/srcdoc`/License`$en`-us^2 License][2 -and a ][^topic`:`/`/MAPIEx`/srcdoc`/ToDo`$en`-us^2 ToDo list][2 .]&] -[s0;2 ] \ No newline at end of file +[s0; [2 MAPIEx has been tested with MSC 32 bits.]&] +[s0;2 &] +[s0; [2 To compile using MinGW32 in Windows it is required to copy +the files in MAPIEx/include`_MINGW32 to MINGW32`\include.]&] +[s0;*+92 &] +[s0;2 &] +[s0;2 ]] \ No newline at end of file diff --git a/bazaar/MAPIEx/srcdoc.tpp/MAPIEx$en-us.tppi b/bazaar/MAPIEx/srcdoc.tpp/MAPIEx$en-us.tppi index 0880b541f..5c6c2205a 100644 --- a/bazaar/MAPIEx/srcdoc.tpp/MAPIEx$en-us.tppi +++ b/bazaar/MAPIEx/srcdoc.tpp/MAPIEx$en-us.tppi @@ -1,7 +1,8 @@ TITLE("General description") COMPRESSED -120,156,149,85,109,111,227,54,12,254,43,68,215,13,119,91,47,239,237,101,237,167,32,237,238,10,180,189,225,174,135,126,8,210,90,145,153,152,136,44,25,146,28,55,27,246,223,71,89,110,147,11,210,117,205,151,216,148,249,144,15,31,146,154,192,225,97,231,168,243,83,231,149,223,233,57,206,69,169,252,116,34,134,253,179,95,191,158,176,95,151,253,250,221,126,183,211,61,233,13,62,14,122,157,126,167,55,232,246,142,187,195,225,160,251,241,120,216,255,253,228,228,84,138,194,147,209,211,201,223,15,255,252,124,113,243,225,251,55,152,184,238,25,76,126,235,14,7,112,61,250,243,242,226,113,250,203,116,226,58,108,235,53,6,200,132,78,21,58,184,38,105,141,51,115,15,95,74,175,140,89,2,42,204,81,123,7,194,65,142,206,137,5,186,35,152,27,149,162,229,7,105,180,23,50,28,235,20,68,81,24,210,62,126,239,51,107,202,69,6,23,143,30,117,138,105,29,10,222,93,71,12,224,151,247,173,38,145,30,108,18,186,35,159,61,101,181,54,37,72,161,65,102,40,57,147, -92,144,218,68,54,5,234,58,170,19,43,140,135,14,72,75,85,166,164,23,64,121,200,52,166,229,57,197,172,206,138,19,182,40,60,110,242,54,22,82,230,232,159,33,130,71,19,164,5,215,66,175,193,81,94,40,62,127,20,225,159,191,176,216,4,98,86,164,155,108,147,135,20,115,3,133,144,75,142,188,143,90,195,138,24,1,42,203,197,66,11,102,14,211,201,125,230,125,145,156,38,237,164,93,85,85,210,202,203,52,105,73,145,180,27,228,214,95,84,220,247,224,198,160,130,115,82,74,204,234,202,142,27,64,69,51,43,236,122,202,33,224,210,71,106,164,29,63,164,8,115,107,242,61,33,42,114,50,163,37,135,49,121,210,86,101,210,46,172,89,88,145,231,104,147,118,46,10,74,30,74,207,245,72,90,153,207,21,71,191,42,37,177,22,119,209,49,170,249,61,124,17,226,238,163,123,155,33,112,73,131,124,66,7,45,248,209,162,18,161,61,93,70,5,84,65,106,99,105,65,90,168,152,109,22,180,156,33,234,211,29,64,234,30,119,206,190,68,224,228,64,99,149,28,212,74, -37,7,81,189,240,202,178,104,227,65,163,12,61,102,215,33,96,233,184,200,13,181,22,87,16,50,20,5,160,181,198,70,33,241,177,64,233,89,72,238,111,109,42,16,74,69,167,149,176,36,102,27,189,185,161,17,28,55,205,178,5,151,220,121,105,74,129,9,159,120,180,129,0,123,5,57,235,0,25,163,5,26,76,56,45,37,166,79,245,217,166,17,234,211,72,23,65,230,66,54,122,197,172,195,44,5,196,21,97,181,65,172,187,145,230,196,160,240,9,253,152,213,14,157,253,238,125,93,15,182,124,38,100,76,153,173,217,20,114,162,72,172,176,180,226,206,223,155,137,225,113,225,34,173,194,92,228,5,43,52,35,69,126,13,227,111,222,134,97,10,200,183,227,207,163,175,27,129,152,89,206,14,156,4,243,88,111,217,93,57,115,158,124,25,106,58,91,67,68,216,23,117,148,134,249,73,141,44,195,104,214,109,177,219,70,123,166,71,42,225,92,20,229,229,30,185,247,166,32,25,219,189,153,161,182,179,242,249,229,16,117,242,161,116,247,189,31,23,226,255,4,248,163,222,14,59, -32,209,248,54,160,102,23,238,32,53,214,183,65,141,54,171,119,7,110,235,228,141,144,207,107,115,23,241,249,224,109,128,227,184,115,119,208,26,235,127,40,63,114,79,226,151,174,94,35,205,192,109,46,43,210,115,43,156,183,165,244,165,197,35,32,95,223,27,70,171,53,84,198,46,195,248,222,145,78,77,229,94,216,84,182,158,19,161,156,225,229,60,125,137,7,55,107,210,30,199,117,118,101,22,91,76,110,176,138,87,199,211,178,83,102,17,22,227,209,43,96,87,36,81,187,237,22,104,44,245,54,175,111,175,87,16,110,205,185,217,114,15,175,188,86,156,255,113,45,79,255,5,31,228,207,50, +120,156,149,85,219,82,35,55,16,253,149,46,66,82,123,97,125,5,150,133,39,202,144,93,170,48,155,2,182,120,112,12,35,107,218,158,46,52,210,172,164,97,112,82,249,247,180,70,3,227,56,222,16,252,226,209,165,79,95,78,247,209,4,182,183,123,59,189,159,122,47,252,14,79,112,46,74,229,167,19,113,48,60,122,119,185,207,118,125,182,27,246,135,253,94,127,127,176,251,113,119,208,27,246,6,187,253,193,94,255,224,96,183,255,113,239,96,248,105,127,255,80,138,194,147,209,211,201,159,119,127,253,124,122,241,225,219,21,76,92,255,8,38,239,251,7,187,48,62,254,237,236,244,113,250,203,116,226,122,188,55,104,54,32,19,58,85,232,96,76,210,26,103,230,30,190,150,94,25,115,15,168,48,71,237,29,8,7,57,58,39,22,232,118,96,110,84,138,150,63,164,209,94,200,112,172,83,16,69,97,72,251,120,223,103,214,148,139,12,78,31,61,234,20,211,218,21,188,25,71,12,224,197,219,78,19,200,0,218,128,110,200,103,79,81,45,77,9,82,104,144,25,74,142,36,23, +164,90,207,166,64,93,123,117,226,1,227,161,3,210,82,149,41,233,5,80,30,34,141,97,121,14,49,171,163,226,128,45,10,143,109,220,198,66,202,57,250,103,136,96,209,56,233,192,88,232,37,56,202,11,197,231,143,34,252,243,13,139,141,35,206,138,116,19,109,114,151,98,110,160,16,242,158,61,111,74,173,201,138,24,1,42,203,197,66,11,102,14,211,201,109,230,125,145,28,38,221,164,91,85,85,210,201,203,52,233,72,145,116,27,228,206,31,84,220,14,224,194,160,130,19,82,74,204,234,202,142,26,64,69,51,43,236,114,202,46,224,204,199,212,72,59,254,72,17,230,214,228,27,92,84,228,100,70,247,236,198,228,73,87,149,73,183,176,102,97,69,158,163,77,186,185,40,40,185,43,61,215,35,233,100,62,87,236,253,188,148,196,92,220,68,195,200,230,183,112,35,248,221,148,238,117,134,192,37,13,244,9,29,184,224,79,139,74,132,246,116,25,21,80,5,170,141,165,5,105,161,98,180,89,224,114,134,168,15,215,0,169,191,215,59,250,26,129,147,45,141,85,178,85,51,149, +108,69,246,194,146,105,209,198,131,70,25,122,204,46,131,195,210,113,145,155,212,58,92,65,200,80,20,128,214,26,27,137,196,199,2,165,103,34,185,191,181,169,64,40,21,141,30,132,37,49,107,249,230,134,70,112,220,52,247,29,56,227,206,75,83,10,153,240,137,71,27,18,96,171,64,103,237,32,99,180,144,6,39,156,150,18,211,167,250,172,166,17,234,211,80,23,65,230,66,54,124,197,168,195,44,5,196,7,194,170,69,172,187,145,230,196,160,240,25,253,136,217,14,157,253,230,109,93,15,222,249,66,200,152,50,91,242,86,136,137,98,98,133,165,7,238,252,141,145,24,30,23,46,210,67,152,139,188,96,134,102,164,200,47,97,116,229,109,24,166,128,124,61,250,114,124,217,18,196,153,229,108,192,65,112,30,203,149,125,87,206,156,39,95,134,154,206,150,16,17,54,121,61,78,195,252,164,70,150,97,52,235,182,88,111,163,13,211,35,149,112,46,146,242,227,30,185,245,166,32,25,219,189,153,161,174,179,242,121,177,141,58,249,80,186,219,193,63,5,241,127,2,252,90,171,195, +26,72,220,124,29,80,163,133,107,72,205,238,235,160,142,91,233,93,131,91,57,121,37,228,179,108,174,35,62,31,188,14,112,20,53,119,13,173,217,221,44,32,22,163,92,78,127,132,204,237,147,116,71,81,96,206,205,98,5,251,2,171,40,230,79,242,163,204,34,72,213,206,11,96,231,36,81,187,85,82,154,157,90,95,235,247,228,5,132,107,115,98,86,204,195,146,7,221,249,77,66,217,230,251,238,253,167,1,140,120,252,72,241,240,187,146,105,179,190,246,119,137,223,75,178,241,25,110,204,235,203,109,165,142,221,211,120,148,174,22,218,70,146,218,231,156,244,220,10,231,109,41,125,105,113,7,200,215,47,171,209,106,9,149,177,247,65,224,110,72,167,166,114,255,241,116,61,139,144,71,23,230,187,86,240,241,213,8,134,3,152,145,223,104,202,226,34,99,86,28,92,16,147,49,233,207,55,108,208,122,12,209,48,205,54,230,153,130,15,38,197,178,86,220,57,169,248,116,196,16,186,205,195,155,220,141,207,46,106,24,190,220,124,38,191,55,135,157,127,87,169,253,159,78,255,6, +31,82,36,58,