wmvcore: Upgrade to IWMProfileManager2.

Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=28847
Signed-off-by: Gijs Vermeulen <gijsvrm@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Gijs Vermeulen 2019-03-10 14:04:48 +01:00 committed by Alexandre Julliard
parent 2f622ac50a
commit 3106cef400
1 changed files with 46 additions and 27 deletions

View File

@ -87,25 +87,28 @@ HRESULT WINAPI WMCreateBackupRestorer(IUnknown *callback, IWMLicenseBackup **lic
}
typedef struct {
IWMProfileManager IWMProfileManager_iface;
IWMProfileManager2 IWMProfileManager2_iface;
LONG ref;
} WMProfileManager;
static inline WMProfileManager *impl_from_IWMProfileManager(IWMProfileManager *iface)
static inline WMProfileManager *impl_from_IWMProfileManager2(IWMProfileManager2 *iface)
{
return CONTAINING_RECORD(iface, WMProfileManager, IWMProfileManager_iface);
return CONTAINING_RECORD(iface, WMProfileManager, IWMProfileManager2_iface);
}
static HRESULT WINAPI WMProfileManager_QueryInterface(IWMProfileManager *iface, REFIID riid, void **ppv)
static HRESULT WINAPI WMProfileManager_QueryInterface(IWMProfileManager2 *iface, REFIID riid, void **ppv)
{
WMProfileManager *This = impl_from_IWMProfileManager(iface);
WMProfileManager *This = impl_from_IWMProfileManager2(iface);
if(IsEqualGUID(&IID_IUnknown, riid)) {
TRACE("(%p)->(IID_IUnknown %p)\n", This, ppv);
*ppv = &This->IWMProfileManager_iface;
*ppv = &This->IWMProfileManager2_iface;
}else if(IsEqualGUID(&IID_IWMProfileManager, riid)) {
TRACE("(%p)->(IID_IWMProfileManager %p)\n", This, ppv);
*ppv = &This->IWMProfileManager_iface;
*ppv = &This->IWMProfileManager2_iface;
}else if(IsEqualGUID(&IID_IWMProfileManager2, riid)) {
TRACE("(%p)->(IID_IWMProfileManager2 %p)\n", This, ppv);
*ppv = &This->IWMProfileManager2_iface;
}else {
FIXME("Unsupported iface %s\n", debugstr_guid(riid));
*ppv = NULL;
@ -116,9 +119,9 @@ static HRESULT WINAPI WMProfileManager_QueryInterface(IWMProfileManager *iface,
return S_OK;
}
static ULONG WINAPI WMProfileManager_AddRef(IWMProfileManager *iface)
static ULONG WINAPI WMProfileManager_AddRef(IWMProfileManager2 *iface)
{
WMProfileManager *This = impl_from_IWMProfileManager(iface);
WMProfileManager *This = impl_from_IWMProfileManager2(iface);
LONG ref = InterlockedIncrement(&This->ref);
TRACE("(%p) ref=%d\n", This, ref);
@ -126,9 +129,9 @@ static ULONG WINAPI WMProfileManager_AddRef(IWMProfileManager *iface)
return ref;
}
static ULONG WINAPI WMProfileManager_Release(IWMProfileManager *iface)
static ULONG WINAPI WMProfileManager_Release(IWMProfileManager2 *iface)
{
WMProfileManager *This = impl_from_IWMProfileManager(iface);
WMProfileManager *This = impl_from_IWMProfileManager2(iface);
LONG ref = InterlockedDecrement(&This->ref);
TRACE("(%p) ref=%d\n", This, ref);
@ -139,49 +142,63 @@ static ULONG WINAPI WMProfileManager_Release(IWMProfileManager *iface)
return ref;
}
static HRESULT WINAPI WMProfileManager_CreateEmptyProfile(IWMProfileManager *iface, WMT_VERSION version, IWMProfile **ret)
static HRESULT WINAPI WMProfileManager_CreateEmptyProfile(IWMProfileManager2 *iface, WMT_VERSION version, IWMProfile **ret)
{
WMProfileManager *This = impl_from_IWMProfileManager(iface);
WMProfileManager *This = impl_from_IWMProfileManager2(iface);
FIXME("(%p)->(%x %p)\n", This, version, ret);
return E_NOTIMPL;
}
static HRESULT WINAPI WMProfileManager_LoadProfileByID(IWMProfileManager *iface, REFGUID guid, IWMProfile **ret)
static HRESULT WINAPI WMProfileManager_LoadProfileByID(IWMProfileManager2 *iface, REFGUID guid, IWMProfile **ret)
{
WMProfileManager *This = impl_from_IWMProfileManager(iface);
WMProfileManager *This = impl_from_IWMProfileManager2(iface);
FIXME("(%p)->(%s %p)\n", This, debugstr_guid(guid), ret);
return E_NOTIMPL;
}
static HRESULT WINAPI WMProfileManager_LoadProfileByData(IWMProfileManager *iface, const WCHAR *profile, IWMProfile **ret)
static HRESULT WINAPI WMProfileManager_LoadProfileByData(IWMProfileManager2 *iface, const WCHAR *profile, IWMProfile **ret)
{
WMProfileManager *This = impl_from_IWMProfileManager(iface);
WMProfileManager *This = impl_from_IWMProfileManager2(iface);
FIXME("(%p)->(%s %p)\n", This, debugstr_w(profile), ret);
return E_NOTIMPL;
}
static HRESULT WINAPI WMProfileManager_SaveProfile(IWMProfileManager *iface, IWMProfile *profile, WCHAR *profile_str, DWORD *len)
static HRESULT WINAPI WMProfileManager_SaveProfile(IWMProfileManager2 *iface, IWMProfile *profile, WCHAR *profile_str, DWORD *len)
{
WMProfileManager *This = impl_from_IWMProfileManager(iface);
WMProfileManager *This = impl_from_IWMProfileManager2(iface);
FIXME("(%p)->(%p %p %p)\n", This, profile, profile_str, len);
return E_NOTIMPL;
}
static HRESULT WINAPI WMProfileManager_GetSystemProfileCount(IWMProfileManager *iface, DWORD *ret)
static HRESULT WINAPI WMProfileManager_GetSystemProfileCount(IWMProfileManager2 *iface, DWORD *ret)
{
WMProfileManager *This = impl_from_IWMProfileManager(iface);
WMProfileManager *This = impl_from_IWMProfileManager2(iface);
FIXME("(%p)->(%p)\n", This, ret);
return E_NOTIMPL;
}
static HRESULT WINAPI WMProfileManager_LoadSystemProfile(IWMProfileManager *iface, DWORD index, IWMProfile **ret)
static HRESULT WINAPI WMProfileManager_LoadSystemProfile(IWMProfileManager2 *iface, DWORD index, IWMProfile **ret)
{
WMProfileManager *This = impl_from_IWMProfileManager(iface);
WMProfileManager *This = impl_from_IWMProfileManager2(iface);
FIXME("(%p)->(%d %p)\n", This, index, ret);
return E_NOTIMPL;
}
static const IWMProfileManagerVtbl WMProfileManagerVtbl = {
static HRESULT WINAPI WMProfileManager2_GetSystemProfileVersion(IWMProfileManager2 *iface, WMT_VERSION *version)
{
WMProfileManager *This = impl_from_IWMProfileManager2(iface);
FIXME("(%p)->(%p)\n", This, version);
return E_NOTIMPL;
}
static HRESULT WINAPI WMProfileManager2_SetSystemProfileVersion(IWMProfileManager2 *iface, WMT_VERSION version)
{
WMProfileManager *This = impl_from_IWMProfileManager2(iface);
FIXME("(%p)->(%x)\n", This, version);
return E_NOTIMPL;
}
static const IWMProfileManager2Vtbl WMProfileManager2Vtbl = {
WMProfileManager_QueryInterface,
WMProfileManager_AddRef,
WMProfileManager_Release,
@ -190,7 +207,9 @@ static const IWMProfileManagerVtbl WMProfileManagerVtbl = {
WMProfileManager_LoadProfileByData,
WMProfileManager_SaveProfile,
WMProfileManager_GetSystemProfileCount,
WMProfileManager_LoadSystemProfile
WMProfileManager_LoadSystemProfile,
WMProfileManager2_GetSystemProfileVersion,
WMProfileManager2_SetSystemProfileVersion
};
HRESULT WINAPI WMCreateProfileManager(IWMProfileManager **ret)
@ -203,9 +222,9 @@ HRESULT WINAPI WMCreateProfileManager(IWMProfileManager **ret)
if(!profile_mgr)
return E_OUTOFMEMORY;
profile_mgr->IWMProfileManager_iface.lpVtbl = &WMProfileManagerVtbl;
profile_mgr->IWMProfileManager2_iface.lpVtbl = &WMProfileManager2Vtbl;
profile_mgr->ref = 1;
*ret = &profile_mgr->IWMProfileManager_iface;
*ret = (IWMProfileManager *)&profile_mgr->IWMProfileManager2_iface;
return S_OK;
}