makedep: Add dependency for ttf font files when necessary.
[wine.git] / dlls / wmvcore / wmvcore_main.c
blob5903bf822eb8c0883c1da3dfceec9c2faca8c5ca
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 "config.h"
21 #include <stdarg.h>
23 #define COBJMACROS
25 #include "windef.h"
26 #include "winbase.h"
27 #include "initguid.h"
28 #include "wmsdkidl.h"
29 #include "wine/debug.h"
31 WINE_DEFAULT_DEBUG_CHANNEL(wmvcore);
33 static inline void *heap_alloc(size_t len)
35 return HeapAlloc(GetProcessHeap(), 0, len);
38 static inline BOOL heap_free(void *mem)
40 return HeapFree(GetProcessHeap(), 0, mem);
43 BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved)
45 TRACE("(0x%p, %d, %p)\n", hinstDLL, fdwReason, lpvReserved);
47 switch (fdwReason)
49 case DLL_WINE_PREATTACH:
50 return FALSE; /* prefer native version */
51 case DLL_PROCESS_ATTACH:
52 DisableThreadLibraryCalls(hinstDLL);
53 break;
56 return TRUE;
59 HRESULT WINAPI DllRegisterServer(void)
61 FIXME("(): stub\n");
63 return S_OK;
66 HRESULT WINAPI WMCreateEditor(IWMMetadataEditor **editor)
68 FIXME("(%p): stub\n", editor);
70 *editor = NULL;
72 return E_NOTIMPL;
75 HRESULT WINAPI WMCreateReader(IUnknown *reserved, DWORD rights, IWMReader **reader)
77 FIXME("(%p, %x, %p): stub\n", reserved, rights, reader);
79 *reader = NULL;
81 return E_NOTIMPL;
84 HRESULT WINAPI WMCreateSyncReader(IUnknown *pcert, DWORD rights, IWMSyncReader **syncreader)
86 FIXME("(%p, %x, %p): stub\n", pcert, rights, syncreader);
88 *syncreader = NULL;
90 return E_NOTIMPL;
93 typedef struct {
94 IWMProfileManager IWMProfileManager_iface;
95 LONG ref;
96 } WMProfileManager;
98 static inline WMProfileManager *impl_from_IWMProfileManager(IWMProfileManager *iface)
100 return CONTAINING_RECORD(iface, WMProfileManager, IWMProfileManager_iface);
103 static HRESULT WINAPI WMProfileManager_QueryInterface(IWMProfileManager *iface, REFIID riid, void **ppv)
105 WMProfileManager *This = impl_from_IWMProfileManager(iface);
107 if(IsEqualGUID(&IID_IUnknown, riid)) {
108 TRACE("(%p)->(IID_IUnknown %p)\n", This, ppv);
109 *ppv = &This->IWMProfileManager_iface;
110 }else if(IsEqualGUID(&IID_IWMProfileManager, riid)) {
111 TRACE("(%p)->(IID_IWMProfileManager %p)\n", This, ppv);
112 *ppv = &This->IWMProfileManager_iface;
113 }else {
114 *ppv = NULL;
115 return E_NOINTERFACE;
118 IUnknown_AddRef((IUnknown*)*ppv);
119 return S_OK;
122 static ULONG WINAPI WMProfileManager_AddRef(IWMProfileManager *iface)
124 WMProfileManager *This = impl_from_IWMProfileManager(iface);
125 LONG ref = InterlockedIncrement(&This->ref);
127 TRACE("(%p) ref=%d\n", This, ref);
129 return ref;
132 static ULONG WINAPI WMProfileManager_Release(IWMProfileManager *iface)
134 WMProfileManager *This = impl_from_IWMProfileManager(iface);
135 LONG ref = InterlockedDecrement(&This->ref);
137 TRACE("(%p) ref=%d\n", This, ref);
139 if(!ref)
140 heap_free(This);
142 return ref;
145 static HRESULT WINAPI WMProfileManager_CreateEmptyProfile(IWMProfileManager *iface, WMT_VERSION version, IWMProfile **ret)
147 WMProfileManager *This = impl_from_IWMProfileManager(iface);
148 FIXME("(%p)->(%x %p)\n", This, version, ret);
149 return E_NOTIMPL;
152 static HRESULT WINAPI WMProfileManager_LoadProfileByID(IWMProfileManager *iface, REFGUID guid, IWMProfile **ret)
154 WMProfileManager *This = impl_from_IWMProfileManager(iface);
155 FIXME("(%p)->(%s %p)\n", This, debugstr_guid(guid), ret);
156 return E_NOTIMPL;
159 static HRESULT WINAPI WMProfileManager_LoadProfileByData(IWMProfileManager *iface, const WCHAR *profile, IWMProfile **ret)
161 WMProfileManager *This = impl_from_IWMProfileManager(iface);
162 FIXME("(%p)->(%s %p)\n", This, debugstr_w(profile), ret);
163 return E_NOTIMPL;
166 static HRESULT WINAPI WMProfileManager_SaveProfile(IWMProfileManager *iface, IWMProfile *profile, WCHAR *profile_str, DWORD *len)
168 WMProfileManager *This = impl_from_IWMProfileManager(iface);
169 FIXME("(%p)->(%p %p %p)\n", This, profile, profile_str, len);
170 return E_NOTIMPL;
173 static HRESULT WINAPI WMProfileManager_GetSystemProfileCount(IWMProfileManager *iface, DWORD *ret)
175 WMProfileManager *This = impl_from_IWMProfileManager(iface);
176 FIXME("(%p)->(%p)\n", This, ret);
177 return E_NOTIMPL;
180 static HRESULT WINAPI WMProfileManager_LoadSystemProfile(IWMProfileManager *iface, DWORD index, IWMProfile **ret)
182 WMProfileManager *This = impl_from_IWMProfileManager(iface);
183 FIXME("(%p)->(%d %p)\n", This, index, ret);
184 return E_NOTIMPL;
187 static const IWMProfileManagerVtbl WMProfileManagerVtbl = {
188 WMProfileManager_QueryInterface,
189 WMProfileManager_AddRef,
190 WMProfileManager_Release,
191 WMProfileManager_CreateEmptyProfile,
192 WMProfileManager_LoadProfileByID,
193 WMProfileManager_LoadProfileByData,
194 WMProfileManager_SaveProfile,
195 WMProfileManager_GetSystemProfileCount,
196 WMProfileManager_LoadSystemProfile
199 HRESULT WINAPI WMCreateProfileManager(IWMProfileManager **ret)
201 WMProfileManager *profile_mgr;
203 TRACE("(%p)\n", ret);
205 profile_mgr = heap_alloc(sizeof(*profile_mgr));
206 if(!profile_mgr)
207 return E_OUTOFMEMORY;
209 profile_mgr->IWMProfileManager_iface.lpVtbl = &WMProfileManagerVtbl;
210 profile_mgr->ref = 1;
212 *ret = &profile_mgr->IWMProfileManager_iface;
213 return S_OK;