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
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
);
49 case DLL_WINE_PREATTACH
:
50 return FALSE
; /* prefer native version */
51 case DLL_PROCESS_ATTACH
:
52 DisableThreadLibraryCalls(hinstDLL
);
59 HRESULT WINAPI
DllRegisterServer(void)
66 HRESULT WINAPI
WMCreateEditor(IWMMetadataEditor
**editor
)
68 FIXME("(%p): stub\n", editor
);
75 HRESULT WINAPI
WMCreateReader(IUnknown
*reserved
, DWORD rights
, IWMReader
**reader
)
77 FIXME("(%p, %x, %p): stub\n", reserved
, rights
, reader
);
84 HRESULT WINAPI
WMCreateSyncReader(IUnknown
*pcert
, DWORD rights
, IWMSyncReader
**syncreader
)
86 FIXME("(%p, %x, %p): stub\n", pcert
, rights
, syncreader
);
94 IWMProfileManager IWMProfileManager_iface
;
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
;
115 return E_NOINTERFACE
;
118 IUnknown_AddRef((IUnknown
*)*ppv
);
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
);
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
);
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
);
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
);
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
);
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
);
173 static HRESULT WINAPI
WMProfileManager_GetSystemProfileCount(IWMProfileManager
*iface
, DWORD
*ret
)
175 WMProfileManager
*This
= impl_from_IWMProfileManager(iface
);
176 FIXME("(%p)->(%p)\n", This
, ret
);
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
);
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
));
207 return E_OUTOFMEMORY
;
209 profile_mgr
->IWMProfileManager_iface
.lpVtbl
= &WMProfileManagerVtbl
;
210 profile_mgr
->ref
= 1;
212 *ret
= &profile_mgr
->IWMProfileManager_iface
;