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
0b4688e1
Commit
0b4688e1
authored
Mar 15, 2018
by
Gijs Vermeulen
Committed by
Alexandre Julliard
Mar 16, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
msscript: Implement IScriptControl_[get|put]_UseSafeSubset.
Signed-off-by:
Gijs Vermeulen
<
gijsvrm@gmail.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
f98d0764
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
52 additions
and
5 deletions
+52
-5
msscript.c
dlls/msscript.ocx/msscript.c
+14
-5
msscript.c
dlls/msscript.ocx/tests/msscript.c
+38
-0
No files found.
dlls/msscript.ocx/msscript.c
View file @
0b4688e1
...
@@ -90,6 +90,7 @@ struct ScriptControl {
...
@@ -90,6 +90,7 @@ struct ScriptControl {
SIZEL
extent
;
SIZEL
extent
;
LONG
timeout
;
LONG
timeout
;
VARIANT_BOOL
allow_ui
;
VARIANT_BOOL
allow_ui
;
VARIANT_BOOL
use_safe_subset
;
/* connection points */
/* connection points */
ConnectionPoint
*
cp_list
;
ConnectionPoint
*
cp_list
;
...
@@ -838,15 +839,22 @@ static HRESULT WINAPI ScriptControl_put_AllowUI(IScriptControl *iface, VARIANT_B
...
@@ -838,15 +839,22 @@ static HRESULT WINAPI ScriptControl_put_AllowUI(IScriptControl *iface, VARIANT_B
static
HRESULT
WINAPI
ScriptControl_get_UseSafeSubset
(
IScriptControl
*
iface
,
VARIANT_BOOL
*
p
)
static
HRESULT
WINAPI
ScriptControl_get_UseSafeSubset
(
IScriptControl
*
iface
,
VARIANT_BOOL
*
p
)
{
{
ScriptControl
*
This
=
impl_from_IScriptControl
(
iface
);
ScriptControl
*
This
=
impl_from_IScriptControl
(
iface
);
FIXME
(
"(%p)->(%p)
\n
"
,
This
,
p
);
TRACE
(
"(%p)->(%p)
\n
"
,
This
,
p
);
return
E_NOTIMPL
;
if
(
!
p
)
return
E_POINTER
;
*
p
=
This
->
use_safe_subset
;
return
S_OK
;
}
}
static
HRESULT
WINAPI
ScriptControl_put_UseSafeSubset
(
IScriptControl
*
iface
,
VARIANT_BOOL
v
)
static
HRESULT
WINAPI
ScriptControl_put_UseSafeSubset
(
IScriptControl
*
iface
,
VARIANT_BOOL
use_safe_subset
)
{
{
ScriptControl
*
This
=
impl_from_IScriptControl
(
iface
);
ScriptControl
*
This
=
impl_from_IScriptControl
(
iface
);
FIXME
(
"(%p)->(%x)
\n
"
,
This
,
v
);
TRACE
(
"(%p)->(%x)
\n
"
,
This
,
use_safe_subset
);
return
E_NOTIMPL
;
This
->
use_safe_subset
=
use_safe_subset
;
return
S_OK
;
}
}
static
HRESULT
WINAPI
ScriptControl_get_Modules
(
IScriptControl
*
iface
,
IScriptModuleCollection
**
p
)
static
HRESULT
WINAPI
ScriptControl_get_Modules
(
IScriptControl
*
iface
,
IScriptModuleCollection
**
p
)
...
@@ -1891,6 +1899,7 @@ static HRESULT WINAPI ScriptControl_CreateInstance(IClassFactory *iface, IUnknow
...
@@ -1891,6 +1899,7 @@ static HRESULT WINAPI ScriptControl_CreateInstance(IClassFactory *iface, IUnknow
script_control
->
view_sink_flags
=
0
;
script_control
->
view_sink_flags
=
0
;
script_control
->
view_sink
=
NULL
;
script_control
->
view_sink
=
NULL
;
script_control
->
allow_ui
=
VARIANT_TRUE
;
script_control
->
allow_ui
=
VARIANT_TRUE
;
script_control
->
use_safe_subset
=
VARIANT_FALSE
;
ConnectionPoint_Init
(
&
script_control
->
cp_scsource
,
script_control
,
&
DIID_DScriptControlSource
);
ConnectionPoint_Init
(
&
script_control
->
cp_scsource
,
script_control
,
&
DIID_DScriptControlSource
);
ConnectionPoint_Init
(
&
script_control
->
cp_propnotif
,
script_control
,
&
IID_IPropertyNotifySink
);
ConnectionPoint_Init
(
&
script_control
->
cp_propnotif
,
script_control
,
&
IID_IPropertyNotifySink
);
...
...
dlls/msscript.ocx/tests/msscript.c
View file @
0b4688e1
...
@@ -1254,6 +1254,43 @@ static void test_AllowUI(void)
...
@@ -1254,6 +1254,43 @@ static void test_AllowUI(void)
IScriptControl_Release
(
sc
);
IScriptControl_Release
(
sc
);
}
}
static
void
test_UseSafeSubset
(
void
)
{
IScriptControl
*
sc
;
VARIANT_BOOL
use_safe_subset
;
HRESULT
hr
;
BSTR
str
;
hr
=
CoCreateInstance
(
&
CLSID_ScriptControl
,
NULL
,
CLSCTX_INPROC_SERVER
|
CLSCTX_INPROC_HANDLER
,
&
IID_IScriptControl
,
(
void
**
)
&
sc
);
ok
(
hr
==
S_OK
,
"got 0x%08x
\n
"
,
hr
);
hr
=
IScriptControl_get_UseSafeSubset
(
sc
,
NULL
);
ok
(
hr
==
E_POINTER
,
"got 0x%08x
\n
"
,
hr
);
hr
=
IScriptControl_get_UseSafeSubset
(
sc
,
&
use_safe_subset
);
ok
(
hr
==
S_OK
,
"got 0x%08x
\n
"
,
hr
);
ok
(
use_safe_subset
==
VARIANT_FALSE
,
"got %d
\n
"
,
use_safe_subset
);
hr
=
IScriptControl_put_UseSafeSubset
(
sc
,
VARIANT_TRUE
);
ok
(
hr
==
S_OK
,
"got 0x%08x
\n
"
,
hr
);
hr
=
IScriptControl_get_UseSafeSubset
(
sc
,
&
use_safe_subset
);
ok
(
hr
==
S_OK
,
"got 0x%08x
\n
"
,
hr
);
ok
(
use_safe_subset
==
VARIANT_TRUE
,
"got %d
\n
"
,
use_safe_subset
);
str
=
SysAllocString
(
vbW
);
hr
=
IScriptControl_put_Language
(
sc
,
str
);
ok
(
hr
==
S_OK
,
"got 0x%08x
\n
"
,
hr
);
SysFreeString
(
str
);
hr
=
IScriptControl_get_UseSafeSubset
(
sc
,
&
use_safe_subset
);
ok
(
hr
==
S_OK
,
"got 0x%08x
\n
"
,
hr
);
ok
(
use_safe_subset
==
VARIANT_TRUE
,
"got %d
\n
"
,
use_safe_subset
);
IScriptControl_Release
(
sc
);
}
START_TEST
(
msscript
)
START_TEST
(
msscript
)
{
{
IUnknown
*
unk
;
IUnknown
*
unk
;
...
@@ -1281,6 +1318,7 @@ START_TEST(msscript)
...
@@ -1281,6 +1318,7 @@ START_TEST(msscript)
test_Reset
();
test_Reset
();
test_AddObject
();
test_AddObject
();
test_AllowUI
();
test_AllowUI
();
test_UseSafeSubset
();
CoUninitialize
();
CoUninitialize
();
}
}
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