4 * Copyright 2009 Owen Rudge for CodeWeavers
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
30 #include "wine/debug.h"
32 WINE_DEFAULT_DEBUG_CHANNEL(winemapi
);
34 /***********************************************************************
35 * DllMain (MAPI32.init)
37 BOOL WINAPI
DllMain(HINSTANCE hinstDLL
, DWORD fdwReason
, LPVOID fImpLoad
)
39 TRACE("(%p,%d,%p)\n", hinstDLL
, fdwReason
, fImpLoad
);
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
)
48 return MAPI_E_NOT_SUPPORTED
;
51 ULONG WINAPI
MAPIDeleteMail(LHANDLE session
, ULONG_PTR uiparam
, LPSTR msg_id
,
52 FLAGS flags
, ULONG reserved
)
55 return MAPI_E_NOT_SUPPORTED
;
58 ULONG WINAPI
MAPIDetails(LHANDLE session
, ULONG_PTR uiparam
, lpMapiRecipDesc recip
,
59 FLAGS flags
, ULONG reserved
)
62 return MAPI_E_NOT_SUPPORTED
;
65 ULONG WINAPI
MAPIFindNext(LHANDLE session
, ULONG_PTR uiparam
, LPSTR msg_type
,
66 LPSTR seed_msg_id
, FLAGS flags
, ULONG reserved
, LPSTR msg_id
)
69 return MAPI_E_NOT_SUPPORTED
;
72 ULONG WINAPI
MAPILogon(ULONG_PTR uiparam
, LPSTR profile
, LPSTR password
,
73 FLAGS flags
, ULONG reserved
, LPLHANDLE session
)
75 TRACE("(0x%08lx %s %p 0x%08x 0x%08x %p)\n", uiparam
,
76 debugstr_a(profile
), password
, flags
, reserved
, session
);
81 return SUCCESS_SUCCESS
;
84 ULONG WINAPI
MAPILogoff(LHANDLE session
, ULONG_PTR uiparam
, FLAGS flags
,
87 TRACE("(0x%08lx 0x%08lx 0x%08x 0x%08x)\n", session
,
88 uiparam
, flags
, reserved
);
90 return SUCCESS_SUCCESS
;
93 ULONG WINAPI
MAPIReadMail(LHANDLE session
, ULONG_PTR uiparam
, LPSTR msg_id
,
94 FLAGS flags
, ULONG reserved
, lpMapiMessage msg
)
97 return MAPI_E_NOT_SUPPORTED
;
100 ULONG WINAPI
MAPIResolveName(LHANDLE session
, ULONG_PTR uiparam
, LPSTR name
,
101 FLAGS flags
, ULONG reserved
, lpMapiRecipDesc
*recip
)
103 static const char smtp
[] = "SMTP:";
108 TRACE("(0x%08lx 0x%08lx %s 0x%08x 0x%08x %p)\n", session
, uiparam
,
109 debugstr_a(name
), flags
, reserved
, recip
);
111 if (!name
|| !strlen(name
))
112 return MAPI_E_FAILURE
;
114 scode
= MAPIAllocateBuffer(sizeof(**recip
) + sizeof(smtp
) + strlen(name
),
117 return MAPI_E_INSUFFICIENT_MEMORY
;
119 ZeroMemory(*recip
, sizeof(**recip
));
120 p
= (char *)(*recip
+ 1);
122 strcpy(p
+ sizeof(smtp
) - 1, name
);
124 (*recip
)->ulRecipClass
= MAPI_TO
;
125 (*recip
)->lpszName
= p
+ sizeof(smtp
) - 1;
126 (*recip
)->lpszAddress
= p
;
127 return SUCCESS_SUCCESS
;
130 ULONG WINAPI
MAPISaveMail(LHANDLE session
, ULONG_PTR uiparam
, lpMapiMessage msg
,
131 FLAGS flags
, ULONG reserved
, LPSTR msg_id
)
134 return MAPI_E_NOT_SUPPORTED
;