ReactOS 0.4.16-dev-109-gf4cb10f
dpclassfactory.c File Reference
#include <stdarg.h>
#include <string.h>
#include "windef.h"
#include "winbase.h"
#include "winuser.h"
#include "objbase.h"
#include "winerror.h"
#include "wine/debug.h"
#include "dplay.h"
#include "dplobby.h"
#include "initguid.h"
#include "dplay_global.h"
Include dependency graph for dpclassfactory.c:

Go to the source code of this file.

Classes

struct  IClassFactoryImpl
 

Macros

#define COBJMACROS
 

Functions

 WINE_DEFAULT_DEBUG_CHANNEL (dplay)
 
static IClassFactoryImplimpl_from_IClassFactory (IClassFactory *iface)
 
static HRESULT WINAPI IClassFactoryImpl_QueryInterface (IClassFactory *iface, REFIID riid, void **ppv)
 
static ULONG WINAPI IClassFactoryImpl_AddRef (IClassFactory *iface)
 
static ULONG WINAPI IClassFactoryImpl_Release (IClassFactory *iface)
 
static HRESULT WINAPI IClassFactoryImpl_CreateInstance (IClassFactory *iface, IUnknown *pOuter, REFIID riid, void **ppv)
 
static HRESULT WINAPI IClassFactoryImpl_LockServer (IClassFactory *iface, BOOL dolock)
 
HRESULT WINAPI DllGetClassObject (REFCLSID rclsid, REFIID riid, LPVOID *ppv)
 

Variables

static const IClassFactoryVtbl cf_vt
 
static IClassFactoryImpl dplay_cf = {{&cf_vt}, dplay_create}
 
static IClassFactoryImpl dplaylobby_cf = {{&cf_vt}, dplobby_create}
 

Macro Definition Documentation

◆ COBJMACROS

#define COBJMACROS

Definition at line 23 of file dpclassfactory.c.

Function Documentation

◆ DllGetClassObject()

HRESULT WINAPI DllGetClassObject ( REFCLSID  rclsid,
REFIID  riid,
LPVOID ppv 
)

Definition at line 125 of file dpclassfactory.c.

126{
127 TRACE("(%s,%s,%p)\n", debugstr_guid(rclsid), debugstr_guid(riid), ppv);
128
129 if (IsEqualCLSID(&CLSID_DirectPlay, rclsid))
130 return IClassFactory_QueryInterface(&dplay_cf.IClassFactory_iface, riid, ppv);
131
132 if (IsEqualCLSID(&CLSID_DirectPlayLobby, rclsid))
133 return IClassFactory_QueryInterface(&dplaylobby_cf.IClassFactory_iface, riid, ppv);
134
135 FIXME("(%s,%s,%p): no class found.\n", debugstr_guid(rclsid), debugstr_guid(riid), ppv);
137}
#define FIXME(fmt,...)
Definition: precomp.h:53
static IClassFactoryImpl dplaylobby_cf
static IClassFactoryImpl dplay_cf
REFIID riid
Definition: atlbase.h:39
REFIID LPVOID * ppv
Definition: atlbase.h:39
#define debugstr_guid
Definition: kernel32.h:35
#define IsEqualCLSID(rclsid1, rclsid2)
Definition: guiddef.h:96
#define TRACE(s)
Definition: solgame.cpp:4
IClassFactory IClassFactory_iface
Definition: main.c:58
#define CLASS_E_CLASSNOTAVAILABLE
Definition: winerror.h:2663

◆ IClassFactoryImpl_AddRef()

static ULONG WINAPI IClassFactoryImpl_AddRef ( IClassFactory iface)
static

Definition at line 67 of file dpclassfactory.c.

68{
69 return 2; /* non-heap based object */
70}

◆ IClassFactoryImpl_CreateInstance()

static HRESULT WINAPI IClassFactoryImpl_CreateInstance ( IClassFactory iface,
IUnknown pOuter,
REFIID  riid,
void **  ppv 
)
static

Definition at line 77 of file dpclassfactory.c.

79{
81
82 TRACE("(%p)->(%p,%s,%p)\n", iface, pOuter, debugstr_guid(riid), ppv);
83
84 if (pOuter)
86
87 return This->createinstance(riid, ppv);
88}
static IClassFactoryImpl * impl_from_IClassFactory(IClassFactory *iface)
#define CLASS_E_NOAGGREGATION
Definition: winerror.h:2662

◆ IClassFactoryImpl_LockServer()

static HRESULT WINAPI IClassFactoryImpl_LockServer ( IClassFactory iface,
BOOL  dolock 
)
static

Definition at line 90 of file dpclassfactory.c.

91{
92 FIXME("(%p)->(%d),stub!\n", iface, dolock);
93 return S_OK;
94}
#define S_OK
Definition: intsafe.h:52

◆ IClassFactoryImpl_QueryInterface()

static HRESULT WINAPI IClassFactoryImpl_QueryInterface ( IClassFactory iface,
REFIID  riid,
void **  ppv 
)
static

Definition at line 50 of file dpclassfactory.c.

52{
53 TRACE("(%p)->(%s %p)\n", iface, debugstr_guid(riid), ppv);
54
56 {
57 *ppv = iface;
58 IClassFactory_AddRef(iface);
59 return S_OK;
60 }
61
62 *ppv = NULL;
63 WARN("no interface for %s\n", debugstr_guid(riid));
64 return E_NOINTERFACE;
65}
#define WARN(fmt,...)
Definition: precomp.h:61
const GUID IID_IUnknown
const GUID IID_IClassFactory
#define NULL
Definition: types.h:112
#define IsEqualGUID(rguid1, rguid2)
Definition: guiddef.h:147
#define E_NOINTERFACE
Definition: winerror.h:2364

◆ IClassFactoryImpl_Release()

static ULONG WINAPI IClassFactoryImpl_Release ( IClassFactory iface)
static

Definition at line 72 of file dpclassfactory.c.

73{
74 return 1; /* non-heap based object */
75}

◆ impl_from_IClassFactory()

static IClassFactoryImpl * impl_from_IClassFactory ( IClassFactory iface)
inlinestatic

Definition at line 45 of file dpclassfactory.c.

46{
47 return CONTAINING_RECORD(iface, IClassFactoryImpl, IClassFactory_iface);
48}
#define CONTAINING_RECORD(address, type, field)
Definition: typedefs.h:260

Referenced by IClassFactoryImpl_CreateInstance().

◆ WINE_DEFAULT_DEBUG_CHANNEL()

WINE_DEFAULT_DEBUG_CHANNEL ( dplay  )

Variable Documentation

◆ cf_vt

const IClassFactoryVtbl cf_vt
static
Initial value:
= {
}
static HRESULT WINAPI IClassFactoryImpl_CreateInstance(IClassFactory *iface, IUnknown *pOuter, REFIID riid, void **ppv)
static HRESULT WINAPI IClassFactoryImpl_LockServer(IClassFactory *iface, BOOL dolock)
static HRESULT WINAPI IClassFactoryImpl_QueryInterface(IClassFactory *iface, REFIID riid, void **ppv)
static ULONG WINAPI IClassFactoryImpl_AddRef(IClassFactory *iface)
static ULONG WINAPI IClassFactoryImpl_Release(IClassFactory *iface)

Definition at line 96 of file dpclassfactory.c.

◆ dplay_cf

IClassFactoryImpl dplay_cf = {{&cf_vt}, dplay_create}
static

Definition at line 104 of file dpclassfactory.c.

Referenced by DllGetClassObject().

◆ dplaylobby_cf

IClassFactoryImpl dplaylobby_cf = {{&cf_vt}, dplobby_create}
static

Definition at line 105 of file dpclassfactory.c.

Referenced by DllGetClassObject().