4 * Copyright 2001, 2009 CodeWeavers Inc.
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2.1 of the License, or (at your option) any later version.
11 * This library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with this library; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
31 #include "wine/debug.h"
34 WINE_DEFAULT_DEBUG_CHANNEL(mapi
);
36 LONG MAPI_ObjectCount
= 0;
38 /***********************************************************************
39 * DllMain (MAPI32.init)
41 BOOL WINAPI
DllMain(HINSTANCE hinstDLL
, DWORD fdwReason
, LPVOID fImpLoad
)
43 TRACE("(%p,%d,%p)\n", hinstDLL
, fdwReason
, fImpLoad
);
47 case DLL_PROCESS_ATTACH
:
48 DisableThreadLibraryCalls(hinstDLL
);
49 load_mapi_providers();
51 case DLL_PROCESS_DETACH
:
52 TRACE("DLL_PROCESS_DETACH: %d objects remaining\n", MAPI_ObjectCount
);
53 unload_mapi_providers();
59 /***********************************************************************
60 * DllGetClassObject (MAPI32.27)
62 HRESULT WINAPI
DllGetClassObject(REFCLSID rclsid
, REFIID iid
, LPVOID
*ppv
)
65 FIXME("\n\tCLSID:\t%s,\n\tIID:\t%s\n", debugstr_guid(rclsid
), debugstr_guid(iid
));
66 return CLASS_E_CLASSNOTAVAILABLE
;
69 /***********************************************************************
70 * DllCanUnloadNow (MAPI32.28)
72 * Determine if this dll can be unloaded from the callers address space.
78 * S_OK, if the dll can be unloaded,
81 HRESULT WINAPI
DllCanUnloadNow(void)
83 return MAPI_ObjectCount
== 0 ? S_OK
: S_FALSE
;
86 HRESULT WINAPI
MAPIInitialize(LPVOID init
)
88 FIXME("(%p) Stub\n", init
);
89 return SUCCESS_SUCCESS
;
92 ULONG WINAPI
MAPILogon(ULONG_PTR uiparam
, LPSTR profile
, LPSTR password
,
93 FLAGS flags
, ULONG reserved
, LPLHANDLE session
)
95 FIXME("(0x%08lx %s %p 0x%08x 0x%08x %p) Stub\n", uiparam
,
96 debugstr_a(profile
), password
, flags
, reserved
, session
);
98 if (session
) *session
= 1;
99 return SUCCESS_SUCCESS
;
102 ULONG WINAPI
MAPILogoff(LHANDLE session
, ULONG_PTR uiparam
, FLAGS flags
,
105 FIXME("(0x%08lx 0x%08lx 0x%08x 0x%08x) Stub\n", session
,
106 uiparam
, flags
, reserved
);
107 return SUCCESS_SUCCESS
;
110 HRESULT WINAPI
MAPILogonEx(ULONG_PTR uiparam
, LPWSTR profile
,
111 LPWSTR password
, ULONG flags
, LPMAPISESSION
*session
)
113 FIXME("(0x%08lx %s %p 0x%08x %p) Stub\n", uiparam
,
114 debugstr_w(profile
), password
, flags
, session
);
115 return SUCCESS_SUCCESS
;
118 HRESULT WINAPI
MAPIOpenLocalFormContainer(LPVOID
*ppfcnt
)
120 FIXME("(%p) Stub\n", ppfcnt
);
124 VOID WINAPI
MAPIUninitialize(void)
129 HRESULT WINAPI
MAPIAdminProfiles(ULONG ulFlags
, LPPROFADMIN
*lppProfAdmin
)
131 FIXME("(%u, %p): stub\n", ulFlags
, lppProfAdmin
);
132 *lppProfAdmin
= NULL
;