shell32/tests: Fix win8 knownfolders relative and parsed paths.
[wine.git] / dlls / wmvcore / wmvcore_main.c
blob4698e62c7e34d28578c53d261788b2cabeb3a1f8
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 "wmsdkidl.h"
23 #include "wine/debug.h"
25 WINE_DEFAULT_DEBUG_CHANNEL(wmvcore);
27 BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved)
29 TRACE("(0x%p, %d, %p)\n", hinstDLL, fdwReason, lpvReserved);
31 switch (fdwReason)
33 case DLL_WINE_PREATTACH:
34 return FALSE; /* prefer native version */
35 case DLL_PROCESS_ATTACH:
36 DisableThreadLibraryCalls(hinstDLL);
37 break;
40 return TRUE;
43 HRESULT WINAPI DllRegisterServer(void)
45 FIXME("(): stub\n");
47 return S_OK;
50 HRESULT WINAPI WMCreateEditor(IWMMetadataEditor **editor)
52 FIXME("(%p): stub\n", editor);
54 *editor = NULL;
56 return E_NOTIMPL;
59 typedef struct {
60 IWMReader IWMReader_iface;
61 LONG ref;
62 } WMReader;
64 static inline WMReader *impl_from_IWMReader(IWMReader *iface)
66 return CONTAINING_RECORD(iface, WMReader, IWMReader_iface);
69 static HRESULT WINAPI WMReader_QueryInterface(IWMReader *iface, REFIID riid, void **ppv)
71 WMReader *This = impl_from_IWMReader(iface);
73 if(IsEqualGUID(riid, &IID_IUnknown)) {
74 TRACE("(%p)->(IID_IUnknown %p)\n", This, ppv);
75 *ppv = &This->IWMReader_iface;
76 }else if(IsEqualGUID(riid, &IID_IWMReader)) {
77 TRACE("(%p)->(IID_IWMReader %p)\n", This, ppv);
78 *ppv = &This->IWMReader_iface;
79 }else {
80 *ppv = NULL;
81 FIXME("(%p)->(%s %p)\n", This, debugstr_guid(riid), ppv);
82 return E_NOINTERFACE;
85 IUnknown_AddRef((IUnknown*)*ppv);
86 return S_OK;
89 static ULONG WINAPI WMReader_AddRef(IWMReader *iface)
91 WMReader *This = impl_from_IWMReader(iface);
92 LONG ref = InterlockedIncrement(&This->ref);
94 TRACE("(%p) ref=%d\n", This, ref);
96 return ref;
99 static ULONG WINAPI WMReader_Release(IWMReader *iface)
101 WMReader *This = impl_from_IWMReader(iface);
102 LONG ref = InterlockedDecrement(&This->ref);
104 TRACE("(%p) ref=%d\n", This, ref);
106 if(!ref)
107 heap_free(This);
109 return ref;
112 static HRESULT WINAPI WMReader_Open(IWMReader *iface, const WCHAR *url, IWMReaderCallback *callback, void *context)
114 WMReader *This = impl_from_IWMReader(iface);
115 FIXME("(%p)->(%s %p %p)\n", This, debugstr_w(url), callback, context);
116 return E_NOTIMPL;
119 static HRESULT WINAPI WMReader_Close(IWMReader *iface)
121 WMReader *This = impl_from_IWMReader(iface);
122 FIXME("(%p)\n", This);
123 return E_NOTIMPL;
126 static HRESULT WINAPI WMReader_GetOutputCount(IWMReader *iface, DWORD *outputs)
128 WMReader *This = impl_from_IWMReader(iface);
129 FIXME("(%p)->(%p)\n", This, outputs);
130 return E_NOTIMPL;
133 static HRESULT WINAPI WMReader_GetOutputProps(IWMReader *iface, DWORD output_num, IWMOutputMediaProps **output)
135 WMReader *This = impl_from_IWMReader(iface);
136 FIXME("(%p)->(%u %p)\n", This, output_num, output);
137 return E_NOTIMPL;
140 static HRESULT WINAPI WMReader_SetOutputProps(IWMReader *iface, DWORD output_num, IWMOutputMediaProps *output)
142 WMReader *This = impl_from_IWMReader(iface);
143 FIXME("(%p)->(%u %p)\n", This, output_num, output);
144 return E_NOTIMPL;
147 static HRESULT WINAPI WMReader_GetOutputFormatCount(IWMReader *iface, DWORD output_num, DWORD *formats)
149 WMReader *This = impl_from_IWMReader(iface);
150 FIXME("(%p)->(%u %p)\n", This, output_num, formats);
151 return E_NOTIMPL;
154 static HRESULT WINAPI WMReader_GetOutputFormat(IWMReader *iface, DWORD output_num, DWORD format_num, IWMOutputMediaProps **props)
156 WMReader *This = impl_from_IWMReader(iface);
157 FIXME("(%p)->(%u %u %p)\n", This, output_num, format_num, props);
158 return E_NOTIMPL;
161 static HRESULT WINAPI WMReader_Start(IWMReader *iface, QWORD start, QWORD duration, float rate, void *context)
163 WMReader *This = impl_from_IWMReader(iface);
164 FIXME("(%p)->(%s %s %f %p)\n", This, wine_dbgstr_longlong(start), wine_dbgstr_longlong(duration), rate, context);
165 return E_NOTIMPL;
168 static HRESULT WINAPI WMReader_Stop(IWMReader *iface)
170 WMReader *This = impl_from_IWMReader(iface);
171 FIXME("(%p)\n", This);
172 return E_NOTIMPL;
175 static HRESULT WINAPI WMReader_Pause(IWMReader *iface)
177 WMReader *This = impl_from_IWMReader(iface);
178 FIXME("(%p)\n", This);
179 return E_NOTIMPL;
182 static HRESULT WINAPI WMReader_Resume(IWMReader *iface)
184 WMReader *This = impl_from_IWMReader(iface);
185 FIXME("(%p)\n", This);
186 return E_NOTIMPL;
189 static const IWMReaderVtbl WMReaderVtbl = {
190 WMReader_QueryInterface,
191 WMReader_AddRef,
192 WMReader_Release,
193 WMReader_Open,
194 WMReader_Close,
195 WMReader_GetOutputCount,
196 WMReader_GetOutputProps,
197 WMReader_SetOutputProps,
198 WMReader_GetOutputFormatCount,
199 WMReader_GetOutputFormat,
200 WMReader_Start,
201 WMReader_Stop,
202 WMReader_Pause,
203 WMReader_Resume
206 HRESULT WINAPI WMCreateReader(IUnknown *reserved, DWORD rights, IWMReader **ret_reader)
208 WMReader *reader;
210 TRACE("(%p, %x, %p)\n", reserved, rights, ret_reader);
212 reader = heap_alloc(sizeof(*reader));
213 if(!reader)
214 return E_OUTOFMEMORY;
216 reader->IWMReader_iface.lpVtbl = &WMReaderVtbl;
217 reader->ref = 1;
219 *ret_reader = &reader->IWMReader_iface;
220 return E_NOTIMPL;
223 HRESULT WINAPI WMCreateSyncReader(IUnknown *pcert, DWORD rights, IWMSyncReader **syncreader)
225 FIXME("(%p, %x, %p): stub\n", pcert, rights, syncreader);
227 *syncreader = NULL;
229 return E_NOTIMPL;
232 typedef struct {
233 IWMProfileManager IWMProfileManager_iface;
234 LONG ref;
235 } WMProfileManager;
237 static inline WMProfileManager *impl_from_IWMProfileManager(IWMProfileManager *iface)
239 return CONTAINING_RECORD(iface, WMProfileManager, IWMProfileManager_iface);
242 static HRESULT WINAPI WMProfileManager_QueryInterface(IWMProfileManager *iface, REFIID riid, void **ppv)
244 WMProfileManager *This = impl_from_IWMProfileManager(iface);
246 if(IsEqualGUID(&IID_IUnknown, riid)) {
247 TRACE("(%p)->(IID_IUnknown %p)\n", This, ppv);
248 *ppv = &This->IWMProfileManager_iface;
249 }else if(IsEqualGUID(&IID_IWMProfileManager, riid)) {
250 TRACE("(%p)->(IID_IWMProfileManager %p)\n", This, ppv);
251 *ppv = &This->IWMProfileManager_iface;
252 }else {
253 *ppv = NULL;
254 return E_NOINTERFACE;
257 IUnknown_AddRef((IUnknown*)*ppv);
258 return S_OK;
261 static ULONG WINAPI WMProfileManager_AddRef(IWMProfileManager *iface)
263 WMProfileManager *This = impl_from_IWMProfileManager(iface);
264 LONG ref = InterlockedIncrement(&This->ref);
266 TRACE("(%p) ref=%d\n", This, ref);
268 return ref;
271 static ULONG WINAPI WMProfileManager_Release(IWMProfileManager *iface)
273 WMProfileManager *This = impl_from_IWMProfileManager(iface);
274 LONG ref = InterlockedDecrement(&This->ref);
276 TRACE("(%p) ref=%d\n", This, ref);
278 if(!ref)
279 heap_free(This);
281 return ref;
284 static HRESULT WINAPI WMProfileManager_CreateEmptyProfile(IWMProfileManager *iface, WMT_VERSION version, IWMProfile **ret)
286 WMProfileManager *This = impl_from_IWMProfileManager(iface);
287 FIXME("(%p)->(%x %p)\n", This, version, ret);
288 return E_NOTIMPL;
291 static HRESULT WINAPI WMProfileManager_LoadProfileByID(IWMProfileManager *iface, REFGUID guid, IWMProfile **ret)
293 WMProfileManager *This = impl_from_IWMProfileManager(iface);
294 FIXME("(%p)->(%s %p)\n", This, debugstr_guid(guid), ret);
295 return E_NOTIMPL;
298 static HRESULT WINAPI WMProfileManager_LoadProfileByData(IWMProfileManager *iface, const WCHAR *profile, IWMProfile **ret)
300 WMProfileManager *This = impl_from_IWMProfileManager(iface);
301 FIXME("(%p)->(%s %p)\n", This, debugstr_w(profile), ret);
302 return E_NOTIMPL;
305 static HRESULT WINAPI WMProfileManager_SaveProfile(IWMProfileManager *iface, IWMProfile *profile, WCHAR *profile_str, DWORD *len)
307 WMProfileManager *This = impl_from_IWMProfileManager(iface);
308 FIXME("(%p)->(%p %p %p)\n", This, profile, profile_str, len);
309 return E_NOTIMPL;
312 static HRESULT WINAPI WMProfileManager_GetSystemProfileCount(IWMProfileManager *iface, DWORD *ret)
314 WMProfileManager *This = impl_from_IWMProfileManager(iface);
315 FIXME("(%p)->(%p)\n", This, ret);
316 return E_NOTIMPL;
319 static HRESULT WINAPI WMProfileManager_LoadSystemProfile(IWMProfileManager *iface, DWORD index, IWMProfile **ret)
321 WMProfileManager *This = impl_from_IWMProfileManager(iface);
322 FIXME("(%p)->(%d %p)\n", This, index, ret);
323 return E_NOTIMPL;
326 static const IWMProfileManagerVtbl WMProfileManagerVtbl = {
327 WMProfileManager_QueryInterface,
328 WMProfileManager_AddRef,
329 WMProfileManager_Release,
330 WMProfileManager_CreateEmptyProfile,
331 WMProfileManager_LoadProfileByID,
332 WMProfileManager_LoadProfileByData,
333 WMProfileManager_SaveProfile,
334 WMProfileManager_GetSystemProfileCount,
335 WMProfileManager_LoadSystemProfile
338 HRESULT WINAPI WMCreateProfileManager(IWMProfileManager **ret)
340 WMProfileManager *profile_mgr;
342 TRACE("(%p)\n", ret);
344 profile_mgr = heap_alloc(sizeof(*profile_mgr));
345 if(!profile_mgr)
346 return E_OUTOFMEMORY;
348 profile_mgr->IWMProfileManager_iface.lpVtbl = &WMProfileManagerVtbl;
349 profile_mgr->ref = 1;
351 *ret = &profile_mgr->IWMProfileManager_iface;
352 return S_OK;