Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
61c69e55
Commit
61c69e55
authored
Sep 17, 2001
by
Ge van Geldorp
Committed by
Alexandre Julliard
Oct 07, 2009
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mapi32/tests: Skip tests if no default email client is installed.
parent
8eada56b
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
84 additions
and
1 deletion
+84
-1
Makefile.in
dlls/mapi32/tests/Makefile.in
+1
-1
imalloc.c
dlls/mapi32/tests/imalloc.c
+7
-0
mapi32_test.h
dlls/mapi32/tests/mapi32_test.h
+62
-0
prop.c
dlls/mapi32/tests/prop.c
+7
-0
util.c
dlls/mapi32/tests/util.c
+7
-0
No files found.
dlls/mapi32/tests/Makefile.in
View file @
61c69e55
...
...
@@ -3,7 +3,7 @@ TOPOBJDIR = ../../..
SRCDIR
=
@srcdir@
VPATH
=
@srcdir@
TESTDLL
=
mapi32.dll
IMPORTS
=
kernel32
IMPORTS
=
advapi32
kernel32
CTESTS
=
\
imalloc.c
\
...
...
dlls/mapi32/tests/imalloc.c
View file @
61c69e55
...
...
@@ -26,6 +26,7 @@
#include "winerror.h"
#include "winnt.h"
#include "mapiutil.h"
#include "mapi32_test.h"
static
HMODULE
hMapi32
=
0
;
...
...
@@ -88,6 +89,12 @@ START_TEST(imalloc)
{
SCODE
ret
;
if
(
!
HaveDefaultMailClient
())
{
win_skip
(
"No default mail client installed
\n
"
);
return
;
}
hMapi32
=
LoadLibraryA
(
"mapi32.dll"
);
pScInitMapiUtil
=
(
void
*
)
GetProcAddress
(
hMapi32
,
"ScInitMapiUtil@4"
);
...
...
dlls/mapi32/tests/mapi32_test.h
0 → 100644
View file @
61c69e55
/*
* 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
*/
/*
* Return FALSE if no default mail client is installed.
*/
static
BOOL
HaveDefaultMailClient
(
void
)
{
HKEY
Key
;
DWORD
Type
,
Size
;
BYTE
Buffer
[
64
];
BOOL
HasHKCUKey
;
/* We check the default value of both HKCU\Software\Clients\Mail and
* HKLM\Software\Clients\Mail, if one of them is present there is a default
* mail client. If neither of these keys is present, we might be running
* on an old Windows version (W95, NT4) and we assume a default mail client
* might be available. Only if one of the keys is present, but there is
* no default value do we assume there is no default client. */
if
(
RegOpenKeyExA
(
HKEY_CURRENT_USER
,
"SOFTWARE
\\
Clients
\\
Mail"
,
0
,
KEY_QUERY_VALUE
,
&
Key
)
==
ERROR_SUCCESS
)
{
Size
=
sizeof
(
Buffer
);
/* Any return value besides ERROR_FILE_NOT_FOUND (including success,
ERROR_MORE_DATA) indicates the value is present */
if
(
RegQueryValueExA
(
Key
,
NULL
,
NULL
,
&
Type
,
Buffer
,
&
Size
)
!=
ERROR_FILE_NOT_FOUND
)
{
RegCloseKey
(
Key
);
return
TRUE
;
}
RegCloseKey
(
Key
);
HasHKCUKey
=
TRUE
;
}
else
HasHKCUKey
=
FALSE
;
if
(
RegOpenKeyExA
(
HKEY_LOCAL_MACHINE
,
"SOFTWARE
\\
Clients
\\
Mail"
,
0
,
KEY_QUERY_VALUE
,
&
Key
)
==
ERROR_SUCCESS
)
{
Size
=
sizeof
(
Buffer
);
if
(
RegQueryValueExA
(
Key
,
NULL
,
NULL
,
&
Type
,
Buffer
,
&
Size
)
!=
ERROR_FILE_NOT_FOUND
)
{
RegCloseKey
(
Key
);
return
TRUE
;
}
RegCloseKey
(
Key
);
return
FALSE
;
}
return
!
HasHKCUKey
;
}
dlls/mapi32/tests/prop.c
View file @
61c69e55
...
...
@@ -27,6 +27,7 @@
#include "initguid.h"
#include "mapiutil.h"
#include "mapitags.h"
#include "mapi32_test.h"
static
HMODULE
hMapi32
=
0
;
...
...
@@ -1360,6 +1361,12 @@ START_TEST(prop)
{
SCODE
ret
;
if
(
!
HaveDefaultMailClient
())
{
win_skip
(
"No default mail client installed
\n
"
);
return
;
}
if
(
!
InitFuncPtrs
())
{
win_skip
(
"Needed functions are not available
\n
"
);
...
...
dlls/mapi32/tests/util.c
View file @
61c69e55
...
...
@@ -26,6 +26,7 @@
#include "winnt.h"
#include "mapiutil.h"
#include "mapitags.h"
#include "mapi32_test.h"
static
HMODULE
hMapi32
=
0
;
...
...
@@ -172,6 +173,12 @@ START_TEST(util)
{
SCODE
ret
;
if
(
!
HaveDefaultMailClient
())
{
win_skip
(
"No default mail client installed
\n
"
);
return
;
}
hMapi32
=
LoadLibraryA
(
"mapi32.dll"
);
pScInitMapiUtil
=
(
void
*
)
GetProcAddress
(
hMapi32
,
"ScInitMapiUtil@4"
);
...
...
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