ReactOS  0.4.14-dev-57-g333b8f1
mapi32_main.c File Reference
#include <stdarg.h>
#include "windef.h"
#include "winbase.h"
#include "winerror.h"
#include "objbase.h"
#include "initguid.h"
#include "mapix.h"
#include "mapiform.h"
#include "mapi.h"
#include "wine/debug.h"
#include "util.h"
Include dependency graph for mapi32_main.c:

Go to the source code of this file.

Functions

 WINE_DEFAULT_DEBUG_CHANNEL (mapi)
 
BOOL WINAPI DllMain (HINSTANCE hinstDLL, DWORD fdwReason, LPVOID fImpLoad)
 
HRESULT WINAPI DllGetClassObject (REFCLSID rclsid, REFIID iid, LPVOID *ppv)
 
HRESULT WINAPI DllCanUnloadNow (void)
 
HRESULT WINAPI MAPIInitialize (LPVOID init)
 
ULONG WINAPI MAPILogon (ULONG_PTR uiparam, LPSTR profile, LPSTR password, FLAGS flags, ULONG reserved, LPLHANDLE session)
 
ULONG WINAPI MAPILogoff (LHANDLE session, ULONG_PTR uiparam, FLAGS flags, ULONG reserved)
 
HRESULT WINAPI MAPILogonEx (ULONG_PTR uiparam, LPWSTR profile, LPWSTR password, ULONG flags, LPMAPISESSION *session)
 
HRESULT WINAPI MAPIOpenLocalFormContainer (LPVOID *ppfcnt)
 
VOID WINAPI MAPIUninitialize (void)
 
HRESULT WINAPI MAPIAdminProfiles (ULONG ulFlags, LPPROFADMIN *lppProfAdmin)
 
ULONG WINAPI MAPIAddress (LHANDLE session, ULONG_PTR uiparam, LPSTR caption, ULONG editfields, LPSTR labels, ULONG nRecips, lpMapiRecipDesc lpRecips, FLAGS flags, ULONG reserved, LPULONG newRecips, lpMapiRecipDesc *lppNewRecips)
 
ULONG WINAPI MAPIDeleteMail (LHANDLE session, ULONG_PTR uiparam, LPSTR msg_id, FLAGS flags, ULONG reserved)
 
ULONG WINAPI MAPIDetails (LHANDLE session, ULONG_PTR uiparam, lpMapiRecipDesc recip, FLAGS flags, ULONG reserved)
 
ULONG WINAPI MAPIFindNext (LHANDLE session, ULONG_PTR uiparam, LPSTR msg_type, LPSTR seed_msg_id, FLAGS flags, ULONG reserved, LPSTR msg_id)
 
ULONG WINAPI MAPIReadMail (LHANDLE session, ULONG_PTR uiparam, LPSTR msg_id, FLAGS flags, ULONG reserved, lpMapiMessage msg)
 
ULONG WINAPI MAPIResolveName (LHANDLE session, ULONG_PTR uiparam, LPSTR name, FLAGS flags, ULONG reserved, lpMapiRecipDesc *recip)
 
ULONG WINAPI MAPISaveMail (LHANDLE session, ULONG_PTR uiparam, lpMapiMessage msg, FLAGS flags, ULONG reserved, LPSTR msg_id)
 

Variables

DECLSPEC_HIDDEN LONG MAPI_ObjectCount = 0
 
DECLSPEC_HIDDEN HINSTANCE hInstMAPI32
 

Function Documentation

◆ DllCanUnloadNow()

HRESULT WINAPI DllCanUnloadNow ( void  )

Definition at line 93 of file mapi32_main.c.

94 {
95  HRESULT ret = S_OK;
96 
97  if (mapiFunctions.DllCanUnloadNow)
98  {
99  ret = mapiFunctions.DllCanUnloadNow();
100  TRACE("(): provider returns %d\n", ret);
101  }
102 
103  return MAPI_ObjectCount == 0 ? ret : S_FALSE;
104 }
#define S_FALSE
Definition: winerror.h:2357
#define TRACE(s)
Definition: solgame.cpp:4
LONG HRESULT
Definition: typedefs.h:77
int ret
MAPI_FUNCTIONS mapiFunctions
Definition: util.c:50
#define S_OK
Definition: intsafe.h:59
DECLSPEC_HIDDEN LONG MAPI_ObjectCount
Definition: mapi32_main.c:36

◆ DllGetClassObject()

HRESULT WINAPI DllGetClassObject ( REFCLSID  rclsid,
REFIID  iid,
LPVOID ppv 
)

Definition at line 65 of file mapi32_main.c.

66 {
67  if (mapiFunctions.DllGetClassObject)
68  {
69  HRESULT ret = mapiFunctions.DllGetClassObject(rclsid, iid, ppv);
70 
71  TRACE("ret: %x\n", ret);
72  return ret;
73  }
74 
75  FIXME("\n\tCLSID:\t%s,\n\tIID:\t%s\n", debugstr_guid(rclsid), debugstr_guid(iid));
76 
77  *ppv = NULL;
79 }
REFIID LPVOID * ppv
Definition: atlbase.h:39
#define CLASS_E_CLASSNOTAVAILABLE
Definition: winerror.h:2663
#define FIXME(fmt,...)
Definition: debug.h:110
smooth NULL
Definition: ftsmooth.c:416
#define debugstr_guid
Definition: kernel32.h:35
#define TRACE(s)
Definition: solgame.cpp:4
LONG HRESULT
Definition: typedefs.h:77
int ret
MAPI_FUNCTIONS mapiFunctions
Definition: util.c:50

◆ DllMain()

BOOL WINAPI DllMain ( HINSTANCE  hinstDLL,
DWORD  fdwReason,
LPVOID  fImpLoad 
)

Definition at line 42 of file mapi32_main.c.

43 {
44  TRACE("(%p,%d,%p)\n", hinstDLL, fdwReason, fImpLoad);
45 
46  switch (fdwReason)
47  {
48  case DLL_PROCESS_ATTACH:
49  hInstMAPI32 = hinstDLL;
50  DisableThreadLibraryCalls(hinstDLL);
52  break;
53  case DLL_PROCESS_DETACH:
54  if (fImpLoad) break;
55  TRACE("DLL_PROCESS_DETACH: %d objects remaining\n", MAPI_ObjectCount);
57  break;
58  }
59  return TRUE;
60 }
#define TRUE
Definition: types.h:120
BOOL WINAPI DisableThreadLibraryCalls(IN HMODULE hLibModule)
Definition: loader.c:85
#define DLL_PROCESS_ATTACH
Definition: compat.h:120
#define DLL_PROCESS_DETACH
Definition: compat.h:119
DECLSPEC_HIDDEN HINSTANCE hInstMAPI32
Definition: mapi32_main.c:37
#define TRACE(s)
Definition: solgame.cpp:4
void load_mapi_providers(void)
Definition: util.c:1024
void unload_mapi_providers(void)
Definition: util.c:1136
DWORD LPVOID fImpLoad
Definition: misc.cpp:155
DECLSPEC_HIDDEN LONG MAPI_ObjectCount
Definition: mapi32_main.c:36

◆ MAPIAddress()

ULONG WINAPI MAPIAddress ( LHANDLE  session,
ULONG_PTR  uiparam,
LPSTR  caption,
ULONG  editfields,
LPSTR  labels,
ULONG  nRecips,
lpMapiRecipDesc  lpRecips,
FLAGS  flags,
ULONG  reserved,
LPULONG  newRecips,
lpMapiRecipDesc lppNewRecips 
)

Definition at line 214 of file mapi32_main.c.

217 {
219  return mapiFunctions.MAPIAddress(session, uiparam, caption, editfields, labels,
220  nRecips, lpRecips, flags, reserved, newRecips, lppNewRecips);
221 
222  return MAPI_E_NOT_SUPPORTED;
223 }
LPMAPIADDRESS MAPIAddress
Definition: util.h:32
r reserved
Definition: btrfs.c:2893
#define MAPI_E_NOT_SUPPORTED
Definition: mapi.h:152
GLbitfield flags
Definition: glext.h:7161
MAPI_FUNCTIONS mapiFunctions
Definition: util.c:50

◆ MAPIAdminProfiles()

HRESULT WINAPI MAPIAdminProfiles ( ULONG  ulFlags,
LPPROFADMIN lppProfAdmin 
)

Definition at line 204 of file mapi32_main.c.

205 {
206  if (mapiFunctions.MAPIAdminProfiles)
207  return mapiFunctions.MAPIAdminProfiles(ulFlags, lppProfAdmin);
208 
209  FIXME("(%u, %p): stub\n", ulFlags, lppProfAdmin);
210  *lppProfAdmin = NULL;
211  return E_FAIL;
212 }
#define E_FAIL
Definition: ddrawi.h:102
#define FIXME(fmt,...)
Definition: debug.h:110
smooth NULL
Definition: ftsmooth.c:416
MAPI_FUNCTIONS mapiFunctions
Definition: util.c:50

◆ MAPIDeleteMail()

ULONG WINAPI MAPIDeleteMail ( LHANDLE  session,
ULONG_PTR  uiparam,
LPSTR  msg_id,
FLAGS  flags,
ULONG  reserved 
)

Definition at line 225 of file mapi32_main.c.

227 {
229  return mapiFunctions.MAPIDeleteMail(session, uiparam, msg_id, flags, reserved);
230 
231  return MAPI_E_NOT_SUPPORTED;
232 }
msg_id
Definition: edit.c:42
r reserved
Definition: btrfs.c:2893
LPMAPIDELETEMAIL MAPIDeleteMail
Definition: util.h:33
#define MAPI_E_NOT_SUPPORTED
Definition: mapi.h:152
GLbitfield flags
Definition: glext.h:7161
MAPI_FUNCTIONS mapiFunctions
Definition: util.c:50

◆ MAPIDetails()

ULONG WINAPI MAPIDetails ( LHANDLE  session,
ULONG_PTR  uiparam,
lpMapiRecipDesc  recip,
FLAGS  flags,
ULONG  reserved 
)

Definition at line 234 of file mapi32_main.c.

236 {
238  return mapiFunctions.MAPIDetails(session, uiparam, recip, flags, reserved);
239 
240  return MAPI_E_NOT_SUPPORTED;
241 }
LPMAPIDETAILS MAPIDetails
Definition: util.h:34
r reserved
Definition: btrfs.c:2893
#define MAPI_E_NOT_SUPPORTED
Definition: mapi.h:152
GLbitfield flags
Definition: glext.h:7161
MAPI_FUNCTIONS mapiFunctions
Definition: util.c:50

◆ MAPIFindNext()

ULONG WINAPI MAPIFindNext ( LHANDLE  session,
ULONG_PTR  uiparam,
LPSTR  msg_type,
LPSTR  seed_msg_id,
FLAGS  flags,
ULONG  reserved,
LPSTR  msg_id 
)

Definition at line 243 of file mapi32_main.c.

245 {
247  return mapiFunctions.MAPIFindNext(session, uiparam, msg_type, seed_msg_id, flags, reserved, msg_id);
248 
249  return MAPI_E_NOT_SUPPORTED;
250 }
msg_id
Definition: edit.c:42
r reserved
Definition: btrfs.c:2893
#define MAPI_E_NOT_SUPPORTED
Definition: mapi.h:152
GLbitfield flags
Definition: glext.h:7161
LPMAPIFINDNEXT MAPIFindNext
Definition: util.h:35
msg_type
Definition: rpc_msg.h:77
MAPI_FUNCTIONS mapiFunctions
Definition: util.c:50

◆ MAPIInitialize()

HRESULT WINAPI MAPIInitialize ( LPVOID  init)

Definition at line 112 of file mapi32_main.c.

113 {
114  TRACE("(%p)\n", init);
115 
118 
119  return MAPI_E_NOT_INITIALIZED;
120 }
static int init
Definition: wintirpc.c:33
#define TRACE(s)
Definition: solgame.cpp:4
MAPI_FUNCTIONS mapiFunctions
Definition: util.c:50
LPMAPIINITIALIZE MAPIInitialize
Definition: util.h:36
#define MAPI_E_NOT_INITIALIZED
Definition: mapicode.h:77

◆ MAPILogoff()

ULONG WINAPI MAPILogoff ( LHANDLE  session,
ULONG_PTR  uiparam,
FLAGS  flags,
ULONG  reserved 
)

Definition at line 149 of file mapi32_main.c.

151 {
152  TRACE("(0x%08lx 0x%08lx 0x%08x 0x%08x)\n", session,
153  uiparam, flags, reserved);
154 
156  return mapiFunctions.MAPILogoff(session, uiparam, flags, reserved);
157 
158  return SUCCESS_SUCCESS;
159 }
r reserved
Definition: btrfs.c:2893
#define TRACE(s)
Definition: solgame.cpp:4
GLbitfield flags
Definition: glext.h:7161
MAPI_FUNCTIONS mapiFunctions
Definition: util.c:50
LPMAPILOGOFF MAPILogoff
Definition: util.h:37
#define SUCCESS_SUCCESS
Definition: mapi.h:122

◆ MAPILogon()

ULONG WINAPI MAPILogon ( ULONG_PTR  uiparam,
LPSTR  profile,
LPSTR  password,
FLAGS  flags,
ULONG  reserved,
LPLHANDLE  session 
)

Definition at line 129 of file mapi32_main.c.

131 {
132  TRACE("(0x%08lx %s %p 0x%08x 0x%08x %p)\n", uiparam,
133  debugstr_a(profile), password, flags, reserved, session);
134 
136  return mapiFunctions.MAPILogon(uiparam, profile, password, flags, reserved, session);
137 
138  if (session) *session = 1;
139  return SUCCESS_SUCCESS;
140 }
r reserved
Definition: btrfs.c:2893
#define TRACE(s)
Definition: solgame.cpp:4
#define debugstr_a
Definition: kernel32.h:31
GLbitfield flags
Definition: glext.h:7161
T1_FIELD_DICT_PRIVATE password
Definition: t1tokens.h:64
LPMAPILOGON MAPILogon
Definition: util.h:38
MAPI_FUNCTIONS mapiFunctions
Definition: util.c:50
#define SUCCESS_SUCCESS
Definition: mapi.h:122
#define profile
Definition: kernel32.h:12

◆ MAPILogonEx()

HRESULT WINAPI MAPILogonEx ( ULONG_PTR  uiparam,
LPWSTR  profile,
LPWSTR  password,
ULONG  flags,
LPMAPISESSION session 
)

Definition at line 167 of file mapi32_main.c.

169 {
170  TRACE("(0x%08lx %s %p 0x%08x %p)\n", uiparam,
171  debugstr_w(profile), password, flags, session);
172 
174  return mapiFunctions.MAPILogonEx(uiparam, profile, password, flags, session);
175 
176  return E_FAIL;
177 }
#define E_FAIL
Definition: ddrawi.h:102
LPMAPILOGONEX MAPILogonEx
Definition: util.h:39
#define debugstr_w
Definition: kernel32.h:32
#define TRACE(s)
Definition: solgame.cpp:4
GLbitfield flags
Definition: glext.h:7161
T1_FIELD_DICT_PRIVATE password
Definition: t1tokens.h:64
MAPI_FUNCTIONS mapiFunctions
Definition: util.c:50
#define profile
Definition: kernel32.h:12

◆ MAPIOpenLocalFormContainer()

HRESULT WINAPI MAPIOpenLocalFormContainer ( LPVOID ppfcnt)

Definition at line 179 of file mapi32_main.c.

180 {
181  if (mapiFunctions.MAPIOpenLocalFormContainer)
182  return mapiFunctions.MAPIOpenLocalFormContainer(ppfcnt);
183 
184  FIXME("(%p) Stub\n", ppfcnt);
185  return E_FAIL;
186 }
#define E_FAIL
Definition: ddrawi.h:102
#define FIXME(fmt,...)
Definition: debug.h:110
MAPI_FUNCTIONS mapiFunctions
Definition: util.c:50

◆ MAPIReadMail()

ULONG WINAPI MAPIReadMail ( LHANDLE  session,
ULONG_PTR  uiparam,
LPSTR  msg_id,
FLAGS  flags,
ULONG  reserved,
lpMapiMessage  msg 
)

Definition at line 252 of file mapi32_main.c.

254 {
256  return mapiFunctions.MAPIReadMail(session, uiparam, msg_id, flags, reserved, msg);
257 
258  return MAPI_E_NOT_SUPPORTED;
259 }
msg_id
Definition: edit.c:42
r reserved
Definition: btrfs.c:2893
LPMAPIREADMAIL MAPIReadMail
Definition: util.h:40
#define MAPI_E_NOT_SUPPORTED
Definition: mapi.h:152
GLbitfield flags
Definition: glext.h:7161
MAPI_FUNCTIONS mapiFunctions
Definition: util.c:50
#define msg(x)
Definition: auth_time.c:54

◆ MAPIResolveName()

ULONG WINAPI MAPIResolveName ( LHANDLE  session,
ULONG_PTR  uiparam,
LPSTR  name,
FLAGS  flags,
ULONG  reserved,
lpMapiRecipDesc recip 
)

Definition at line 261 of file mapi32_main.c.

263 {
265  return mapiFunctions.MAPIResolveName(session, uiparam, name, flags, reserved, recip);
266 
267  return MAPI_E_NOT_SUPPORTED;
268 }
LPMAPIRESOLVENAME MAPIResolveName
Definition: util.h:41
r reserved
Definition: btrfs.c:2893
#define MAPI_E_NOT_SUPPORTED
Definition: mapi.h:152
GLbitfield flags
Definition: glext.h:7161
MAPI_FUNCTIONS mapiFunctions
Definition: util.c:50
Definition: name.c:36

◆ MAPISaveMail()

ULONG WINAPI MAPISaveMail ( LHANDLE  session,
ULONG_PTR  uiparam,
lpMapiMessage  msg,
FLAGS  flags,
ULONG  reserved,
LPSTR  msg_id 
)

Definition at line 270 of file mapi32_main.c.

272 {
274  return mapiFunctions.MAPISaveMail(session, uiparam, msg, flags, reserved, msg_id);
275 
276  return MAPI_E_NOT_SUPPORTED;
277 }
msg_id
Definition: edit.c:42
r reserved
Definition: btrfs.c:2893
#define MAPI_E_NOT_SUPPORTED
Definition: mapi.h:152
LPMAPISAVEMAIL MAPISaveMail
Definition: util.h:42
GLbitfield flags
Definition: glext.h:7161
MAPI_FUNCTIONS mapiFunctions
Definition: util.c:50
#define msg(x)
Definition: auth_time.c:54

◆ MAPIUninitialize()

VOID WINAPI MAPIUninitialize ( void  )

Definition at line 195 of file mapi32_main.c.

196 {
197  TRACE("()\n");
198 
199  /* Try to uninitialise the Extended MAPI library */
202 }
LPMAPIUNINITIALIZE MAPIUninitialize
Definition: util.h:46
#define TRACE(s)
Definition: solgame.cpp:4
MAPI_FUNCTIONS mapiFunctions
Definition: util.c:50

◆ WINE_DEFAULT_DEBUG_CHANNEL()

WINE_DEFAULT_DEBUG_CHANNEL ( mapi  )

Variable Documentation

◆ hInstMAPI32

Definition at line 37 of file mapi32_main.c.

Referenced by DllMain(), MAPISendMail(), and MAPISendMailW().

◆ MAPI_ObjectCount

DECLSPEC_HIDDEN LONG MAPI_ObjectCount = 0