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
1807e534
Commit
1807e534
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: Add semi-stub for PropVariantToStringAlloc.
Signed-off-by:
Alistair Leslie-Hughes
<
leslie_alistair@hotmail.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
d17e760c
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
67 additions
and
2 deletions
+67
-2
propsys.spec
dlls/propsys/propsys.spec
+1
-1
propvar.c
dlls/propsys/propvar.c
+37
-0
propsys.c
dlls/propsys/tests/propsys.c
+27
-1
propvarutil.h
include/propvarutil.h
+2
-0
No files found.
dlls/propsys/propsys.spec
View file @
1807e534
...
...
@@ -134,7 +134,7 @@
@ stub PropVariantToInt64WithDefault
@ stub PropVariantToStrRet
@ stub PropVariantToString
@ st
ub PropVariantToStringAlloc
@ st
dcall PropVariantToStringAlloc(ptr ptr)
@ stub PropVariantToStringVector
@ stub PropVariantToStringVectorAlloc
@ stub PropVariantToStringWithDefault
...
...
dlls/propsys/propvar.c
View file @
1807e534
...
...
@@ -209,6 +209,43 @@ HRESULT WINAPI PropVariantToUInt64(REFPROPVARIANT propvarIn, ULONGLONG *ret)
return
hr
;
}
HRESULT
WINAPI
PropVariantToStringAlloc
(
REFPROPVARIANT
propvarIn
,
WCHAR
**
ret
)
{
WCHAR
*
res
=
NULL
;
HRESULT
hr
=
S_OK
;
TRACE
(
"%p,%p semi-stub
\n
"
,
propvarIn
,
ret
);
switch
(
propvarIn
->
vt
)
{
case
VT_NULL
:
res
=
CoTaskMemAlloc
(
1
*
sizeof
(
WCHAR
));
res
[
0
]
=
'\0'
;
break
;
case
VT_LPSTR
:
if
(
propvarIn
->
u
.
pszVal
)
{
DWORD
len
;
len
=
MultiByteToWideChar
(
CP_ACP
,
0
,
propvarIn
->
u
.
pszVal
,
-
1
,
NULL
,
0
);
res
=
CoTaskMemAlloc
(
len
*
sizeof
(
WCHAR
));
if
(
!
res
)
return
E_OUTOFMEMORY
;
MultiByteToWideChar
(
CP_ACP
,
0
,
propvarIn
->
u
.
pszVal
,
-
1
,
res
,
len
);
}
break
;
default:
FIXME
(
"Unsupported conversion (%d)
\n
"
,
propvarIn
->
vt
);
hr
=
E_FAIL
;
break
;
}
*
ret
=
res
;
return
hr
;
}
/******************************************************************
* PropVariantChangeType (PROPSYS.@)
*/
...
...
dlls/propsys/tests/propsys.c
View file @
1807e534
...
...
@@ -38,6 +38,10 @@ DEFINE_GUID(GUID_NULL,0,0,0,0,0,0,0,0,0,0,0);
DEFINE_GUID
(
dummy_guid
,
0xdeadbeef
,
0xdead
,
0xbeef
,
0xde
,
0xad
,
0xbe
,
0xef
,
0xca
,
0xfe
,
0xba
,
0xbe
);
DEFINE_GUID
(
expect_guid
,
0x12345678
,
0x1234
,
0x1234
,
0x12
,
0x34
,
0x12
,
0x34
,
0x56
,
0x78
,
0x90
,
0x12
);
static
const
char
topic
[]
=
"wine topic"
;
static
const
WCHAR
topicW
[]
=
{
'w'
,
'i'
,
'n'
,
'e'
,
' '
,
't'
,
'o'
,
'p'
,
'i'
,
'c'
,
0
};
static
const
WCHAR
emptyW
[]
=
{
0
};
static
int
strcmp_wa
(
LPCWSTR
strw
,
const
char
*
stra
)
{
CHAR
buf
[
512
];
...
...
@@ -150,7 +154,6 @@ static void test_PSStringFromPropertyKey(void)
static
void
test_PSPropertyKeyFromString
(
void
)
{
static
const
WCHAR
emptyW
[]
=
{
0
};
static
const
WCHAR
fmtid_clsidW
[]
=
{
'S'
,
't'
,
'd'
,
'F'
,
'o'
,
'n'
,
't'
,
' '
,
'1'
,
0
};
static
const
WCHAR
fmtid_truncatedW
[]
=
{
'{'
,
'1'
,
'2'
,
'3'
,
'4'
,
'5'
,
'6'
,
'7'
,
'8'
,
'-'
,
'1'
,
'2'
,
'3'
,
'4'
,
'-'
,
'1'
,
'2'
,
'3'
,
'4'
,
'-'
,
0
};
...
...
@@ -616,6 +619,28 @@ static void test_PropVariantToGUID(void)
PropVariantClear
(
&
propvar
);
}
static
void
test_PropVariantToStringAlloc
(
void
)
{
PROPVARIANT
prop
;
WCHAR
*
str
;
HRESULT
hres
;
prop
.
vt
=
VT_NULL
;
hres
=
PropVariantToStringAlloc
(
&
prop
,
&
str
);
ok
(
hres
==
S_OK
,
"returned %x
\n
"
,
hres
);
ok
(
!
lstrcmpW
(
str
,
emptyW
),
"got %s
\n
"
,
wine_dbgstr_w
(
str
));
CoTaskMemFree
(
str
);
prop
.
vt
=
VT_LPSTR
;
prop
.
u
.
pszVal
=
CoTaskMemAlloc
(
strlen
(
topic
)
+
1
);
strcpy
(
prop
.
u
.
pszVal
,
topic
);
hres
=
PropVariantToStringAlloc
(
&
prop
,
&
str
);
ok
(
hres
==
S_OK
,
"returned %x
\n
"
,
hres
);
ok
(
!
lstrcmpW
(
str
,
topicW
),
"got %s
\n
"
,
wine_dbgstr_w
(
str
));
CoTaskMemFree
(
str
);
PropVariantClear
(
&
prop
);
}
static
void
test_PropVariantCompare
(
void
)
{
PROPVARIANT
empty
,
null
,
emptyarray
,
i2_0
,
i2_2
,
i4_large
,
i4_largeneg
,
i4_2
,
str_2
,
str_02
,
str_b
;
...
...
@@ -874,6 +899,7 @@ START_TEST(propsys)
test_InitPropVariantFromGUIDAsString
();
test_InitPropVariantFromBuffer
();
test_PropVariantToGUID
();
test_PropVariantToStringAlloc
();
test_PropVariantCompare
();
test_intconversions
();
}
include/propvarutil.h
View file @
1807e534
...
...
@@ -77,6 +77,8 @@ HRESULT WINAPI PropVariantToUInt16(REFPROPVARIANT propvarIn, USHORT *ret);
HRESULT
WINAPI
PropVariantToUInt32
(
REFPROPVARIANT
propvarIn
,
ULONG
*
ret
);
HRESULT
WINAPI
PropVariantToUInt64
(
REFPROPVARIANT
propvarIn
,
ULONGLONG
*
ret
);
HRESULT
WINAPI
PropVariantToStringAlloc
(
REFPROPVARIANT
propvarIn
,
WCHAR
**
ret
);
#ifdef __cplusplus
HRESULT
InitPropVariantFromBoolean
(
BOOL
fVal
,
PROPVARIANT
*
ppropvar
);
...
...
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