wmvcore: Move the sync reader implementation to winegstreamer.
[wine.git] / dlls / wmvcore / wmvcore_main.c
blob8d4d425136992776b626aa64d8a37fa97534e6b7
1 /*
2 * Copyright 2012 Austin English
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Lesser General Public
6 * License as published by the Free Software Foundation; either
7 * version 2.1 of the License, or (at your option) any later version.
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Lesser General Public License for more details.
14 * You should have received a copy of the GNU Lesser General Public
15 * License along with this library; if not, write to the Free Software
16 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
19 #include "wmvcore.h"
21 #include "initguid.h"
22 #include "wmsdk.h"
23 #include "wine/debug.h"
24 #include "wine/heap.h"
26 WINE_DEFAULT_DEBUG_CHANNEL(wmvcore);
28 HRESULT WINAPI winegstreamer_create_wm_sync_reader(IWMSyncReader **reader);
30 HRESULT WINAPI WMCreateSyncReader(IUnknown *reserved, DWORD rights, IWMSyncReader **reader)
32 TRACE("reserved %p, rights %#x, reader %p.\n", reserved, rights, reader);
34 return winegstreamer_create_wm_sync_reader(reader);
37 HRESULT WINAPI WMCreateSyncReaderPriv(IWMSyncReader **reader)
39 TRACE("reader %p.\n", reader);
41 return winegstreamer_create_wm_sync_reader(reader);
44 HRESULT WINAPI WMCheckURLExtension(const WCHAR *url)
46 FIXME("(%s): stub\n", wine_dbgstr_w(url));
48 if (!url)
49 return E_INVALIDARG;
51 return NS_E_INVALID_NAME;
54 HRESULT WINAPI WMCheckURLScheme(const WCHAR *scheme)
56 FIXME("(%s): stub\n", wine_dbgstr_w(scheme));
58 return NS_E_INVALID_NAME;
61 HRESULT WINAPI WMCreateEditor(IWMMetadataEditor **editor)
63 FIXME("(%p): stub\n", editor);
65 *editor = NULL;
67 return E_NOTIMPL;
70 HRESULT WINAPI WMCreateBackupRestorer(IUnknown *callback, IWMLicenseBackup **licBackup)
72 FIXME("(%p %p): stub\n", callback, licBackup);
74 if (!callback)
75 return E_INVALIDARG;
77 *licBackup = NULL;
79 return E_NOTIMPL;
82 HRESULT WINAPI WMIsContentProtected(const WCHAR *filename, BOOL *protected)
84 FIXME("(%s %p): semi-stub\n", wine_dbgstr_w(filename), protected);
86 if (!filename || !protected)
87 return E_INVALIDARG;
89 *protected = FALSE;
91 return S_FALSE;
94 typedef struct {
95 IWMProfileManager2 IWMProfileManager2_iface;
96 LONG ref;
97 } WMProfileManager;
99 static inline WMProfileManager *impl_from_IWMProfileManager2(IWMProfileManager2 *iface)
101 return CONTAINING_RECORD(iface, WMProfileManager, IWMProfileManager2_iface);
104 static HRESULT WINAPI WMProfileManager_QueryInterface(IWMProfileManager2 *iface, REFIID riid, void **ppv)
106 WMProfileManager *This = impl_from_IWMProfileManager2(iface);
108 if(IsEqualGUID(&IID_IUnknown, riid)) {
109 TRACE("(%p)->(IID_IUnknown %p)\n", This, ppv);
110 *ppv = &This->IWMProfileManager2_iface;
111 }else if(IsEqualGUID(&IID_IWMProfileManager, riid)) {
112 TRACE("(%p)->(IID_IWMProfileManager %p)\n", This, ppv);
113 *ppv = &This->IWMProfileManager2_iface;
114 }else if(IsEqualGUID(&IID_IWMProfileManager2, riid)) {
115 TRACE("(%p)->(IID_IWMProfileManager2 %p)\n", This, ppv);
116 *ppv = &This->IWMProfileManager2_iface;
117 }else {
118 FIXME("Unsupported iface %s\n", debugstr_guid(riid));
119 *ppv = NULL;
120 return E_NOINTERFACE;
123 IUnknown_AddRef((IUnknown*)*ppv);
124 return S_OK;
127 static ULONG WINAPI WMProfileManager_AddRef(IWMProfileManager2 *iface)
129 WMProfileManager *This = impl_from_IWMProfileManager2(iface);
130 LONG ref = InterlockedIncrement(&This->ref);
132 TRACE("(%p) ref=%d\n", This, ref);
134 return ref;
137 static ULONG WINAPI WMProfileManager_Release(IWMProfileManager2 *iface)
139 WMProfileManager *This = impl_from_IWMProfileManager2(iface);
140 LONG ref = InterlockedDecrement(&This->ref);
142 TRACE("(%p) ref=%d\n", This, ref);
144 if(!ref)
145 heap_free(This);
147 return ref;
150 static HRESULT WINAPI WMProfileManager_CreateEmptyProfile(IWMProfileManager2 *iface, WMT_VERSION version, IWMProfile **ret)
152 WMProfileManager *This = impl_from_IWMProfileManager2(iface);
153 FIXME("(%p)->(%x %p)\n", This, version, ret);
154 return E_NOTIMPL;
157 static HRESULT WINAPI WMProfileManager_LoadProfileByID(IWMProfileManager2 *iface, REFGUID guid, IWMProfile **ret)
159 WMProfileManager *This = impl_from_IWMProfileManager2(iface);
160 FIXME("(%p)->(%s %p)\n", This, debugstr_guid(guid), ret);
161 return E_NOTIMPL;
164 static HRESULT WINAPI WMProfileManager_LoadProfileByData(IWMProfileManager2 *iface, const WCHAR *profile, IWMProfile **ret)
166 WMProfileManager *This = impl_from_IWMProfileManager2(iface);
167 FIXME("(%p)->(%s %p)\n", This, debugstr_w(profile), ret);
168 return E_NOTIMPL;
171 static HRESULT WINAPI WMProfileManager_SaveProfile(IWMProfileManager2 *iface, IWMProfile *profile, WCHAR *profile_str, DWORD *len)
173 WMProfileManager *This = impl_from_IWMProfileManager2(iface);
174 FIXME("(%p)->(%p %p %p)\n", This, profile, profile_str, len);
175 return E_NOTIMPL;
178 static HRESULT WINAPI WMProfileManager_GetSystemProfileCount(IWMProfileManager2 *iface, DWORD *ret)
180 WMProfileManager *This = impl_from_IWMProfileManager2(iface);
181 FIXME("(%p)->(%p)\n", This, ret);
182 return E_NOTIMPL;
185 static HRESULT WINAPI WMProfileManager_LoadSystemProfile(IWMProfileManager2 *iface, DWORD index, IWMProfile **ret)
187 WMProfileManager *This = impl_from_IWMProfileManager2(iface);
188 FIXME("(%p)->(%d %p)\n", This, index, ret);
189 return E_NOTIMPL;
192 static HRESULT WINAPI WMProfileManager2_GetSystemProfileVersion(IWMProfileManager2 *iface, WMT_VERSION *version)
194 WMProfileManager *This = impl_from_IWMProfileManager2(iface);
195 FIXME("(%p)->(%p)\n", This, version);
196 return E_NOTIMPL;
199 static HRESULT WINAPI WMProfileManager2_SetSystemProfileVersion(IWMProfileManager2 *iface, WMT_VERSION version)
201 WMProfileManager *This = impl_from_IWMProfileManager2(iface);
202 FIXME("(%p)->(%x)\n", This, version);
203 return E_NOTIMPL;
206 static const IWMProfileManager2Vtbl WMProfileManager2Vtbl = {
207 WMProfileManager_QueryInterface,
208 WMProfileManager_AddRef,
209 WMProfileManager_Release,
210 WMProfileManager_CreateEmptyProfile,
211 WMProfileManager_LoadProfileByID,
212 WMProfileManager_LoadProfileByData,
213 WMProfileManager_SaveProfile,
214 WMProfileManager_GetSystemProfileCount,
215 WMProfileManager_LoadSystemProfile,
216 WMProfileManager2_GetSystemProfileVersion,
217 WMProfileManager2_SetSystemProfileVersion
220 HRESULT WINAPI WMCreateProfileManager(IWMProfileManager **ret)
222 WMProfileManager *profile_mgr;
224 TRACE("(%p)\n", ret);
226 profile_mgr = heap_alloc(sizeof(*profile_mgr));
227 if(!profile_mgr)
228 return E_OUTOFMEMORY;
230 profile_mgr->IWMProfileManager2_iface.lpVtbl = &WMProfileManager2Vtbl;
231 profile_mgr->ref = 1;
233 *ret = (IWMProfileManager *)&profile_mgr->IWMProfileManager2_iface;
234 return S_OK;