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
3e0a6da5
Commit
3e0a6da5
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]_State.
Signed-off-by:
Gijs Vermeulen
<
gijsvrm@gmail.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
0b4688e1
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
76 additions
and
4 deletions
+76
-4
msscript.c
dlls/msscript.ocx/msscript.c
+22
-4
msscript.c
dlls/msscript.ocx/tests/msscript.c
+54
-0
No files found.
dlls/msscript.ocx/msscript.c
View file @
3e0a6da5
...
@@ -91,6 +91,7 @@ struct ScriptControl {
...
@@ -91,6 +91,7 @@ struct ScriptControl {
LONG
timeout
;
LONG
timeout
;
VARIANT_BOOL
allow_ui
;
VARIANT_BOOL
allow_ui
;
VARIANT_BOOL
use_safe_subset
;
VARIANT_BOOL
use_safe_subset
;
ScriptControlStates
state
;
/* connection points */
/* connection points */
ConnectionPoint
*
cp_list
;
ConnectionPoint
*
cp_list
;
...
@@ -761,15 +762,31 @@ static HRESULT WINAPI ScriptControl_put_Language(IScriptControl *iface, BSTR lan
...
@@ -761,15 +762,31 @@ static HRESULT WINAPI ScriptControl_put_Language(IScriptControl *iface, BSTR lan
static
HRESULT
WINAPI
ScriptControl_get_State
(
IScriptControl
*
iface
,
ScriptControlStates
*
p
)
static
HRESULT
WINAPI
ScriptControl_get_State
(
IScriptControl
*
iface
,
ScriptControlStates
*
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
;
if
(
!
This
->
host
)
return
E_FAIL
;
*
p
=
This
->
state
;
return
S_OK
;
}
}
static
HRESULT
WINAPI
ScriptControl_put_State
(
IScriptControl
*
iface
,
ScriptControlStates
state
)
static
HRESULT
WINAPI
ScriptControl_put_State
(
IScriptControl
*
iface
,
ScriptControlStates
state
)
{
{
ScriptControl
*
This
=
impl_from_IScriptControl
(
iface
);
ScriptControl
*
This
=
impl_from_IScriptControl
(
iface
);
FIXME
(
"(%p)->(%x)
\n
"
,
This
,
state
);
TRACE
(
"(%p)->(%x)
\n
"
,
This
,
state
);
return
E_NOTIMPL
;
if
(
!
This
->
host
)
return
E_FAIL
;
if
(
state
!=
Initialized
&&
state
!=
Connected
)
return
CTL_E_INVALIDPROPERTYVALUE
;
This
->
state
=
state
;
return
S_OK
;
}
}
static
HRESULT
WINAPI
ScriptControl_put_SitehWnd
(
IScriptControl
*
iface
,
LONG
hwnd
)
static
HRESULT
WINAPI
ScriptControl_put_SitehWnd
(
IScriptControl
*
iface
,
LONG
hwnd
)
...
@@ -1900,6 +1917,7 @@ static HRESULT WINAPI ScriptControl_CreateInstance(IClassFactory *iface, IUnknow
...
@@ -1900,6 +1917,7 @@ static HRESULT WINAPI ScriptControl_CreateInstance(IClassFactory *iface, IUnknow
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
;
script_control
->
use_safe_subset
=
VARIANT_FALSE
;
script_control
->
state
=
Initialized
;
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 @
3e0a6da5
...
@@ -1291,6 +1291,59 @@ static void test_UseSafeSubset(void)
...
@@ -1291,6 +1291,59 @@ static void test_UseSafeSubset(void)
IScriptControl_Release
(
sc
);
IScriptControl_Release
(
sc
);
}
}
static
void
test_State
(
void
)
{
IScriptControl
*
sc
;
ScriptControlStates
state
;
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_State
(
sc
,
NULL
);
ok
(
hr
==
E_POINTER
,
"got 0x%08x
\n
"
,
hr
);
hr
=
IScriptControl_get_State
(
sc
,
&
state
);
ok
(
hr
==
E_FAIL
,
"got 0x%08x
\n
"
,
hr
);
hr
=
IScriptControl_put_State
(
sc
,
Connected
);
ok
(
hr
==
E_FAIL
,
"got 0x%08x
\n
"
,
hr
);
str
=
SysAllocString
(
vbW
);
hr
=
IScriptControl_put_Language
(
sc
,
str
);
ok
(
hr
==
S_OK
,
"got 0x%08x
\n
"
,
hr
);
SysFreeString
(
str
);
hr
=
IScriptControl_get_State
(
sc
,
&
state
);
ok
(
hr
==
S_OK
,
"got 0x%08x
\n
"
,
hr
);
ok
(
state
==
Initialized
,
"got %d
\n
"
,
state
);
hr
=
IScriptControl_put_State
(
sc
,
Connected
);
ok
(
hr
==
S_OK
,
"got 0x%08x
\n
"
,
hr
);
hr
=
IScriptControl_get_State
(
sc
,
&
state
);
ok
(
hr
==
S_OK
,
"got 0x%08x
\n
"
,
hr
);
ok
(
state
==
Connected
,
"got %d
\n
"
,
state
);
hr
=
IScriptControl_put_State
(
sc
,
2
);
ok
(
hr
==
CTL_E_INVALIDPROPERTYVALUE
,
"got 0x%08x
\n
"
,
hr
);
hr
=
IScriptControl_get_State
(
sc
,
&
state
);
ok
(
hr
==
S_OK
,
"got 0x%08x
\n
"
,
hr
);
ok
(
state
==
Connected
,
"got %d
\n
"
,
state
);
hr
=
IScriptControl_put_State
(
sc
,
-
1
);
ok
(
hr
==
CTL_E_INVALIDPROPERTYVALUE
,
"got 0x%08x
\n
"
,
hr
);
hr
=
IScriptControl_get_State
(
sc
,
&
state
);
ok
(
hr
==
S_OK
,
"got 0x%08x
\n
"
,
hr
);
ok
(
state
==
Connected
,
"got %d
\n
"
,
state
);
IScriptControl_Release
(
sc
);
}
START_TEST
(
msscript
)
START_TEST
(
msscript
)
{
{
IUnknown
*
unk
;
IUnknown
*
unk
;
...
@@ -1319,6 +1372,7 @@ START_TEST(msscript)
...
@@ -1319,6 +1372,7 @@ START_TEST(msscript)
test_AddObject
();
test_AddObject
();
test_AllowUI
();
test_AllowUI
();
test_UseSafeSubset
();
test_UseSafeSubset
();
test_State
();
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