Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
b4b7724a
Commit
b4b7724a
authored
Dec 16, 2009
by
Owen Rudge
Committed by
Alexandre Julliard
Dec 17, 2009
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mapi32: Remove fallback procedure in MAPISendMail and replace with error message.
parent
75f52140
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
71 additions
and
144 deletions
+71
-144
En.rc
dlls/mapi32/En.rc
+30
-0
Makefile.in
dlls/mapi32/Makefile.in
+4
-2
mapi32_main.c
dlls/mapi32/mapi32_main.c
+2
-0
res.h
dlls/mapi32/res.h
+26
-0
sendmail.c
dlls/mapi32/sendmail.c
+8
-142
util.h
dlls/mapi32/util.h
+1
-0
No files found.
dlls/mapi32/En.rc
0 → 100644
View file @
b4b7724a
/*
* MAPI32 English resources
*
* Copyright 2009 Owen Rudge for CodeWeavers
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*
*/
#include "res.h"
LANGUAGE LANG_ENGLISH, SUBLANG_DEFAULT
STRINGTABLE
{
IDS_NO_MAPI_CLIENT, "Mail sending failed as you do not have a MAPI mail client installed."
IDS_SEND_MAIL, "Send Mail"
}
dlls/mapi32/Makefile.in
View file @
b4b7724a
...
...
@@ -4,7 +4,7 @@ SRCDIR = @srcdir@
VPATH
=
@srcdir@
MODULE
=
mapi32.dll
IMPORTLIB
=
mapi32
IMPORTS
=
uuid shlwapi shell32 advapi32 kernel32
IMPORTS
=
uuid shlwapi shell32
user32
advapi32 kernel32
C_SRCS
=
\
imalloc.c
\
...
...
@@ -13,7 +13,9 @@ C_SRCS = \
sendmail.c
\
util.c
RC_SRCS
=
version.rc
RC_SRCS
=
\
En.rc
\
version.rc
@MAKE_DLL_RULES@
...
...
dlls/mapi32/mapi32_main.c
View file @
b4b7724a
...
...
@@ -34,6 +34,7 @@
WINE_DEFAULT_DEBUG_CHANNEL
(
mapi
);
LONG
MAPI_ObjectCount
=
0
;
HINSTANCE
hInstMAPI32
;
/***********************************************************************
* DllMain (MAPI32.init)
...
...
@@ -45,6 +46,7 @@ BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID fImpLoad)
switch
(
fdwReason
)
{
case
DLL_PROCESS_ATTACH
:
hInstMAPI32
=
hinstDLL
;
DisableThreadLibraryCalls
(
hinstDLL
);
load_mapi_providers
();
break
;
...
...
dlls/mapi32/res.h
0 → 100644
View file @
b4b7724a
/*
* MAPI32 resources
*
* Copyright 2009 Owen Rudge for CodeWeavers
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*
*/
#include <windef.h>
/* Strings */
#define IDS_NO_MAPI_CLIENT 1
#define IDS_SEND_MAIL 2
dlls/mapi32/sendmail.c
View file @
b4b7724a
...
...
@@ -30,6 +30,7 @@
#include "windef.h"
#include "winbase.h"
#include "winerror.h"
#include "winuser.h"
#include "objbase.h"
#include "objidl.h"
#include "mapi.h"
...
...
@@ -41,6 +42,7 @@
#include "shlwapi.h"
#include "wine/debug.h"
#include "util.h"
#include "res.h"
WINE_DEFAULT_DEBUG_CHANNEL
(
mapi
);
...
...
@@ -383,27 +385,11 @@ cleanup: ;
* Success: SUCCESS_SUCCESS
* Failure: MAPI_E_FAILURE
*
* NOTES
* The fallback procedure is a temporary hack.
*/
ULONG
WINAPI
MAPISendMail
(
LHANDLE
session
,
ULONG_PTR
uiparam
,
lpMapiMessage
message
,
FLAGS
flags
,
ULONG
reserved
)
{
ULONG
ret
=
MAPI_E_FAILURE
;
unsigned
int
i
,
to_count
=
0
,
cc_count
=
0
,
bcc_count
=
0
;
unsigned
int
to_size
=
0
,
cc_size
=
0
,
bcc_size
=
0
,
subj_size
,
body_size
;
char
*
to
=
NULL
,
*
cc
=
NULL
,
*
bcc
=
NULL
;
const
char
*
address
,
*
subject
,
*
body
;
static
const
char
format
[]
=
"mailto:
\"
%s
\"
?subject=
\"
%s
\"
&cc=
\"
%s
\"
&bcc=
\"
%s
\"
&body=
\"
%s
\"
"
;
char
*
mailto
=
NULL
,
*
escape
=
NULL
;
char
empty_string
[]
=
""
;
HRESULT
res
;
DWORD
size
;
TRACE
(
"(0x%08lx 0x%08lx %p 0x%08x 0x%08x)
\n
"
,
session
,
uiparam
,
message
,
flags
,
reserved
);
WCHAR
msg_title
[
READ_BUF_SIZE
],
error_msg
[
READ_BUF_SIZE
];
/* Check to see if we have a Simple MAPI provider loaded */
if
(
mapiFunctions
.
MAPISendMail
)
...
...
@@ -413,133 +399,13 @@ ULONG WINAPI MAPISendMail( LHANDLE session, ULONG_PTR uiparam,
if
(
MAPIInitialize
(
NULL
)
==
S_OK
)
return
sendmail_extended_mapi
(
session
,
uiparam
,
message
,
flags
,
reserved
);
/* Fall back on our own implementation */
if
(
!
message
)
return
MAPI_E_FAILURE
;
/* Display an error message since we apparently have no mail clients */
LoadStringW
(
hInstMAPI32
,
IDS_NO_MAPI_CLIENT
,
error_msg
,
sizeof
(
error_msg
)
/
sizeof
(
WCHAR
));
LoadStringW
(
hInstMAPI32
,
IDS_SEND_MAIL
,
msg_title
,
sizeof
(
msg_title
)
/
sizeof
(
WCHAR
));
for
(
i
=
0
;
i
<
message
->
nRecipCount
;
i
++
)
{
if
(
!
message
->
lpRecips
)
{
WARN
(
"No recipients found
\n
"
);
return
MAPI_E_FAILURE
;
}
MessageBoxW
((
HWND
)
uiparam
,
error_msg
,
msg_title
,
MB_ICONEXCLAMATION
);
address
=
message
->
lpRecips
[
i
].
lpszAddress
;
if
(
address
)
{
switch
(
message
->
lpRecips
[
i
].
ulRecipClass
)
{
case
MAPI_ORIG
:
TRACE
(
"From: %s
\n
"
,
debugstr_a
(
address
)
);
break
;
case
MAPI_TO
:
TRACE
(
"To: %s
\n
"
,
debugstr_a
(
address
)
);
to_size
+=
lstrlenA
(
address
)
+
1
;
break
;
case
MAPI_CC
:
TRACE
(
"Cc: %s
\n
"
,
debugstr_a
(
address
)
);
cc_size
+=
lstrlenA
(
address
)
+
1
;
break
;
case
MAPI_BCC
:
TRACE
(
"Bcc: %s
\n
"
,
debugstr_a
(
address
)
);
bcc_size
+=
lstrlenA
(
address
)
+
1
;
break
;
default:
TRACE
(
"Unknown recipient class: %d
\n
"
,
message
->
lpRecips
[
i
].
ulRecipClass
);
}
}
else
FIXME
(
"Name resolution and entry identifiers not supported
\n
"
);
}
if
(
message
->
nFileCount
)
FIXME
(
"Ignoring attachments
\n
"
);
subject
=
message
->
lpszSubject
?
message
->
lpszSubject
:
""
;
body
=
message
->
lpszNoteText
?
message
->
lpszNoteText
:
""
;
TRACE
(
"Subject: %s
\n
"
,
debugstr_a
(
subject
)
);
TRACE
(
"Body: %s
\n
"
,
debugstr_a
(
body
)
);
subj_size
=
lstrlenA
(
subject
);
body_size
=
lstrlenA
(
body
);
ret
=
MAPI_E_INSUFFICIENT_MEMORY
;
if
(
to_size
)
{
to
=
HeapAlloc
(
GetProcessHeap
(),
0
,
to_size
);
if
(
!
to
)
goto
exit
;
to
[
0
]
=
0
;
}
if
(
cc_size
)
{
cc
=
HeapAlloc
(
GetProcessHeap
(),
0
,
cc_size
);
if
(
!
cc
)
goto
exit
;
cc
[
0
]
=
0
;
}
if
(
bcc_size
)
{
bcc
=
HeapAlloc
(
GetProcessHeap
(),
0
,
bcc_size
);
if
(
!
bcc
)
goto
exit
;
bcc
[
0
]
=
0
;
}
if
(
message
->
lpOriginator
)
TRACE
(
"From: %s
\n
"
,
debugstr_a
(
message
->
lpOriginator
->
lpszAddress
)
);
for
(
i
=
0
;
i
<
message
->
nRecipCount
;
i
++
)
{
address
=
message
->
lpRecips
[
i
].
lpszAddress
;
if
(
address
)
{
switch
(
message
->
lpRecips
[
i
].
ulRecipClass
)
{
case
MAPI_TO
:
if
(
to_count
)
lstrcatA
(
to
,
","
);
lstrcatA
(
to
,
address
);
to_count
++
;
break
;
case
MAPI_CC
:
if
(
cc_count
)
lstrcatA
(
cc
,
","
);
lstrcatA
(
cc
,
address
);
cc_count
++
;
break
;
case
MAPI_BCC
:
if
(
bcc_count
)
lstrcatA
(
bcc
,
","
);
lstrcatA
(
bcc
,
address
);
bcc_count
++
;
break
;
}
}
}
ret
=
MAPI_E_FAILURE
;
size
=
sizeof
(
format
)
+
to_size
+
cc_size
+
bcc_size
+
subj_size
+
body_size
;
mailto
=
HeapAlloc
(
GetProcessHeap
(),
0
,
size
);
if
(
!
mailto
)
goto
exit
;
sprintf
(
mailto
,
format
,
to
?
to
:
""
,
subject
,
cc
?
cc
:
""
,
bcc
?
bcc
:
""
,
body
);
size
=
1
;
res
=
UrlEscapeA
(
mailto
,
empty_string
,
&
size
,
URL_ESCAPE_SPACES_ONLY
);
if
(
res
!=
E_POINTER
)
goto
exit
;
escape
=
HeapAlloc
(
GetProcessHeap
(),
0
,
size
);
if
(
!
escape
)
goto
exit
;
res
=
UrlEscapeA
(
mailto
,
escape
,
&
size
,
URL_ESCAPE_SPACES_ONLY
);
if
(
res
!=
S_OK
)
goto
exit
;
if
((
UINT_PTR
)
ShellExecuteA
(
NULL
,
"open"
,
escape
,
NULL
,
NULL
,
0
)
>
32
)
ret
=
SUCCESS_SUCCESS
;
exit:
HeapFree
(
GetProcessHeap
(),
0
,
to
);
HeapFree
(
GetProcessHeap
(),
0
,
cc
);
HeapFree
(
GetProcessHeap
(),
0
,
bcc
);
HeapFree
(
GetProcessHeap
(),
0
,
mailto
);
HeapFree
(
GetProcessHeap
(),
0
,
escape
);
return
ret
;
return
MAPI_E_NOT_SUPPORTED
;
}
ULONG
WINAPI
MAPISendDocuments
(
ULONG_PTR
uiparam
,
LPSTR
delim
,
LPSTR
paths
,
...
...
dlls/mapi32/util.h
View file @
b4b7724a
...
...
@@ -61,5 +61,6 @@ typedef struct MAPI_FUNCTIONS {
}
MAPI_FUNCTIONS
;
extern
MAPI_FUNCTIONS
mapiFunctions
;
extern
HINSTANCE
hInstMAPI32
;
#endif
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment