[eterhack 1/4] winemapi: Implement MAPIResolveName (eterbug #6747).

Alexander Morozov amorozov на etersoft.ru
Чт Янв 13 16:56:24 MSK 2011


---
 dlls/winemapi/Makefile.in |    2 +-
 dlls/winemapi/main.c      |   28 ++++++++++++++++++++++++++--
 2 files changed, 27 insertions(+), 3 deletions(-)

diff --git a/dlls/winemapi/Makefile.in b/dlls/winemapi/Makefile.in
index 0c1ff6e..0c9c8a6 100644
--- a/dlls/winemapi/Makefile.in
+++ b/dlls/winemapi/Makefile.in
@@ -1,5 +1,5 @@
 MODULE    = winemapi.dll
-IMPORTS   = shlwapi shell32
+IMPORTS   = shlwapi shell32 mapi32
 
 C_SRCS = \
 	main.c \
diff --git a/dlls/winemapi/main.c b/dlls/winemapi/main.c
index a954ab7..0627aa2 100644
--- a/dlls/winemapi/main.c
+++ b/dlls/winemapi/main.c
@@ -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,
-- 
1.7.3.4


------------e8Ehp0EWD5AyIg6qya9bPo--



Подробная информация о списке рассылки Wine-patches