mirror of
https://github.com/reactos/reactos.git
synced 2025-04-27 00:50:23 +00:00
sync mapi32 with wine 1.1.34
svn path=/trunk/; revision=44420
This commit is contained in:
parent
8cf6e9f84e
commit
0f9bc5c1a4
5 changed files with 80 additions and 8 deletions
|
@ -32,6 +32,7 @@
|
||||||
#include "objbase.h"
|
#include "objbase.h"
|
||||||
#include "shlwapi.h"
|
#include "shlwapi.h"
|
||||||
#include "mapiutil.h"
|
#include "mapiutil.h"
|
||||||
|
#include "util.h"
|
||||||
#include "wine/debug.h"
|
#include "wine/debug.h"
|
||||||
|
|
||||||
WINE_DEFAULT_DEBUG_CHANNEL(mapi);
|
WINE_DEFAULT_DEBUG_CHANNEL(mapi);
|
||||||
|
@ -63,6 +64,9 @@ LPMALLOC WINAPI MAPIGetDefaultMalloc(void)
|
||||||
{
|
{
|
||||||
TRACE("()\n");
|
TRACE("()\n");
|
||||||
|
|
||||||
|
if (mapiFunctions.MAPIGetDefaultMalloc)
|
||||||
|
return mapiFunctions.MAPIGetDefaultMalloc();
|
||||||
|
|
||||||
IMalloc_AddRef((LPMALLOC)&MAPI_IMalloc);
|
IMalloc_AddRef((LPMALLOC)&MAPI_IMalloc);
|
||||||
return (LPMALLOC)&MAPI_IMalloc;
|
return (LPMALLOC)&MAPI_IMalloc;
|
||||||
}
|
}
|
||||||
|
|
|
@ -89,7 +89,15 @@ HRESULT WINAPI DllGetClassObject(REFCLSID rclsid, REFIID iid, LPVOID *ppv)
|
||||||
*/
|
*/
|
||||||
HRESULT WINAPI DllCanUnloadNow(void)
|
HRESULT WINAPI DllCanUnloadNow(void)
|
||||||
{
|
{
|
||||||
return MAPI_ObjectCount == 0 ? S_OK : S_FALSE;
|
HRESULT ret = S_OK;
|
||||||
|
|
||||||
|
if (mapiFunctions.DllCanUnloadNow)
|
||||||
|
{
|
||||||
|
ret = mapiFunctions.DllCanUnloadNow();
|
||||||
|
TRACE("(): provider returns %d\n", ret);
|
||||||
|
}
|
||||||
|
|
||||||
|
return MAPI_ObjectCount == 0 ? ret : S_FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
/***********************************************************************
|
/***********************************************************************
|
||||||
|
@ -167,6 +175,9 @@ HRESULT WINAPI MAPILogonEx(ULONG_PTR uiparam, LPWSTR profile,
|
||||||
|
|
||||||
HRESULT WINAPI MAPIOpenLocalFormContainer(LPVOID *ppfcnt)
|
HRESULT WINAPI MAPIOpenLocalFormContainer(LPVOID *ppfcnt)
|
||||||
{
|
{
|
||||||
|
if (mapiFunctions.MAPIOpenLocalFormContainer)
|
||||||
|
return mapiFunctions.MAPIOpenLocalFormContainer(ppfcnt);
|
||||||
|
|
||||||
FIXME("(%p) Stub\n", ppfcnt);
|
FIXME("(%p) Stub\n", ppfcnt);
|
||||||
return E_FAIL;
|
return E_FAIL;
|
||||||
}
|
}
|
||||||
|
@ -189,6 +200,9 @@ VOID WINAPI MAPIUninitialize(void)
|
||||||
|
|
||||||
HRESULT WINAPI MAPIAdminProfiles(ULONG ulFlags, LPPROFADMIN *lppProfAdmin)
|
HRESULT WINAPI MAPIAdminProfiles(ULONG ulFlags, LPPROFADMIN *lppProfAdmin)
|
||||||
{
|
{
|
||||||
|
if (mapiFunctions.MAPIAdminProfiles)
|
||||||
|
return mapiFunctions.MAPIAdminProfiles(ulFlags, lppProfAdmin);
|
||||||
|
|
||||||
FIXME("(%u, %p): stub\n", ulFlags, lppProfAdmin);
|
FIXME("(%u, %p): stub\n", ulFlags, lppProfAdmin);
|
||||||
*lppProfAdmin = NULL;
|
*lppProfAdmin = NULL;
|
||||||
return E_FAIL;
|
return E_FAIL;
|
||||||
|
|
|
@ -59,7 +59,7 @@ static ULONG sendmail_extended_mapi(LHANDLE mapi_session, ULONG_PTR uiparam, lpM
|
||||||
IMAPITable* msg_table;
|
IMAPITable* msg_table;
|
||||||
LPSRowSet rows = NULL;
|
LPSRowSet rows = NULL;
|
||||||
IMsgStore* msg_store;
|
IMsgStore* msg_store;
|
||||||
IMAPIFolder* folder = NULL;
|
IMAPIFolder* folder = NULL, *draft_folder = NULL;
|
||||||
LPENTRYID entry_id;
|
LPENTRYID entry_id;
|
||||||
LPSPropValue props;
|
LPSPropValue props;
|
||||||
ULONG entry_len;
|
ULONG entry_len;
|
||||||
|
@ -151,10 +151,10 @@ static ULONG sendmail_extended_mapi(LHANDLE mapi_session, ULONG_PTR uiparam, lpM
|
||||||
goto logoff;
|
goto logoff;
|
||||||
|
|
||||||
IMsgStore_OpenEntry(msg_store, props[0].Value.bin.cb, (LPENTRYID) props[0].Value.bin.lpb,
|
IMsgStore_OpenEntry(msg_store, props[0].Value.bin.cb, (LPENTRYID) props[0].Value.bin.lpb,
|
||||||
NULL, MAPI_MODIFY, &obj_type, (LPUNKNOWN *) &folder);
|
NULL, MAPI_MODIFY, &obj_type, (LPUNKNOWN *) &draft_folder);
|
||||||
|
|
||||||
/* Create a new message */
|
/* Create a new message */
|
||||||
if (IMAPIFolder_CreateMessage(folder, NULL, 0, &msg) == S_OK)
|
if (IMAPIFolder_CreateMessage(draft_folder, NULL, 0, &msg) == S_OK)
|
||||||
{
|
{
|
||||||
ULONG token;
|
ULONG token;
|
||||||
SPropValue p;
|
SPropValue p;
|
||||||
|
@ -329,7 +329,7 @@ static ULONG sendmail_extended_mapi(LHANDLE mapi_session, ULONG_PTR uiparam, lpM
|
||||||
{
|
{
|
||||||
/* Show the message form (edit window) */
|
/* Show the message form (edit window) */
|
||||||
|
|
||||||
ret = IMAPISession_ShowForm(session, 0, msg_store, folder, NULL,
|
ret = IMAPISession_ShowForm(session, 0, msg_store, draft_folder, NULL,
|
||||||
token, NULL, 0, status, flags, access,
|
token, NULL, 0, status, flags, access,
|
||||||
props->Value.lpszA);
|
props->Value.lpszA);
|
||||||
|
|
||||||
|
@ -354,7 +354,8 @@ static ULONG sendmail_extended_mapi(LHANDLE mapi_session, ULONG_PTR uiparam, lpM
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Free up the resources we've used */
|
/* Free up the resources we've used */
|
||||||
IMAPIFolder_Release(folder);
|
IMAPIFolder_Release(draft_folder);
|
||||||
|
if (folder) IMAPIFolder_Release(folder);
|
||||||
IMsgStore_Release(msg_store);
|
IMsgStore_Release(msg_store);
|
||||||
|
|
||||||
logoff: ;
|
logoff: ;
|
||||||
|
|
|
@ -68,6 +68,9 @@ MAPI_FUNCTIONS mapiFunctions;
|
||||||
*/
|
*/
|
||||||
SCODE WINAPI ScInitMapiUtil(ULONG ulReserved)
|
SCODE WINAPI ScInitMapiUtil(ULONG ulReserved)
|
||||||
{
|
{
|
||||||
|
if (mapiFunctions.ScInitMapiUtil)
|
||||||
|
return mapiFunctions.ScInitMapiUtil(ulReserved);
|
||||||
|
|
||||||
FIXME("(0x%08x)stub!\n", ulReserved);
|
FIXME("(0x%08x)stub!\n", ulReserved);
|
||||||
if (ulReserved)
|
if (ulReserved)
|
||||||
return MAPI_E_INVALID_PARAMETER;
|
return MAPI_E_INVALID_PARAMETER;
|
||||||
|
@ -91,7 +94,10 @@ SCODE WINAPI ScInitMapiUtil(ULONG ulReserved)
|
||||||
*/
|
*/
|
||||||
VOID WINAPI DeinitMapiUtil(void)
|
VOID WINAPI DeinitMapiUtil(void)
|
||||||
{
|
{
|
||||||
FIXME("()stub!\n");
|
if (mapiFunctions.DeinitMapiUtil)
|
||||||
|
mapiFunctions.DeinitMapiUtil();
|
||||||
|
else
|
||||||
|
FIXME("()stub!\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
typedef LPVOID *LPMAPIALLOCBUFFER;
|
typedef LPVOID *LPMAPIALLOCBUFFER;
|
||||||
|
@ -124,6 +130,9 @@ SCODE WINAPI MAPIAllocateBuffer(ULONG cbSize, LPVOID *lppBuffer)
|
||||||
|
|
||||||
TRACE("(%d,%p)\n", cbSize, lppBuffer);
|
TRACE("(%d,%p)\n", cbSize, lppBuffer);
|
||||||
|
|
||||||
|
if (mapiFunctions.MAPIAllocateBuffer)
|
||||||
|
return mapiFunctions.MAPIAllocateBuffer(cbSize, lppBuffer);
|
||||||
|
|
||||||
if (!lppBuffer)
|
if (!lppBuffer)
|
||||||
return E_INVALIDARG;
|
return E_INVALIDARG;
|
||||||
|
|
||||||
|
@ -164,6 +173,9 @@ SCODE WINAPI MAPIAllocateMore(ULONG cbSize, LPVOID lpOrig, LPVOID *lppBuffer)
|
||||||
|
|
||||||
TRACE("(%d,%p,%p)\n", cbSize, lpOrig, lppBuffer);
|
TRACE("(%d,%p,%p)\n", cbSize, lpOrig, lppBuffer);
|
||||||
|
|
||||||
|
if (mapiFunctions.MAPIAllocateMore)
|
||||||
|
return mapiFunctions.MAPIAllocateMore(cbSize, lpOrig, lppBuffer);
|
||||||
|
|
||||||
if (!lppBuffer || !lpBuff || !--lpBuff)
|
if (!lppBuffer || !lpBuff || !--lpBuff)
|
||||||
return E_INVALIDARG;
|
return E_INVALIDARG;
|
||||||
|
|
||||||
|
@ -200,6 +212,9 @@ ULONG WINAPI MAPIFreeBuffer(LPVOID lpBuffer)
|
||||||
|
|
||||||
TRACE("(%p)\n", lpBuffer);
|
TRACE("(%p)\n", lpBuffer);
|
||||||
|
|
||||||
|
if (mapiFunctions.MAPIFreeBuffer)
|
||||||
|
return mapiFunctions.MAPIFreeBuffer(lpBuffer);
|
||||||
|
|
||||||
if (lpBuff && --lpBuff)
|
if (lpBuff && --lpBuff)
|
||||||
{
|
{
|
||||||
while (lpBuff)
|
while (lpBuff)
|
||||||
|
@ -239,6 +254,9 @@ HRESULT WINAPI WrapProgress(PVOID unk1, PVOID unk2, PVOID unk3, PVOID unk4, PVOI
|
||||||
*/
|
*/
|
||||||
HRESULT WINAPI HrThisThreadAdviseSink(LPMAPIADVISESINK lpSink, LPMAPIADVISESINK* lppNewSink)
|
HRESULT WINAPI HrThisThreadAdviseSink(LPMAPIADVISESINK lpSink, LPMAPIADVISESINK* lppNewSink)
|
||||||
{
|
{
|
||||||
|
if (mapiFunctions.HrThisThreadAdviseSink)
|
||||||
|
return mapiFunctions.HrThisThreadAdviseSink(lpSink, lppNewSink);
|
||||||
|
|
||||||
FIXME("(%p,%p)semi-stub\n", lpSink, lppNewSink);
|
FIXME("(%p,%p)semi-stub\n", lpSink, lppNewSink);
|
||||||
|
|
||||||
if (!lpSink || !lppNewSink)
|
if (!lpSink || !lppNewSink)
|
||||||
|
@ -695,6 +713,9 @@ HRESULT WINAPI OpenStreamOnFile(LPALLOCATEBUFFER lpAlloc, LPFREEBUFFER lpFree,
|
||||||
TRACE("(%p,%p,0x%08x,%s,%s,%p)\n", lpAlloc, lpFree, ulFlags,
|
TRACE("(%p,%p,0x%08x,%s,%s,%p)\n", lpAlloc, lpFree, ulFlags,
|
||||||
debugstr_a((LPSTR)lpszPath), debugstr_a((LPSTR)lpszPrefix), lppStream);
|
debugstr_a((LPSTR)lpszPath), debugstr_a((LPSTR)lpszPrefix), lppStream);
|
||||||
|
|
||||||
|
if (mapiFunctions.OpenStreamOnFile)
|
||||||
|
return mapiFunctions.OpenStreamOnFile(lpAlloc, lpFree, ulFlags, lpszPath, lpszPrefix, lppStream);
|
||||||
|
|
||||||
if (lppStream)
|
if (lppStream)
|
||||||
*lppStream = NULL;
|
*lppStream = NULL;
|
||||||
|
|
||||||
|
@ -857,6 +878,9 @@ BOOL WINAPI FGetComponentPath(LPCSTR component, LPCSTR qualifier, LPSTR dll_path
|
||||||
|
|
||||||
TRACE("%s %s %p %u %d\n", component, qualifier, dll_path, dll_path_length, install);
|
TRACE("%s %s %p %u %d\n", component, qualifier, dll_path, dll_path_length, install);
|
||||||
|
|
||||||
|
if (mapiFunctions.FGetComponentPath)
|
||||||
|
return mapiFunctions.FGetComponentPath(component, qualifier, dll_path, dll_path_length, install);
|
||||||
|
|
||||||
dll_path[0] = 0;
|
dll_path[0] = 0;
|
||||||
|
|
||||||
hmsi = LoadLibraryA("msi.dll");
|
hmsi = LoadLibraryA("msi.dll");
|
||||||
|
@ -903,6 +927,9 @@ HRESULT WINAPI HrQueryAllRows(LPMAPITABLE lpTable, LPSPropTagArray lpPropTags,
|
||||||
LPSRestriction lpRestriction, LPSSortOrderSet lpSortOrderSet,
|
LPSRestriction lpRestriction, LPSSortOrderSet lpSortOrderSet,
|
||||||
LONG crowsMax, LPSRowSet *lppRows)
|
LONG crowsMax, LPSRowSet *lppRows)
|
||||||
{
|
{
|
||||||
|
if (mapiFunctions.HrQueryAllRows)
|
||||||
|
return mapiFunctions.HrQueryAllRows(lpTable, lpPropTags, lpRestriction, lpSortOrderSet, crowsMax, lppRows);
|
||||||
|
|
||||||
FIXME("(%p, %p, %p, %p, %d, %p): stub\n", lpTable, lpPropTags, lpRestriction, lpSortOrderSet, crowsMax, lppRows);
|
FIXME("(%p, %p, %p, %p, %d, %p): stub\n", lpTable, lpPropTags, lpRestriction, lpSortOrderSet, crowsMax, lppRows);
|
||||||
*lppRows = NULL;
|
*lppRows = NULL;
|
||||||
return MAPI_E_CALL_FAILED;
|
return MAPI_E_CALL_FAILED;
|
||||||
|
@ -1057,7 +1084,20 @@ void load_mapi_providers(void)
|
||||||
mapiFunctions.MAPILogonEx = (void*) GetProcAddress(mapi_ex_provider, "MAPILogonEx");
|
mapiFunctions.MAPILogonEx = (void*) GetProcAddress(mapi_ex_provider, "MAPILogonEx");
|
||||||
mapiFunctions.MAPIUninitialize = (void*) GetProcAddress(mapi_ex_provider, "MAPIUninitialize");
|
mapiFunctions.MAPIUninitialize = (void*) GetProcAddress(mapi_ex_provider, "MAPIUninitialize");
|
||||||
|
|
||||||
|
mapiFunctions.DeinitMapiUtil = (void*) GetProcAddress(mapi_ex_provider, "DeinitMapiUtil@0");
|
||||||
|
mapiFunctions.DllCanUnloadNow = (void*) GetProcAddress(mapi_ex_provider, "DllCanUnloadNow");
|
||||||
mapiFunctions.DllGetClassObject = (void*) GetProcAddress(mapi_ex_provider, "DllGetClassObject");
|
mapiFunctions.DllGetClassObject = (void*) GetProcAddress(mapi_ex_provider, "DllGetClassObject");
|
||||||
|
mapiFunctions.FGetComponentPath = (void*) GetProcAddress(mapi_ex_provider, "FGetComponentPath");
|
||||||
|
mapiFunctions.HrThisThreadAdviseSink = (void*) GetProcAddress(mapi_ex_provider, "HrThisThreadAdviseSink@8");
|
||||||
|
mapiFunctions.HrQueryAllRows = (void*) GetProcAddress(mapi_ex_provider, "HrQueryAllRows@24");
|
||||||
|
mapiFunctions.MAPIAdminProfiles = (void*) GetProcAddress(mapi_ex_provider, "MAPIAdminProfiles");
|
||||||
|
mapiFunctions.MAPIAllocateBuffer = (void*) GetProcAddress(mapi_ex_provider, "MAPIAllocateBuffer");
|
||||||
|
mapiFunctions.MAPIAllocateMore = (void*) GetProcAddress(mapi_ex_provider, "MAPIAllocateMore");
|
||||||
|
mapiFunctions.MAPIFreeBuffer = (void*) GetProcAddress(mapi_ex_provider, "MAPIFreeBuffer");
|
||||||
|
mapiFunctions.MAPIGetDefaultMalloc = (void*) GetProcAddress(mapi_ex_provider, "MAPIGetDefaultMalloc@0");
|
||||||
|
mapiFunctions.MAPIOpenLocalFormContainer = (void *) GetProcAddress(mapi_ex_provider, "MAPIOpenLocalFormContainer");
|
||||||
|
mapiFunctions.OpenStreamOnFile = (void*) GetProcAddress(mapi_ex_provider, "OpenStreamOnFile@24");
|
||||||
|
mapiFunctions.ScInitMapiUtil = (void*) GetProcAddress(mapi_ex_provider, "ScInitMapiUtil@4");
|
||||||
}
|
}
|
||||||
|
|
||||||
cleanUp:
|
cleanUp:
|
||||||
|
|
|
@ -44,7 +44,20 @@ typedef struct MAPI_FUNCTIONS {
|
||||||
LPMAPISENDDOCUMENTS MAPISendDocuments;
|
LPMAPISENDDOCUMENTS MAPISendDocuments;
|
||||||
LPMAPIUNINITIALIZE MAPIUninitialize;
|
LPMAPIUNINITIALIZE MAPIUninitialize;
|
||||||
|
|
||||||
HRESULT (WINAPI *DllGetClassObject)(REFCLSID, REFIID, LPVOID *);
|
VOID (WINAPI *DeinitMapiUtil) (void);
|
||||||
|
HRESULT (WINAPI *DllCanUnloadNow) (void);
|
||||||
|
HRESULT (WINAPI *DllGetClassObject) (REFCLSID, REFIID, LPVOID *);
|
||||||
|
BOOL (WINAPI *FGetComponentPath) (LPCSTR, LPCSTR, LPSTR, DWORD, BOOL);
|
||||||
|
HRESULT (WINAPI *MAPIAdminProfiles) (ULONG, LPPROFADMIN *);
|
||||||
|
SCODE (WINAPI *MAPIAllocateBuffer) (ULONG, LPVOID *);
|
||||||
|
SCODE (WINAPI *MAPIAllocateMore) (ULONG, LPVOID, LPVOID *);
|
||||||
|
ULONG (WINAPI *MAPIFreeBuffer) (LPVOID);
|
||||||
|
LPMALLOC (WINAPI *MAPIGetDefaultMalloc) (void);
|
||||||
|
HRESULT (WINAPI *MAPIOpenLocalFormContainer) (LPVOID *);
|
||||||
|
HRESULT (WINAPI *HrThisThreadAdviseSink) (LPMAPIADVISESINK, LPMAPIADVISESINK*);
|
||||||
|
HRESULT (WINAPI *HrQueryAllRows) (LPMAPITABLE, LPSPropTagArray, LPSRestriction, LPSSortOrderSet, LONG, LPSRowSet *);
|
||||||
|
HRESULT (WINAPI *OpenStreamOnFile) (LPALLOCATEBUFFER, LPFREEBUFFER, ULONG, LPWSTR, LPWSTR, LPSTREAM *);
|
||||||
|
SCODE (WINAPI *ScInitMapiUtil) (ULONG ulReserved);
|
||||||
} MAPI_FUNCTIONS;
|
} MAPI_FUNCTIONS;
|
||||||
|
|
||||||
extern MAPI_FUNCTIONS mapiFunctions;
|
extern MAPI_FUNCTIONS mapiFunctions;
|
||||||
|
|
Loading…
Reference in a new issue