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
398a4be3
Commit
398a4be3
authored
Mar 15, 2019
by
Nikolay Sivov
Committed by
Alexandre Julliard
Mar 15, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
propsys: Add support for VT_R4/VT_R8 to PropVariantCompareEx().
Signed-off-by:
Nikolay Sivov
<
nsivov@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
0a508e49
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
47 additions
and
10 deletions
+47
-10
propvar.c
dlls/propsys/propvar.c
+15
-9
propsys.c
dlls/propsys/tests/propsys.c
+32
-1
No files found.
dlls/propsys/propvar.c
View file @
398a4be3
...
...
@@ -846,7 +846,7 @@ INT WINAPI PropVariantCompareEx(REFPROPVARIANT propvar1, REFPROPVARIANT propvar2
else
propvar2_converted
=
propvar2
;
#define CMP_
INT
_VALUE(var) do { \
#define CMP_
NUM
_VALUE(var) do { \
if (propvar1->u.var > propvar2_converted->u.var) \
res = 1; \
else if (propvar1->u.var < propvar2_converted->u.var) \
...
...
@@ -858,28 +858,34 @@ INT WINAPI PropVariantCompareEx(REFPROPVARIANT propvar1, REFPROPVARIANT propvar2
switch
(
propvar1
->
vt
)
{
case
VT_I1
:
CMP_
INT
_VALUE
(
cVal
);
CMP_
NUM
_VALUE
(
cVal
);
break
;
case
VT_UI1
:
CMP_
INT
_VALUE
(
bVal
);
CMP_
NUM
_VALUE
(
bVal
);
break
;
case
VT_I2
:
CMP_
INT
_VALUE
(
iVal
);
CMP_
NUM
_VALUE
(
iVal
);
break
;
case
VT_UI2
:
CMP_
INT
_VALUE
(
uiVal
);
CMP_
NUM
_VALUE
(
uiVal
);
break
;
case
VT_I4
:
CMP_
INT
_VALUE
(
lVal
);
CMP_
NUM
_VALUE
(
lVal
);
break
;
case
VT_UI4
:
CMP_
INT
_VALUE
(
uiVal
);
CMP_
NUM
_VALUE
(
uiVal
);
break
;
case
VT_I8
:
CMP_
INT
_VALUE
(
hVal
.
QuadPart
);
CMP_
NUM
_VALUE
(
hVal
.
QuadPart
);
break
;
case
VT_UI8
:
CMP_INT_VALUE
(
uhVal
.
QuadPart
);
CMP_NUM_VALUE
(
uhVal
.
QuadPart
);
break
;
case
VT_R4
:
CMP_NUM_VALUE
(
fltVal
);
break
;
case
VT_R8
:
CMP_NUM_VALUE
(
dblVal
);
break
;
case
VT_BSTR
:
case
VT_LPWSTR
:
...
...
dlls/propsys/tests/propsys.c
View file @
398a4be3
...
...
@@ -660,7 +660,7 @@ static void test_PropVariantToStringAlloc(void)
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
;
PROPVARIANT
clsid_null
,
clsid
,
clsid2
;
PROPVARIANT
clsid_null
,
clsid
,
clsid2
,
r4_0
,
r4_2
,
r8_0
,
r8_2
;
INT
res
;
static
const
WCHAR
str_2W
[]
=
{
'2'
,
0
};
static
const
WCHAR
str_02W
[]
=
{
'0'
,
'2'
,
0
};
...
...
@@ -711,6 +711,14 @@ static void test_PropVariantCompare(void)
clsid
.
u
.
puuid
=
(
GUID
*
)
&
dummy_guid
;
clsid2
.
vt
=
VT_CLSID
;
clsid2
.
u
.
puuid
=
(
GUID
*
)
&
GUID_NULL
;
r4_0
.
vt
=
VT_R4
;
r4_0
.
u
.
fltVal
=
0
.
0
f
;
r4_2
.
vt
=
VT_R4
;
r4_2
.
u
.
fltVal
=
2
.
0
f
;
r8_0
.
vt
=
VT_R8
;
r8_0
.
u
.
dblVal
=
0
.
0
;
r8_2
.
vt
=
VT_R8
;
r8_2
.
u
.
dblVal
=
2
.
0
;
res
=
PropVariantCompareEx
(
&
empty
,
&
empty
,
0
,
0
);
ok
(
res
==
0
,
"res=%i
\n
"
,
res
);
...
...
@@ -807,6 +815,29 @@ static void test_PropVariantCompare(void)
res
=
PropVariantCompareEx
(
&
clsid
,
&
clsid_null
,
0
,
PVCF_TREATEMPTYASGREATERTHAN
);
ok
(
res
==
-
1
,
"res=%i
\n
"
,
res
);
/* VT_R4/VT_R8 */
res
=
PropVariantCompareEx
(
&
r4_0
,
&
r8_0
,
0
,
0
);
todo_wine
ok
(
res
==
0
,
"res=%i
\n
"
,
res
);
res
=
PropVariantCompareEx
(
&
r4_0
,
&
r4_0
,
0
,
0
);
ok
(
res
==
0
,
"res=%i
\n
"
,
res
);
res
=
PropVariantCompareEx
(
&
r4_0
,
&
r4_2
,
0
,
0
);
ok
(
res
==
-
1
,
"res=%i
\n
"
,
res
);
res
=
PropVariantCompareEx
(
&
r4_2
,
&
r4_0
,
0
,
0
);
ok
(
res
==
1
,
"res=%i
\n
"
,
res
);
res
=
PropVariantCompareEx
(
&
r8_0
,
&
r8_0
,
0
,
0
);
ok
(
res
==
0
,
"res=%i
\n
"
,
res
);
res
=
PropVariantCompareEx
(
&
r8_0
,
&
r8_2
,
0
,
0
);
ok
(
res
==
-
1
,
"res=%i
\n
"
,
res
);
res
=
PropVariantCompareEx
(
&
r8_2
,
&
r8_0
,
0
,
0
);
ok
(
res
==
1
,
"res=%i
\n
"
,
res
);
SysFreeString
(
str_2
.
u
.
bstrVal
);
SysFreeString
(
str_02
.
u
.
bstrVal
);
SysFreeString
(
str_b
.
u
.
bstrVal
);
...
...
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