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
67c9b7cb
Commit
67c9b7cb
authored
Jan 02, 2007
by
Alex Villacís Lasso
Committed by
Alexandre Julliard
Jan 03, 2007
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
oleaut32: Support for VT_DISPATCH in VarDiv.
parent
01395dec
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
46 additions
and
25 deletions
+46
-25
variant.c
dlls/oleaut32/variant.c
+46
-25
No files found.
dlls/oleaut32/variant.c
View file @
67c9b7cb
...
...
@@ -3527,6 +3527,29 @@ HRESULT WINAPI VarDiv(LPVARIANT left, LPVARIANT right, LPVARIANT result)
VARTYPE
leftvt
,
rightvt
;
VARTYPE
rightExtraFlags
,
leftExtraFlags
,
ExtraFlags
;
VARIANT
lv
,
rv
;
VARIANT
tempLeft
,
tempRight
;
VariantInit
(
&
tempLeft
);
VariantInit
(
&
tempRight
);
VariantInit
(
&
lv
);
VariantInit
(
&
rv
);
TRACE
(
"(%p->(%s%s),%p->(%s%s),%p)
\n
"
,
left
,
debugstr_VT
(
left
),
debugstr_VF
(
left
),
right
,
debugstr_VT
(
right
),
debugstr_VF
(
right
),
result
);
/* Handle VT_DISPATCH by storing and taking address of returned value */
if
((
V_VT
(
left
)
&
VT_TYPEMASK
)
==
VT_DISPATCH
)
{
hres
=
VARIANT_FetchDispatchValue
(
left
,
&
tempLeft
);
if
(
FAILED
(
hres
))
goto
end
;
left
=
&
tempLeft
;
}
if
((
V_VT
(
right
)
&
VT_TYPEMASK
)
==
VT_DISPATCH
)
{
hres
=
VARIANT_FetchDispatchValue
(
right
,
&
tempRight
);
if
(
FAILED
(
hres
))
goto
end
;
right
=
&
tempRight
;
}
leftvt
=
V_VT
(
left
)
&
VT_TYPEMASK
;
rightvt
=
V_VT
(
right
)
&
VT_TYPEMASK
;
...
...
@@ -3534,15 +3557,18 @@ HRESULT WINAPI VarDiv(LPVARIANT left, LPVARIANT right, LPVARIANT result)
rightExtraFlags
=
V_VT
(
right
)
&
(
~
VT_TYPEMASK
);
if
(
leftExtraFlags
!=
rightExtraFlags
)
return
DISP_E_BADVARTYPE
;
{
hres
=
DISP_E_BADVARTYPE
;
goto
end
;
}
ExtraFlags
=
leftExtraFlags
;
TRACE
(
"(%p->(%s%s),%p->(%s%s),%p)
\n
"
,
left
,
debugstr_VT
(
left
),
debugstr_VF
(
left
),
right
,
debugstr_VT
(
right
),
debugstr_VF
(
right
),
result
);
/* Native VarPow always returns a error when using any extra flags */
/* Native VarDiv always returns a error when using any extra flags */
if
(
ExtraFlags
!=
0
)
return
DISP_E_BADVARTYPE
;
{
hres
=
DISP_E_BADVARTYPE
;
goto
end
;
}
/* Determine return type */
if
(
!
(
rightvt
==
VT_EMPTY
))
...
...
@@ -3550,7 +3576,8 @@ HRESULT WINAPI VarDiv(LPVARIANT left, LPVARIANT right, LPVARIANT result)
if
(
leftvt
==
VT_NULL
||
rightvt
==
VT_NULL
)
{
V_VT
(
result
)
=
VT_NULL
;
return
S_OK
;
hres
=
S_OK
;
goto
end
;
}
else
if
(
leftvt
==
VT_DECIMAL
||
rightvt
==
VT_DECIMAL
)
resvt
=
VT_DECIMAL
;
...
...
@@ -3580,30 +3607,21 @@ HRESULT WINAPI VarDiv(LPVARIANT left, LPVARIANT right, LPVARIANT result)
else
if
(
leftvt
==
VT_NULL
&&
rightvt
==
VT_EMPTY
)
{
V_VT
(
result
)
=
VT_NULL
;
return
S_OK
;
hres
=
S_OK
;
goto
end
;
}
else
return
DISP_E_BADVARTYPE
;
VariantInit
(
&
lv
)
;
VariantInit
(
&
rv
);
{
hres
=
DISP_E_BADVARTYPE
;
goto
end
;
}
/* coerce to the result type */
hres
=
VariantChangeType
(
&
lv
,
left
,
0
,
resvt
);
if
(
hres
!=
S_OK
)
{
VariantClear
(
&
lv
);
VariantClear
(
&
rv
);
return
hres
;
}
if
(
hres
!=
S_OK
)
goto
end
;
hres
=
VariantChangeType
(
&
rv
,
right
,
0
,
resvt
);
if
(
hres
!=
S_OK
)
{
VariantClear
(
&
lv
);
VariantClear
(
&
rv
);
return
hres
;
}
if
(
hres
!=
S_OK
)
goto
end
;
/* do the math */
V_VT
(
result
)
=
resvt
;
...
...
@@ -3642,9 +3660,12 @@ HRESULT WINAPI VarDiv(LPVARIANT left, LPVARIANT right, LPVARIANT result)
break
;
}
end:
VariantClear
(
&
lv
);
VariantClear
(
&
rv
);
VariantClear
(
&
tempLeft
);
VariantClear
(
&
tempRight
);
TRACE
(
"returning 0x%8x (variant type %s)
\n
"
,
hres
,
debugstr_VT
(
result
));
return
hres
;
}
...
...
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