shlwapi/tests: Link directly to Url*() functions.
[wine.git] / dlls / qdvd / qdvd_main.c
blob608a664e3927130a183d695d42322eeca66f6768
1 /*
2 * DirectShow DVD support
4 * Copyright 2009 Austin English
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2.1 of the License, or (at your option) any later version.
11 * This library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with this library; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
21 #include "qdvd_private.h"
22 #include "rpcproxy.h"
24 WINE_DEFAULT_DEBUG_CHANNEL(quartz);
26 struct class_factory
28 IClassFactory IClassFactory_iface;
29 HRESULT (*create_instance)(IUnknown *outer, IUnknown **out);
32 static struct class_factory *impl_from_IClassFactory(IClassFactory *iface)
34 return CONTAINING_RECORD(iface, struct class_factory, IClassFactory_iface);
37 static HRESULT WINAPI class_factory_QueryInterface(IClassFactory *iface, REFIID iid, void **out)
39 TRACE("iface %p, iid %s, out %p.\n", iface, debugstr_guid(iid), out);
41 if (IsEqualGUID(iid, &IID_IUnknown) || IsEqualGUID(iid, &IID_IClassFactory))
43 IClassFactory_AddRef(iface);
44 *out = iface;
45 return S_OK;
48 *out = NULL;
49 WARN("%s not implemented, returning E_NOINTERFACE\n", debugstr_guid(iid));
50 return E_NOINTERFACE;
53 static ULONG WINAPI class_factory_AddRef(IClassFactory *iface)
55 return 2;
58 static ULONG WINAPI class_factory_Release(IClassFactory *iface)
60 return 1;
63 static HRESULT WINAPI class_factory_CreateInstance(IClassFactory *iface,
64 IUnknown *outer, REFIID iid, void **out)
66 struct class_factory *factory = impl_from_IClassFactory(iface);
67 IUnknown *unk;
68 HRESULT hr;
70 TRACE("iface %p, outer %p, iid %s, out %p.\n", iface, outer, debugstr_guid(iid), out);
72 *out = NULL;
74 if (outer && !IsEqualGUID(iid, &IID_IUnknown))
75 return E_NOINTERFACE;
77 if (SUCCEEDED(hr = factory->create_instance(outer, &unk)))
79 hr = IUnknown_QueryInterface(unk, iid, out);
80 IUnknown_Release(unk);
82 return hr;
85 static HRESULT WINAPI class_factory_LockServer(IClassFactory *iface, BOOL lock)
87 FIXME("lock %d, stub!\n", lock);
88 return S_OK;
91 static const IClassFactoryVtbl class_factory_vtbl =
93 class_factory_QueryInterface,
94 class_factory_AddRef,
95 class_factory_Release,
96 class_factory_CreateInstance,
97 class_factory_LockServer,
100 static struct class_factory graph_builder_cf = {{&class_factory_vtbl}, graph_builder_create};
101 static struct class_factory navigator_cf = {{&class_factory_vtbl}, navigator_create};
103 HRESULT WINAPI DllGetClassObject(REFCLSID clsid, REFIID iid, void **out)
105 TRACE("clsid %s, iid %s, out %p.\n", debugstr_guid(clsid), debugstr_guid(iid), out);
107 if (IsEqualGUID(clsid, &CLSID_DvdGraphBuilder))
108 return IClassFactory_QueryInterface(&graph_builder_cf.IClassFactory_iface, iid, out);
109 if (IsEqualGUID(clsid, &CLSID_DVDNavigator))
110 return IClassFactory_QueryInterface(&navigator_cf.IClassFactory_iface, iid, out);
112 FIXME("%s not available, returning CLASS_E_CLASSNOTAVAILABLE.\n", debugstr_guid(clsid));
113 return CLASS_E_CLASSNOTAVAILABLE;