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
7edaff43
Commit
7edaff43
authored
Aug 31, 2011
by
Jacek Caban
Committed by
Alexandre Julliard
Aug 31, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
vbscript: Added IActiveScript::InitNew implementation.
parent
c35745d4
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
55 additions
and
3 deletions
+55
-3
vbscript.c
dlls/vbscript/vbscript.c
+50
-3
vbscript.h
dlls/vbscript/vbscript.h
+5
-0
No files found.
dlls/vbscript/vbscript.c
View file @
7edaff43
...
...
@@ -50,11 +50,41 @@ struct VBScript {
LONG
ref
;
SCRIPTSTATE
state
;
IActiveScriptSite
*
site
;
script_ctx_t
*
ctx
;
LONG
thread_id
;
LCID
lcid
;
};
static
void
change_state
(
VBScript
*
This
,
SCRIPTSTATE
state
)
{
if
(
This
->
state
==
state
)
return
;
This
->
state
=
state
;
if
(
This
->
site
)
IActiveScriptSite_OnStateChange
(
This
->
site
,
state
);
}
static
HRESULT
set_ctx_site
(
VBScript
*
This
)
{
This
->
ctx
->
lcid
=
This
->
lcid
;
IActiveScriptSite_AddRef
(
This
->
site
);
This
->
ctx
->
site
=
This
->
site
;
change_state
(
This
,
SCRIPTSTATE_INITIALIZED
);
return
S_OK
;
}
static
void
destroy_script
(
script_ctx_t
*
ctx
)
{
if
(
ctx
->
site
)
IActiveScriptSite_Release
(
ctx
->
site
);
heap_free
(
ctx
);
}
static
inline
VBScript
*
impl_from_IActiveScript
(
IActiveScript
*
iface
)
{
return
CONTAINING_RECORD
(
iface
,
VBScript
,
IActiveScript_iface
);
...
...
@@ -133,7 +163,7 @@ static HRESULT WINAPI VBScript_SetScriptSite(IActiveScript *iface, IActiveScript
if
(
hres
==
S_OK
)
This
->
lcid
=
lcid
;
return
S_OK
;
return
This
->
ctx
?
set_ctx_site
(
This
)
:
S_OK
;
}
static
HRESULT
WINAPI
VBScript_GetScriptSite
(
IActiveScript
*
iface
,
REFIID
riid
,
...
...
@@ -271,8 +301,24 @@ static ULONG WINAPI VBScriptParse_Release(IActiveScriptParse *iface)
static
HRESULT
WINAPI
VBScriptParse_InitNew
(
IActiveScriptParse
*
iface
)
{
VBScript
*
This
=
impl_from_IActiveScriptParse
(
iface
);
FIXME
(
"(%p)
\n
"
,
This
);
return
S_OK
;
script_ctx_t
*
ctx
;
TRACE
(
"(%p)
\n
"
,
This
);
if
(
This
->
ctx
)
return
E_UNEXPECTED
;
ctx
=
heap_alloc_zero
(
sizeof
(
script_ctx_t
));
if
(
!
ctx
)
return
E_OUTOFMEMORY
;
ctx
=
InterlockedCompareExchangePointer
((
void
**
)
&
This
->
ctx
,
ctx
,
NULL
);
if
(
ctx
)
{
destroy_script
(
ctx
);
return
E_UNEXPECTED
;
}
return
This
->
site
?
set_ctx_site
(
This
)
:
S_OK
;
}
static
HRESULT
WINAPI
VBScriptParse_AddScriptlet
(
IActiveScriptParse
*
iface
,
...
...
@@ -325,6 +371,7 @@ HRESULT WINAPI VBScriptFactory_CreateInstance(IClassFactory *iface, IUnknown *pU
ret
->
IActiveScriptParse_iface
.
lpVtbl
=
&
VBScriptParseVtbl
;
ret
->
ref
=
1
;
ret
->
state
=
SCRIPTSTATE_UNINITIALIZED
;
hres
=
IActiveScript_QueryInterface
(
&
ret
->
IActiveScript_iface
,
riid
,
ppv
);
IActiveScript_Release
(
&
ret
->
IActiveScript_iface
);
...
...
dlls/vbscript/vbscript.h
View file @
7edaff43
...
...
@@ -19,6 +19,11 @@
#include "activscp.h"
#include "vbscript_classes.h"
typedef
struct
{
IActiveScriptSite
*
site
;
LCID
lcid
;
}
script_ctx_t
;
HRESULT
WINAPI
VBScriptFactory_CreateInstance
(
IClassFactory
*
,
IUnknown
*
,
REFIID
,
void
**
);
static
inline
void
*
heap_alloc
(
size_t
len
)
...
...
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