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
a0fb8662
Commit
a0fb8662
authored
Oct 27, 2005
by
Ivan Leo Puoti
Committed by
Alexandre Julliard
Oct 27, 2005
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Allow mapi32 tests to load and exit gracefully if mapi32.dll isn't
installed.
parent
7230a908
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
33 additions
and
18 deletions
+33
-18
Makefile.in
dlls/mapi32/tests/Makefile.in
+1
-1
prop.c
dlls/mapi32/tests/prop.c
+32
-17
No files found.
dlls/mapi32/tests/Makefile.in
View file @
a0fb8662
...
...
@@ -3,7 +3,7 @@ TOPOBJDIR = ../../..
SRCDIR
=
@srcdir@
VPATH
=
@srcdir@
TESTDLL
=
mapi32.dll
IMPORTS
=
mapi32
kernel32
IMPORTS
=
kernel32
EXTRALIBS
=
-luuid
CTESTS
=
\
...
...
dlls/mapi32/tests/prop.c
View file @
a0fb8662
...
...
@@ -29,8 +29,6 @@
#include "mapiutil.h"
#include "mapitags.h"
HRESULT
WINAPI
MAPIInitialize
(
LPVOID
);
static
HMODULE
hMapi32
=
0
;
static
SCODE
(
WINAPI
*
pScInitMapiUtil
)(
ULONG
);
...
...
@@ -53,6 +51,23 @@ static ULONG (WINAPI *pFBadProp)(LPSPropValue);
static
ULONG
(
WINAPI
*
pFBadColumnSet
)(
LPSPropTagArray
);
static
SCODE
(
WINAPI
*
pCreateIProp
)(
LPCIID
,
ALLOCATEBUFFER
*
,
ALLOCATEMORE
*
,
FREEBUFFER
*
,
LPVOID
,
LPPROPDATA
*
);
static
SCODE
(
WINAPI
*
pMAPIAllocateBuffer
)(
ULONG
,
LPVOID
FAR
);
static
SCODE
(
WINAPI
*
pMAPIAllocateMore
)(
ULONG
,
LPVOID
,
LPVOID
FAR
);
static
SCODE
(
WINAPI
*
pMAPIFreeBuffer
)(
LPVOID
);
static
BOOL
InitFuncPtrs
(
void
)
{
hMapi32
=
LoadLibraryA
(
"mapi32.dll"
);
pScInitMapiUtil
=
(
void
*
)
GetProcAddress
(
hMapi32
,
"ScInitMapiUtil@4"
);
pMAPIAllocateBuffer
=
(
void
*
)
GetProcAddress
(
hMapi32
,
"MAPIAllocateBuffer"
);
pMAPIAllocateMore
=
(
void
*
)
GetProcAddress
(
hMapi32
,
"MAPIAllocateMore"
);
pMAPIFreeBuffer
=
(
void
*
)
GetProcAddress
(
hMapi32
,
"MAPIFreeBuffer"
);
if
(
pScInitMapiUtil
&&
pMAPIAllocateBuffer
&&
pMAPIAllocateMore
&&
pMAPIFreeBuffer
)
return
TRUE
;
else
return
FALSE
;
}
static
ULONG
ptTypes
[]
=
{
PT_I2
,
PT_I4
,
PT_R4
,
PT_R8
,
PT_CURRENCY
,
PT_APPTIME
,
PT_SYSTIME
,
...
...
@@ -79,11 +94,11 @@ static void test_PropCopyMore(void)
if
(
!
pPropCopyMore
)
return
;
scode
=
MAPIAllocateBuffer
(
sizeof
(
LPSPropValue
),
(
LPVOID
*
)
lpDest
);
scode
=
p
MAPIAllocateBuffer
(
sizeof
(
LPSPropValue
),
(
LPVOID
*
)
lpDest
);
if
(
FAILED
(
scode
))
return
;
scode
=
MAPIAllocateMore
(
sizeof
(
LPSPropValue
),
lpDest
,
(
LPVOID
*
)
lpSrc
);
scode
=
p
MAPIAllocateMore
(
sizeof
(
LPSPropValue
),
lpDest
,
(
LPVOID
*
)
lpSrc
);
if
(
FAILED
(
scode
))
return
;
...
...
@@ -107,7 +122,7 @@ static void test_PropCopyMore(void)
memset
(
lpDest
,
0xff
,
sizeof
(
SPropValue
));
scode
=
pPropCopyMore
(
lpDest
,
lpSrc
,
MAPIAllocateMore
,
lpDest
);
scode
=
pPropCopyMore
(
lpDest
,
lpSrc
,
(
ALLOCATEMORE
*
)
p
MAPIAllocateMore
,
lpDest
);
ok
(
!
scode
&&
lpDest
->
ulPropTag
==
lpSrc
->
ulPropTag
,
"PropCopyMore: Expected 0x0,%ld, got 0x%08lx,%ld
\n
"
,
lpSrc
->
ulPropTag
,
scode
,
lpDest
->
ulPropTag
);
...
...
@@ -133,7 +148,7 @@ static void test_PropCopyMore(void)
}
/* Since all allocations are linked, freeing lpDest frees everything */
MAPIFreeBuffer
(
lpDest
);
p
MAPIFreeBuffer
(
lpDest
);
}
static
void
test_UlPropSize
(
void
)
...
...
@@ -1132,6 +1147,7 @@ static void test_IProp(void)
SCODE
sc
;
pCreateIProp
=
(
void
*
)
GetProcAddress
(
hMapi32
,
"CreateIProp@24"
);
if
(
!
pCreateIProp
)
return
;
...
...
@@ -1139,8 +1155,8 @@ static void test_IProp(void)
/* Create the object */
lpIProp
=
NULL
;
sc
=
pCreateIProp
(
&
IID_IMAPIPropData
,
MAPIAllocateBuffer
,
MAPIAllocateMore
,
MAPIFreeBuffer
,
NULL
,
&
lpIProp
);
sc
=
pCreateIProp
(
&
IID_IMAPIPropData
,
(
ALLOCATEBUFFER
FAR
*
)
pMAPIAllocateBuffer
,
(
ALLOCATEMORE
FAR
*
)
p
MAPIAllocateMore
,
(
FREEBUFFER
FAR
*
)
p
MAPIFreeBuffer
,
NULL
,
&
lpIProp
);
ok
(
sc
==
S_OK
&&
lpIProp
,
"CreateIProp: expected S_OK, non-null, got 0x%08lX,%p
\n
"
,
sc
,
lpIProp
);
...
...
@@ -1160,7 +1176,7 @@ static void test_IProp(void)
"GetPropList(empty): Expected S_OK, non-null, 0, got 0x%08lX,%p,%ld
\n
"
,
sc
,
lpTags
,
lpTags
?
lpTags
->
cValues
:
0
);
if
(
lpTags
)
MAPIFreeBuffer
(
lpTags
);
p
MAPIFreeBuffer
(
lpTags
);
/* Get props - succeeds returning 0 items */
lpProps
=
NULL
;
...
...
@@ -1177,7 +1193,7 @@ static void test_IProp(void)
"GetProps(empty): Expected %x, got %lx
\n
"
,
CHANGE_PROP_TYPE
(
PR_IMPORTANCE
,
PT_ERROR
),
lpProps
[
0
].
ulPropTag
);
MAPIFreeBuffer
(
lpProps
);
p
MAPIFreeBuffer
(
lpProps
);
}
/* Add (NULL) - Can't add NULL's */
...
...
@@ -1214,7 +1230,7 @@ static void test_IProp(void)
ok
(
lpTags
->
aulPropTag
[
0
]
==
PR_IMPORTANCE
,
"GetPropList: Expected %x, got %lx
\n
"
,
PR_IMPORTANCE
,
lpTags
->
aulPropTag
[
0
]);
MAPIFreeBuffer
(
lpTags
);
p
MAPIFreeBuffer
(
lpTags
);
}
/* Set access to read and write */
...
...
@@ -1291,7 +1307,7 @@ static void test_IProp(void)
PR_IMPORTANCE
,
E_ACCESSDENIED
,
lpProbs
->
aProblem
[
0
].
ulIndex
,
lpProbs
->
aProblem
[
0
].
ulPropTag
,
lpProbs
->
aProblem
[
0
].
scode
);
MAPIFreeBuffer
(
lpProbs
);
p
MAPIFreeBuffer
(
lpProbs
);
}
lpProbs
=
NULL
;
...
...
@@ -1312,7 +1328,7 @@ static void test_IProp(void)
ok
(
lpTags
->
aulPropTag
[
0
]
==
PR_IMPORTANCE
,
"GetPropList: Expected %x, got %lx
\n
"
,
PR_IMPORTANCE
,
lpTags
->
aulPropTag
[
0
]);
MAPIFreeBuffer
(
lpTags
);
p
MAPIFreeBuffer
(
lpTags
);
}
/* Set item to r/w again */
...
...
@@ -1332,11 +1348,9 @@ static void test_IProp(void)
START_TEST
(
prop
)
{
hMapi32
=
LoadLibraryA
(
"mapi32.dll"
);
pScInitMapiUtil
=
(
void
*
)
GetProcAddress
(
hMapi32
,
"ScInitMapiUtil@4"
);
if
(
!
pScInitMapiUtil
)
if
(
!
InitFuncPtrs
())
return
;
pScInitMapiUtil
(
0
);
test_PropCopyMore
();
...
...
@@ -1357,4 +1371,5 @@ START_TEST(prop)
test_FBadColumnSet
();
test_IProp
();
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