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
173515e7
Commit
173515e7
authored
Jul 01, 2016
by
Alistair Leslie-Hughes
Committed by
Alexandre Julliard
Jul 06, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
propsys: Support VT_LPWSTR in PropVariantChangeType.
Signed-off-by:
Alistair Leslie-Hughes
<
leslie_alistair@hotmail.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
1807e534
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
51 additions
and
0 deletions
+51
-0
propvar.c
dlls/propsys/propvar.c
+14
-0
propsys.c
dlls/propsys/tests/propsys.c
+37
-0
No files found.
dlls/propsys/propvar.c
View file @
173515e7
...
...
@@ -257,6 +257,9 @@ HRESULT WINAPI PropVariantChangeType(PROPVARIANT *ppropvarDest, REFPROPVARIANT p
FIXME
(
"(%p, %p, %d, %d, %d): semi-stub!
\n
"
,
ppropvarDest
,
propvarSrc
,
propvarSrc
->
vt
,
flags
,
vt
);
if
(
vt
==
propvarSrc
->
vt
)
return
PropVariantCopy
(
ppropvarDest
,
propvarSrc
);
switch
(
vt
)
{
case
VT_I2
:
...
...
@@ -325,6 +328,17 @@ HRESULT WINAPI PropVariantChangeType(PROPVARIANT *ppropvarDest, REFPROPVARIANT p
}
return
hr
;
}
case
VT_LPWSTR
:
{
WCHAR
*
res
;
hr
=
PropVariantToStringAlloc
(
propvarSrc
,
&
res
);
if
(
SUCCEEDED
(
hr
))
{
ppropvarDest
->
vt
=
VT_LPWSTR
;
ppropvarDest
->
u
.
pwszVal
=
res
;
}
return
hr
;
}
}
switch
(
propvarSrc
->
vt
)
...
...
dlls/propsys/tests/propsys.c
View file @
173515e7
...
...
@@ -891,6 +891,42 @@ static void test_intconversions(void)
ok
(
llval
==
-
7
,
"got wrong value %s
\n
"
,
debugstr_longlong
(
llval
));
}
static
void
test_PropVariantChangeType_LPWSTR
(
void
)
{
PROPVARIANT
dest
,
src
;
HRESULT
hr
;
PropVariantInit
(
&
dest
);
src
.
vt
=
VT_NULL
;
hr
=
PropVariantChangeType
(
&
dest
,
&
src
,
0
,
VT_LPWSTR
);
ok
(
hr
==
S_OK
,
"hr=%x
\n
"
,
hr
);
ok
(
dest
.
vt
==
VT_LPWSTR
,
"got %d
\n
"
,
dest
.
vt
);
ok
(
!
lstrcmpW
(
dest
.
u
.
pwszVal
,
emptyW
),
"got %s
\n
"
,
wine_dbgstr_w
(
dest
.
u
.
pwszVal
));
PropVariantClear
(
&
dest
);
PropVariantClear
(
&
src
);
src
.
vt
=
VT_LPSTR
;
src
.
u
.
pszVal
=
CoTaskMemAlloc
(
strlen
(
topic
)
+
1
);
strcpy
(
src
.
u
.
pszVal
,
topic
);
hr
=
PropVariantChangeType
(
&
dest
,
&
src
,
0
,
VT_LPWSTR
);
ok
(
hr
==
S_OK
,
"hr=%x
\n
"
,
hr
);
ok
(
dest
.
vt
==
VT_LPWSTR
,
"got %d
\n
"
,
dest
.
vt
);
ok
(
!
lstrcmpW
(
dest
.
u
.
pwszVal
,
topicW
),
"got %s
\n
"
,
wine_dbgstr_w
(
dest
.
u
.
pwszVal
));
PropVariantClear
(
&
dest
);
PropVariantClear
(
&
src
);
src
.
vt
=
VT_LPWSTR
;
src
.
u
.
pwszVal
=
CoTaskMemAlloc
(
(
lstrlenW
(
topicW
)
+
1
)
*
sizeof
(
WCHAR
));
lstrcpyW
(
src
.
u
.
pwszVal
,
topicW
);
hr
=
PropVariantChangeType
(
&
dest
,
&
src
,
0
,
VT_LPWSTR
);
ok
(
hr
==
S_OK
,
"hr=%x
\n
"
,
hr
);
ok
(
dest
.
vt
==
VT_LPWSTR
,
"got %d
\n
"
,
dest
.
vt
);
ok
(
!
lstrcmpW
(
dest
.
u
.
pwszVal
,
topicW
),
"got %s
\n
"
,
wine_dbgstr_w
(
dest
.
u
.
pwszVal
));
PropVariantClear
(
&
dest
);
PropVariantClear
(
&
src
);
}
START_TEST
(
propsys
)
{
test_PSStringFromPropertyKey
();
...
...
@@ -902,4 +938,5 @@ START_TEST(propsys)
test_PropVariantToStringAlloc
();
test_PropVariantCompare
();
test_intconversions
();
test_PropVariantChangeType_LPWSTR
();
}
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