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
ae46ad83
Commit
ae46ad83
authored
Jan 23, 2012
by
Alistair Leslie-Hughes
Committed by
Alexandre Julliard
Jan 25, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
jscript: ActiveX objects might not support IServiceProvider Interface.
parent
bb4c2108
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
38 additions
and
4 deletions
+38
-4
jscript.c
dlls/jscript/jscript.c
+10
-3
activex.c
dlls/jscript/tests/activex.c
+28
-1
No files found.
dlls/jscript/jscript.c
View file @
ae46ad83
...
...
@@ -287,7 +287,12 @@ static ULONG WINAPI AXSite_Release(IServiceProvider *iface)
TRACE
(
"(%p) ref=%d
\n
"
,
This
,
ref
);
if
(
!
ref
)
{
if
(
This
->
sp
)
IServiceProvider_Release
(
This
->
sp
);
heap_free
(
This
);
}
return
ref
;
}
...
...
@@ -299,6 +304,9 @@ static HRESULT WINAPI AXSite_QueryService(IServiceProvider *iface,
TRACE
(
"(%p)->(%s %s %p)
\n
"
,
This
,
debugstr_guid
(
guidService
),
debugstr_guid
(
riid
),
ppv
);
if
(
!
This
->
sp
)
return
E_NOINTERFACE
;
return
IServiceProvider_QueryService
(
This
->
sp
,
guidService
,
riid
,
ppv
);
}
...
...
@@ -311,14 +319,13 @@ static IServiceProviderVtbl AXSiteVtbl = {
IUnknown
*
create_ax_site
(
script_ctx_t
*
ctx
)
{
IServiceProvider
*
sp
;
IServiceProvider
*
sp
=
NULL
;
AXSite
*
ret
;
HRESULT
hres
;
hres
=
IActiveScriptSite_QueryInterface
(
ctx
->
site
,
&
IID_IServiceProvider
,
(
void
**
)
&
sp
);
if
(
FAILED
(
hres
))
{
ERR
(
"Could not get IServiceProvider iface: %08x
\n
"
,
hres
);
return
NULL
;
TRACE
(
"Could not get IServiceProvider iface: %08x
\n
"
,
hres
);
}
ret
=
heap_alloc
(
sizeof
(
AXSite
));
...
...
dlls/jscript/tests/activex.c
View file @
ae46ad83
...
...
@@ -80,6 +80,7 @@ static DWORD QueryCustomPolicy_psize;
static
DWORD
QueryCustomPolicy_policy
;
static
HRESULT
QI_IDispatch_hres
;
static
HRESULT
SetSite_hres
;
static
BOOL
AllowIServiceProvider
;
#define TESTOBJ_CLSID "{178fc163-f585-4e24-9c13-4bb7faf80646}"
...
...
@@ -575,7 +576,7 @@ static HRESULT WINAPI ActiveScriptSite_QueryInterface(IActiveScriptSite *iface,
*
ppv
=
iface
;
}
else
if
(
IsEqualGUID
(
&
IID_IActiveScriptSite
,
riid
))
{
*
ppv
=
iface
;
}
else
if
(
IsEqualGUID
(
&
IID_IServiceProvider
,
riid
))
{
}
else
if
(
IsEqualGUID
(
&
IID_IServiceProvider
,
riid
)
&&
AllowIServiceProvider
)
{
*
ppv
=
&
ServiceProvider
;
}
else
{
*
ppv
=
NULL
;
...
...
@@ -718,6 +719,7 @@ static IActiveScriptParse *create_script(BOOL skip_tests, BOOL use_sec_mgr)
QueryCustomPolicy_policy
=
URLPOLICY_ALLOW
;
QI_IDispatch_hres
=
S_OK
;
SetSite_hres
=
S_OK
;
AllowIServiceProvider
=
TRUE
;
hres
=
CoCreateInstance
(
&
CLSID_JScript
,
NULL
,
CLSCTX_INPROC_SERVER
|
CLSCTX_INPROC_HANDLER
,
&
IID_IActiveScript
,
(
void
**
)
&
script
);
...
...
@@ -1032,6 +1034,31 @@ static void test_ActiveXObject(void)
CHECK_CALLED
(
SetSite
);
IUnknown_Release
(
parser
);
/* No IServiceProvider Interface */
parser
=
create_script
(
FALSE
,
FALSE
);
object_with_site
=
&
ObjectWithSite
;
AllowIServiceProvider
=
FALSE
;
SET_EXPECT
(
CreateInstance
);
SET_EXPECT
(
QI_IObjectWithSite
);
SET_EXPECT
(
reportSuccess
);
SET_EXPECT
(
SetSite
);
parse_script_a
(
parser
,
"(new ActiveXObject('Wine.Test')).reportSuccess();"
);
CHECK_CALLED
(
CreateInstance
);
CHECK_CALLED
(
QI_IObjectWithSite
);
CHECK_CALLED
(
reportSuccess
);
CHECK_CALLED
(
SetSite
);
IUnknown_Release
(
parser
);
parser
=
create_script
(
FALSE
,
TRUE
);
object_with_site
=
&
ObjectWithSite
;
AllowIServiceProvider
=
FALSE
;
parse_script_a
(
parser
,
"testException(function() { new ActiveXObject('Wine.Test'); }, 'Error', -2146827859);"
);
IUnknown_Release
(
parser
);
}
static
BOOL
init_key
(
const
char
*
key_name
,
const
char
*
def_value
,
BOOL
init
)
...
...
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