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
d339a0b4
Commit
d339a0b4
authored
Sep 22, 2011
by
Jacek Caban
Committed by
Alexandre Julliard
Sep 22, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
vbscript: Added support for IObjectWithSite in create_object.
parent
0d039cc6
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
111 additions
and
3 deletions
+111
-3
global.c
dlls/vbscript/global.c
+11
-3
vbscript.c
dlls/vbscript/vbscript.c
+98
-0
vbscript.h
dlls/vbscript/vbscript.h
+2
-0
No files found.
dlls/vbscript/global.c
View file @
d339a0b4
...
...
@@ -122,10 +122,18 @@ static IUnknown *create_object(script_ctx_t *ctx, const WCHAR *progid)
hres
=
IUnknown_QueryInterface
(
obj
,
&
IID_IObjectWithSite
,
(
void
**
)
&
obj_site
);
if
(
SUCCEEDED
(
hres
))
{
FIXME
(
"ObjectWithSite
\n
"
);
IUnknown
*
ax_site
;
ax_site
=
create_ax_site
(
ctx
);
if
(
ax_site
)
{
hres
=
IObjectWithSite_SetSite
(
obj_site
,
ax_site
);
IUnknown_Release
(
ax_site
);
}
IObjectWithSite_Release
(
obj_site
);
IUnknown_Release
(
obj
);
return
NULL
;
if
(
!
ax_site
||
FAILED
(
hres
))
{
IUnknown_Release
(
obj
);
return
NULL
;
}
}
return
obj
;
...
...
dlls/vbscript/vbscript.c
View file @
d339a0b4
...
...
@@ -664,3 +664,101 @@ HRESULT WINAPI VBScriptFactory_CreateInstance(IClassFactory *iface, IUnknown *pU
IActiveScript_Release
(
&
ret
->
IActiveScript_iface
);
return
hres
;
}
typedef
struct
{
IServiceProvider
IServiceProvider_iface
;
LONG
ref
;
IServiceProvider
*
sp
;
}
AXSite
;
static
inline
AXSite
*
impl_from_IServiceProvider
(
IServiceProvider
*
iface
)
{
return
CONTAINING_RECORD
(
iface
,
AXSite
,
IServiceProvider_iface
);
}
static
HRESULT
WINAPI
AXSite_QueryInterface
(
IServiceProvider
*
iface
,
REFIID
riid
,
void
**
ppv
)
{
AXSite
*
This
=
impl_from_IServiceProvider
(
iface
);
if
(
IsEqualGUID
(
&
IID_IUnknown
,
riid
))
{
TRACE
(
"(%p)->(IID_IUnknown %p)
\n
"
,
This
,
ppv
);
*
ppv
=
&
This
->
IServiceProvider_iface
;
}
else
if
(
IsEqualGUID
(
&
IID_IServiceProvider
,
riid
))
{
TRACE
(
"(%p)->(IID_IServiceProvider %p)
\n
"
,
This
,
ppv
);
*
ppv
=
&
This
->
IServiceProvider_iface
;
}
else
{
TRACE
(
"(%p)->(%s %p)
\n
"
,
This
,
debugstr_guid
(
riid
),
ppv
);
*
ppv
=
NULL
;
return
E_NOINTERFACE
;
}
IUnknown_AddRef
((
IUnknown
*
)
*
ppv
);
return
S_OK
;
}
static
ULONG
WINAPI
AXSite_AddRef
(
IServiceProvider
*
iface
)
{
AXSite
*
This
=
impl_from_IServiceProvider
(
iface
);
LONG
ref
=
InterlockedIncrement
(
&
This
->
ref
);
TRACE
(
"(%p) ref=%d
\n
"
,
This
,
ref
);
return
ref
;
}
static
ULONG
WINAPI
AXSite_Release
(
IServiceProvider
*
iface
)
{
AXSite
*
This
=
impl_from_IServiceProvider
(
iface
);
LONG
ref
=
InterlockedDecrement
(
&
This
->
ref
);
TRACE
(
"(%p) ref=%d
\n
"
,
This
,
ref
);
if
(
!
ref
)
heap_free
(
This
);
return
ref
;
}
static
HRESULT
WINAPI
AXSite_QueryService
(
IServiceProvider
*
iface
,
REFGUID
guidService
,
REFIID
riid
,
void
**
ppv
)
{
AXSite
*
This
=
impl_from_IServiceProvider
(
iface
);
TRACE
(
"(%p)->(%s %s %p)
\n
"
,
This
,
debugstr_guid
(
guidService
),
debugstr_guid
(
riid
),
ppv
);
return
IServiceProvider_QueryService
(
This
->
sp
,
guidService
,
riid
,
ppv
);
}
static
IServiceProviderVtbl
AXSiteVtbl
=
{
AXSite_QueryInterface
,
AXSite_AddRef
,
AXSite_Release
,
AXSite_QueryService
};
IUnknown
*
create_ax_site
(
script_ctx_t
*
ctx
)
{
IServiceProvider
*
sp
;
AXSite
*
ret
;
HRESULT
hres
;
hres
=
IActiveScriptSite_QueryInterface
(
ctx
->
site
,
&
IID_IServiceProvider
,
(
void
**
)
&
sp
);
if
(
FAILED
(
hres
))
{
ERR
(
"Could not get IServiceProvider iface: %08x
\n
"
,
hres
);
return
NULL
;
}
ret
=
heap_alloc
(
sizeof
(
*
ret
));
if
(
!
ret
)
{
IServiceProvider_Release
(
sp
);
return
NULL
;
}
ret
->
IServiceProvider_iface
.
lpVtbl
=
&
AXSiteVtbl
;
ret
->
ref
=
1
;
ret
->
sp
=
sp
;
return
(
IUnknown
*
)
&
ret
->
IServiceProvider_iface
;
}
dlls/vbscript/vbscript.h
View file @
d339a0b4
...
...
@@ -171,6 +171,8 @@ struct _script_ctx_t {
HRESULT
init_global
(
script_ctx_t
*
);
HRESULT
init_err
(
script_ctx_t
*
);
IUnknown
*
create_ax_site
(
script_ctx_t
*
)
DECLSPEC_HIDDEN
;
typedef
enum
{
ARG_NONE
=
0
,
ARG_STR
,
...
...
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