ReactOS 0.4.17-dev-934-g091855f
dmband_main.c File Reference
#include "initguid.h"
#include "dmband_private.h"
#include "rpcproxy.h"
#include "dmusic_band.h"
#include "dmobject.h"
Include dependency graph for dmband_main.c:

Go to the source code of this file.

Classes

struct  IClassFactoryImpl
 

Functions

 WINE_DEFAULT_DEBUG_CHANNEL (dmband)
 
static IClassFactoryImpl * impl_from_IClassFactory (IClassFactory *iface)
 
static HRESULT WINAPI ClassFactory_QueryInterface (IClassFactory *iface, REFIID riid, void **ppv)
 
static ULONG WINAPI ClassFactory_AddRef (IClassFactory *iface)
 
static ULONG WINAPI ClassFactory_Release (IClassFactory *iface)
 
static HRESULT WINAPI ClassFactory_CreateInstance (IClassFactory *iface, IUnknown *pUnkOuter, REFIID riid, void **ppv)
 
static HRESULT WINAPI ClassFactory_LockServer (IClassFactory *iface, BOOL dolock)
 
HRESULT WINAPI DllGetClassObject (REFCLSID rclsid, REFIID riid, LPVOID *ppv)
 

Variables

static const IClassFactoryVtbl classfactory_vtbl
 
static IClassFactoryImpl Band_CF = {{&classfactory_vtbl}, create_dmband}
 
static IClassFactoryImpl BandTrack_CF = {{&classfactory_vtbl}, create_dmbandtrack}
 

Function Documentation

◆ ClassFactory_AddRef()

static ULONG WINAPI ClassFactory_AddRef ( IClassFactory *  iface)
static

Definition at line 61 of file dmband_main.c.

62{
63 return 2; /* non-heap based object */
64}

◆ ClassFactory_CreateInstance()

static HRESULT WINAPI ClassFactory_CreateInstance ( IClassFactory *  iface,
IUnknown *  pUnkOuter,
REFIID  riid,
void **  ppv 
)
static

Definition at line 71 of file dmband_main.c.

73{
75
76 TRACE ("(%p, %s, %p)\n", pUnkOuter, debugstr_dmguid(riid), ppv);
77
78 if (pUnkOuter) {
79 *ppv = NULL;
81 }
82
83 return This->fnCreateInstance(riid, ppv);
84}
#define NULL
Definition: types.h:112
static IClassFactoryImpl * impl_from_IClassFactory(IClassFactory *iface)
Definition: dmband_main.c:36
const char * debugstr_dmguid(const GUID *id)
Definition: dmobject.c:36
REFIID riid
Definition: atlbase.h:39
REFIID LPVOID * ppv
Definition: atlbase.h:39
#define TRACE(s)
Definition: solgame.cpp:4
#define CLASS_E_NOAGGREGATION
Definition: winerror.h:3771

◆ ClassFactory_LockServer()

static HRESULT WINAPI ClassFactory_LockServer ( IClassFactory *  iface,
BOOL  dolock 
)
static

Definition at line 86 of file dmband_main.c.

87{
88 TRACE("(%d)\n", dolock);
89 return S_OK;
90}
#define S_OK
Definition: intsafe.h:52

◆ ClassFactory_QueryInterface()

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

Definition at line 41 of file dmband_main.c.

42{
43 if (ppv == NULL)
44 return E_POINTER;
45
47 TRACE("(%p)->(IID_IUnknown %p)\n", iface, ppv);
49 TRACE("(%p)->(IID_IClassFactory %p)\n", iface, ppv);
50 else {
51 FIXME("(%p)->(%s %p)\n", iface, debugstr_guid(riid), ppv);
52 *ppv = NULL;
53 return E_NOINTERFACE;
54 }
55
56 *ppv = iface;
57 IClassFactory_AddRef(iface);
58 return S_OK;
59}
#define FIXME(fmt,...)
Definition: precomp.h:53
const GUID IID_IUnknown
const GUID IID_IClassFactory
#define debugstr_guid
Definition: kernel32.h:35
#define IsEqualGUID(rguid1, rguid2)
Definition: guiddef.h:147
#define E_NOINTERFACE
Definition: winerror.h:3479
#define E_POINTER
Definition: winerror.h:3480

◆ ClassFactory_Release()

static ULONG WINAPI ClassFactory_Release ( IClassFactory *  iface)
static

Definition at line 66 of file dmband_main.c.

67{
68 return 1; /* non-heap based object */
69}

◆ DllGetClassObject()

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

Definition at line 109 of file dmband_main.c.

110{
111 TRACE("(%s, %s, %p)\n", debugstr_dmguid(rclsid), debugstr_dmguid(riid), ppv);
112
113 if (IsEqualCLSID(rclsid, &CLSID_DirectMusicBand))
114 return IClassFactory_QueryInterface(&Band_CF.IClassFactory_iface, riid, ppv);
115 else if (IsEqualCLSID(rclsid, &CLSID_DirectMusicBandTrack))
116 return IClassFactory_QueryInterface(&BandTrack_CF.IClassFactory_iface, riid, ppv);
117
118 WARN("(%s, %s, %p): no interface found.\n", debugstr_dmguid(rclsid), debugstr_dmguid(riid), ppv);
120}
#define WARN(fmt,...)
Definition: precomp.h:61
static IClassFactoryImpl Band_CF
Definition: dmband_main.c:100
static IClassFactoryImpl BandTrack_CF
Definition: dmband_main.c:101
#define IsEqualCLSID(rclsid1, rclsid2)
Definition: guiddef.h:96
IClassFactory IClassFactory_iface
Definition: main.c:44
#define CLASS_E_CLASSNOTAVAILABLE
Definition: winerror.h:3772

◆ impl_from_IClassFactory()

static IClassFactoryImpl * impl_from_IClassFactory ( IClassFactory *  iface)
inlinestatic

Definition at line 36 of file dmband_main.c.

37{
38 return CONTAINING_RECORD(iface, IClassFactoryImpl, IClassFactory_iface);
39}
#define CONTAINING_RECORD(address, type, field)
Definition: typedefs.h:260

Referenced by ClassFactory_CreateInstance().

◆ WINE_DEFAULT_DEBUG_CHANNEL()

WINE_DEFAULT_DEBUG_CHANNEL ( dmband  )

Variable Documentation

◆ Band_CF

Definition at line 100 of file dmband_main.c.

Referenced by DllGetClassObject().

◆ BandTrack_CF

Definition at line 101 of file dmband_main.c.

Referenced by DllGetClassObject().

◆ classfactory_vtbl

const IClassFactoryVtbl classfactory_vtbl
static
Initial value:
= {
}
static HRESULT WINAPI ClassFactory_LockServer(IClassFactory *iface, BOOL dolock)
Definition: dmband_main.c:86
static HRESULT WINAPI ClassFactory_CreateInstance(IClassFactory *iface, IUnknown *pUnkOuter, REFIID riid, void **ppv)
Definition: dmband_main.c:71
static ULONG WINAPI ClassFactory_Release(IClassFactory *iface)
Definition: dmband_main.c:66
static HRESULT WINAPI ClassFactory_QueryInterface(IClassFactory *iface, REFIID riid, void **ppv)
Definition: dmband_main.c:41
static ULONG WINAPI ClassFactory_AddRef(IClassFactory *iface)
Definition: dmband_main.c:61

Definition at line 92 of file dmband_main.c.