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