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
9373ec4c
Commit
9373ec4c
authored
Jan 29, 2024
by
Gabriel Ivăncescu
Committed by
Alexandre Julliard
Jan 30, 2024
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
jscript: Implement IActiveScriptSite service.
Signed-off-by:
Gabriel Ivăncescu
<
gabrielopcode@gmail.com
>
parent
384d5bfd
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
49 additions
and
0 deletions
+49
-0
jsutils.c
dlls/jscript/jsutils.c
+8
-0
caller.c
dlls/jscript/tests/caller.c
+10
-0
script.c
dlls/mshtml/tests/script.c
+31
-0
No files found.
dlls/jscript/jsutils.c
View file @
9373ec4c
...
...
@@ -1035,6 +1035,14 @@ static HRESULT WINAPI JSCaller_QueryService(IServiceProvider *iface, REFGUID gui
{
JSCaller
*
This
=
impl_from_IServiceProvider
(
iface
);
if
(
IsEqualGUID
(
guidService
,
&
IID_IActiveScriptSite
))
{
TRACE
(
"(%p)->(IID_IActiveScriptSite)
\n
"
,
This
);
if
(
This
->
ctx
&&
This
->
ctx
->
site
)
return
IActiveScriptSite_QueryInterface
(
This
->
ctx
->
site
,
riid
,
ppv
);
*
ppv
=
NULL
;
return
E_NOINTERFACE
;
}
if
(
IsEqualGUID
(
guidService
,
&
SID_GetCaller
))
{
TRACE
(
"(%p)->(SID_GetCaller)
\n
"
,
This
);
*
ppv
=
NULL
;
...
...
dlls/jscript/tests/caller.c
View file @
9373ec4c
...
...
@@ -75,6 +75,7 @@ static const CLSID CLSID_JScript =
expect_ ## func = called_ ## func = FALSE
DEFINE_EXPECT
(
sp_caller_QI_NULL
);
DEFINE_EXPECT
(
site_QI_NULL
);
DEFINE_EXPECT
(
testArgConv
);
DEFINE_EXPECT
(
testGetCaller
);
DEFINE_EXPECT
(
testGetCallerJS
);
...
...
@@ -254,6 +255,7 @@ static void test_change_types(IVariantChangeType *change_type, IDispatch *obj_di
static
void
test_caller
(
IServiceProvider
*
caller
,
IDispatch
*
arg_obj
)
{
IVariantChangeType
*
change_type
;
IUnknown
*
unk
;
HRESULT
hres
;
hres
=
IServiceProvider_QueryService
(
caller
,
&
SID_VariantConversion
,
&
IID_IVariantChangeType
,
(
void
**
)
&
change_type
);
...
...
@@ -263,6 +265,12 @@ static void test_caller(IServiceProvider *caller, IDispatch *arg_obj)
test_change_types
(
change_type
,
arg_obj
);
IVariantChangeType_Release
(
change_type
);
SET_EXPECT
(
site_QI_NULL
);
hres
=
IServiceProvider_QueryService
(
caller
,
&
IID_IActiveScriptSite
,
&
IID_NULL
,
(
void
**
)
&
unk
);
ok
(
hres
==
E_NOINTERFACE
,
"Querying for IActiveScriptSite->NULL returned: %08lx
\n
"
,
hres
);
ok
(
!
unk
,
"unk != NULL
\n
"
);
CHECK_CALLED
(
site_QI_NULL
);
}
static
IServiceProvider
sp_caller_obj
;
...
...
@@ -567,6 +575,8 @@ static HRESULT WINAPI ActiveScriptSite_QueryInterface(IActiveScriptSite *iface,
}
else
if
(
IsEqualGUID
(
&
IID_IActiveScriptSite
,
riid
))
{
*
ppv
=
iface
;
}
else
{
if
(
IsEqualGUID
(
&
IID_NULL
,
riid
))
CHECK_EXPECT
(
site_QI_NULL
);
*
ppv
=
NULL
;
return
E_NOINTERFACE
;
}
...
...
dlls/mshtml/tests/script.c
View file @
9373ec4c
...
...
@@ -313,6 +313,36 @@ fail:
return
SysAllocString
(
L"File"
);
}
static
void
test_sp_caller
(
IServiceProvider
*
sp
)
{
IOleCommandTarget
*
cmdtarget
;
IServiceProvider
*
caller
;
IHTMLWindow2
*
window
;
HRESULT
hres
;
VARIANT
var
;
hres
=
IServiceProvider_QueryService
(
sp
,
&
SID_GetCaller
,
&
IID_IServiceProvider
,
(
void
**
)
&
caller
);
ok
(
hres
==
S_OK
,
"QueryService(SID_GetCaller) returned: %08lx
\n
"
,
hres
);
ok
(
!
caller
,
"caller != NULL
\n
"
);
hres
=
IServiceProvider_QueryService
(
sp
,
&
IID_IActiveScriptSite
,
&
IID_IOleCommandTarget
,
(
void
**
)
&
cmdtarget
);
ok
(
hres
==
S_OK
,
"QueryService(IActiveScriptSite->IOleCommandTarget) failed: %08lx
\n
"
,
hres
);
ok
(
cmdtarget
!=
NULL
,
"IOleCommandTarget is NULL
\n
"
);
V_VT
(
&
var
)
=
VT_EMPTY
;
hres
=
IOleCommandTarget_Exec
(
cmdtarget
,
&
CGID_ScriptSite
,
CMDID_SCRIPTSITE_SECURITY_WINDOW
,
0
,
NULL
,
&
var
);
ok
(
hres
==
S_OK
,
"Exec failed: %08lx
\n
"
,
hres
);
ok
(
V_VT
(
&
var
)
==
VT_DISPATCH
,
"V_VT(CMDID_SCRIPTSITE_SECURITY_WINDOW) = %d
\n
"
,
V_VT
(
&
var
));
ok
(
V_DISPATCH
(
&
var
)
!=
NULL
,
"V_DISPATCH(CMDID_SCRIPTSITE_SECURITY_WINDOW) = NULL
\n
"
);
IOleCommandTarget_Release
(
cmdtarget
);
hres
=
IDispatch_QueryInterface
(
V_DISPATCH
(
&
var
),
&
IID_IHTMLWindow2
,
(
void
**
)
&
window
);
ok
(
hres
==
S_OK
,
"QueryInterface(IHTMLWindow2) failed: %08lx
\n
"
,
hres
);
ok
(
window
!=
NULL
,
"window is NULL
\n
"
);
IHTMLWindow2_Release
(
window
);
VariantClear
(
&
var
);
}
static
void
test_script_vars
(
unsigned
argc
,
VARIANTARG
*
argv
)
{
static
const
WCHAR
*
const
jsobj_names
[]
=
{
L"abc"
,
L"foO"
,
L"bar"
,
L"TostRing"
,
L"hasownpropERty"
};
...
...
@@ -1170,6 +1200,7 @@ static HRESULT WINAPI externalDisp_InvokeEx(IDispatchEx *iface, DISPID id, LCID
ok
(
!
pvarRes
,
"pvarRes != NULL
\n
"
);
ok
(
pei
!=
NULL
,
"pei == NULL
\n
"
);
test_sp_caller
(
pspCaller
);
return
S_OK
;
case
DISPID_EXTERNAL_TODO_WINE_OK
:
...
...
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