ReactOS  0.4.14-dev-41-g31d7680
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 }
REFIID riid
Definition: precomp.h:44
REFIID LPVOID * ppv
Definition: atlbase.h:39
static IClassFactoryImpl dplay_cf
#define CLASS_E_CLASSNOTAVAILABLE
Definition: winerror.h:2663
static IClassFactoryImpl dplaylobby_cf
#define FIXME(fmt,...)
Definition: debug.h:110
#define debugstr_guid
Definition: kernel32.h:35
#define TRACE(s)
Definition: solgame.cpp:4
IClassFactory IClassFactory_iface
Definition: main.c:58
#define IsEqualCLSID(rclsid1, rclsid2)
Definition: guiddef.h:96

◆ 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)
85  return CLASS_E_NOAGGREGATION;
86 
87  return This->createinstance(riid, ppv);
88 }
REFIID riid
Definition: precomp.h:44
REFIID LPVOID * ppv
Definition: atlbase.h:39
#define debugstr_guid
Definition: kernel32.h:35
#define TRACE(s)
Definition: solgame.cpp:4
#define CLASS_E_NOAGGREGATION
Definition: winerror.h:2662
static IClassFactoryImpl * impl_from_IClassFactory(IClassFactory *iface)

◆ 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 FIXME(fmt,...)
Definition: debug.h:110
#define S_OK
Definition: intsafe.h:59

◆ 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 E_NOINTERFACE
Definition: winerror.h:2364
REFIID riid
Definition: precomp.h:44
#define WARN(fmt,...)
Definition: debug.h:111
REFIID LPVOID * ppv
Definition: atlbase.h:39
smooth NULL
Definition: ftsmooth.c:416
#define debugstr_guid
Definition: kernel32.h:35
#define TRACE(s)
Definition: solgame.cpp:4
const GUID IID_IUnknown
#define S_OK
Definition: intsafe.h:59
BOOL WINAPI IsEqualGUID(REFGUID rguid1, REFGUID rguid2)
Definition: compobj.c:4021
const GUID IID_IClassFactory

◆ 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 }
PFLT_MESSAGE_WAITER_QUEUE CONTAINING_RECORD(Csq, DEVICE_EXTENSION, IrpQueue)) -> WaiterQ.mLock) _IRQL_raises_(DISPATCH_LEVEL) VOID NTAPI FltpAcquireMessageWaiterLock(_In_ PIO_CSQ Csq, _Out_ PKIRQL Irql)
Definition: Messaging.c:560

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_QueryInterface(IClassFactory *iface, REFIID riid, void **ppv)
static HRESULT WINAPI IClassFactoryImpl_LockServer(IClassFactory *iface, BOOL dolock)
static HRESULT WINAPI IClassFactoryImpl_CreateInstance(IClassFactory *iface, IUnknown *pOuter, REFIID riid, void **ppv)
static ULONG WINAPI IClassFactoryImpl_Release(IClassFactory *iface)
static ULONG WINAPI IClassFactoryImpl_AddRef(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().