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
08031fdc
Commit
08031fdc
authored
Aug 01, 2011
by
Michael Stefaniuc
Committed by
Alexandre Julliard
Aug 01, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dxdiagn: COM cleanup for the IClassFactory iface.
parent
aa591dcd
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
22 additions
and
24 deletions
+22
-24
dxdiag_main.c
dlls/dxdiagn/dxdiag_main.c
+22
-24
No files found.
dlls/dxdiagn/dxdiag_main.c
View file @
08031fdc
...
...
@@ -19,6 +19,8 @@
*
*/
#define COBJMACROS
#include "config.h"
#include <stdarg.h>
...
...
@@ -53,39 +55,42 @@ BOOL WINAPI DllMain(HINSTANCE hInstDLL, DWORD fdwReason, LPVOID lpvReserved)
* DXDiag ClassFactory
*/
typedef
struct
{
const
IClassFactoryVtbl
*
lpVtbl
;
REFCLSID
rclsid
;
HRESULT
(
*
pfnCreateInstanceFactory
)(
LPCLASSFACTORY
iface
,
LPUNKNOWN
punkOuter
,
REFIID
riid
,
LPVOID
*
ppobj
);
IClassFactory
IClassFactory_iface
;
}
IClassFactoryImpl
;
static
HRESULT
WINAPI
DXDiagCF_QueryInterface
(
LPCLASSFACTORY
iface
,
REFIID
riid
,
LPVOID
*
ppobj
)
{
static
HRESULT
WINAPI
DXDiagCF_QueryInterface
(
IClassFactory
*
iface
,
REFIID
riid
,
void
**
ppv
)
{
FIXME
(
"- no interface
\n\t
IID:
\t
%s
\n
"
,
debugstr_guid
(
riid
));
if
(
pp
obj
==
NULL
)
return
E_POINTER
;
if
(
pp
v
==
NULL
)
return
E_POINTER
;
return
E_NOINTERFACE
;
}
static
ULONG
WINAPI
DXDiagCF_AddRef
(
LPCLASSFACTORY
iface
)
{
static
ULONG
WINAPI
DXDiagCF_AddRef
(
IClassFactory
*
iface
)
{
DXDIAGN_LockModule
();
return
2
;
/* non-heap based object */
}
static
ULONG
WINAPI
DXDiagCF_Release
(
LPCLASSFACTORY
iface
)
{
static
ULONG
WINAPI
DXDiagCF_Release
(
IClassFactory
*
iface
)
{
DXDIAGN_UnlockModule
();
return
1
;
/* non-heap based object */
}
static
HRESULT
WINAPI
DXDiagCF_CreateInstance
(
LPCLASSFACTORY
iface
,
LPUNKNOWN
pOuter
,
REFIID
riid
,
LPVOID
*
ppobj
)
{
IClassFactoryImpl
*
This
=
(
IClassFactoryImpl
*
)
iface
;
TRACE
(
"(%p)->(%p,%s,%p)
\n
"
,
This
,
pOuter
,
debugstr_guid
(
riid
),
ppobj
);
static
HRESULT
WINAPI
DXDiagCF_CreateInstance
(
IClassFactory
*
iface
,
IUnknown
*
pOuter
,
REFIID
riid
,
void
**
ppv
)
{
TRACE
(
"(%p)->(%p,%s,%p)
\n
"
,
iface
,
pOuter
,
debugstr_guid
(
riid
),
ppv
);
return
This
->
pfnCreateInstanceFactory
(
iface
,
pOuter
,
riid
,
ppobj
);
return
DXDiag_CreateDXDiagProvider
(
iface
,
pOuter
,
riid
,
ppv
);
}
static
HRESULT
WINAPI
DXDiagCF_LockServer
(
LPCLASSFACTORY
iface
,
BOOL
dolock
)
{
static
HRESULT
WINAPI
DXDiagCF_LockServer
(
IClassFactory
*
iface
,
BOOL
dolock
)
{
TRACE
(
"(%d)
\n
"
,
dolock
);
if
(
dolock
)
...
...
@@ -104,10 +109,7 @@ static const IClassFactoryVtbl DXDiagCF_Vtbl = {
DXDiagCF_LockServer
};
static
IClassFactoryImpl
DXDiag_CFS
[]
=
{
{
&
DXDiagCF_Vtbl
,
&
CLSID_DxDiagProvider
,
DXDiag_CreateDXDiagProvider
},
{
NULL
,
NULL
,
NULL
}
};
static
IClassFactoryImpl
DXDiag_CF
=
{
{
&
DXDiagCF_Vtbl
}
};
/***********************************************************************
* DllCanUnloadNow (DXDIAGN.@)
...
...
@@ -122,17 +124,13 @@ HRESULT WINAPI DllCanUnloadNow(void)
*/
HRESULT
WINAPI
DllGetClassObject
(
REFCLSID
rclsid
,
REFIID
riid
,
LPVOID
*
ppv
)
{
int
i
=
0
;
TRACE
(
"(%s,%s,%p)
\n
"
,
debugstr_guid
(
rclsid
),
debugstr_guid
(
riid
),
ppv
);
while
(
NULL
!=
DXDiag_CFS
[
i
].
rclsid
)
{
if
(
IsEqualGUID
(
rclsid
,
DXDiag_CFS
[
i
].
rclsid
))
{
DXDiagCF_AddRef
((
IClassFactory
*
)
&
DXDiag_CFS
[
i
]
);
*
ppv
=
&
DXDiag_CFS
[
i
]
;
if
(
IsEqualGUID
(
rclsid
,
&
CLSID_DxDiagProvider
))
{
IClassFactory_AddRef
(
&
DXDiag_CF
.
IClassFactory_iface
);
*
ppv
=
&
DXDiag_CF
.
IClassFactory_iface
;
return
S_OK
;
}
++
i
;
}
FIXME
(
"(%s,%s,%p): no interface found.
\n
"
,
debugstr_guid
(
rclsid
),
debugstr_guid
(
riid
),
ppv
);
return
CLASS_E_CLASSNOTAVAILABLE
;
...
...
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