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
d19cdef8
Commit
d19cdef8
authored
Sep 01, 2008
by
Jacek Caban
Committed by
Alexandre Julliard
Sep 02, 2008
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
jscript: Added IActiveScriptParse::InitNew implementation.
parent
9e6784c2
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
48 additions
and
5 deletions
+48
-5
jscript.c
dlls/jscript/jscript.c
+33
-4
jscript.h
dlls/jscript/jscript.h
+9
-0
jscript_main.c
dlls/jscript/jscript_main.c
+0
-1
jscript.c
dlls/jscript/tests/jscript.c
+6
-0
No files found.
dlls/jscript/jscript.c
View file @
d19cdef8
...
...
@@ -17,7 +17,6 @@
*/
#include "jscript.h"
#include "activscp.h"
#include "objsafe.h"
#include "wine/debug.h"
...
...
@@ -34,6 +33,7 @@ typedef struct {
LONG
ref
;
DWORD
safeopt
;
script_ctx_t
*
ctx
;
}
JScript
;
#define ACTSCRIPT(x) ((IActiveScript*) &(x)->lpIActiveScriptVtbl)
...
...
@@ -42,6 +42,14 @@ typedef struct {
#define ACTSCPPROP(x) ((IActiveScriptProperty*) &(x)->lpIActiveScriptPropertyVtbl)
#define OBJSAFETY(x) ((IObjectSafety*) &(x)->lpIObjectSafetyVtbl)
void
script_release
(
script_ctx_t
*
ctx
)
{
if
(
--
ctx
->
ref
)
return
;
heap_free
(
ctx
);
}
#define ACTSCRIPT_THIS(iface) DEFINE_THIS(JScript, IActiveScript, iface)
static
HRESULT
WINAPI
JScript_QueryInterface
(
IActiveScript
*
iface
,
REFIID
riid
,
void
**
ppv
)
...
...
@@ -100,6 +108,8 @@ static ULONG WINAPI JScript_Release(IActiveScript *iface)
TRACE
(
"(%p) ref=%d
\n
"
,
iface
,
ref
);
if
(
!
ref
)
{
if
(
This
->
ctx
)
script_release
(
This
->
ctx
);
heap_free
(
This
);
unlock_module
();
}
...
...
@@ -251,8 +261,27 @@ static ULONG WINAPI JScriptParse_Release(IActiveScriptParse *iface)
static
HRESULT
WINAPI
JScriptParse_InitNew
(
IActiveScriptParse
*
iface
)
{
JScript
*
This
=
ASPARSE_THIS
(
iface
);
FIXME
(
"(%p)
\n
"
,
This
);
return
E_NOTIMPL
;
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
->
ref
=
1
;
ctx
->
state
=
SCRIPTSTATE_UNINITIALIZED
;
ctx
=
InterlockedCompareExchangePointer
((
void
**
)
&
This
->
ctx
,
ctx
,
NULL
);
if
(
ctx
)
{
script_release
(
ctx
);
return
E_UNEXPECTED
;
}
return
S_OK
;
}
static
HRESULT
WINAPI
JScriptParse_AddScriptlet
(
IActiveScriptParse
*
iface
,
...
...
@@ -449,7 +478,7 @@ HRESULT WINAPI JScriptFactory_CreateInstance(IClassFactory *iface, IUnknown *pUn
lock_module
();
ret
=
heap_alloc
(
sizeof
(
*
ret
));
ret
=
heap_alloc
_zero
(
sizeof
(
*
ret
));
ret
->
lpIActiveScriptVtbl
=
&
JScriptVtbl
;
ret
->
lpIActiveScriptParseVtbl
=
&
JScriptParseVtbl
;
...
...
dlls/jscript/jscript.h
View file @
d19cdef8
...
...
@@ -25,6 +25,15 @@
#include "winbase.h"
#include "winuser.h"
#include "ole2.h"
#include "activscp.h"
typedef
struct
_script_ctx_t
script_ctx_t
;
struct
_script_ctx_t
{
LONG
ref
;
SCRIPTSTATE
state
;
};
HRESULT
WINAPI
JScriptFactory_CreateInstance
(
IClassFactory
*
,
IUnknown
*
,
REFIID
,
void
**
);
...
...
dlls/jscript/jscript_main.c
View file @
d19cdef8
...
...
@@ -22,7 +22,6 @@
#include "winreg.h"
#include "advpub.h"
#include "activscp.h"
#include "activaut.h"
#include "objsafe.h"
...
...
dlls/jscript/tests/jscript.c
View file @
d19cdef8
...
...
@@ -110,6 +110,12 @@ static void test_jscript(void)
test_safety
(
unk
);
hres
=
IActiveScriptParse_InitNew
(
parse
);
ok
(
hres
==
S_OK
,
"InitNew failed: %08x
\n
"
,
hres
);
hres
=
IActiveScriptParse_InitNew
(
parse
);
ok
(
hres
==
E_UNEXPECTED
,
"InitNew failed: %08x, expected E_UNEXPECTED
\n
"
,
hres
);
IActiveScriptParse_Release
(
parse
);
IActiveScript_Release
(
script
);
IUnknown_Release
(
unk
);
...
...
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