2012-05-03 19:41:30 +02:00
|
|
|
/*
|
|
|
|
* Copyright 2012 Austin English
|
|
|
|
*
|
|
|
|
* This library is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU Lesser General Public
|
|
|
|
* License as published by the Free Software Foundation; either
|
|
|
|
* version 2.1 of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This library is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
* Lesser General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU Lesser General Public
|
|
|
|
* License along with this library; if not, write to the Free Software
|
|
|
|
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
|
|
|
|
*/
|
|
|
|
|
2015-03-11 15:29:51 +01:00
|
|
|
#include "wmvcore.h"
|
2012-05-03 19:41:30 +02:00
|
|
|
|
2014-03-10 13:35:38 +01:00
|
|
|
#include "initguid.h"
|
2017-06-14 22:29:26 +02:00
|
|
|
#include "wmsdk.h"
|
2012-05-03 19:41:30 +02:00
|
|
|
#include "wine/debug.h"
|
2018-02-07 00:20:05 +01:00
|
|
|
#include "wine/heap.h"
|
2012-05-03 19:41:30 +02:00
|
|
|
|
|
|
|
WINE_DEFAULT_DEBUG_CHANNEL(wmvcore);
|
|
|
|
|
|
|
|
BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved)
|
|
|
|
{
|
|
|
|
TRACE("(0x%p, %d, %p)\n", hinstDLL, fdwReason, lpvReserved);
|
|
|
|
|
|
|
|
switch (fdwReason)
|
|
|
|
{
|
|
|
|
case DLL_WINE_PREATTACH:
|
|
|
|
return FALSE; /* prefer native version */
|
|
|
|
case DLL_PROCESS_ATTACH:
|
|
|
|
DisableThreadLibraryCalls(hinstDLL);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
return TRUE;
|
|
|
|
}
|
2012-05-17 15:56:32 +02:00
|
|
|
|
2012-11-16 15:13:14 +01:00
|
|
|
HRESULT WINAPI DllRegisterServer(void)
|
|
|
|
{
|
|
|
|
FIXME("(): stub\n");
|
|
|
|
|
|
|
|
return S_OK;
|
|
|
|
}
|
|
|
|
|
2019-02-21 08:55:56 +01:00
|
|
|
HRESULT WINAPI WMCheckURLExtension(const WCHAR *url)
|
|
|
|
{
|
|
|
|
FIXME("(%s): stub\n", wine_dbgstr_w(url));
|
|
|
|
|
|
|
|
if (!url)
|
|
|
|
return E_INVALIDARG;
|
|
|
|
|
|
|
|
return NS_E_INVALID_NAME;
|
|
|
|
}
|
|
|
|
|
2017-06-14 22:29:26 +02:00
|
|
|
HRESULT WINAPI WMCheckURLScheme(const WCHAR *scheme)
|
|
|
|
{
|
|
|
|
FIXME("(%s): stub\n", wine_dbgstr_w(scheme));
|
|
|
|
|
|
|
|
return NS_E_INVALID_NAME;
|
|
|
|
}
|
|
|
|
|
2013-02-13 03:58:41 +01:00
|
|
|
HRESULT WINAPI WMCreateEditor(IWMMetadataEditor **editor)
|
|
|
|
{
|
|
|
|
FIXME("(%p): stub\n", editor);
|
|
|
|
|
|
|
|
*editor = NULL;
|
|
|
|
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
2019-03-04 23:35:59 +01:00
|
|
|
HRESULT WINAPI WMCreateBackupRestorer(IUnknown *callback, IWMLicenseBackup **licBackup)
|
|
|
|
{
|
|
|
|
FIXME("(%p %p): stub\n", callback, licBackup);
|
|
|
|
|
|
|
|
if (!callback)
|
|
|
|
return E_INVALIDARG;
|
|
|
|
|
|
|
|
*licBackup = NULL;
|
|
|
|
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
2020-02-29 21:55:59 +01:00
|
|
|
HRESULT WINAPI WMIsContentProtected(const WCHAR *filename, BOOL *protected)
|
|
|
|
{
|
|
|
|
FIXME("(%s %p): semi-stub\n", wine_dbgstr_w(filename), protected);
|
|
|
|
|
|
|
|
if (!filename || !protected)
|
|
|
|
return E_INVALIDARG;
|
|
|
|
|
|
|
|
*protected = FALSE;
|
|
|
|
|
|
|
|
return S_FALSE;
|
|
|
|
}
|
|
|
|
|
2014-03-10 13:35:38 +01:00
|
|
|
typedef struct {
|
2019-03-10 14:04:48 +01:00
|
|
|
IWMProfileManager2 IWMProfileManager2_iface;
|
2014-03-10 13:35:38 +01:00
|
|
|
LONG ref;
|
|
|
|
} WMProfileManager;
|
|
|
|
|
2019-03-10 14:04:48 +01:00
|
|
|
static inline WMProfileManager *impl_from_IWMProfileManager2(IWMProfileManager2 *iface)
|
2014-03-10 13:35:38 +01:00
|
|
|
{
|
2019-03-10 14:04:48 +01:00
|
|
|
return CONTAINING_RECORD(iface, WMProfileManager, IWMProfileManager2_iface);
|
2014-03-10 13:35:38 +01:00
|
|
|
}
|
|
|
|
|
2019-03-10 14:04:48 +01:00
|
|
|
static HRESULT WINAPI WMProfileManager_QueryInterface(IWMProfileManager2 *iface, REFIID riid, void **ppv)
|
2014-03-10 13:35:38 +01:00
|
|
|
{
|
2019-03-10 14:04:48 +01:00
|
|
|
WMProfileManager *This = impl_from_IWMProfileManager2(iface);
|
2014-03-10 13:35:38 +01:00
|
|
|
|
|
|
|
if(IsEqualGUID(&IID_IUnknown, riid)) {
|
|
|
|
TRACE("(%p)->(IID_IUnknown %p)\n", This, ppv);
|
2019-03-10 14:04:48 +01:00
|
|
|
*ppv = &This->IWMProfileManager2_iface;
|
2014-03-10 13:35:38 +01:00
|
|
|
}else if(IsEqualGUID(&IID_IWMProfileManager, riid)) {
|
|
|
|
TRACE("(%p)->(IID_IWMProfileManager %p)\n", This, ppv);
|
2019-03-10 14:04:48 +01:00
|
|
|
*ppv = &This->IWMProfileManager2_iface;
|
|
|
|
}else if(IsEqualGUID(&IID_IWMProfileManager2, riid)) {
|
|
|
|
TRACE("(%p)->(IID_IWMProfileManager2 %p)\n", This, ppv);
|
|
|
|
*ppv = &This->IWMProfileManager2_iface;
|
2014-03-10 13:35:38 +01:00
|
|
|
}else {
|
2018-05-22 15:44:08 +02:00
|
|
|
FIXME("Unsupported iface %s\n", debugstr_guid(riid));
|
2014-03-10 13:35:38 +01:00
|
|
|
*ppv = NULL;
|
|
|
|
return E_NOINTERFACE;
|
|
|
|
}
|
|
|
|
|
|
|
|
IUnknown_AddRef((IUnknown*)*ppv);
|
|
|
|
return S_OK;
|
|
|
|
}
|
|
|
|
|
2019-03-10 14:04:48 +01:00
|
|
|
static ULONG WINAPI WMProfileManager_AddRef(IWMProfileManager2 *iface)
|
2014-03-10 13:35:38 +01:00
|
|
|
{
|
2019-03-10 14:04:48 +01:00
|
|
|
WMProfileManager *This = impl_from_IWMProfileManager2(iface);
|
2014-03-10 13:35:38 +01:00
|
|
|
LONG ref = InterlockedIncrement(&This->ref);
|
|
|
|
|
|
|
|
TRACE("(%p) ref=%d\n", This, ref);
|
|
|
|
|
|
|
|
return ref;
|
|
|
|
}
|
|
|
|
|
2019-03-10 14:04:48 +01:00
|
|
|
static ULONG WINAPI WMProfileManager_Release(IWMProfileManager2 *iface)
|
2014-03-10 13:35:38 +01:00
|
|
|
{
|
2019-03-10 14:04:48 +01:00
|
|
|
WMProfileManager *This = impl_from_IWMProfileManager2(iface);
|
2014-03-10 13:35:38 +01:00
|
|
|
LONG ref = InterlockedDecrement(&This->ref);
|
|
|
|
|
|
|
|
TRACE("(%p) ref=%d\n", This, ref);
|
|
|
|
|
|
|
|
if(!ref)
|
|
|
|
heap_free(This);
|
|
|
|
|
|
|
|
return ref;
|
|
|
|
}
|
|
|
|
|
2019-03-10 14:04:48 +01:00
|
|
|
static HRESULT WINAPI WMProfileManager_CreateEmptyProfile(IWMProfileManager2 *iface, WMT_VERSION version, IWMProfile **ret)
|
2014-03-10 13:35:38 +01:00
|
|
|
{
|
2019-03-10 14:04:48 +01:00
|
|
|
WMProfileManager *This = impl_from_IWMProfileManager2(iface);
|
2014-03-10 13:35:38 +01:00
|
|
|
FIXME("(%p)->(%x %p)\n", This, version, ret);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
2019-03-10 14:04:48 +01:00
|
|
|
static HRESULT WINAPI WMProfileManager_LoadProfileByID(IWMProfileManager2 *iface, REFGUID guid, IWMProfile **ret)
|
2014-03-10 13:35:38 +01:00
|
|
|
{
|
2019-03-10 14:04:48 +01:00
|
|
|
WMProfileManager *This = impl_from_IWMProfileManager2(iface);
|
2014-03-10 13:35:38 +01:00
|
|
|
FIXME("(%p)->(%s %p)\n", This, debugstr_guid(guid), ret);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
2019-03-10 14:04:48 +01:00
|
|
|
static HRESULT WINAPI WMProfileManager_LoadProfileByData(IWMProfileManager2 *iface, const WCHAR *profile, IWMProfile **ret)
|
2014-03-10 13:35:38 +01:00
|
|
|
{
|
2019-03-10 14:04:48 +01:00
|
|
|
WMProfileManager *This = impl_from_IWMProfileManager2(iface);
|
2014-03-10 13:35:38 +01:00
|
|
|
FIXME("(%p)->(%s %p)\n", This, debugstr_w(profile), ret);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
2019-03-10 14:04:48 +01:00
|
|
|
static HRESULT WINAPI WMProfileManager_SaveProfile(IWMProfileManager2 *iface, IWMProfile *profile, WCHAR *profile_str, DWORD *len)
|
2014-03-10 13:35:38 +01:00
|
|
|
{
|
2019-03-10 14:04:48 +01:00
|
|
|
WMProfileManager *This = impl_from_IWMProfileManager2(iface);
|
2014-03-10 13:35:38 +01:00
|
|
|
FIXME("(%p)->(%p %p %p)\n", This, profile, profile_str, len);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
2019-03-10 14:04:48 +01:00
|
|
|
static HRESULT WINAPI WMProfileManager_GetSystemProfileCount(IWMProfileManager2 *iface, DWORD *ret)
|
2014-03-10 13:35:38 +01:00
|
|
|
{
|
2019-03-10 14:04:48 +01:00
|
|
|
WMProfileManager *This = impl_from_IWMProfileManager2(iface);
|
2014-03-10 13:35:38 +01:00
|
|
|
FIXME("(%p)->(%p)\n", This, ret);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
2019-03-10 14:04:48 +01:00
|
|
|
static HRESULT WINAPI WMProfileManager_LoadSystemProfile(IWMProfileManager2 *iface, DWORD index, IWMProfile **ret)
|
2014-03-10 13:35:38 +01:00
|
|
|
{
|
2019-03-10 14:04:48 +01:00
|
|
|
WMProfileManager *This = impl_from_IWMProfileManager2(iface);
|
2014-03-10 13:35:38 +01:00
|
|
|
FIXME("(%p)->(%d %p)\n", This, index, ret);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
2019-03-10 14:04:48 +01:00
|
|
|
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 = {
|
2014-03-10 13:35:38 +01:00
|
|
|
WMProfileManager_QueryInterface,
|
|
|
|
WMProfileManager_AddRef,
|
|
|
|
WMProfileManager_Release,
|
|
|
|
WMProfileManager_CreateEmptyProfile,
|
|
|
|
WMProfileManager_LoadProfileByID,
|
|
|
|
WMProfileManager_LoadProfileByData,
|
|
|
|
WMProfileManager_SaveProfile,
|
|
|
|
WMProfileManager_GetSystemProfileCount,
|
2019-03-10 14:04:48 +01:00
|
|
|
WMProfileManager_LoadSystemProfile,
|
|
|
|
WMProfileManager2_GetSystemProfileVersion,
|
|
|
|
WMProfileManager2_SetSystemProfileVersion
|
2014-03-10 13:35:38 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
HRESULT WINAPI WMCreateProfileManager(IWMProfileManager **ret)
|
|
|
|
{
|
|
|
|
WMProfileManager *profile_mgr;
|
|
|
|
|
|
|
|
TRACE("(%p)\n", ret);
|
|
|
|
|
|
|
|
profile_mgr = heap_alloc(sizeof(*profile_mgr));
|
|
|
|
if(!profile_mgr)
|
|
|
|
return E_OUTOFMEMORY;
|
|
|
|
|
2019-03-10 14:04:48 +01:00
|
|
|
profile_mgr->IWMProfileManager2_iface.lpVtbl = &WMProfileManager2Vtbl;
|
2014-03-10 13:35:38 +01:00
|
|
|
profile_mgr->ref = 1;
|
|
|
|
|
2019-03-10 14:04:48 +01:00
|
|
|
*ret = (IWMProfileManager *)&profile_mgr->IWMProfileManager2_iface;
|
2014-03-10 13:35:38 +01:00
|
|
|
return S_OK;
|
|
|
|
}
|