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
568b0d5c
Commit
568b0d5c
authored
Jan 16, 2011
by
Michael Stefaniuc
Committed by
Alexandre Julliard
Jan 17, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
jscript: COM cleanup for the IServiceProvider iface.
parent
3b1d9d43
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
16 deletions
+13
-16
jscript.c
dlls/jscript/jscript.c
+13
-14
jscript.h
dlls/jscript/jscript.h
+0
-2
No files found.
dlls/jscript/jscript.c
View file @
568b0d5c
...
...
@@ -154,27 +154,28 @@ static HRESULT set_ctx_site(JScript *This)
}
typedef
struct
{
const
IServiceProviderVtbl
*
lpIServiceProviderVtbl
;
IServiceProvider
IServiceProvider_iface
;
LONG
ref
;
IServiceProvider
*
sp
;
}
AXSite
;
#define SERVPROV(x) ((IServiceProvider*) &(x)->lpIServiceProviderVtbl)
#define SERVPROV_THIS(iface) DEFINE_THIS(AXSite, IServiceProvider, iface)
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
=
SERVPROV_THIS
(
iface
);
AXSite
*
This
=
impl_from_IServiceProvider
(
iface
);
if
(
IsEqualGUID
(
&
IID_IUnknown
,
riid
))
{
TRACE
(
"(%p)->(IID_IUnknown %p)
\n
"
,
This
,
ppv
);
*
ppv
=
SERVPROV
(
This
)
;
*
ppv
=
&
This
->
IServiceProvider_iface
;
}
else
if
(
IsEqualGUID
(
&
IID_IServiceProvider
,
riid
))
{
TRACE
(
"(%p)->(IID_IServiceProvider %p)
\n
"
,
This
,
ppv
);
*
ppv
=
SERVPROV
(
This
)
;
*
ppv
=
&
This
->
IServiceProvider_iface
;
}
else
{
TRACE
(
"(%p)->(%s %p)
\n
"
,
This
,
debugstr_guid
(
riid
),
ppv
);
*
ppv
=
NULL
;
...
...
@@ -187,7 +188,7 @@ static HRESULT WINAPI AXSite_QueryInterface(IServiceProvider *iface, REFIID riid
static
ULONG
WINAPI
AXSite_AddRef
(
IServiceProvider
*
iface
)
{
AXSite
*
This
=
SERVPROV_THIS
(
iface
);
AXSite
*
This
=
impl_from_IServiceProvider
(
iface
);
LONG
ref
=
InterlockedIncrement
(
&
This
->
ref
);
TRACE
(
"(%p) ref=%d
\n
"
,
This
,
ref
);
...
...
@@ -197,7 +198,7 @@ static ULONG WINAPI AXSite_AddRef(IServiceProvider *iface)
static
ULONG
WINAPI
AXSite_Release
(
IServiceProvider
*
iface
)
{
AXSite
*
This
=
SERVPROV_THIS
(
iface
);
AXSite
*
This
=
impl_from_IServiceProvider
(
iface
);
LONG
ref
=
InterlockedDecrement
(
&
This
->
ref
);
TRACE
(
"(%p) ref=%d
\n
"
,
This
,
ref
);
...
...
@@ -211,15 +212,13 @@ static ULONG WINAPI AXSite_Release(IServiceProvider *iface)
static
HRESULT
WINAPI
AXSite_QueryService
(
IServiceProvider
*
iface
,
REFGUID
guidService
,
REFIID
riid
,
void
**
ppv
)
{
AXSite
*
This
=
SERVPROV_THIS
(
iface
);
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
);
}
#undef SERVPROV_THIS
static
IServiceProviderVtbl
AXSiteVtbl
=
{
AXSite_QueryInterface
,
AXSite_AddRef
,
...
...
@@ -245,11 +244,11 @@ IUnknown *create_ax_site(script_ctx_t *ctx)
return
NULL
;
}
ret
->
lpIServiceProvider
Vtbl
=
&
AXSiteVtbl
;
ret
->
IServiceProvider_iface
.
lp
Vtbl
=
&
AXSiteVtbl
;
ret
->
ref
=
1
;
ret
->
sp
=
sp
;
return
(
IUnknown
*
)
SERVPROV
(
ret
)
;
return
(
IUnknown
*
)
&
ret
->
IServiceProvider_iface
;
}
static
inline
JScript
*
impl_from_IActiveScript
(
IActiveScript
*
iface
)
...
...
dlls/jscript/jscript.h
View file @
568b0d5c
...
...
@@ -525,5 +525,3 @@ static inline LPWSTR heap_strdupW(LPCWSTR str)
return
ret
;
}
#define DEFINE_THIS(cls,ifc,iface) ((cls*)((BYTE*)(iface)-offsetof(cls,lp ## ifc ## Vtbl)))
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