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
740a850a
Commit
740a850a
authored
Dec 04, 2010
by
Michael Stefaniuc
Committed by
Alexandre Julliard
Dec 05, 2010
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mshtml: Use an iface instead of a vtbl pointer in ClassFactory.
parent
66a515ae
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
6 deletions
+11
-6
main.c
dlls/mshtml/main.c
+11
-6
No files found.
dlls/mshtml/main.c
View file @
740a850a
...
...
@@ -172,11 +172,16 @@ BOOL WINAPI DllMain(HINSTANCE hInstDLL, DWORD fdwReason, LPVOID lpv)
*/
typedef
HRESULT
(
*
CreateInstanceFunc
)(
IUnknown
*
,
REFIID
,
void
**
);
typedef
struct
{
const
IClassFactoryVtbl
*
lpVtbl
;
IClassFactory
IClassFactory_iface
;
LONG
ref
;
CreateInstanceFunc
fnCreateInstance
;
}
ClassFactory
;
static
inline
ClassFactory
*
impl_from_IClassFactory
(
IClassFactory
*
iface
)
{
return
CONTAINING_RECORD
(
iface
,
ClassFactory
,
IClassFactory_iface
);
}
static
HRESULT
WINAPI
ClassFactory_QueryInterface
(
IClassFactory
*
iface
,
REFGUID
riid
,
void
**
ppvObject
)
{
if
(
IsEqualGUID
(
&
IID_IClassFactory
,
riid
)
||
IsEqualGUID
(
&
IID_IUnknown
,
riid
))
{
...
...
@@ -192,7 +197,7 @@ static HRESULT WINAPI ClassFactory_QueryInterface(IClassFactory *iface, REFGUID
static
ULONG
WINAPI
ClassFactory_AddRef
(
IClassFactory
*
iface
)
{
ClassFactory
*
This
=
(
ClassFactory
*
)
iface
;
ClassFactory
*
This
=
impl_from_IClassFactory
(
iface
)
;
ULONG
ref
=
InterlockedIncrement
(
&
This
->
ref
);
TRACE
(
"(%p) ref = %u
\n
"
,
This
,
ref
);
return
ref
;
...
...
@@ -200,7 +205,7 @@ static ULONG WINAPI ClassFactory_AddRef(IClassFactory *iface)
static
ULONG
WINAPI
ClassFactory_Release
(
IClassFactory
*
iface
)
{
ClassFactory
*
This
=
(
ClassFactory
*
)
iface
;
ClassFactory
*
This
=
impl_from_IClassFactory
(
iface
)
;
ULONG
ref
=
InterlockedDecrement
(
&
This
->
ref
);
TRACE
(
"(%p) ref = %u
\n
"
,
This
,
ref
);
...
...
@@ -215,7 +220,7 @@ static ULONG WINAPI ClassFactory_Release(IClassFactory *iface)
static
HRESULT
WINAPI
ClassFactory_CreateInstance
(
IClassFactory
*
iface
,
IUnknown
*
pUnkOuter
,
REFIID
riid
,
void
**
ppvObject
)
{
ClassFactory
*
This
=
(
ClassFactory
*
)
iface
;
ClassFactory
*
This
=
impl_from_IClassFactory
(
iface
)
;
return
This
->
fnCreateInstance
(
pUnkOuter
,
riid
,
ppvObject
);
}
...
...
@@ -240,11 +245,11 @@ static HRESULT ClassFactory_Create(REFIID riid, void **ppv, CreateInstanceFunc f
ClassFactory
*
ret
=
heap_alloc
(
sizeof
(
ClassFactory
));
HRESULT
hres
;
ret
->
lpVtbl
=
&
HTMLClassFactoryVtbl
;
ret
->
IClassFactory_iface
.
lpVtbl
=
&
HTMLClassFactoryVtbl
;
ret
->
ref
=
0
;
ret
->
fnCreateInstance
=
fnCreateInstance
;
hres
=
IClassFactory_QueryInterface
(
(
IClassFactory
*
)
ret
,
riid
,
ppv
);
hres
=
IClassFactory_QueryInterface
(
&
ret
->
IClassFactory_iface
,
riid
,
ppv
);
if
(
FAILED
(
hres
))
{
heap_free
(
ret
);
*
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