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
9ecc7121
Commit
9ecc7121
authored
Sep 08, 2004
by
Francois Gouget
Committed by
Alexandre Julliard
Sep 08, 2004
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
The union in PROPVARIANT is always nameless on Windows. So define a
macro to deal with it correctly.
parent
843e58d3
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
8 deletions
+12
-8
propvariant.c
dlls/ole32/tests/propvariant.c
+12
-8
No files found.
dlls/ole32/tests/propvariant.c
View file @
9ecc7121
...
...
@@ -18,8 +18,6 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#define NONAMELESSUNION
#define NONAMELESSSTRUCT
#include "windows.h"
/* not present in Wine yet */
/*#include "propidl.h"*/
...
...
@@ -28,6 +26,12 @@ WINOLEAPI PropVariantCopy(PROPVARIANT*, const PROPVARIANT*);
#include "wine/test.h"
#ifdef NONAMELESSUNION
# define U(x) (x).u
#else
# define U(x) (x)
#endif
struct
valid_mapping
{
BOOL
simple
;
...
...
@@ -172,30 +176,30 @@ static void test_copy()
HRESULT
hr
;
propvarSrc
.
vt
=
VT_BSTR
;
propvarSrc
.
u
.
bstrVal
=
SysAllocString
(
wszTestString
);
U
(
propvarSrc
)
.
bstrVal
=
SysAllocString
(
wszTestString
);
hr
=
PropVariantCopy
(
&
propvarDst
,
&
propvarSrc
);
ok
(
hr
==
S_OK
,
"PropVariantCopy(...VT_BSTR...) failed
\n
"
);
ok
(
!
lstrcmpW
(
propvarSrc
.
u
.
bstrVal
,
propvarDst
.
u
.
bstrVal
),
"BSTR not copied properly
\n
"
);
ok
(
!
lstrcmpW
(
U
(
propvarSrc
).
bstrVal
,
U
(
propvarDst
)
.
bstrVal
),
"BSTR not copied properly
\n
"
);
hr
=
PropVariantClear
(
&
propvarSrc
);
ok
(
hr
==
S_OK
,
"PropVariantClear(...VT_BSTR...) failed
\n
"
);
hr
=
PropVariantClear
(
&
propvarDst
);
ok
(
hr
==
S_OK
,
"PropVariantClear(...VT_BSTR...) failed
\n
"
);
propvarSrc
.
vt
=
VT_LPWSTR
;
propvarSrc
.
u
.
pwszVal
=
(
LPWSTR
)
wszTestString
;
U
(
propvarSrc
)
.
pwszVal
=
(
LPWSTR
)
wszTestString
;
hr
=
PropVariantCopy
(
&
propvarDst
,
&
propvarSrc
);
ok
(
hr
==
S_OK
,
"PropVariantCopy(...VT_LPWSTR...) failed
\n
"
);
ok
(
!
lstrcmpW
(
propvarSrc
.
u
.
pwszVal
,
propvarDst
.
u
.
pwszVal
),
"Wide string not copied properly
\n
"
);
ok
(
!
lstrcmpW
(
U
(
propvarSrc
).
pwszVal
,
U
(
propvarDst
)
.
pwszVal
),
"Wide string not copied properly
\n
"
);
hr
=
PropVariantClear
(
&
propvarDst
);
ok
(
hr
==
S_OK
,
"PropVariantClear(...VT_LPWSTR...) failed
\n
"
);
memset
(
&
propvarSrc
,
0
,
sizeof
(
propvarSrc
));
propvarSrc
.
vt
=
VT_LPSTR
;
propvarSrc
.
u
.
pszVal
=
(
LPSTR
)
szTestString
;
U
(
propvarSrc
)
.
pszVal
=
(
LPSTR
)
szTestString
;
hr
=
PropVariantCopy
(
&
propvarDst
,
&
propvarSrc
);
ok
(
hr
==
S_OK
,
"PropVariantCopy(...VT_LPSTR...) failed
\n
"
);
ok
(
!
strcmp
(
propvarSrc
.
u
.
pszVal
,
propvarDst
.
u
.
pszVal
),
"String not copied properly
\n
"
);
ok
(
!
strcmp
(
U
(
propvarSrc
).
pszVal
,
U
(
propvarDst
)
.
pszVal
),
"String not copied properly
\n
"
);
hr
=
PropVariantClear
(
&
propvarDst
);
ok
(
hr
==
S_OK
,
"PropVariantClear(...VT_LPSTR...) failed
\n
"
);
memset
(
&
propvarSrc
,
0
,
sizeof
(
propvarSrc
));
...
...
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