winemapi: Implement MAPIResolveName.

This commit is contained in:
Alexander Morozov 2011-01-13 16:56:24 +03:00 committed by Alexandre Julliard
parent 2133b6c38d
commit e5dee7d965
2 changed files with 27 additions and 3 deletions

View File

@ -1,5 +1,5 @@
MODULE = winemapi.dll
IMPORTS = shlwapi shell32
IMPORTS = shlwapi shell32 mapi32
C_SRCS = \
main.c \

View File

@ -26,6 +26,7 @@
#include "objbase.h"
#include "mapidefs.h"
#include "mapi.h"
#include "mapix.h"
#include "wine/debug.h"
WINE_DEFAULT_DEBUG_CHANNEL(winemapi);
@ -99,8 +100,31 @@ ULONG WINAPI MAPIReadMail(LHANDLE session, ULONG_PTR uiparam, LPSTR msg_id,
ULONG WINAPI MAPIResolveName(LHANDLE session, ULONG_PTR uiparam, LPSTR name,
FLAGS flags, ULONG reserved, lpMapiRecipDesc *recip)
{
FIXME("(stub)\n");
return MAPI_E_NOT_SUPPORTED;
static const char smtp[] = "SMTP:";
SCODE scode;
char *p;
TRACE("(0x%08lx 0x%08lx %s 0x%08x 0x%08x %p)\n", session, uiparam,
debugstr_a(name), flags, reserved, recip);
if (!name || !strlen(name))
return MAPI_E_FAILURE;
scode = MAPIAllocateBuffer(sizeof(**recip) + sizeof(smtp) + strlen(name),
(LPVOID *)recip);
if (scode != S_OK)
return MAPI_E_INSUFFICIENT_MEMORY;
ZeroMemory(*recip, sizeof(**recip));
p = (char *)(*recip + 1);
strcpy(p, smtp);
strcpy(p + sizeof(smtp) - 1, name);
(*recip)->ulRecipClass = MAPI_TO;
(*recip)->lpszName = p + sizeof(smtp) - 1;
(*recip)->lpszAddress = p;
return SUCCESS_SUCCESS;
}
ULONG WINAPI MAPISaveMail(LHANDLE session, ULONG_PTR uiparam, lpMapiMessage msg,