winsock: Implement getnameinfo.
[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., 59 Temple Place, Suite 330, Boston, MA  02111-1307  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 "wine/debug.h"
29
30 WINE_DEFAULT_DEBUG_CHANNEL(mapi);
31
32 LONG MAPI_ObjectCount = 0;
33
34 /***********************************************************************
35  *              DllMain (MAPI32.init)
36  */
37 BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID fImpLoad)
38 {
39     TRACE("(%p,%ld,%p)\n", hinstDLL, fdwReason, fImpLoad);
40
41     switch (fdwReason)
42     {
43     case DLL_PROCESS_ATTACH:
44         DisableThreadLibraryCalls(hinstDLL);
45         break;
46     case DLL_PROCESS_DETACH:
47         TRACE("DLL_PROCESS_DETACH: %ld objects remaining\n", MAPI_ObjectCount);
48         break;
49     }
50     return TRUE;
51 }
52
53 /***********************************************************************
54  * DllCanUnloadNow (MAPI32.28)
55  *
56  * Determine if this dll can be unloaded from the callers address space.
57  *
58  * PARAMS
59  *  None.
60  *
61  * RETURNS
62  *  S_OK, if the dll can be unloaded,
63  *  S_FALSE, otherwise.
64  */
65 HRESULT WINAPI DllCanUnloadNow(void)
66 {
67     return MAPI_ObjectCount == 0 ? S_OK : S_FALSE;
68 }
69
70 HRESULT WINAPI MAPIInitialize(LPVOID init)
71 {
72     FIXME("(%p) Stub\n", init);
73     return SUCCESS_SUCCESS;
74 }
75
76 ULONG WINAPI MAPILogon(ULONG uiparam, LPSTR profile, LPSTR password,
77     FLAGS flags, ULONG reserved, LPLHANDLE session)
78 {
79     FIXME("(0x%08lx %s %p 0x%08lx 0x%08lx %p) Stub\n", uiparam,
80           debugstr_a(profile), password, flags, reserved, session);
81
82     if (session) *session = 1;
83     return SUCCESS_SUCCESS;
84 }
85
86 ULONG WINAPI MAPILogoff(LHANDLE session, ULONG uiparam, FLAGS flags,
87     ULONG reserved )
88 {
89     FIXME("(0x%08lx 0x%08lx 0x%08lx 0x%08lx) Stub\n", session,
90           uiparam, flags, reserved);
91     return SUCCESS_SUCCESS;
92 }
93
94 HRESULT WINAPI MAPILogonEx(ULONG_PTR uiparam, LPWSTR profile,
95     LPWSTR password, ULONG flags, LPMAPISESSION *session)
96 {
97     FIXME("(0x%08lx %s %p 0x%08lx %p) Stub\n", uiparam,
98           debugstr_w(profile), password, flags, session);
99     return SUCCESS_SUCCESS;
100 }
101
102 VOID WINAPI MAPIUninitialize(void)
103 {
104     FIXME("Stub\n");
105 }