Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
bac7c1ef
Commit
bac7c1ef
authored
Mar 12, 2012
by
Jacek Caban
Committed by
Alexandre Julliard
Mar 12, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
jscript: Added ChangeType implementation.
parent
2cbd6a63
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
86 additions
and
2 deletions
+86
-2
jscript.c
dlls/jscript/jscript.c
+14
-2
jscript.h
dlls/jscript/jscript.h
+2
-0
jsutils.c
dlls/jscript/jsutils.c
+70
-0
No files found.
dlls/jscript/jscript.c
View file @
bac7c1ef
...
...
@@ -1002,8 +1002,20 @@ static ULONG WINAPI VariantChangeType_Release(IVariantChangeType *iface)
static
HRESULT
WINAPI
VariantChangeType_ChangeType
(
IVariantChangeType
*
iface
,
VARIANT
*
dst
,
VARIANT
*
src
,
LCID
lcid
,
VARTYPE
vt
)
{
JScript
*
This
=
impl_from_IVariantChangeType
(
iface
);
FIXME
(
"(%p)->(%p %s %x %d)
\n
"
,
This
,
dst
,
debugstr_variant
(
src
),
lcid
,
vt
);
return
E_NOTIMPL
;
HRESULT
hres
;
TRACE
(
"(%p)->(%p %s %x %d)
\n
"
,
This
,
dst
,
debugstr_variant
(
src
),
lcid
,
vt
);
if
(
!
This
->
ctx
)
{
FIXME
(
"Object uninitialized
\n
"
);
return
E_UNEXPECTED
;
}
hres
=
VariantClear
(
dst
);
if
(
FAILED
(
hres
))
return
hres
;
return
variant_change_type
(
This
->
ctx
,
dst
,
src
,
vt
);
}
static
const
IVariantChangeTypeVtbl
VariantChangeTypeVtbl
=
{
...
...
dlls/jscript/jscript.h
View file @
bac7c1ef
...
...
@@ -260,6 +260,8 @@ HRESULT to_uint32(script_ctx_t*,VARIANT*,jsexcept_t*,DWORD*) DECLSPEC_HIDDEN;
HRESULT
to_string
(
script_ctx_t
*
,
VARIANT
*
,
jsexcept_t
*
,
BSTR
*
)
DECLSPEC_HIDDEN
;
HRESULT
to_object
(
script_ctx_t
*
,
VARIANT
*
,
IDispatch
**
)
DECLSPEC_HIDDEN
;
HRESULT
variant_change_type
(
script_ctx_t
*
,
VARIANT
*
,
VARIANT
*
,
VARTYPE
);
BSTR
int_to_bstr
(
int
)
DECLSPEC_HIDDEN
;
HRESULT
double_to_bstr
(
double
,
BSTR
*
)
DECLSPEC_HIDDEN
;
...
...
dlls/jscript/jsutils.c
View file @
bac7c1ef
...
...
@@ -657,6 +657,76 @@ HRESULT to_object(script_ctx_t *ctx, VARIANT *v, IDispatch **disp)
return
S_OK
;
}
HRESULT
variant_change_type
(
script_ctx_t
*
ctx
,
VARIANT
*
dst
,
VARIANT
*
src
,
VARTYPE
vt
)
{
jsexcept_t
ei
;
HRESULT
hres
;
memset
(
&
ei
,
0
,
sizeof
(
ei
));
switch
(
vt
)
{
case
VT_I2
:
case
VT_I4
:
{
INT
i
;
hres
=
to_int32
(
ctx
,
src
,
&
ei
,
&
i
);
if
(
SUCCEEDED
(
hres
))
{
if
(
vt
==
VT_I4
)
V_I4
(
dst
)
=
i
;
else
V_I2
(
dst
)
=
i
;
}
break
;
}
case
VT_R8
:
hres
=
to_number
(
ctx
,
src
,
&
ei
,
dst
);
if
(
SUCCEEDED
(
hres
)
&&
V_VT
(
dst
)
==
VT_I4
)
V_R8
(
dst
)
=
V_I4
(
dst
);
break
;
case
VT_R4
:
{
VARIANT
n
;
hres
=
to_number
(
ctx
,
src
,
&
ei
,
&
n
);
if
(
SUCCEEDED
(
hres
))
V_R4
(
dst
)
=
num_val
(
&
n
);
break
;
}
case
VT_BOOL
:
{
VARIANT_BOOL
b
;
hres
=
to_boolean
(
src
,
&
b
);
if
(
SUCCEEDED
(
hres
))
V_BOOL
(
dst
)
=
b
;
break
;
}
case
VT_BSTR
:
{
BSTR
str
;
hres
=
to_string
(
ctx
,
src
,
&
ei
,
&
str
);
if
(
SUCCEEDED
(
hres
))
V_BSTR
(
dst
)
=
str
;
break
;
}
case
VT_EMPTY
:
hres
=
V_VT
(
src
)
==
VT_EMPTY
?
S_OK
:
E_NOTIMPL
;
break
;
case
VT_NULL
:
hres
=
V_VT
(
src
)
==
VT_NULL
?
S_OK
:
E_NOTIMPL
;
break
;
default:
FIXME
(
"vt %d not implemented
\n
"
,
vt
);
hres
=
E_NOTIMPL
;
}
if
(
FAILED
(
hres
))
{
VariantClear
(
&
ei
.
var
);
return
hres
;
}
V_VT
(
dst
)
=
vt
;
return
S_OK
;
}
static
inline
JSCaller
*
impl_from_IServiceProvider
(
IServiceProvider
*
iface
)
{
return
CONTAINING_RECORD
(
iface
,
JSCaller
,
IServiceProvider_iface
);
...
...
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