ReactOS 0.4.17-dev-934-g091855f
dmcompos_main.c
Go to the documentation of this file.
1/* DirectMusicComposer Main
2 *
3 * Copyright (C) 2003-2004 Rok Mandeljc
4 *
5 * This program is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Lesser General Public
7 * License as published by the Free Software Foundation; either
8 * version 2.1 of the License, or (at your option) any later version.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * Lesser General Public License for more details.
14 *
15 * You should have received a copy of the GNU Lesser General Public
16 * License along with this program; if not, write to the Free Software
17 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
18 */
19
20
21#include <stdarg.h>
22
23#define COBJMACROS
24
25#include "windef.h"
26#include "winbase.h"
27#include "winnt.h"
28#include "wingdi.h"
29#include "winuser.h"
30#include "winreg.h"
31#include "objbase.h"
32#include "initguid.h"
33#include "dmusici.h"
34
35#include "dmcompos_private.h"
36#include "dmobject.h"
37#include "rpcproxy.h"
38
40
41typedef struct {
42 IClassFactory IClassFactory_iface;
43 HRESULT (*fnCreateInstance)(REFIID riid, void **ret_iface);
45
47{
48 FIXME("(%s, %p) stub\n", debugstr_dmguid(riid), ret_iface);
49
51}
52
53/******************************************************************
54 * IClassFactory implementation
55 */
57{
58 return CONTAINING_RECORD(iface, IClassFactoryImpl, IClassFactory_iface);
59}
60
62{
63 if (ppv == NULL)
64 return E_POINTER;
65
67 TRACE("(%p)->(IID_IUnknown %p)\n", iface, ppv);
69 TRACE("(%p)->(IID_IClassFactory %p)\n", iface, ppv);
70 else {
71 FIXME("(%p)->(%s %p)\n", iface, debugstr_guid(riid), ppv);
72 *ppv = NULL;
73 return E_NOINTERFACE;
74 }
75
76 *ppv = iface;
77 IUnknown_AddRef((IUnknown*)*ppv);
78 return S_OK;
79}
80
82{
83 return 2; /* non-heap based object */
84}
85
87{
88 return 1; /* non-heap based object */
89}
90
92 REFIID riid, void **ppv)
93{
95
96 TRACE ("(%p, %s, %p)\n", pUnkOuter, debugstr_dmguid(riid), ppv);
97
98 if (pUnkOuter) {
99 *ppv = NULL;
101 }
102
103 return This->fnCreateInstance(riid, ppv);
104}
105
107{
108 TRACE("(%d)\n", dolock);
109 return S_OK;
110}
111
112static const IClassFactoryVtbl classfactory_vtbl = {
118};
119
125
126
127/******************************************************************
128 * DllGetClassObject (DMCOMPOS.@)
129 *
130 *
131 */
133 TRACE("(%s, %s, %p)\n", debugstr_dmguid(rclsid), debugstr_dmguid(riid), ppv);
134 if (IsEqualCLSID (rclsid, &CLSID_DirectMusicChordMap) && IsEqualIID (riid, &IID_IClassFactory)) {
135 *ppv = &ChordMap_CF;
136 IClassFactory_AddRef((IClassFactory*)*ppv);
137 return S_OK;
138 } else if (IsEqualCLSID (rclsid, &CLSID_DirectMusicComposer) && IsEqualIID (riid, &IID_IClassFactory)) {
139 *ppv = &Composer_CF;
140 IClassFactory_AddRef((IClassFactory*)*ppv);
141 return S_OK;
142 } else if (IsEqualCLSID (rclsid, &CLSID_DirectMusicChordMapTrack) && IsEqualIID (riid, &IID_IClassFactory)) {
144 IClassFactory_AddRef((IClassFactory*)*ppv);
145 return S_OK;
146 } else if (IsEqualCLSID (rclsid, &CLSID_DirectMusicTemplate) && IsEqualIID (riid, &IID_IClassFactory)) {
147 *ppv = &Template_CF;
148 IClassFactory_AddRef((IClassFactory*)*ppv);
149 return S_OK;
150 } else if (IsEqualCLSID (rclsid, &CLSID_DirectMusicSignPostTrack) && IsEqualIID (riid, &IID_IClassFactory)) {
152 IClassFactory_AddRef((IClassFactory*)*ppv);
153 return S_OK;
154 }
155
156 WARN("(%s, %s, %p): no interface found.\n", debugstr_dmguid(rclsid), debugstr_dmguid(riid), ppv);
158}
#define WINE_DEFAULT_DEBUG_CHANNEL(t)
Definition: precomp.h:23
#define FIXME(fmt,...)
Definition: precomp.h:53
#define WARN(fmt,...)
Definition: precomp.h:61
const GUID IID_IUnknown
const GUID IID_IClassFactory
HRESULT create_dmchordmap(REFIID lpcGUID, void **ppobj)
Definition: chordmap.c:309
HRESULT create_dmchordmaptrack(REFIID lpcGUID, void **ppobj)
HRESULT create_dmcomposer(REFIID riid, void **ret_iface)
Definition: composer.c:170
#define NULL
Definition: types.h:112
static IClassFactoryImpl SignPostTrack_CF
static HRESULT WINAPI ClassFactory_LockServer(IClassFactory *iface, BOOL dolock)
static HRESULT WINAPI ClassFactory_CreateInstance(IClassFactory *iface, IUnknown *pUnkOuter, REFIID riid, void **ppv)
Definition: dmcompos_main.c:91
static HRESULT create_direct_music_template(REFIID riid, void **ret_iface)
Definition: dmcompos_main.c:46
static IClassFactoryImpl ChordMap_CF
static ULONG WINAPI ClassFactory_Release(IClassFactory *iface)
Definition: dmcompos_main.c:86
static IClassFactoryImpl ChordMapTrack_CF
static const IClassFactoryVtbl classfactory_vtbl
static HRESULT WINAPI ClassFactory_QueryInterface(IClassFactory *iface, REFIID riid, void **ppv)
Definition: dmcompos_main.c:61
HRESULT WINAPI DllGetClassObject(REFCLSID rclsid, REFIID riid, LPVOID *ppv)
static IClassFactoryImpl Template_CF
static ULONG WINAPI ClassFactory_AddRef(IClassFactory *iface)
Definition: dmcompos_main.c:81
static IClassFactoryImpl * impl_from_IClassFactory(IClassFactory *iface)
Definition: dmcompos_main.c:56
static IClassFactoryImpl Composer_CF
HRESULT create_dmsignposttrack(REFIID riid, void **ret_iface)
const char * debugstr_dmguid(const GUID *id)
Definition: dmobject.c:36
unsigned int BOOL
Definition: ntddk_ex.h:94
HRESULT(* fnCreateInstance)(IUnknown *pUnkOuter, LPVOID *ppObj)
Definition: hnetcfg.c:35
REFIID riid
Definition: atlbase.h:39
REFIID LPVOID * ppv
Definition: atlbase.h:39
#define S_OK
Definition: intsafe.h:52
#define debugstr_guid
Definition: kernel32.h:35
#define IsEqualGUID(rguid1, rguid2)
Definition: guiddef.h:147
#define IsEqualIID(riid1, riid2)
Definition: guiddef.h:95
#define REFIID
Definition: guiddef.h:118
#define REFCLSID
Definition: guiddef.h:117
#define IsEqualCLSID(rclsid1, rclsid2)
Definition: guiddef.h:96
#define TRACE(s)
Definition: solgame.cpp:4
#define CONTAINING_RECORD(address, type, field)
Definition: typedefs.h:260
uint32_t ULONG
Definition: typedefs.h:59
#define HRESULT
Definition: msvc.h:7
#define WINAPI
Definition: msvc.h:6
#define E_NOINTERFACE
Definition: winerror.h:3479
#define CLASS_E_NOAGGREGATION
Definition: winerror.h:3771
#define E_POINTER
Definition: winerror.h:3480
#define CLASS_E_CLASSNOTAVAILABLE
Definition: winerror.h:3772