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
90844e20
Commit
90844e20
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 VarMod.
parent
cdceb023
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
61 additions
and
23 deletions
+61
-23
variant.c
dlls/oleaut32/variant.c
+61
-23
No files found.
dlls/oleaut32/variant.c
View file @
90844e20
...
...
@@ -5264,13 +5264,30 @@ HRESULT WINAPI VarMod(LPVARIANT left, LPVARIANT right, LPVARIANT result)
HRESULT
rc
=
E_FAIL
;
int
resT
=
0
;
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
)
{
rc
=
VARIANT_FetchDispatchValue
(
left
,
&
tempLeft
);
if
(
FAILED
(
rc
))
goto
end
;
left
=
&
tempLeft
;
}
if
((
V_VT
(
right
)
&
VT_TYPEMASK
)
==
VT_DISPATCH
)
{
rc
=
VARIANT_FetchDispatchValue
(
right
,
&
tempRight
);
if
(
FAILED
(
rc
))
goto
end
;
right
=
&
tempRight
;
}
/* check for invalid inputs */
lOk
=
TRUE
;
switch
(
V_VT
(
left
)
&
VT_TYPEMASK
)
{
...
...
@@ -5296,17 +5313,21 @@ HRESULT WINAPI VarMod(LPVARIANT left, LPVARIANT right, LPVARIANT result)
case
VT_VARIANT
:
case
VT_UNKNOWN
:
V_VT
(
result
)
=
VT_EMPTY
;
return
DISP_E_TYPEMISMATCH
;
rc
=
DISP_E_TYPEMISMATCH
;
goto
end
;
case
VT_ERROR
:
return
DISP_E_TYPEMISMATCH
;
rc
=
DISP_E_TYPEMISMATCH
;
goto
end
;
case
VT_RECORD
:
V_VT
(
result
)
=
VT_EMPTY
;
return
DISP_E_TYPEMISMATCH
;
rc
=
DISP_E_TYPEMISMATCH
;
goto
end
;
case
VT_NULL
:
break
;
default:
V_VT
(
result
)
=
VT_EMPTY
;
return
DISP_E_BADVARTYPE
;
rc
=
DISP_E_BADVARTYPE
;
goto
end
;
}
...
...
@@ -5320,13 +5341,15 @@ HRESULT WINAPI VarMod(LPVARIANT left, LPVARIANT right, LPVARIANT result)
if
((
V_VT
(
left
)
==
VT_INT
)
&&
(
V_VT
(
right
)
==
VT_I8
))
{
V_VT
(
result
)
=
VT_EMPTY
;
return
DISP_E_TYPEMISMATCH
;
rc
=
DISP_E_TYPEMISMATCH
;
goto
end
;
}
case
VT_INT
:
if
((
V_VT
(
right
)
==
VT_INT
)
&&
(
V_VT
(
left
)
==
VT_I8
))
{
V_VT
(
result
)
=
VT_EMPTY
;
return
DISP_E_TYPEMISMATCH
;
rc
=
DISP_E_TYPEMISMATCH
;
goto
end
;
}
case
VT_UI1
:
case
VT_UI2
:
...
...
@@ -5339,7 +5362,8 @@ HRESULT WINAPI VarMod(LPVARIANT left, LPVARIANT right, LPVARIANT result)
if
(
V_VT
(
left
)
==
VT_EMPTY
)
{
V_VT
(
result
)
=
VT_I4
;
return
S_OK
;
rc
=
S_OK
;
goto
end
;
}
case
VT_EMPTY
:
case
VT_DATE
:
...
...
@@ -5347,53 +5371,61 @@ HRESULT WINAPI VarMod(LPVARIANT left, LPVARIANT right, LPVARIANT result)
if
(
V_VT
(
left
)
==
VT_ERROR
)
{
V_VT
(
result
)
=
VT_EMPTY
;
return
DISP_E_TYPEMISMATCH
;
rc
=
DISP_E_TYPEMISMATCH
;
goto
end
;
}
case
VT_BSTR
:
if
(
V_VT
(
left
)
==
VT_NULL
)
{
V_VT
(
result
)
=
VT_NULL
;
return
S_OK
;
rc
=
S_OK
;
goto
end
;
}
break
;
case
VT_VOID
:
V_VT
(
result
)
=
VT_EMPTY
;
return
DISP_E_BADVARTYPE
;
rc
=
DISP_E_BADVARTYPE
;
goto
end
;
case
VT_NULL
:
if
(
V_VT
(
left
)
==
VT_VOID
)
{
V_VT
(
result
)
=
VT_EMPTY
;
return
DISP_E_BADVARTYPE
;
rc
=
DISP_E_BADVARTYPE
;
}
else
if
((
V_VT
(
left
)
==
VT_NULL
)
||
(
V_VT
(
left
)
==
VT_EMPTY
)
||
(
V_VT
(
left
)
==
VT_ERROR
)
||
lOk
)
{
V_VT
(
result
)
=
VT_NULL
;
return
S_OK
;
rc
=
S_OK
;
}
else
{
V_VT
(
result
)
=
VT_NULL
;
return
DISP_E_BADVARTYPE
;
rc
=
DISP_E_BADVARTYPE
;
}
goto
end
;
case
VT_VARIANT
:
case
VT_UNKNOWN
:
V_VT
(
result
)
=
VT_EMPTY
;
return
DISP_E_TYPEMISMATCH
;
rc
=
DISP_E_TYPEMISMATCH
;
goto
end
;
case
VT_ERROR
:
return
DISP_E_TYPEMISMATCH
;
rc
=
DISP_E_TYPEMISMATCH
;
goto
end
;
case
VT_RECORD
:
if
((
V_VT
(
left
)
==
15
)
||
((
V_VT
(
left
)
>=
24
)
&&
(
V_VT
(
left
)
<=
35
))
||
!
lOk
)
{
V_VT
(
result
)
=
VT_EMPTY
;
return
DISP_E_BADVARTYPE
;
rc
=
DISP_E_BADVARTYPE
;
}
else
{
V_VT
(
result
)
=
VT_EMPTY
;
return
DISP_E_TYPEMISMATCH
;
rc
=
DISP_E_TYPEMISMATCH
;
}
goto
end
;
default:
V_VT
(
result
)
=
VT_EMPTY
;
return
DISP_E_BADVARTYPE
;
rc
=
DISP_E_BADVARTYPE
;
goto
end
;
}
/* determine the result type */
...
...
@@ -5414,21 +5446,22 @@ HRESULT WINAPI VarMod(LPVARIANT left, LPVARIANT right, LPVARIANT result)
if
(
FAILED
(
rc
))
{
FIXME
(
"Could not convert left type %d to %d? rc == 0x%X
\n
"
,
V_VT
(
left
),
VT_I8
,
rc
);
return
rc
;
goto
end
;
}
rc
=
VariantChangeType
(
&
rv
,
right
,
0
,
VT_I8
);
if
(
FAILED
(
rc
))
{
FIXME
(
"Could not convert right type %d to %d? rc == 0x%X
\n
"
,
V_VT
(
right
),
VT_I8
,
rc
);
return
rc
;
goto
end
;
}
/* if right is zero set VT_EMPTY and return divide by zero */
if
(
V_I8
(
&
rv
)
==
0
)
{
V_VT
(
result
)
=
VT_EMPTY
;
return
DISP_E_DIVBYZERO
;
rc
=
DISP_E_DIVBYZERO
;
goto
end
;
}
/* perform the modulo operation */
...
...
@@ -5442,10 +5475,15 @@ HRESULT WINAPI VarMod(LPVARIANT left, LPVARIANT right, LPVARIANT result)
if
(
FAILED
(
rc
))
{
FIXME
(
"Could not convert 0x%x to %d?
\n
"
,
V_VT
(
result
),
resT
);
return
rc
;
/* fall to end of function */
}
return
S_OK
;
end:
VariantClear
(
&
lv
);
VariantClear
(
&
rv
);
VariantClear
(
&
tempLeft
);
VariantClear
(
&
tempRight
);
return
rc
;
}
/**********************************************************************
...
...
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