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
72b86f96
Commit
72b86f96
authored
Feb 14, 2023
by
Jason Millard
Committed by
Alexandre Julliard
Feb 15, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
oleaut32: Fix VarAbs function for BSTR with positive values.
parent
23f0df42
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
10 additions
and
3 deletions
+10
-3
vartest.c
dlls/oleaut32/tests/vartest.c
+8
-0
variant.c
dlls/oleaut32/variant.c
+1
-3
api.vbs
dlls/vbscript/tests/api.vbs
+1
-0
No files found.
dlls/oleaut32/tests/vartest.c
View file @
72b86f96
...
@@ -3145,6 +3145,14 @@ static void test_VarAbs(void)
...
@@ -3145,6 +3145,14 @@ static void test_VarAbs(void)
hres
=
pVarAbs
(
&
v
,
&
vDst
);
hres
=
pVarAbs
(
&
v
,
&
vDst
);
ok
(
hres
==
S_OK
&&
V_VT
(
&
vDst
)
==
VT_R8
&&
V_R8
(
&
vDst
)
==
1
.
1
,
ok
(
hres
==
S_OK
&&
V_VT
(
&
vDst
)
==
VT_R8
&&
V_R8
(
&
vDst
)
==
1
.
1
,
"VarAbs: expected 0x0,%d,%g, got 0x%lX,%d,%g
\n
"
,
VT_R8
,
1
.
1
,
hres
,
V_VT
(
&
vDst
),
V_R8
(
&
vDst
));
"VarAbs: expected 0x0,%d,%g, got 0x%lX,%d,%g
\n
"
,
VT_R8
,
1
.
1
,
hres
,
V_VT
(
&
vDst
),
V_R8
(
&
vDst
));
V_VT
(
&
v
)
=
VT_BSTR
;
V_BSTR
(
&
v
)
=
SysAllocString
(
L"30000"
);
memset
(
&
vDst
,
0
,
sizeof
(
vDst
));
hres
=
pVarAbs
(
&
v
,
&
vDst
);
ok
(
hres
==
S_OK
&&
V_VT
(
&
vDst
)
==
VT_R8
&&
V_R8
(
&
vDst
)
==
30000
.
0
,
"VarAbs: expected 0x0,%d,%g, got 0x%lX,%d,%g
\n
"
,
VT_R8
,
30000
.
0
,
hres
,
V_VT
(
&
vDst
),
V_R8
(
&
vDst
));
SysFreeString
(
V_BSTR
(
&
v
));
}
}
static
HRESULT
(
WINAPI
*
pVarNot
)(
LPVARIANT
,
LPVARIANT
);
static
HRESULT
(
WINAPI
*
pVarNot
)(
LPVARIANT
,
LPVARIANT
);
...
...
dlls/oleaut32/variant.c
View file @
72b86f96
...
@@ -4329,7 +4329,6 @@ VarOr_Exit:
...
@@ -4329,7 +4329,6 @@ VarOr_Exit:
*/
*/
HRESULT
WINAPI
VarAbs
(
LPVARIANT
pVarIn
,
LPVARIANT
pVarOut
)
HRESULT
WINAPI
VarAbs
(
LPVARIANT
pVarIn
,
LPVARIANT
pVarOut
)
{
{
VARIANT
varIn
;
HRESULT
hRet
=
S_OK
;
HRESULT
hRet
=
S_OK
;
VARIANT
temp
;
VARIANT
temp
;
...
@@ -4373,11 +4372,10 @@ HRESULT WINAPI VarAbs(LPVARIANT pVarIn, LPVARIANT pVarOut)
...
@@ -4373,11 +4372,10 @@ HRESULT WINAPI VarAbs(LPVARIANT pVarIn, LPVARIANT pVarOut)
if
(
V_R4
(
pVarOut
)
<
0
.
0
)
V_R4
(
pVarOut
)
=
-
V_R4
(
pVarOut
);
if
(
V_R4
(
pVarOut
)
<
0
.
0
)
V_R4
(
pVarOut
)
=
-
V_R4
(
pVarOut
);
break
;
break
;
case
VT_BSTR
:
case
VT_BSTR
:
hRet
=
VarR8FromStr
(
V_BSTR
(
pVarIn
),
LOCALE_USER_DEFAULT
,
0
,
&
V_R8
(
&
varIn
));
hRet
=
VarR8FromStr
(
V_BSTR
(
pVarIn
),
LOCALE_USER_DEFAULT
,
0
,
&
V_R8
(
pVarOut
));
if
(
FAILED
(
hRet
))
if
(
FAILED
(
hRet
))
break
;
break
;
V_VT
(
pVarOut
)
=
VT_R8
;
V_VT
(
pVarOut
)
=
VT_R8
;
pVarIn
=
&
varIn
;
/* Fall through ... */
/* Fall through ... */
case
VT_DATE
:
case
VT_DATE
:
case
VT_R8
:
case
VT_R8
:
...
...
dlls/vbscript/tests/api.vbs
View file @
72b86f96
...
@@ -1672,6 +1672,7 @@ Call ok(Abs(True) = 1, "Abs(True) = " & Abs(True))
...
@@ -1672,6 +1672,7 @@ Call ok(Abs(True) = 1, "Abs(True) = " & Abs(True))
Call
ok
(
getVT
(
Abs
(
True
))
=
"VT_I2"
,
"getVT(Abs(True)) = "
&
getVT
(
Abs
(
True
)))
Call
ok
(
getVT
(
Abs
(
True
))
=
"VT_I2"
,
"getVT(Abs(True)) = "
&
getVT
(
Abs
(
True
)))
Call
ok
(
Abs
(
CByte
(
1
))
=
1
,
"Abs(CByte(1)) = "
&
Abs
(
CByte
(
1
)))
Call
ok
(
Abs
(
CByte
(
1
))
=
1
,
"Abs(CByte(1)) = "
&
Abs
(
CByte
(
1
)))
Call
ok
(
getVT
(
Abs
(
CByte
(
1
)))
=
"VT_UI1"
,
"getVT(Abs(CByte(1))) = "
&
getVT
(
Abs
(
CByte
(
1
))))
Call
ok
(
getVT
(
Abs
(
CByte
(
1
)))
=
"VT_UI1"
,
"getVT(Abs(CByte(1))) = "
&
getVT
(
Abs
(
CByte
(
1
))))
Call
ok
(
Abs
(
"30000"
)
=
30000
,
"Abs(
""
30000
""
) = "
&
Abs
(
"30000"
))
Sub
testAbsError
(
strings
,
error_num1
,
error_num2
)
Sub
testAbsError
(
strings
,
error_num1
,
error_num2
)
on
error
resume
next
on
error
resume
next
...
...
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