comctl32: Add EnumMRUList tests.
[wine] / dlls / mapi32 / mapi32_main.c
1 /*
2  *             MAPI basics
3  *
4  * Copyright 2001 CodeWeavers Inc.
5  *
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.
10  *
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.
15  *
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
19  */
20
21 #include <stdarg.h>
22
23 #include "windef.h"
24 #include "winbase.h"
25 #include "winerror.h"
26 #include "objbase.h"
27 #include "mapix.h"
28 #include "mapiform.h"
29 #include "mapi.h"
30 #include "wine/debug.h"
31
32 WINE_DEFAULT_DEBUG_CHANNEL(mapi);
33
34 LONG MAPI_ObjectCount = 0;
35
36 /***********************************************************************
37  *              DllMain (MAPI32.init)
38  */
39 BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID fImpLoad)
40 {
41     TRACE("(%p,%d,%p)\n", hinstDLL, fdwReason, fImpLoad);
42
43     switch (fdwReason)
44     {
45     case DLL_PROCESS_ATTACH:
46         DisableThreadLibraryCalls(hinstDLL);
47         break;
48     case DLL_PROCESS_DETACH:
49         TRACE("DLL_PROCESS_DETACH: %d objects remaining\n", MAPI_ObjectCount);
50         break;
51     }
52     return TRUE;
53 }
54
55 /***********************************************************************
56  *              DllGetClassObject (MAPI32.27)
57  */
58 HRESULT WINAPI DllGetClassObject(REFCLSID rclsid, REFIID iid, LPVOID *ppv)
59 {
60     *ppv = NULL;
61     FIXME("\n\tCLSID:\t%s,\n\tIID:\t%s\n", debugstr_guid(rclsid), debugstr_guid(iid));
62     return CLASS_E_CLASSNOTAVAILABLE;
63 }
64
65 /***********************************************************************
66  * DllCanUnloadNow (MAPI32.28)
67  *
68  * Determine if this dll can be unloaded from the callers address space.
69  *
70  * PARAMS
71  *  None.
72  *
73  * RETURNS
74  *  S_OK, if the dll can be unloaded,
75  *  S_FALSE, otherwise.
76  */
77 HRESULT WINAPI DllCanUnloadNow(void)
78 {
79     return MAPI_ObjectCount == 0 ? S_OK : S_FALSE;
80 }
81
82 HRESULT WINAPI MAPIInitialize(LPVOID init)
83 {
84     FIXME("(%p) Stub\n", init);
85     return SUCCESS_SUCCESS;
86 }
87
88 ULONG WINAPI MAPILogon(ULONG_PTR uiparam, LPSTR profile, LPSTR password,
89     FLAGS flags, ULONG reserved, LPLHANDLE session)
90 {
91     FIXME("(0x%08lx %s %p 0x%08lx 0x%08x %p) Stub\n", uiparam,
92           debugstr_a(profile), password, flags, reserved, session);
93
94     if (session) *session = 1;
95     return SUCCESS_SUCCESS;
96 }
97
98 ULONG WINAPI MAPILogoff(LHANDLE session, ULONG_PTR uiparam, FLAGS flags,
99     ULONG reserved )
100 {
101     FIXME("(0x%08lx 0x%08lx 0x%08lx 0x%08x) Stub\n", session,
102           uiparam, flags, reserved);
103     return SUCCESS_SUCCESS;
104 }
105
106 HRESULT WINAPI MAPILogonEx(ULONG_PTR uiparam, LPWSTR profile,
107     LPWSTR password, ULONG flags, LPMAPISESSION *session)
108 {
109     FIXME("(0x%08lx %s %p 0x%08x %p) Stub\n", uiparam,
110           debugstr_w(profile), password, flags, session);
111     return SUCCESS_SUCCESS;
112 }
113
114 HRESULT WINAPI MAPIOpenLocalFormContainer(LPVOID *ppfcnt)
115 {
116     FIXME("(%p) Stub\n", ppfcnt);
117     return E_FAIL;
118 }
119
120 VOID WINAPI MAPIUninitialize(void)
121 {
122     FIXME("Stub\n");
123 }
124
125 HRESULT WINAPI MAPIAdminProfiles(ULONG ulFlags,  LPPROFADMIN *lppProfAdmin)
126 {
127     FIXME("(%u, %p): stub\n", ulFlags, lppProfAdmin);
128     *lppProfAdmin = NULL;
129     return E_FAIL;
130 }