From 421ab509fc3c647a64c3e16cf9431f452fda5e2b Mon Sep 17 00:00:00 2001 From: Owen Rudge Date: Fri, 18 Sep 2009 15:15:45 +0100 Subject: [PATCH] mapi32: Implement MAPIInitialize, Logon, Logoff, LogonEx, Uninitialize. --- dlls/mapi32/mapi32_main.c | 66 ++++++++++++++++++++++++++++++++++++++++++----- 1 file changed, 59 insertions(+), 7 deletions(-) diff --git a/dlls/mapi32/mapi32_main.c b/dlls/mapi32/mapi32_main.c index 0f82e762369..5b6e6e52845 100644 --- a/dlls/mapi32/mapi32_main.c +++ b/dlls/mapi32/mapi32_main.c @@ -83,36 +83,77 @@ HRESULT WINAPI DllCanUnloadNow(void) return MAPI_ObjectCount == 0 ? S_OK : S_FALSE; } +/*********************************************************************** + * MAPIInitialize + * + * Initialises the MAPI library. In our case, we pass through to the + * loaded Extended MAPI provider. + */ HRESULT WINAPI MAPIInitialize(LPVOID init) { - FIXME("(%p) Stub\n", init); - return SUCCESS_SUCCESS; + TRACE("(%p)\n", init); + + if (mapiFunctions.MAPIInitialize) + return mapiFunctions.MAPIInitialize(init); + + return MAPI_E_NOT_INITIALIZED; } +/*********************************************************************** + * MAPILogon + * + * Logs on to a MAPI provider. If available, we pass this through to a + * Simple MAPI provider. Otherwise, we maintain basic functionality + * ourselves. + */ ULONG WINAPI MAPILogon(ULONG_PTR uiparam, LPSTR profile, LPSTR password, FLAGS flags, ULONG reserved, LPLHANDLE session) { - FIXME("(0x%08lx %s %p 0x%08x 0x%08x %p) Stub\n", uiparam, + TRACE("(0x%08lx %s %p 0x%08x 0x%08x %p)\n", uiparam, debugstr_a(profile), password, flags, reserved, session); + if (mapiFunctions.MAPILogon) + return mapiFunctions.MAPILogon(uiparam, profile, password, flags, reserved, session); + if (session) *session = 1; return SUCCESS_SUCCESS; } +/*********************************************************************** + * MAPILogoff + * + * Logs off from a MAPI provider. If available, we pass this through to a + * Simple MAPI provider. Otherwise, we maintain basic functionality + * ourselves. + */ ULONG WINAPI MAPILogoff(LHANDLE session, ULONG_PTR uiparam, FLAGS flags, ULONG reserved ) { - FIXME("(0x%08lx 0x%08lx 0x%08x 0x%08x) Stub\n", session, + TRACE("(0x%08lx 0x%08lx 0x%08x 0x%08x)\n", session, uiparam, flags, reserved); + + if (mapiFunctions.MAPILogoff) + return mapiFunctions.MAPILogoff(session, uiparam, flags, reserved); + return SUCCESS_SUCCESS; } +/*********************************************************************** + * MAPILogonEx + * + * Logs on to a MAPI provider. If available, we pass this through to an + * Extended MAPI provider. Otherwise, we return an error. + */ HRESULT WINAPI MAPILogonEx(ULONG_PTR uiparam, LPWSTR profile, LPWSTR password, ULONG flags, LPMAPISESSION *session) { - FIXME("(0x%08lx %s %p 0x%08x %p) Stub\n", uiparam, + TRACE("(0x%08lx %s %p 0x%08x %p)\n", uiparam, debugstr_w(profile), password, flags, session); - return SUCCESS_SUCCESS; + + if (mapiFunctions.MAPILogonEx) + return mapiFunctions.MAPILogonEx(uiparam, profile, password, flags, session); + + return E_FAIL; } HRESULT WINAPI MAPIOpenLocalFormContainer(LPVOID *ppfcnt) @@ -121,9 +162,20 @@ HRESULT WINAPI MAPIOpenLocalFormContainer(LPVOID *ppfcnt) return E_FAIL; } +/*********************************************************************** + * MAPIUninitialize + * + * Uninitialises the MAPI library. In our case, we pass through to the + * loaded Extended MAPI provider. + * + */ VOID WINAPI MAPIUninitialize(void) { - FIXME("Stub\n"); + TRACE("()\n"); + + /* Try to uninitialise the Extended MAPI library */ + if (mapiFunctions.MAPIUninitialize) + mapiFunctions.MAPIUninitialize(); } HRESULT WINAPI MAPIAdminProfiles(ULONG ulFlags, LPPROFADMIN *lppProfAdmin) -- 2.11.4.GIT