dinput: Added ConfigureDevices A to W crosscall.
[wine] / dlls / winemapi / main.c
1 /*
2  *             Wine MAPI provider
3  *
4  * Copyright 2009 Owen Rudge for CodeWeavers
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 "mapidefs.h"
28 #include "mapi.h"
29 #include "mapix.h"
30 #include "wine/debug.h"
31
32 WINE_DEFAULT_DEBUG_CHANNEL(winemapi);
33
34 /***********************************************************************
35  *              DllMain (MAPI32.init)
36  */
37 BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID fImpLoad)
38 {
39     TRACE("(%p,%d,%p)\n", hinstDLL, fdwReason, fImpLoad);
40     return TRUE;
41 }
42
43 ULONG WINAPI MAPIAddress(LHANDLE session, ULONG_PTR uiparam, LPSTR caption,
44     ULONG editfields, LPSTR labels, ULONG nRecips, lpMapiRecipDesc lpRecips,
45     FLAGS flags, ULONG reserved, LPULONG newRecips, lpMapiRecipDesc * lppNewRecips)
46 {
47     FIXME("(stub)\n");
48     return MAPI_E_NOT_SUPPORTED;
49 }
50
51 ULONG WINAPI MAPIDeleteMail(LHANDLE session, ULONG_PTR uiparam, LPSTR msg_id,
52     FLAGS flags, ULONG reserved)
53 {
54     FIXME("(stub)\n");
55     return MAPI_E_NOT_SUPPORTED;
56 }
57
58 ULONG WINAPI MAPIDetails(LHANDLE session, ULONG_PTR uiparam, lpMapiRecipDesc recip,
59     FLAGS flags, ULONG reserved)
60 {
61     FIXME("(stub)\n");
62     return MAPI_E_NOT_SUPPORTED;
63 }
64
65 ULONG WINAPI MAPIFindNext(LHANDLE session, ULONG_PTR uiparam, LPSTR msg_type,
66     LPSTR seed_msg_id, FLAGS flags, ULONG reserved, LPSTR msg_id)
67 {
68     FIXME("(stub)\n");
69     return MAPI_E_NOT_SUPPORTED;
70 }
71
72 ULONG WINAPI MAPILogon(ULONG_PTR uiparam, LPSTR profile, LPSTR password,
73     FLAGS flags, ULONG reserved, LPLHANDLE session)
74 {
75     TRACE("(0x%08lx %s %p 0x%08x 0x%08x %p)\n", uiparam,
76           debugstr_a(profile), password, flags, reserved, session);
77
78     if (session)
79         *session = 1;
80
81     return SUCCESS_SUCCESS;
82 }
83
84 ULONG WINAPI MAPILogoff(LHANDLE session, ULONG_PTR uiparam, FLAGS flags,
85     ULONG reserved)
86 {
87     TRACE("(0x%08lx 0x%08lx 0x%08x 0x%08x)\n", session,
88           uiparam, flags, reserved);
89
90     return SUCCESS_SUCCESS;
91 }
92
93 ULONG WINAPI MAPIReadMail(LHANDLE session, ULONG_PTR uiparam, LPSTR msg_id,
94     FLAGS flags, ULONG reserved, lpMapiMessage msg)
95 {
96     FIXME("(stub)\n");
97     return MAPI_E_NOT_SUPPORTED;
98 }
99
100 ULONG WINAPI MAPIResolveName(LHANDLE session, ULONG_PTR uiparam, LPSTR name,
101     FLAGS flags, ULONG reserved, lpMapiRecipDesc *recip)
102 {
103     static const char smtp[] = "SMTP:";
104
105     SCODE scode;
106     char *p;
107
108     TRACE("(0x%08lx 0x%08lx %s 0x%08x 0x%08x %p)\n", session, uiparam,
109           debugstr_a(name), flags, reserved, recip);
110
111     if (!name || !strlen(name))
112         return MAPI_E_FAILURE;
113
114     scode = MAPIAllocateBuffer(sizeof(**recip) + sizeof(smtp) + strlen(name),
115                                (LPVOID *)recip);
116     if (scode != S_OK)
117         return MAPI_E_INSUFFICIENT_MEMORY;
118
119     ZeroMemory(*recip, sizeof(**recip));
120     p = (char *)(*recip + 1);
121     strcpy(p, smtp);
122     strcpy(p + sizeof(smtp) - 1, name);
123
124     (*recip)->ulRecipClass = MAPI_TO;
125     (*recip)->lpszName = p + sizeof(smtp) - 1;
126     (*recip)->lpszAddress = p;
127     return SUCCESS_SUCCESS;
128 }
129
130 ULONG WINAPI MAPISaveMail(LHANDLE session, ULONG_PTR uiparam, lpMapiMessage msg,
131     FLAGS flags, ULONG reserved, LPSTR msg_id)
132 {
133     FIXME("(stub)\n");
134     return MAPI_E_NOT_SUPPORTED;
135 }