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
ad2fdafe
Commit
ad2fdafe
authored
Jan 30, 2010
by
Andrew Nguyen
Committed by
Alexandre Julliard
Feb 01, 2010
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mapi32/tests: Invoke MAPIInitialize before performing the HexFromBin tests.
This avoids crashes with the native Outlook extended MAPI provider.
parent
491201a8
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
2 deletions
+19
-2
util.c
dlls/mapi32/tests/util.c
+19
-2
No files found.
dlls/mapi32/tests/util.c
View file @
ad2fdafe
...
...
@@ -31,6 +31,7 @@
static
HMODULE
hMapi32
=
0
;
static
SCODE
(
WINAPI
*
pScInitMapiUtil
)(
ULONG
);
static
void
(
WINAPI
*
pDeinitMapiUtil
)(
void
);
static
void
(
WINAPI
*
pSwapPword
)(
PUSHORT
,
ULONG
);
static
void
(
WINAPI
*
pSwapPlong
)(
PULONG
,
ULONG
);
static
void
(
WINAPI
*
pHexFromBin
)(
LPBYTE
,
int
,
LPWSTR
);
...
...
@@ -39,12 +40,15 @@ static UINT (WINAPI *pUFromSz)(LPCSTR);
static
ULONG
(
WINAPI
*
pUlFromSzHex
)(
LPCSTR
);
static
ULONG
(
WINAPI
*
pCbOfEncoded
)(
LPCSTR
);
static
BOOL
(
WINAPI
*
pIsBadBoundedStringPtr
)(
LPCSTR
,
ULONG
);
static
SCODE
(
WINAPI
*
pMAPIInitialize
)(
LPVOID
);
static
void
(
WINAPI
*
pMAPIUninitialize
)(
void
);
static
void
init_function_pointers
(
void
)
{
hMapi32
=
LoadLibraryA
(
"mapi32.dll"
);
pScInitMapiUtil
=
(
void
*
)
GetProcAddress
(
hMapi32
,
"ScInitMapiUtil@4"
);
pDeinitMapiUtil
=
(
void
*
)
GetProcAddress
(
hMapi32
,
"DeinitMapiUtil@0"
);
pSwapPword
=
(
void
*
)
GetProcAddress
(
hMapi32
,
"SwapPword@8"
);
pSwapPlong
=
(
void
*
)
GetProcAddress
(
hMapi32
,
"SwapPlong@8"
);
pHexFromBin
=
(
void
*
)
GetProcAddress
(
hMapi32
,
"HexFromBin@12"
);
...
...
@@ -53,6 +57,8 @@ static void init_function_pointers(void)
pUlFromSzHex
=
(
void
*
)
GetProcAddress
(
hMapi32
,
"UlFromSzHex@4"
);
pCbOfEncoded
=
(
void
*
)
GetProcAddress
(
hMapi32
,
"CbOfEncoded@4"
);
pIsBadBoundedStringPtr
=
(
void
*
)
GetProcAddress
(
hMapi32
,
"IsBadBoundedStringPtr@8"
);
pMAPIInitialize
=
(
void
*
)
GetProcAddress
(
hMapi32
,
"MAPIInitialize"
);
pMAPIUninitialize
=
(
void
*
)
GetProcAddress
(
hMapi32
,
"MAPIUninitialize"
);
}
static
void
test_SwapPword
(
void
)
...
...
@@ -209,9 +215,9 @@ START_TEST(util)
init_function_pointers
();
if
(
!
pScInitMapiUtil
)
if
(
!
pScInitMapiUtil
||
!
pDeinitMapiUtil
)
{
win_skip
(
"
ScInitMapiUtil is
not available
\n
"
);
win_skip
(
"
MAPI utility initialization functions are
not available
\n
"
);
FreeLibrary
(
hMapi32
);
return
;
}
...
...
@@ -233,11 +239,22 @@ START_TEST(util)
test_SwapPword
();
test_SwapPlong
();
/* We call MAPIInitialize here for the benefit of native extended MAPI
* providers which crash in the HexFromBin tests when MAPIInitialize has
* not been called. Since MAPIInitialize is irrelevant for HexFfromBin on
* Wine, we do not care whether MAPIInitialize succeeds. */
if
(
pMAPIInitialize
)
ret
=
pMAPIInitialize
(
NULL
);
test_HexFromBin
();
if
(
pMAPIUninitialize
&&
ret
==
S_OK
)
pMAPIUninitialize
();
test_UFromSz
();
test_UlFromSzHex
();
test_CbOfEncoded
();
test_IsBadBoundedStringPtr
();
pDeinitMapiUtil
();
FreeLibrary
(
hMapi32
);
}
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