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
6d4533a8
Commit
6d4533a8
authored
Sep 30, 2009
by
Jacek Caban
Committed by
Alexandre Julliard
Sep 30, 2009
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
jscript: Added ActiveXObject constructor implementation.
parent
90fadf84
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
139 additions
and
4 deletions
+139
-4
Makefile.in
dlls/jscript/Makefile.in
+1
-1
activex.c
dlls/jscript/activex.c
+122
-2
error.c
dlls/jscript/error.c
+5
-0
jscript.c
dlls/jscript/jscript.c
+6
-0
jscript.h
dlls/jscript/jscript.h
+3
-1
jscript_En.rc
dlls/jscript/jscript_En.rc
+1
-0
resource.h
dlls/jscript/resource.h
+1
-0
No files found.
dlls/jscript/Makefile.in
View file @
6d4533a8
...
@@ -3,7 +3,7 @@ TOPOBJDIR = ../..
...
@@ -3,7 +3,7 @@ TOPOBJDIR = ../..
SRCDIR
=
@srcdir@
SRCDIR
=
@srcdir@
VPATH
=
@srcdir@
VPATH
=
@srcdir@
MODULE
=
jscript.dll
MODULE
=
jscript.dll
IMPORTS
=
oleaut32 user32 advapi32 kernel32
IMPORTS
=
oleaut32
ole32
user32 advapi32 kernel32
RC_SRCS
=
\
RC_SRCS
=
\
jscript_De.rc
\
jscript_De.rc
\
...
...
dlls/jscript/activex.c
View file @
6d4533a8
...
@@ -20,16 +20,136 @@
...
@@ -20,16 +20,136 @@
#include "wine/port.h"
#include "wine/port.h"
#include "jscript.h"
#include "jscript.h"
#include "objsafe.h"
#include "wine/debug.h"
#include "wine/debug.h"
WINE_DEFAULT_DEBUG_CHANNEL
(
jscript
);
WINE_DEFAULT_DEBUG_CHANNEL
(
jscript
);
/* Defined as extern in urlmon.idl, but not exported by uuid.lib */
const
GUID
GUID_CUSTOM_CONFIRMOBJECTSAFETY
=
{
0x10200490
,
0xfa38
,
0x11d0
,{
0xac
,
0x0e
,
0x00
,
0xa0
,
0xc9
,
0xf
,
0xff
,
0xc0
}};
static
IInternetHostSecurityManager
*
get_sec_mgr
(
script_ctx_t
*
ctx
)
{
IInternetHostSecurityManager
*
secmgr
;
IServiceProvider
*
sp
;
HRESULT
hres
;
if
(
!
ctx
->
site
)
return
NULL
;
if
(
ctx
->
secmgr
)
return
ctx
->
secmgr
;
hres
=
IActiveScriptSite_QueryInterface
(
ctx
->
site
,
&
IID_IServiceProvider
,
(
void
**
)
&
sp
);
if
(
FAILED
(
hres
))
return
NULL
;
hres
=
IServiceProvider_QueryService
(
sp
,
&
SID_SInternetHostSecurityManager
,
&
IID_IInternetHostSecurityManager
,
(
void
**
)
&
secmgr
);
IServiceProvider_Release
(
sp
);
if
(
FAILED
(
hres
))
return
NULL
;
return
ctx
->
secmgr
=
secmgr
;
}
static
IUnknown
*
create_activex_object
(
script_ctx_t
*
ctx
,
const
WCHAR
*
progid
)
{
IInternetHostSecurityManager
*
secmgr
;
struct
CONFIRMSAFETY
cs
;
DWORD
policy_size
;
BYTE
*
bpolicy
;
IUnknown
*
obj
;
DWORD
policy
;
GUID
guid
;
HRESULT
hres
;
hres
=
CLSIDFromProgID
(
progid
,
&
guid
);
if
(
FAILED
(
hres
))
return
NULL
;
TRACE
(
"GUID %s
\n
"
,
debugstr_guid
(
&
guid
));
secmgr
=
get_sec_mgr
(
ctx
);
if
(
!
secmgr
)
return
NULL
;
policy
=
0
;
hres
=
IInternetHostSecurityManager_ProcessUrlAction
(
secmgr
,
URLACTION_ACTIVEX_RUN
,
(
BYTE
*
)
&
policy
,
sizeof
(
policy
),
(
BYTE
*
)
&
guid
,
sizeof
(
GUID
),
0
,
0
);
if
(
FAILED
(
hres
)
||
policy
!=
URLPOLICY_ALLOW
)
return
NULL
;
/* FIXME: Use IClassFactoryEx */
hres
=
CoCreateInstance
(
&
guid
,
NULL
,
CLSCTX_INPROC_SERVER
|
CLSCTX_INPROC_HANDLER
,
&
IID_IUnknown
,
(
void
**
)
&
obj
);
if
(
FAILED
(
hres
))
return
NULL
;
cs
.
clsid
=
guid
;
cs
.
pUnk
=
obj
;
cs
.
dwFlags
=
0
;
hres
=
IInternetHostSecurityManager_QueryCustomPolicy
(
secmgr
,
&
GUID_CUSTOM_CONFIRMOBJECTSAFETY
,
&
bpolicy
,
&
policy_size
,
(
BYTE
*
)
&
cs
,
sizeof
(
cs
),
0
);
if
(
SUCCEEDED
(
hres
))
{
policy
=
policy_size
>=
sizeof
(
DWORD
)
?
*
(
DWORD
*
)
bpolicy
:
URLPOLICY_DISALLOW
;
CoTaskMemFree
(
bpolicy
);
}
if
(
FAILED
(
hres
)
||
policy
!=
URLPOLICY_ALLOW
)
{
IUnknown_Release
(
obj
);
return
NULL
;
}
return
obj
;
}
static
HRESULT
ActiveXObject_value
(
script_ctx_t
*
ctx
,
vdisp_t
*
jsthis
,
WORD
flags
,
DISPPARAMS
*
dp
,
static
HRESULT
ActiveXObject_value
(
script_ctx_t
*
ctx
,
vdisp_t
*
jsthis
,
WORD
flags
,
DISPPARAMS
*
dp
,
VARIANT
*
retv
,
jsexcept_t
*
ei
,
IServiceProvider
*
caller
)
VARIANT
*
retv
,
jsexcept_t
*
ei
,
IServiceProvider
*
caller
)
{
{
FIXME
(
"
\n
"
);
IDispatch
*
disp
;
return
E_NOTIMPL
;
IUnknown
*
obj
;
BSTR
progid
;
HRESULT
hres
;
TRACE
(
"
\n
"
);
if
(
flags
!=
DISPATCH_CONSTRUCT
)
{
FIXME
(
"unsupported flags %x
\n
"
,
flags
);
return
E_NOTIMPL
;
}
if
(
ctx
->
safeopt
!=
(
INTERFACESAFE_FOR_UNTRUSTED_DATA
|
INTERFACE_USES_DISPEX
|
INTERFACE_USES_SECURITY_MANAGER
))
{
FIXME
(
"Unsupported safeopt %x
\n
"
,
ctx
->
safeopt
);
return
E_NOTIMPL
;
}
if
(
arg_cnt
(
dp
)
!=
1
)
{
FIXME
(
"unsuported arg_cnt %d
\n
"
,
arg_cnt
(
dp
));
return
E_NOTIMPL
;
}
hres
=
to_string
(
ctx
,
get_arg
(
dp
,
0
),
ei
,
&
progid
);
if
(
FAILED
(
hres
))
return
hres
;
obj
=
create_activex_object
(
ctx
,
progid
);
SysFreeString
(
progid
);
if
(
!
obj
)
return
throw_generic_error
(
ctx
,
ei
,
IDS_CREATE_OBJ_ERROR
,
NULL
);
hres
=
IUnknown_QueryInterface
(
obj
,
&
IID_IDispatch
,
(
void
**
)
&
disp
);
IUnknown_Release
(
obj
);
if
(
FAILED
(
hres
))
{
FIXME
(
"Object does not support IDispatch
\n
"
);
return
E_NOTIMPL
;
}
V_VT
(
retv
)
=
VT_DISPATCH
;
V_DISPATCH
(
retv
)
=
disp
;
return
S_OK
;
}
}
HRESULT
create_activex_constr
(
script_ctx_t
*
ctx
,
DispatchEx
**
ret
)
HRESULT
create_activex_constr
(
script_ctx_t
*
ctx
,
DispatchEx
**
ret
)
...
...
dlls/jscript/error.c
View file @
6d4533a8
...
@@ -429,6 +429,11 @@ HRESULT throw_eval_error(script_ctx_t *ctx, jsexcept_t *ei, UINT id, const WCHAR
...
@@ -429,6 +429,11 @@ HRESULT throw_eval_error(script_ctx_t *ctx, jsexcept_t *ei, UINT id, const WCHAR
return
throw_error
(
ctx
,
ei
,
id
,
str
,
ctx
->
eval_error_constr
);
return
throw_error
(
ctx
,
ei
,
id
,
str
,
ctx
->
eval_error_constr
);
}
}
HRESULT
throw_generic_error
(
script_ctx_t
*
ctx
,
jsexcept_t
*
ei
,
UINT
id
,
const
WCHAR
*
str
)
{
return
throw_error
(
ctx
,
ei
,
id
,
str
,
ctx
->
error_constr
);
}
HRESULT
throw_range_error
(
script_ctx_t
*
ctx
,
jsexcept_t
*
ei
,
UINT
id
,
const
WCHAR
*
str
)
HRESULT
throw_range_error
(
script_ctx_t
*
ctx
,
jsexcept_t
*
ei
,
UINT
id
,
const
WCHAR
*
str
)
{
{
return
throw_error
(
ctx
,
ei
,
id
,
str
,
ctx
->
range_error_constr
);
return
throw_error
(
ctx
,
ei
,
id
,
str
,
ctx
->
range_error_constr
);
...
...
dlls/jscript/jscript.c
View file @
6d4533a8
...
@@ -351,6 +351,11 @@ static HRESULT WINAPI JScript_Close(IActiveScript *iface)
...
@@ -351,6 +351,11 @@ static HRESULT WINAPI JScript_Close(IActiveScript *iface)
This
->
ctx
->
named_items
=
NULL
;
This
->
ctx
->
named_items
=
NULL
;
}
}
if
(
This
->
ctx
->
secmgr
)
{
IInternetHostSecurityManager_Release
(
This
->
ctx
->
secmgr
);
This
->
ctx
->
secmgr
=
NULL
;
}
if
(
This
->
ctx
->
site
)
{
if
(
This
->
ctx
->
site
)
{
IActiveScriptSite_Release
(
This
->
ctx
->
site
);
IActiveScriptSite_Release
(
This
->
ctx
->
site
);
This
->
ctx
->
site
=
NULL
;
This
->
ctx
->
site
=
NULL
;
...
@@ -554,6 +559,7 @@ static HRESULT WINAPI JScriptParse_InitNew(IActiveScriptParse *iface)
...
@@ -554,6 +559,7 @@ static HRESULT WINAPI JScriptParse_InitNew(IActiveScriptParse *iface)
ctx
->
ref
=
1
;
ctx
->
ref
=
1
;
ctx
->
state
=
SCRIPTSTATE_UNINITIALIZED
;
ctx
->
state
=
SCRIPTSTATE_UNINITIALIZED
;
ctx
->
safeopt
=
This
->
safeopt
;
jsheap_init
(
&
ctx
->
tmp_heap
);
jsheap_init
(
&
ctx
->
tmp_heap
);
ctx
=
InterlockedCompareExchangePointer
((
void
**
)
&
This
->
ctx
,
ctx
,
NULL
);
ctx
=
InterlockedCompareExchangePointer
((
void
**
)
&
This
->
ctx
,
ctx
,
NULL
);
...
...
dlls/jscript/jscript.h
View file @
6d4533a8
...
@@ -214,6 +214,7 @@ HRESULT create_builtin_function(script_ctx_t*,builtin_invoke_t,const WCHAR*,cons
...
@@ -214,6 +214,7 @@ HRESULT create_builtin_function(script_ctx_t*,builtin_invoke_t,const WCHAR*,cons
HRESULT
Function_value
(
script_ctx_t
*
,
vdisp_t
*
,
WORD
,
DISPPARAMS
*
,
VARIANT
*
,
jsexcept_t
*
,
IServiceProvider
*
);
HRESULT
Function_value
(
script_ctx_t
*
,
vdisp_t
*
,
WORD
,
DISPPARAMS
*
,
VARIANT
*
,
jsexcept_t
*
,
IServiceProvider
*
);
HRESULT
throw_eval_error
(
script_ctx_t
*
,
jsexcept_t
*
,
UINT
,
const
WCHAR
*
);
HRESULT
throw_eval_error
(
script_ctx_t
*
,
jsexcept_t
*
,
UINT
,
const
WCHAR
*
);
HRESULT
throw_generic_error
(
script_ctx_t
*
,
jsexcept_t
*
,
UINT
,
const
WCHAR
*
);
HRESULT
throw_range_error
(
script_ctx_t
*
,
jsexcept_t
*
,
UINT
,
const
WCHAR
*
);
HRESULT
throw_range_error
(
script_ctx_t
*
,
jsexcept_t
*
,
UINT
,
const
WCHAR
*
);
HRESULT
throw_reference_error
(
script_ctx_t
*
,
jsexcept_t
*
,
UINT
,
const
WCHAR
*
);
HRESULT
throw_reference_error
(
script_ctx_t
*
,
jsexcept_t
*
,
UINT
,
const
WCHAR
*
);
HRESULT
throw_regexp_error
(
script_ctx_t
*
,
jsexcept_t
*
,
UINT
,
const
WCHAR
*
);
HRESULT
throw_regexp_error
(
script_ctx_t
*
,
jsexcept_t
*
,
UINT
,
const
WCHAR
*
);
...
@@ -221,7 +222,6 @@ HRESULT throw_syntax_error(script_ctx_t*,jsexcept_t*,UINT,const WCHAR*);
...
@@ -221,7 +222,6 @@ HRESULT throw_syntax_error(script_ctx_t*,jsexcept_t*,UINT,const WCHAR*);
HRESULT
throw_type_error
(
script_ctx_t
*
,
jsexcept_t
*
,
UINT
,
const
WCHAR
*
);
HRESULT
throw_type_error
(
script_ctx_t
*
,
jsexcept_t
*
,
UINT
,
const
WCHAR
*
);
HRESULT
throw_uri_error
(
script_ctx_t
*
,
jsexcept_t
*
,
UINT
,
const
WCHAR
*
);
HRESULT
throw_uri_error
(
script_ctx_t
*
,
jsexcept_t
*
,
UINT
,
const
WCHAR
*
);
HRESULT
create_object
(
script_ctx_t
*
,
DispatchEx
*
,
DispatchEx
**
);
HRESULT
create_object
(
script_ctx_t
*
,
DispatchEx
*
,
DispatchEx
**
);
HRESULT
create_math
(
script_ctx_t
*
,
DispatchEx
**
);
HRESULT
create_math
(
script_ctx_t
*
,
DispatchEx
**
);
HRESULT
create_array
(
script_ctx_t
*
,
DWORD
,
DispatchEx
**
);
HRESULT
create_array
(
script_ctx_t
*
,
DWORD
,
DispatchEx
**
);
...
@@ -260,6 +260,8 @@ struct _script_ctx_t {
...
@@ -260,6 +260,8 @@ struct _script_ctx_t {
exec_ctx_t
*
exec_ctx
;
exec_ctx_t
*
exec_ctx
;
named_item_t
*
named_items
;
named_item_t
*
named_items
;
IActiveScriptSite
*
site
;
IActiveScriptSite
*
site
;
IInternetHostSecurityManager
*
secmgr
;
DWORD
safeopt
;
LCID
lcid
;
LCID
lcid
;
jsheap_t
tmp_heap
;
jsheap_t
tmp_heap
;
...
...
dlls/jscript/jscript_En.rc
View file @
6d4533a8
...
@@ -24,6 +24,7 @@ STRINGTABLE DISCARDABLE
...
@@ -24,6 +24,7 @@ STRINGTABLE DISCARDABLE
{
{
IDS_TO_PRIMITIVE "Error converting object to primitive type"
IDS_TO_PRIMITIVE "Error converting object to primitive type"
IDS_INVALID_CALL_ARG "Invalid procedure call or argument"
IDS_INVALID_CALL_ARG "Invalid procedure call or argument"
IDS_CREATE_OBJ_ERROR "Automation server can't create object"
IDS_NO_PROPERTY "Object doesn't support this property or method"
IDS_NO_PROPERTY "Object doesn't support this property or method"
IDS_ARG_NOT_OPT "Argument not optional"
IDS_ARG_NOT_OPT "Argument not optional"
IDS_SYNTAX_ERROR "Syntax error"
IDS_SYNTAX_ERROR "Syntax error"
...
...
dlls/jscript/resource.h
View file @
6d4533a8
...
@@ -20,6 +20,7 @@
...
@@ -20,6 +20,7 @@
#define IDS_TO_PRIMITIVE 0x0001
#define IDS_TO_PRIMITIVE 0x0001
#define IDS_INVALID_CALL_ARG 0x0005
#define IDS_INVALID_CALL_ARG 0x0005
#define IDS_CREATE_OBJ_ERROR 0x01AD
#define IDS_NO_PROPERTY 0x01B6
#define IDS_NO_PROPERTY 0x01B6
#define IDS_ARG_NOT_OPT 0x01c1
#define IDS_ARG_NOT_OPT 0x01c1
#define IDS_SYNTAX_ERROR 0x03EA
#define IDS_SYNTAX_ERROR 0x03EA
...
...
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