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
0750bfbb
Commit
0750bfbb
authored
Mar 16, 2008
by
Jacek Caban
Committed by
Alexandre Julliard
Mar 17, 2008
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
jscript: Added JScript stub implementation.
parent
85b024d5
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
268 additions
and
18 deletions
+268
-18
Makefile.in
dlls/jscript/Makefile.in
+1
-0
jscript.c
dlls/jscript/jscript.c
+219
-0
jscript.h
dlls/jscript/jscript.h
+46
-0
jscript_main.c
dlls/jscript/jscript_main.c
+2
-18
No files found.
dlls/jscript/Makefile.in
View file @
0750bfbb
...
...
@@ -8,6 +8,7 @@ IMPORTS = kernel32
RC_SRCS
=
rsrc.rc
C_SRCS
=
\
jscript.c
\
jscript_main.c
@MAKE_DLL_RULES@
...
...
dlls/jscript/jscript.c
0 → 100644
View file @
0750bfbb
/*
* Copyright 2008 Jacek Caban for CodeWeavers
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
#include "jscript.h"
#include "activscp.h"
#include "wine/debug.h"
WINE_DEFAULT_DEBUG_CHANNEL
(
jscript
);
typedef
struct
{
const
IActiveScriptVtbl
*
lpIActiveScriptVtbl
;
LONG
ref
;
}
JScript
;
#define ACTSCRIPT(x) ((IActiveScript*) &(x)->lpIActiveScriptVtbl)
#define ACTSCRIPT_THIS(iface) DEFINE_THIS(JScript, IActiveScript, iface)
static
HRESULT
WINAPI
JScript_QueryInterface
(
IActiveScript
*
iface
,
REFIID
riid
,
void
**
ppv
)
{
JScript
*
This
=
ACTSCRIPT_THIS
(
iface
);
*
ppv
=
NULL
;
if
(
IsEqualGUID
(
riid
,
&
IID_IUnknown
))
{
TRACE
(
"(%p)->(IID_IUnknown %p)
\n
"
,
This
,
ppv
);
*
ppv
=
ACTSCRIPT
(
This
);
}
else
if
(
IsEqualGUID
(
riid
,
&
IID_IActiveScript
))
{
TRACE
(
"(%p)->(IID_IActiveScript %p)
\n
"
,
This
,
ppv
);
*
ppv
=
ACTSCRIPT
(
This
);
}
if
(
*
ppv
)
{
IUnknown_AddRef
((
IUnknown
*
)
*
ppv
);
return
S_OK
;
}
FIXME
(
"(%p)->(%s %p)
\n
"
,
This
,
debugstr_guid
(
riid
),
ppv
);
return
E_NOINTERFACE
;
}
static
ULONG
WINAPI
JScript_AddRef
(
IActiveScript
*
iface
)
{
JScript
*
This
=
ACTSCRIPT_THIS
(
iface
);
LONG
ref
=
InterlockedIncrement
(
&
This
->
ref
);
TRACE
(
"(%p) ref=%d
\n
"
,
This
,
ref
);
return
ref
;
}
static
ULONG
WINAPI
JScript_Release
(
IActiveScript
*
iface
)
{
JScript
*
This
=
ACTSCRIPT_THIS
(
iface
);
LONG
ref
=
InterlockedDecrement
(
&
This
->
ref
);
TRACE
(
"(%p) ref=%d
\n
"
,
iface
,
ref
);
if
(
!
ref
)
heap_free
(
This
);
return
ref
;
}
static
HRESULT
WINAPI
JScript_SetScriptSite
(
IActiveScript
*
iface
,
IActiveScriptSite
*
pass
)
{
JScript
*
This
=
ACTSCRIPT_THIS
(
iface
);
FIXME
(
"(%p)->(%p)
\n
"
,
This
,
pass
);
return
E_NOTIMPL
;
}
static
HRESULT
WINAPI
JScript_GetScriptSite
(
IActiveScript
*
iface
,
REFIID
riid
,
void
**
ppvObject
)
{
JScript
*
This
=
ACTSCRIPT_THIS
(
iface
);
FIXME
(
"(%p)->()
\n
"
,
This
);
return
E_NOTIMPL
;
}
static
HRESULT
WINAPI
JScript_SetScriptState
(
IActiveScript
*
iface
,
SCRIPTSTATE
ss
)
{
JScript
*
This
=
ACTSCRIPT_THIS
(
iface
);
FIXME
(
"(%p)->(%d)
\n
"
,
This
,
ss
);
return
E_NOTIMPL
;
}
static
HRESULT
WINAPI
JScript_GetScriptState
(
IActiveScript
*
iface
,
SCRIPTSTATE
*
pssState
)
{
JScript
*
This
=
ACTSCRIPT_THIS
(
iface
);
FIXME
(
"(%p)->(%p)
\n
"
,
This
,
pssState
);
return
E_NOTIMPL
;
}
static
HRESULT
WINAPI
JScript_Close
(
IActiveScript
*
iface
)
{
JScript
*
This
=
ACTSCRIPT_THIS
(
iface
);
FIXME
(
"(%p)->()
\n
"
,
This
);
return
E_NOTIMPL
;
}
static
HRESULT
WINAPI
JScript_AddNamedItem
(
IActiveScript
*
iface
,
LPCOLESTR
pstrName
,
DWORD
dwFlags
)
{
JScript
*
This
=
ACTSCRIPT_THIS
(
iface
);
FIXME
(
"(%p)->(%s %x)
\n
"
,
This
,
debugstr_w
(
pstrName
),
dwFlags
);
return
E_NOTIMPL
;
}
static
HRESULT
WINAPI
JScript_AddTypeLib
(
IActiveScript
*
iface
,
REFGUID
rguidTypeLib
,
DWORD
dwMajor
,
DWORD
dwMinor
,
DWORD
dwFlags
)
{
JScript
*
This
=
ACTSCRIPT_THIS
(
iface
);
FIXME
(
"(%p)->()
\n
"
,
This
);
return
E_NOTIMPL
;
}
static
HRESULT
WINAPI
JScript_GetScriptDispatch
(
IActiveScript
*
iface
,
LPCOLESTR
pstrItemName
,
IDispatch
**
ppdisp
)
{
JScript
*
This
=
ACTSCRIPT_THIS
(
iface
);
FIXME
(
"(%p)->()
\n
"
,
This
);
return
E_NOTIMPL
;
}
static
HRESULT
WINAPI
JScript_GetCurrentScriptThreadID
(
IActiveScript
*
iface
,
SCRIPTTHREADID
*
pstridThread
)
{
JScript
*
This
=
ACTSCRIPT_THIS
(
iface
);
FIXME
(
"(%p)->()
\n
"
,
This
);
return
E_NOTIMPL
;
}
static
HRESULT
WINAPI
JScript_GetScriptThreadID
(
IActiveScript
*
iface
,
DWORD
dwWin32ThreadId
,
SCRIPTTHREADID
*
pstidThread
)
{
JScript
*
This
=
ACTSCRIPT_THIS
(
iface
);
FIXME
(
"(%p)->()
\n
"
,
This
);
return
E_NOTIMPL
;
}
static
HRESULT
WINAPI
JScript_GetScriptThreadState
(
IActiveScript
*
iface
,
SCRIPTTHREADID
stidThread
,
SCRIPTTHREADSTATE
*
pstsState
)
{
JScript
*
This
=
ACTSCRIPT_THIS
(
iface
);
FIXME
(
"(%p)->()
\n
"
,
This
);
return
E_NOTIMPL
;
}
static
HRESULT
WINAPI
JScript_InterruptScriptThread
(
IActiveScript
*
iface
,
SCRIPTTHREADID
stidThread
,
const
EXCEPINFO
*
pexcepinfo
,
DWORD
dwFlags
)
{
JScript
*
This
=
ACTSCRIPT_THIS
(
iface
);
FIXME
(
"(%p)->()
\n
"
,
This
);
return
E_NOTIMPL
;
}
static
HRESULT
WINAPI
JScript_Clone
(
IActiveScript
*
iface
,
IActiveScript
**
ppscript
)
{
JScript
*
This
=
ACTSCRIPT_THIS
(
iface
);
FIXME
(
"(%p)->()
\n
"
,
This
);
return
E_NOTIMPL
;
}
#undef ACTSCRIPT_THIS
static
const
IActiveScriptVtbl
JScriptVtbl
=
{
JScript_QueryInterface
,
JScript_AddRef
,
JScript_Release
,
JScript_SetScriptSite
,
JScript_GetScriptSite
,
JScript_SetScriptState
,
JScript_GetScriptState
,
JScript_Close
,
JScript_AddNamedItem
,
JScript_AddTypeLib
,
JScript_GetScriptDispatch
,
JScript_GetCurrentScriptThreadID
,
JScript_GetScriptThreadID
,
JScript_GetScriptThreadState
,
JScript_InterruptScriptThread
,
JScript_Clone
};
HRESULT
WINAPI
JScriptFactory_CreateInstance
(
IClassFactory
*
iface
,
IUnknown
*
pUnkOuter
,
REFIID
riid
,
void
**
ppv
)
{
JScript
*
ret
;
HRESULT
hres
;
TRACE
(
"(%p %s %p)
\n
"
,
pUnkOuter
,
debugstr_guid
(
riid
),
ppv
);
ret
=
heap_alloc
(
sizeof
(
*
ret
));
ret
->
lpIActiveScriptVtbl
=
&
JScriptVtbl
;
ret
->
ref
=
1
;
hres
=
IActiveScript_QueryInterface
(
ACTSCRIPT
(
ret
),
riid
,
ppv
);
IActiveScript_Release
(
ACTSCRIPT
(
ret
));
return
hres
;
}
dlls/jscript/jscript.h
0 → 100644
View file @
0750bfbb
/*
* Copyright 2008 Jacek Caban for CodeWeavers
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
#include <stdarg.h>
#include <stdio.h>
#define COBJMACROS
#include "windef.h"
#include "winbase.h"
#include "winuser.h"
#include "ole2.h"
HRESULT
WINAPI
JScriptFactory_CreateInstance
(
IClassFactory
*
,
IUnknown
*
,
REFIID
,
void
**
);
static
inline
void
*
heap_alloc
(
size_t
len
)
{
return
HeapAlloc
(
GetProcessHeap
(),
0
,
len
);
}
static
inline
void
*
heap_alloc_zero
(
size_t
len
)
{
return
HeapAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
len
);
}
static
inline
BOOL
heap_free
(
void
*
mem
)
{
return
HeapFree
(
GetProcessHeap
(),
0
,
mem
);
}
#define DEFINE_THIS(cls,ifc,iface) ((cls*)((BYTE*)(iface)-offsetof(cls,lp ## ifc ## Vtbl)))
dlls/jscript/jscript_main.c
View file @
0750bfbb
...
...
@@ -16,21 +16,12 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
#include "config.h"
#include <stdarg.h>
#include <stdio.h>
#include "initguid.h"
#
define COBJMACROS
#
include "jscript.h"
#include "windef.h"
#include "winbase.h"
#include "winuser.h"
#include "winreg.h"
#include "advpub.h"
#include "initguid.h"
#include "ole2.h"
#include "activscp.h"
#include "activaut.h"
...
...
@@ -47,13 +38,6 @@ static const CLSID CLSID_JScriptEncode =
static
HINSTANCE
jscript_hinstance
;
HRESULT
WINAPI
JScriptFactory_CreateInstance
(
IClassFactory
*
iface
,
IUnknown
*
pUnkOuter
,
REFIID
riid
,
void
**
ppv
)
{
FIXME
(
"(%p %s %p)
\n
"
,
pUnkOuter
,
debugstr_guid
(
riid
),
ppv
);
return
E_NOTIMPL
;
}
static
HRESULT
WINAPI
ClassFactory_QueryInterface
(
IClassFactory
*
iface
,
REFIID
riid
,
void
**
ppv
)
{
*
ppv
=
NULL
;
...
...
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