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
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
);
33 case DLL_WINE_PREATTACH
:
34 return FALSE
; /* prefer native version */
35 case DLL_PROCESS_ATTACH
:
36 DisableThreadLibraryCalls(hinstDLL
);
43 HRESULT WINAPI
DllRegisterServer(void)
50 HRESULT WINAPI
WMCreateEditor(IWMMetadataEditor
**editor
)
52 FIXME("(%p): stub\n", editor
);
60 IWMReader IWMReader_iface
;
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
;
81 FIXME("(%p)->(%s %p)\n", This
, debugstr_guid(riid
), ppv
);
85 IUnknown_AddRef((IUnknown
*)*ppv
);
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
);
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
);
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
);
119 static HRESULT WINAPI
WMReader_Close(IWMReader
*iface
)
121 WMReader
*This
= impl_from_IWMReader(iface
);
122 FIXME("(%p)\n", This
);
126 static HRESULT WINAPI
WMReader_GetOutputCount(IWMReader
*iface
, DWORD
*outputs
)
128 WMReader
*This
= impl_from_IWMReader(iface
);
129 FIXME("(%p)->(%p)\n", This
, outputs
);
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
);
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
);
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
);
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
);
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
);
168 static HRESULT WINAPI
WMReader_Stop(IWMReader
*iface
)
170 WMReader
*This
= impl_from_IWMReader(iface
);
171 FIXME("(%p)\n", This
);
175 static HRESULT WINAPI
WMReader_Pause(IWMReader
*iface
)
177 WMReader
*This
= impl_from_IWMReader(iface
);
178 FIXME("(%p)\n", This
);
182 static HRESULT WINAPI
WMReader_Resume(IWMReader
*iface
)
184 WMReader
*This
= impl_from_IWMReader(iface
);
185 FIXME("(%p)\n", This
);
189 static const IWMReaderVtbl WMReaderVtbl
= {
190 WMReader_QueryInterface
,
195 WMReader_GetOutputCount
,
196 WMReader_GetOutputProps
,
197 WMReader_SetOutputProps
,
198 WMReader_GetOutputFormatCount
,
199 WMReader_GetOutputFormat
,
206 HRESULT WINAPI
WMCreateReader(IUnknown
*reserved
, DWORD rights
, IWMReader
**ret_reader
)
210 TRACE("(%p, %x, %p)\n", reserved
, rights
, ret_reader
);
212 reader
= heap_alloc(sizeof(*reader
));
214 return E_OUTOFMEMORY
;
216 reader
->IWMReader_iface
.lpVtbl
= &WMReaderVtbl
;
219 *ret_reader
= &reader
->IWMReader_iface
;
223 HRESULT WINAPI
WMCreateSyncReader(IUnknown
*pcert
, DWORD rights
, IWMSyncReader
**syncreader
)
225 FIXME("(%p, %x, %p): stub\n", pcert
, rights
, syncreader
);
233 IWMProfileManager IWMProfileManager_iface
;
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
;
254 return E_NOINTERFACE
;
257 IUnknown_AddRef((IUnknown
*)*ppv
);
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
);
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
);
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
);
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
);
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
);
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
);
312 static HRESULT WINAPI
WMProfileManager_GetSystemProfileCount(IWMProfileManager
*iface
, DWORD
*ret
)
314 WMProfileManager
*This
= impl_from_IWMProfileManager(iface
);
315 FIXME("(%p)->(%p)\n", This
, ret
);
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
);
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
));
346 return E_OUTOFMEMORY
;
348 profile_mgr
->IWMProfileManager_iface
.lpVtbl
= &WMProfileManagerVtbl
;
349 profile_mgr
->ref
= 1;
351 *ret
= &profile_mgr
->IWMProfileManager_iface
;