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"
24 #include "wine/heap.h"
26 WINE_DEFAULT_DEBUG_CHANNEL(wmvcore
);
28 HRESULT WINAPI
winegstreamer_create_wm_async_reader(IWMReader
**reader
);
29 HRESULT WINAPI
winegstreamer_create_wm_sync_reader(IWMSyncReader
**reader
);
31 HRESULT WINAPI
WMCreateReader(IUnknown
*reserved
, DWORD rights
, IWMReader
**reader
)
33 TRACE("reserved %p, rights %#lx, reader %p.\n", reserved
, rights
, reader
);
35 return winegstreamer_create_wm_async_reader(reader
);
38 HRESULT WINAPI
WMCreateReaderPriv(IWMReader
**reader
)
40 TRACE("reader %p.\n", reader
);
42 return winegstreamer_create_wm_async_reader(reader
);
45 HRESULT WINAPI
WMCreateSyncReader(IUnknown
*reserved
, DWORD rights
, IWMSyncReader
**reader
)
47 TRACE("reserved %p, rights %#lx, reader %p.\n", reserved
, rights
, reader
);
49 return winegstreamer_create_wm_sync_reader(reader
);
52 HRESULT WINAPI
WMCreateSyncReaderPriv(IWMSyncReader
**reader
)
54 TRACE("reader %p.\n", reader
);
56 return winegstreamer_create_wm_sync_reader(reader
);
59 HRESULT WINAPI
WMCheckURLExtension(const WCHAR
*url
)
61 FIXME("(%s): stub\n", wine_dbgstr_w(url
));
66 return NS_E_INVALID_NAME
;
69 HRESULT WINAPI
WMCheckURLScheme(const WCHAR
*scheme
)
71 FIXME("(%s): stub\n", wine_dbgstr_w(scheme
));
73 return NS_E_INVALID_NAME
;
76 HRESULT WINAPI
WMCreateEditor(IWMMetadataEditor
**editor
)
78 FIXME("(%p): stub\n", editor
);
85 HRESULT WINAPI
WMCreateBackupRestorer(IUnknown
*callback
, IWMLicenseBackup
**licBackup
)
87 FIXME("(%p %p): stub\n", callback
, licBackup
);
97 HRESULT WINAPI
WMIsContentProtected(const WCHAR
*filename
, BOOL
*protected)
99 FIXME("(%s %p): semi-stub\n", wine_dbgstr_w(filename
), protected);
101 if (!filename
|| !protected)
110 IWMProfileManager2 IWMProfileManager2_iface
;
114 static inline WMProfileManager
*impl_from_IWMProfileManager2(IWMProfileManager2
*iface
)
116 return CONTAINING_RECORD(iface
, WMProfileManager
, IWMProfileManager2_iface
);
119 static HRESULT WINAPI
WMProfileManager_QueryInterface(IWMProfileManager2
*iface
, REFIID riid
, void **ppv
)
121 WMProfileManager
*This
= impl_from_IWMProfileManager2(iface
);
123 if(IsEqualGUID(&IID_IUnknown
, riid
)) {
124 TRACE("(%p)->(IID_IUnknown %p)\n", This
, ppv
);
125 *ppv
= &This
->IWMProfileManager2_iface
;
126 }else if(IsEqualGUID(&IID_IWMProfileManager
, riid
)) {
127 TRACE("(%p)->(IID_IWMProfileManager %p)\n", This
, ppv
);
128 *ppv
= &This
->IWMProfileManager2_iface
;
129 }else if(IsEqualGUID(&IID_IWMProfileManager2
, riid
)) {
130 TRACE("(%p)->(IID_IWMProfileManager2 %p)\n", This
, ppv
);
131 *ppv
= &This
->IWMProfileManager2_iface
;
133 FIXME("Unsupported iface %s\n", debugstr_guid(riid
));
135 return E_NOINTERFACE
;
138 IUnknown_AddRef((IUnknown
*)*ppv
);
142 static ULONG WINAPI
WMProfileManager_AddRef(IWMProfileManager2
*iface
)
144 WMProfileManager
*This
= impl_from_IWMProfileManager2(iface
);
145 LONG ref
= InterlockedIncrement(&This
->ref
);
147 TRACE("(%p) ref=%ld\n", This
, ref
);
152 static ULONG WINAPI
WMProfileManager_Release(IWMProfileManager2
*iface
)
154 WMProfileManager
*This
= impl_from_IWMProfileManager2(iface
);
155 LONG ref
= InterlockedDecrement(&This
->ref
);
157 TRACE("(%p) ref=%ld\n", This
, ref
);
165 static HRESULT WINAPI
WMProfileManager_CreateEmptyProfile(IWMProfileManager2
*iface
, WMT_VERSION version
, IWMProfile
**ret
)
167 WMProfileManager
*This
= impl_from_IWMProfileManager2(iface
);
168 FIXME("(%p)->(%x %p)\n", This
, version
, ret
);
172 static HRESULT WINAPI
WMProfileManager_LoadProfileByID(IWMProfileManager2
*iface
, REFGUID guid
, IWMProfile
**ret
)
174 WMProfileManager
*This
= impl_from_IWMProfileManager2(iface
);
175 FIXME("(%p)->(%s %p)\n", This
, debugstr_guid(guid
), ret
);
179 static HRESULT WINAPI
WMProfileManager_LoadProfileByData(IWMProfileManager2
*iface
, const WCHAR
*profile
, IWMProfile
**ret
)
181 WMProfileManager
*This
= impl_from_IWMProfileManager2(iface
);
182 FIXME("(%p)->(%s %p)\n", This
, debugstr_w(profile
), ret
);
186 static HRESULT WINAPI
WMProfileManager_SaveProfile(IWMProfileManager2
*iface
, IWMProfile
*profile
, WCHAR
*profile_str
, DWORD
*len
)
188 WMProfileManager
*This
= impl_from_IWMProfileManager2(iface
);
189 FIXME("(%p)->(%p %p %p)\n", This
, profile
, profile_str
, len
);
193 static HRESULT WINAPI
WMProfileManager_GetSystemProfileCount(IWMProfileManager2
*iface
, DWORD
*ret
)
195 WMProfileManager
*This
= impl_from_IWMProfileManager2(iface
);
196 FIXME("(%p)->(%p)\n", This
, ret
);
200 static HRESULT WINAPI
WMProfileManager_LoadSystemProfile(IWMProfileManager2
*iface
, DWORD index
, IWMProfile
**ret
)
202 WMProfileManager
*This
= impl_from_IWMProfileManager2(iface
);
203 FIXME("(%p)->(%ld %p)\n", This
, index
, ret
);
207 static HRESULT WINAPI
WMProfileManager2_GetSystemProfileVersion(IWMProfileManager2
*iface
, WMT_VERSION
*version
)
209 WMProfileManager
*This
= impl_from_IWMProfileManager2(iface
);
210 FIXME("(%p)->(%p)\n", This
, version
);
214 static HRESULT WINAPI
WMProfileManager2_SetSystemProfileVersion(IWMProfileManager2
*iface
, WMT_VERSION version
)
216 WMProfileManager
*This
= impl_from_IWMProfileManager2(iface
);
217 FIXME("(%p)->(%x)\n", This
, version
);
221 static const IWMProfileManager2Vtbl WMProfileManager2Vtbl
= {
222 WMProfileManager_QueryInterface
,
223 WMProfileManager_AddRef
,
224 WMProfileManager_Release
,
225 WMProfileManager_CreateEmptyProfile
,
226 WMProfileManager_LoadProfileByID
,
227 WMProfileManager_LoadProfileByData
,
228 WMProfileManager_SaveProfile
,
229 WMProfileManager_GetSystemProfileCount
,
230 WMProfileManager_LoadSystemProfile
,
231 WMProfileManager2_GetSystemProfileVersion
,
232 WMProfileManager2_SetSystemProfileVersion
235 HRESULT WINAPI
WMCreateProfileManager(IWMProfileManager
**ret
)
237 WMProfileManager
*profile_mgr
;
239 TRACE("(%p)\n", ret
);
241 profile_mgr
= heap_alloc(sizeof(*profile_mgr
));
243 return E_OUTOFMEMORY
;
245 profile_mgr
->IWMProfileManager2_iface
.lpVtbl
= &WMProfileManager2Vtbl
;
246 profile_mgr
->ref
= 1;
248 *ret
= (IWMProfileManager
*)&profile_mgr
->IWMProfileManager2_iface
;