Fixed callback parameters (bogus hWave); added acm conversion for
[wine.git] / dlls / dplayx / dpclassfactory.c
blobd0df9484259d90a80db67492daffada4c6b49d4c
1 #include <string.h>
2 #include "windef.h"
3 #include "wine/obj_base.h"
4 #include "winerror.h"
5 #include "debugtools.h"
6 #include "dpinit.h"
8 DEFAULT_DEBUG_CHANNEL(dplay);
11 /*******************************************************************************
12 * DirectPlayLobby ClassFactory
15 typedef struct
17 /* IUnknown fields */
18 ICOM_VFIELD(IClassFactory);
19 DWORD ref;
20 } IClassFactoryImpl;
22 static HRESULT WINAPI
23 DP_and_DPL_QueryInterface(LPCLASSFACTORY iface,REFIID riid,LPVOID *ppobj) {
24 ICOM_THIS(IClassFactoryImpl,iface);
26 FIXME("(%p)->(%s,%p),stub!\n",This,debugstr_guid(riid),ppobj);
28 return E_NOINTERFACE;
31 static ULONG WINAPI
32 DP_and_DPL_AddRef(LPCLASSFACTORY iface) {
33 ICOM_THIS(IClassFactoryImpl,iface);
34 return ++(This->ref);
37 static ULONG WINAPI DP_and_DPL_Release(LPCLASSFACTORY iface) {
38 ICOM_THIS(IClassFactoryImpl,iface);
39 /* static class (reference starts @ 1), won't ever be freed */
40 return --(This->ref);
43 static HRESULT WINAPI DP_and_DPL_CreateInstance(
44 LPCLASSFACTORY iface,LPUNKNOWN pOuter,REFIID riid,LPVOID *ppobj
45 ) {
46 ICOM_THIS(IClassFactoryImpl,iface);
48 TRACE("(%p)->(%p,%s,%p)\n",This,pOuter,debugstr_guid(riid),ppobj);
50 if ( DPL_CreateInterface( riid, ppobj ) == S_OK )
52 return S_OK;
54 else if ( DP_CreateInterface( riid, ppobj ) == S_OK )
56 return S_OK;
59 return E_NOINTERFACE;
62 static HRESULT WINAPI DP_and_DPL_LockServer(LPCLASSFACTORY iface,BOOL dolock) {
63 ICOM_THIS(IClassFactoryImpl,iface);
64 FIXME("(%p)->(%d),stub!\n",This,dolock);
65 return S_OK;
68 static ICOM_VTABLE(IClassFactory) DP_and_DPL_Vtbl = {
69 ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
70 DP_and_DPL_QueryInterface,
71 DP_and_DPL_AddRef,
72 DP_and_DPL_Release,
73 DP_and_DPL_CreateInstance,
74 DP_and_DPL_LockServer
77 static IClassFactoryImpl DP_and_DPL_CF = {&DP_and_DPL_Vtbl, 1 };
80 /*******************************************************************************
81 * DPLAYX_DllGetClassObject [DPLAYX.11]
82 * Retrieves DP or DPL class object from a DLL object
84 * NOTES
85 * Docs say returns STDAPI
87 * PARAMS
88 * rclsid [I] CLSID for the class object
89 * riid [I] Reference to identifier of interface for class object
90 * ppv [O] Address of variable to receive interface pointer for riid
92 * RETURNS
93 * Success: S_OK
94 * Failure: CLASS_E_CLASSNOTAVAILABLE, E_OUTOFMEMORY, E_INVALIDARG,
95 * E_UNEXPECTED
97 DWORD WINAPI DPLAYX_DllGetClassObject(REFCLSID rclsid,REFIID riid,LPVOID *ppv)
99 TRACE("(%p,%p,%p)\n", debugstr_guid(rclsid), debugstr_guid(riid), ppv);
101 if ( IsEqualCLSID( riid, &IID_IClassFactory ) )
103 *ppv = (LPVOID)&DP_and_DPL_CF;
104 IClassFactory_AddRef( (IClassFactory*)*ppv );
106 return S_OK;
109 ERR("(%p,%p,%p): no interface found.\n", debugstr_guid(rclsid), debugstr_guid(riid), ppv);
110 return CLASS_E_CLASSNOTAVAILABLE;