msctf: Maintain context reference in ranges.
[wine.git] / dlls / wmvcore / wmvcore_main.c
blob5f93fc68e3b56e4a4105ed94203fc57d2a063b11
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 WMCheckURLExtension(const WCHAR *url)
30 FIXME("(%s): stub\n", wine_dbgstr_w(url));
32 if (!url)
33 return E_INVALIDARG;
35 return NS_E_INVALID_NAME;
38 HRESULT WINAPI WMCheckURLScheme(const WCHAR *scheme)
40 FIXME("(%s): stub\n", wine_dbgstr_w(scheme));
42 return NS_E_INVALID_NAME;
45 HRESULT WINAPI WMCreateEditor(IWMMetadataEditor **editor)
47 FIXME("(%p): stub\n", editor);
49 *editor = NULL;
51 return E_NOTIMPL;
54 HRESULT WINAPI WMCreateBackupRestorer(IUnknown *callback, IWMLicenseBackup **licBackup)
56 FIXME("(%p %p): stub\n", callback, licBackup);
58 if (!callback)
59 return E_INVALIDARG;
61 *licBackup = NULL;
63 return E_NOTIMPL;
66 HRESULT WINAPI WMIsContentProtected(const WCHAR *filename, BOOL *protected)
68 FIXME("(%s %p): semi-stub\n", wine_dbgstr_w(filename), protected);
70 if (!filename || !protected)
71 return E_INVALIDARG;
73 *protected = FALSE;
75 return S_FALSE;
78 typedef struct {
79 IWMProfileManager2 IWMProfileManager2_iface;
80 LONG ref;
81 } WMProfileManager;
83 static inline WMProfileManager *impl_from_IWMProfileManager2(IWMProfileManager2 *iface)
85 return CONTAINING_RECORD(iface, WMProfileManager, IWMProfileManager2_iface);
88 static HRESULT WINAPI WMProfileManager_QueryInterface(IWMProfileManager2 *iface, REFIID riid, void **ppv)
90 WMProfileManager *This = impl_from_IWMProfileManager2(iface);
92 if(IsEqualGUID(&IID_IUnknown, riid)) {
93 TRACE("(%p)->(IID_IUnknown %p)\n", This, ppv);
94 *ppv = &This->IWMProfileManager2_iface;
95 }else if(IsEqualGUID(&IID_IWMProfileManager, riid)) {
96 TRACE("(%p)->(IID_IWMProfileManager %p)\n", This, ppv);
97 *ppv = &This->IWMProfileManager2_iface;
98 }else if(IsEqualGUID(&IID_IWMProfileManager2, riid)) {
99 TRACE("(%p)->(IID_IWMProfileManager2 %p)\n", This, ppv);
100 *ppv = &This->IWMProfileManager2_iface;
101 }else {
102 FIXME("Unsupported iface %s\n", debugstr_guid(riid));
103 *ppv = NULL;
104 return E_NOINTERFACE;
107 IUnknown_AddRef((IUnknown*)*ppv);
108 return S_OK;
111 static ULONG WINAPI WMProfileManager_AddRef(IWMProfileManager2 *iface)
113 WMProfileManager *This = impl_from_IWMProfileManager2(iface);
114 LONG ref = InterlockedIncrement(&This->ref);
116 TRACE("(%p) ref=%d\n", This, ref);
118 return ref;
121 static ULONG WINAPI WMProfileManager_Release(IWMProfileManager2 *iface)
123 WMProfileManager *This = impl_from_IWMProfileManager2(iface);
124 LONG ref = InterlockedDecrement(&This->ref);
126 TRACE("(%p) ref=%d\n", This, ref);
128 if(!ref)
129 heap_free(This);
131 return ref;
134 static HRESULT WINAPI WMProfileManager_CreateEmptyProfile(IWMProfileManager2 *iface, WMT_VERSION version, IWMProfile **ret)
136 WMProfileManager *This = impl_from_IWMProfileManager2(iface);
137 FIXME("(%p)->(%x %p)\n", This, version, ret);
138 return E_NOTIMPL;
141 static HRESULT WINAPI WMProfileManager_LoadProfileByID(IWMProfileManager2 *iface, REFGUID guid, IWMProfile **ret)
143 WMProfileManager *This = impl_from_IWMProfileManager2(iface);
144 FIXME("(%p)->(%s %p)\n", This, debugstr_guid(guid), ret);
145 return E_NOTIMPL;
148 static HRESULT WINAPI WMProfileManager_LoadProfileByData(IWMProfileManager2 *iface, const WCHAR *profile, IWMProfile **ret)
150 WMProfileManager *This = impl_from_IWMProfileManager2(iface);
151 FIXME("(%p)->(%s %p)\n", This, debugstr_w(profile), ret);
152 return E_NOTIMPL;
155 static HRESULT WINAPI WMProfileManager_SaveProfile(IWMProfileManager2 *iface, IWMProfile *profile, WCHAR *profile_str, DWORD *len)
157 WMProfileManager *This = impl_from_IWMProfileManager2(iface);
158 FIXME("(%p)->(%p %p %p)\n", This, profile, profile_str, len);
159 return E_NOTIMPL;
162 static HRESULT WINAPI WMProfileManager_GetSystemProfileCount(IWMProfileManager2 *iface, DWORD *ret)
164 WMProfileManager *This = impl_from_IWMProfileManager2(iface);
165 FIXME("(%p)->(%p)\n", This, ret);
166 return E_NOTIMPL;
169 static HRESULT WINAPI WMProfileManager_LoadSystemProfile(IWMProfileManager2 *iface, DWORD index, IWMProfile **ret)
171 WMProfileManager *This = impl_from_IWMProfileManager2(iface);
172 FIXME("(%p)->(%d %p)\n", This, index, ret);
173 return E_NOTIMPL;
176 static HRESULT WINAPI WMProfileManager2_GetSystemProfileVersion(IWMProfileManager2 *iface, WMT_VERSION *version)
178 WMProfileManager *This = impl_from_IWMProfileManager2(iface);
179 FIXME("(%p)->(%p)\n", This, version);
180 return E_NOTIMPL;
183 static HRESULT WINAPI WMProfileManager2_SetSystemProfileVersion(IWMProfileManager2 *iface, WMT_VERSION version)
185 WMProfileManager *This = impl_from_IWMProfileManager2(iface);
186 FIXME("(%p)->(%x)\n", This, version);
187 return E_NOTIMPL;
190 static const IWMProfileManager2Vtbl WMProfileManager2Vtbl = {
191 WMProfileManager_QueryInterface,
192 WMProfileManager_AddRef,
193 WMProfileManager_Release,
194 WMProfileManager_CreateEmptyProfile,
195 WMProfileManager_LoadProfileByID,
196 WMProfileManager_LoadProfileByData,
197 WMProfileManager_SaveProfile,
198 WMProfileManager_GetSystemProfileCount,
199 WMProfileManager_LoadSystemProfile,
200 WMProfileManager2_GetSystemProfileVersion,
201 WMProfileManager2_SetSystemProfileVersion
204 HRESULT WINAPI WMCreateProfileManager(IWMProfileManager **ret)
206 WMProfileManager *profile_mgr;
208 TRACE("(%p)\n", ret);
210 profile_mgr = heap_alloc(sizeof(*profile_mgr));
211 if(!profile_mgr)
212 return E_OUTOFMEMORY;
214 profile_mgr->IWMProfileManager2_iface.lpVtbl = &WMProfileManager2Vtbl;
215 profile_mgr->ref = 1;
217 *ret = (IWMProfileManager *)&profile_mgr->IWMProfileManager2_iface;
218 return S_OK;