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
f7ef02bd
Commit
f7ef02bd
authored
Oct 03, 2023
by
Nikolay Sivov
Committed by
Alexandre Julliard
Oct 03, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
propsys: Partially implement VariantToString().
Wine-Bug:
https://bugs.winehq.org/show_bug.cgi?id=55708
Signed-off-by:
Nikolay Sivov
<
nsivov@codeweavers.com
>
parent
0770ba61
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
64 additions
and
1 deletion
+64
-1
propsys.spec
dlls/propsys/propsys.spec
+1
-1
propvar.c
dlls/propsys/propvar.c
+32
-0
propsys.c
dlls/propsys/tests/propsys.c
+30
-0
propvarutil.h
include/propvarutil.h
+1
-0
No files found.
dlls/propsys/propsys.spec
View file @
f7ef02bd
...
...
@@ -190,7 +190,7 @@
@ stub VariantToInt64WithDefault
@ stub VariantToPropVariant
@ stub VariantToStrRet
@ st
ub VariantToString
@ st
dcall VariantToString(ptr ptr long)
@ stub VariantToStringAlloc
@ stub VariantToStringArray
@ stub VariantToStringArrayAlloc
...
...
dlls/propsys/propvar.c
View file @
f7ef02bd
...
...
@@ -432,6 +432,38 @@ PCWSTR WINAPI VariantToStringWithDefault(const VARIANT *pvar, const WCHAR *defau
}
/******************************************************************
* VariantToString (PROPSYS.@)
*/
HRESULT
WINAPI
VariantToString
(
REFVARIANT
var
,
PWSTR
ret
,
UINT
cch
)
{
WCHAR
*
str
=
NULL
;
TRACE
(
"%p, %p, %u.
\n
"
,
var
,
ret
,
cch
);
*
ret
=
0
;
if
(
!
cch
)
return
E_INVALIDARG
;
if
(
V_VT
(
var
)
==
VT_BSTR
)
{
str
=
V_BSTR
(
var
);
}
else
{
FIXME
(
"Unsupported type %d.
\n
"
,
V_VT
(
var
));
return
E_NOTIMPL
;
}
if
(
wcslen
(
str
)
>
cch
-
1
)
return
STRSAFE_E_INSUFFICIENT_BUFFER
;
wcscpy
(
ret
,
str
);
return
S_OK
;
}
/******************************************************************
* PropVariantChangeType (PROPSYS.@)
*/
HRESULT
WINAPI
PropVariantChangeType
(
PROPVARIANT
*
ppropvarDest
,
REFPROPVARIANT
propvarSrc
,
...
...
dlls/propsys/tests/propsys.c
View file @
f7ef02bd
...
...
@@ -2277,6 +2277,35 @@ static void test_VariantToStringWithDefault(void)
SysFreeString
(
b
);
}
static
void
test_VariantToString
(
void
)
{
HRESULT
hr
;
VARIANT
v
;
WCHAR
buff
[
64
];
buff
[
0
]
=
1
;
V_VT
(
&
v
)
=
VT_EMPTY
;
hr
=
VariantToString
(
&
v
,
buff
,
64
);
todo_wine
ok
(
hr
==
S_OK
,
"Unexpected hr %#lx.
\n
"
,
hr
);
ok
(
!
buff
[
0
],
"Unexpected buffer.
\n
"
);
V_VT
(
&
v
)
=
VT_BSTR
;
V_BSTR
(
&
v
)
=
SysAllocString
(
L"test1"
);
buff
[
0
]
=
1
;
hr
=
VariantToString
(
&
v
,
buff
,
0
);
ok
(
hr
==
E_INVALIDARG
,
"Unexpected hr %#lx.
\n
"
,
hr
);
ok
(
!
buff
[
0
],
"Unexpected buffer.
\n
"
);
hr
=
VariantToString
(
&
v
,
buff
,
5
);
ok
(
hr
==
STRSAFE_E_INSUFFICIENT_BUFFER
,
"Unexpected hr %#lx.
\n
"
,
hr
);
hr
=
VariantToString
(
&
v
,
buff
,
6
);
ok
(
hr
==
S_OK
,
"Unexpected hr %#lx.
\n
"
,
hr
);
ok
(
!
wcscmp
(
buff
,
L"test1"
),
"Unexpected string.
\n
"
);
VariantClear
(
&
v
);
}
START_TEST
(
propsys
)
{
test_InitPropVariantFromGUIDAsString
();
...
...
@@ -2304,4 +2333,5 @@ START_TEST(propsys)
test_propertystore
();
test_PSCreatePropertyStoreFromObject
();
test_VariantToStringWithDefault
();
test_VariantToString
();
}
include/propvarutil.h
View file @
f7ef02bd
...
...
@@ -95,6 +95,7 @@ HRESULT WINAPI PropVariantToBuffer(REFPROPVARIANT propvarIn, void *ret, UINT cb)
HRESULT
WINAPI
PropVariantToString
(
REFPROPVARIANT
propvarIn
,
PWSTR
ret
,
UINT
cch
);
PCWSTR
WINAPI
PropVariantToStringWithDefault
(
REFPROPVARIANT
propvarIn
,
LPCWSTR
pszDefault
);
PCWSTR
WINAPI
VariantToStringWithDefault
(
const
VARIANT
*
pvar
,
LPCWSTR
pszDefault
);
HRESULT
WINAPI
VariantToString
(
REFVARIANT
var
,
PWSTR
ret
,
UINT
cch
);
HRESULT
WINAPI
PropVariantToStringAlloc
(
REFPROPVARIANT
propvarIn
,
WCHAR
**
ret
);
...
...
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