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
c8f81cce
Commit
c8f81cce
authored
Jan 26, 2023
by
Gabriel Ivăncescu
Committed by
Alexandre Julliard
Jan 27, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
vbscript: Add a ServiceProvider stub.
Signed-off-by:
Gabriel Ivăncescu
<
gabrielopcode@gmail.com
>
parent
6deee88a
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
92 additions
and
2 deletions
+92
-2
vbdisp.c
dlls/vbscript/vbdisp.c
+2
-2
vbscript.c
dlls/vbscript/vbscript.c
+83
-0
vbscript.h
dlls/vbscript/vbscript.h
+7
-0
No files found.
dlls/vbscript/vbdisp.c
View file @
c8f81cce
...
...
@@ -1661,7 +1661,7 @@ HRESULT disp_call(script_ctx_t *ctx, IDispatch *disp, DISPID id, DISPPARAMS *dp,
hres
=
IDispatch_QueryInterface
(
disp
,
&
IID_IDispatchEx
,
(
void
**
)
&
dispex
);
if
(
SUCCEEDED
(
hres
))
{
hres
=
IDispatchEx_InvokeEx
(
dispex
,
id
,
ctx
->
lcid
,
flags
,
dp
,
retv
,
&
ei
,
NULL
/* CALLER_FIXME */
);
hres
=
IDispatchEx_InvokeEx
(
dispex
,
id
,
ctx
->
lcid
,
flags
,
dp
,
retv
,
&
ei
,
&
ctx
->
vbcaller
->
IServiceProvider_iface
);
IDispatchEx_Release
(
dispex
);
}
else
{
UINT
err
=
0
;
...
...
@@ -1699,7 +1699,7 @@ HRESULT disp_propput(script_ctx_t *ctx, IDispatch *disp, DISPID id, WORD flags,
hres
=
IDispatch_QueryInterface
(
disp
,
&
IID_IDispatchEx
,
(
void
**
)
&
dispex
);
if
(
SUCCEEDED
(
hres
))
{
hres
=
IDispatchEx_InvokeEx
(
dispex
,
id
,
ctx
->
lcid
,
flags
,
dp
,
NULL
,
&
ei
,
NULL
/* FIXME! */
);
hres
=
IDispatchEx_InvokeEx
(
dispex
,
id
,
ctx
->
lcid
,
flags
,
dp
,
NULL
,
&
ei
,
&
ctx
->
vbcaller
->
IServiceProvider_iface
);
IDispatchEx_Release
(
dispex
);
}
else
{
UINT
err
=
0
;
...
...
dlls/vbscript/vbscript.c
View file @
c8f81cce
...
...
@@ -366,6 +366,80 @@ static void decrease_state(VBScript *This, SCRIPTSTATE state)
}
}
static
inline
struct
vbcaller
*
vbcaller_from_IServiceProvider
(
IServiceProvider
*
iface
)
{
return
CONTAINING_RECORD
(
iface
,
struct
vbcaller
,
IServiceProvider_iface
);
}
static
HRESULT
WINAPI
vbcaller_QueryInterface
(
IServiceProvider
*
iface
,
REFIID
riid
,
void
**
ppv
)
{
struct
vbcaller
*
This
=
vbcaller_from_IServiceProvider
(
iface
);
if
(
IsEqualGUID
(
&
IID_IUnknown
,
riid
)
||
IsEqualGUID
(
&
IID_IServiceProvider
,
riid
))
{
*
ppv
=
&
This
->
IServiceProvider_iface
;
}
else
{
WARN
(
"(%p)->(%s %p)
\n
"
,
This
,
debugstr_guid
(
riid
),
ppv
);
*
ppv
=
NULL
;
return
E_NOINTERFACE
;
}
IUnknown_AddRef
((
IUnknown
*
)
*
ppv
);
return
S_OK
;
}
static
ULONG
WINAPI
vbcaller_AddRef
(
IServiceProvider
*
iface
)
{
struct
vbcaller
*
This
=
vbcaller_from_IServiceProvider
(
iface
);
LONG
ref
=
InterlockedIncrement
(
&
This
->
ref
);
TRACE
(
"(%p) ref=%ld
\n
"
,
This
,
ref
);
return
ref
;
}
static
ULONG
WINAPI
vbcaller_Release
(
IServiceProvider
*
iface
)
{
struct
vbcaller
*
This
=
vbcaller_from_IServiceProvider
(
iface
);
LONG
ref
=
InterlockedDecrement
(
&
This
->
ref
);
TRACE
(
"(%p) ref=%ld
\n
"
,
This
,
ref
);
if
(
!
ref
)
free
(
This
);
return
ref
;
}
static
HRESULT
WINAPI
vbcaller_QueryService
(
IServiceProvider
*
iface
,
REFGUID
guidService
,
REFIID
riid
,
void
**
ppv
)
{
struct
vbcaller
*
This
=
vbcaller_from_IServiceProvider
(
iface
);
FIXME
(
"(%p)->(%s %s %p)
\n
"
,
This
,
debugstr_guid
(
guidService
),
debugstr_guid
(
riid
),
ppv
);
*
ppv
=
NULL
;
return
E_NOINTERFACE
;
}
static
const
IServiceProviderVtbl
ServiceProviderVtbl
=
{
vbcaller_QueryInterface
,
vbcaller_AddRef
,
vbcaller_Release
,
vbcaller_QueryService
};
static
struct
vbcaller
*
create_vbcaller
(
void
)
{
struct
vbcaller
*
ret
;
ret
=
malloc
(
sizeof
(
*
ret
));
if
(
ret
)
{
ret
->
IServiceProvider_iface
.
lpVtbl
=
&
ServiceProviderVtbl
;
ret
->
ref
=
1
;
}
return
ret
;
}
static
inline
VBScriptError
*
impl_from_IActiveScriptError
(
IActiveScriptError
*
iface
)
{
return
CONTAINING_RECORD
(
iface
,
VBScriptError
,
IActiveScriptError_iface
);
...
...
@@ -545,6 +619,7 @@ static ULONG WINAPI VBScript_Release(IActiveScript *iface)
if
(
!
ref
)
{
decrease_state
(
This
,
SCRIPTSTATE_CLOSED
);
detach_global_objects
(
This
->
ctx
);
IServiceProvider_Release
(
&
This
->
ctx
->
vbcaller
->
IServiceProvider_iface
);
free
(
This
->
ctx
);
free
(
This
);
}
...
...
@@ -1102,6 +1177,7 @@ static const IObjectSafetyVtbl VBScriptSafetyVtbl = {
HRESULT
WINAPI
VBScriptFactory_CreateInstance
(
IClassFactory
*
iface
,
IUnknown
*
pUnkOuter
,
REFIID
riid
,
void
**
ppv
)
{
struct
vbcaller
*
vbcaller
;
script_ctx_t
*
ctx
;
VBScript
*
ret
;
HRESULT
hres
;
...
...
@@ -1112,6 +1188,11 @@ HRESULT WINAPI VBScriptFactory_CreateInstance(IClassFactory *iface, IUnknown *pU
if
(
!
ret
)
return
E_OUTOFMEMORY
;
if
(
!
(
vbcaller
=
create_vbcaller
()))
{
free
(
ret
);
return
E_OUTOFMEMORY
;
}
ret
->
IActiveScript_iface
.
lpVtbl
=
&
VBScriptVtbl
;
ret
->
IActiveScriptDebug_iface
.
lpVtbl
=
&
VBScriptDebugVtbl
;
ret
->
IActiveScriptParse_iface
.
lpVtbl
=
&
VBScriptParseVtbl
;
...
...
@@ -1123,10 +1204,12 @@ HRESULT WINAPI VBScriptFactory_CreateInstance(IClassFactory *iface, IUnknown *pU
ctx
=
ret
->
ctx
=
calloc
(
1
,
sizeof
(
*
ctx
));
if
(
!
ctx
)
{
IServiceProvider_Release
(
&
vbcaller
->
IServiceProvider_iface
);
free
(
ret
);
return
E_OUTOFMEMORY
;
}
ctx
->
vbcaller
=
vbcaller
;
ctx
->
safeopt
=
INTERFACE_USES_DISPEX
;
list_init
(
&
ctx
->
objects
);
list_init
(
&
ctx
->
code_list
);
...
...
dlls/vbscript/vbscript.h
View file @
c8f81cce
...
...
@@ -180,12 +180,19 @@ static inline VARIANT *get_arg(DISPPARAMS *dp, DWORD i)
return
dp
->
rgvarg
+
dp
->
cArgs
-
i
-
1
;
}
struct
vbcaller
{
IServiceProvider
IServiceProvider_iface
;
LONG
ref
;
};
struct
_script_ctx_t
{
IActiveScriptSite
*
site
;
LCID
lcid
;
UINT
codepage
;
IInternetHostSecurityManager
*
secmgr
;
struct
vbcaller
*
vbcaller
;
DWORD
safeopt
;
ScriptDisp
*
script_obj
;
...
...
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