2003-07-01 06:30:30 +02:00
|
|
|
/*
|
|
|
|
* IEnumMoniker implementation for DEVENUM.dll
|
|
|
|
*
|
|
|
|
* Copyright (C) 2002 Robert Shearman
|
|
|
|
*
|
|
|
|
* 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
|
2006-05-18 14:49:52 +02:00
|
|
|
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
|
2003-07-01 06:30:30 +02:00
|
|
|
*
|
|
|
|
* NOTES ON THIS FILE:
|
|
|
|
* - Implements IEnumMoniker interface which enumerates through moniker
|
|
|
|
* objects created from HKEY_CLASSES/CLSID/{DEVICE_CLSID}/Instance
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include "devenum_private.h"
|
|
|
|
#include "oleauto.h"
|
2005-05-18 20:20:39 +02:00
|
|
|
#include "ocidl.h"
|
2018-06-25 00:20:29 +02:00
|
|
|
#include "dmoreg.h"
|
2003-07-01 06:30:30 +02:00
|
|
|
|
|
|
|
#include "wine/debug.h"
|
|
|
|
|
|
|
|
WINE_DEFAULT_DEBUG_CHANNEL(devenum);
|
|
|
|
|
2012-04-03 00:16:52 +02:00
|
|
|
typedef struct
|
|
|
|
{
|
|
|
|
IEnumMoniker IEnumMoniker_iface;
|
2018-03-07 03:57:10 +01:00
|
|
|
CLSID class;
|
2012-04-03 00:16:52 +02:00
|
|
|
LONG ref;
|
2018-06-25 00:20:30 +02:00
|
|
|
IEnumDMO *dmo_enum;
|
2018-03-07 03:57:08 +01:00
|
|
|
HKEY sw_key;
|
|
|
|
DWORD sw_index;
|
|
|
|
HKEY cm_key;
|
|
|
|
DWORD cm_index;
|
2012-04-03 00:16:52 +02:00
|
|
|
} EnumMonikerImpl;
|
|
|
|
|
2004-12-07 15:37:11 +01:00
|
|
|
typedef struct
|
|
|
|
{
|
2010-12-04 22:13:13 +01:00
|
|
|
IPropertyBag IPropertyBag_iface;
|
2005-07-11 15:21:17 +02:00
|
|
|
LONG ref;
|
2018-03-07 03:57:11 +01:00
|
|
|
enum device_type type;
|
2018-06-25 00:20:29 +02:00
|
|
|
union
|
|
|
|
{
|
|
|
|
WCHAR path[MAX_PATH]; /* for filters and codecs */
|
|
|
|
CLSID clsid; /* for DMOs */
|
|
|
|
};
|
2004-12-07 15:37:11 +01:00
|
|
|
} RegPropBagImpl;
|
|
|
|
|
|
|
|
|
2010-12-04 22:13:13 +01:00
|
|
|
static inline RegPropBagImpl *impl_from_IPropertyBag(IPropertyBag *iface)
|
|
|
|
{
|
|
|
|
return CONTAINING_RECORD(iface, RegPropBagImpl, IPropertyBag_iface);
|
|
|
|
}
|
|
|
|
|
2003-07-01 06:30:30 +02:00
|
|
|
static HRESULT WINAPI DEVENUM_IPropertyBag_QueryInterface(
|
|
|
|
LPPROPERTYBAG iface,
|
|
|
|
REFIID riid,
|
|
|
|
LPVOID *ppvObj)
|
|
|
|
{
|
2010-12-04 22:13:13 +01:00
|
|
|
RegPropBagImpl *This = impl_from_IPropertyBag(iface);
|
2008-12-07 11:38:12 +01:00
|
|
|
|
|
|
|
TRACE("(%p)->(%s, %p)\n", iface, debugstr_guid(riid), ppvObj);
|
2003-07-01 06:30:30 +02:00
|
|
|
|
|
|
|
if (This == NULL || ppvObj == NULL) return E_POINTER;
|
|
|
|
|
|
|
|
if (IsEqualGUID(riid, &IID_IUnknown) ||
|
|
|
|
IsEqualGUID(riid, &IID_IPropertyBag))
|
|
|
|
{
|
2009-01-13 10:57:39 +01:00
|
|
|
*ppvObj = iface;
|
2012-04-03 00:19:59 +02:00
|
|
|
IPropertyBag_AddRef(iface);
|
2003-07-01 06:30:30 +02:00
|
|
|
return S_OK;
|
|
|
|
}
|
|
|
|
|
2010-01-11 23:47:51 +01:00
|
|
|
FIXME("- no interface IID: %s\n", debugstr_guid(riid));
|
2003-07-01 06:30:30 +02:00
|
|
|
return E_NOINTERFACE;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**********************************************************************
|
|
|
|
* DEVENUM_IPropertyBag_AddRef (also IUnknown)
|
|
|
|
*/
|
|
|
|
static ULONG WINAPI DEVENUM_IPropertyBag_AddRef(LPPROPERTYBAG iface)
|
|
|
|
{
|
2010-12-04 22:13:13 +01:00
|
|
|
RegPropBagImpl *This = impl_from_IPropertyBag(iface);
|
2008-12-07 11:38:12 +01:00
|
|
|
|
|
|
|
TRACE("(%p)->() AddRef from %d\n", iface, This->ref);
|
2003-07-01 06:30:30 +02:00
|
|
|
|
|
|
|
return InterlockedIncrement(&This->ref);
|
|
|
|
}
|
|
|
|
|
|
|
|
/**********************************************************************
|
|
|
|
* DEVENUM_IPropertyBag_Release (also IUnknown)
|
|
|
|
*/
|
|
|
|
static ULONG WINAPI DEVENUM_IPropertyBag_Release(LPPROPERTYBAG iface)
|
|
|
|
{
|
2010-12-04 22:13:13 +01:00
|
|
|
RegPropBagImpl *This = impl_from_IPropertyBag(iface);
|
2005-01-10 13:25:29 +01:00
|
|
|
ULONG ref;
|
2003-07-01 06:30:30 +02:00
|
|
|
|
2008-12-07 11:38:12 +01:00
|
|
|
TRACE("(%p)->() ReleaseThis->ref from %d\n", iface, This->ref);
|
2003-07-01 06:30:30 +02:00
|
|
|
|
2005-01-10 13:25:29 +01:00
|
|
|
ref = InterlockedDecrement(&This->ref);
|
|
|
|
if (ref == 0) {
|
2003-07-01 06:30:30 +02:00
|
|
|
CoTaskMemFree(This);
|
2004-12-07 15:37:11 +01:00
|
|
|
DEVENUM_UnlockModule();
|
2003-07-01 06:30:30 +02:00
|
|
|
}
|
2005-01-10 13:25:29 +01:00
|
|
|
return ref;
|
2003-07-01 06:30:30 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI DEVENUM_IPropertyBag_Read(
|
|
|
|
LPPROPERTYBAG iface,
|
|
|
|
LPCOLESTR pszPropName,
|
|
|
|
VARIANT* pVar,
|
|
|
|
IErrorLog* pErrorLog)
|
|
|
|
{
|
2018-06-25 00:20:29 +02:00
|
|
|
static const WCHAR FriendlyNameW[] = {'F','r','i','e','n','d','l','y','N','a','m','e',0};
|
2003-08-05 21:19:21 +02:00
|
|
|
LPVOID pData = NULL;
|
2005-07-07 14:08:42 +02:00
|
|
|
DWORD received;
|
2003-07-01 06:30:30 +02:00
|
|
|
DWORD type = 0;
|
2010-12-04 22:13:13 +01:00
|
|
|
RegPropBagImpl *This = impl_from_IPropertyBag(iface);
|
2003-07-01 06:30:30 +02:00
|
|
|
HRESULT res = S_OK;
|
2018-03-07 03:57:11 +01:00
|
|
|
LONG reswin32 = ERROR_SUCCESS;
|
2018-06-25 00:20:29 +02:00
|
|
|
WCHAR name[80];
|
2018-03-07 03:57:11 +01:00
|
|
|
HKEY hkey;
|
2003-07-01 06:30:30 +02:00
|
|
|
|
|
|
|
TRACE("(%p)->(%s, %p, %p)\n", This, debugstr_w(pszPropName), pVar, pErrorLog);
|
|
|
|
|
|
|
|
if (!pszPropName || !pVar)
|
|
|
|
return E_POINTER;
|
|
|
|
|
2018-06-25 00:20:29 +02:00
|
|
|
if (This->type == DEVICE_DMO)
|
|
|
|
{
|
2019-05-31 08:49:22 +02:00
|
|
|
if (!lstrcmpW(pszPropName, FriendlyNameW))
|
2018-06-25 00:20:29 +02:00
|
|
|
{
|
|
|
|
res = DMOGetName(&This->clsid, name);
|
|
|
|
if (SUCCEEDED(res))
|
|
|
|
{
|
|
|
|
V_VT(pVar) = VT_BSTR;
|
|
|
|
V_BSTR(pVar) = SysAllocString(name);
|
|
|
|
}
|
|
|
|
return res;
|
|
|
|
}
|
|
|
|
return HRESULT_FROM_WIN32(ERROR_NOT_FOUND);
|
|
|
|
}
|
|
|
|
|
2018-03-07 03:57:11 +01:00
|
|
|
if (This->type == DEVICE_FILTER)
|
|
|
|
reswin32 = RegOpenKeyW(HKEY_CLASSES_ROOT, This->path, &hkey);
|
|
|
|
else if (This->type == DEVICE_CODEC)
|
|
|
|
reswin32 = RegOpenKeyW(HKEY_CURRENT_USER, This->path, &hkey);
|
2003-07-01 06:30:30 +02:00
|
|
|
res = HRESULT_FROM_WIN32(reswin32);
|
|
|
|
|
2018-03-07 03:57:11 +01:00
|
|
|
if (SUCCEEDED(res))
|
|
|
|
{
|
|
|
|
reswin32 = RegQueryValueExW(hkey, pszPropName, NULL, NULL, NULL, &received);
|
|
|
|
res = HRESULT_FROM_WIN32(reswin32);
|
|
|
|
}
|
|
|
|
|
2003-07-01 06:30:30 +02:00
|
|
|
if (SUCCEEDED(res))
|
|
|
|
{
|
2003-08-05 21:19:21 +02:00
|
|
|
pData = HeapAlloc(GetProcessHeap(), 0, received);
|
|
|
|
|
|
|
|
/* work around a GCC bug that occurs here unless we use the reswin32 variable as well */
|
2018-03-07 03:57:11 +01:00
|
|
|
reswin32 = RegQueryValueExW(hkey, pszPropName, NULL, &type, pData, &received);
|
2003-08-05 21:19:21 +02:00
|
|
|
res = HRESULT_FROM_WIN32(reswin32);
|
|
|
|
}
|
|
|
|
|
|
|
|
if (SUCCEEDED(res))
|
|
|
|
{
|
|
|
|
res = E_INVALIDARG; /* assume we cannot coerce into right type */
|
|
|
|
|
2009-01-13 10:57:39 +01:00
|
|
|
TRACE("Read %d bytes (%s)\n", received, type == REG_SZ ? debugstr_w(pData) : "binary data");
|
2003-08-05 21:19:21 +02:00
|
|
|
|
2003-07-01 06:30:30 +02:00
|
|
|
switch (type)
|
|
|
|
{
|
|
|
|
case REG_SZ:
|
|
|
|
switch (V_VT(pVar))
|
|
|
|
{
|
|
|
|
case VT_LPWSTR:
|
2014-09-02 23:17:37 +02:00
|
|
|
V_BSTR(pVar) = CoTaskMemAlloc(received);
|
|
|
|
memcpy(V_BSTR(pVar), pData, received);
|
2003-08-05 21:19:21 +02:00
|
|
|
res = S_OK;
|
|
|
|
break;
|
2003-07-01 06:30:30 +02:00
|
|
|
case VT_EMPTY:
|
|
|
|
V_VT(pVar) = VT_BSTR;
|
|
|
|
/* fall through */
|
|
|
|
case VT_BSTR:
|
2014-09-02 23:17:37 +02:00
|
|
|
V_BSTR(pVar) = SysAllocStringLen(pData, received/sizeof(WCHAR) - 1);
|
2003-08-05 21:19:21 +02:00
|
|
|
res = S_OK;
|
|
|
|
break;
|
2003-07-01 06:30:30 +02:00
|
|
|
}
|
|
|
|
break;
|
|
|
|
case REG_DWORD:
|
2006-10-08 18:58:22 +02:00
|
|
|
TRACE("REG_DWORD: %x\n", *(DWORD *)pData);
|
2003-07-01 06:30:30 +02:00
|
|
|
switch (V_VT(pVar))
|
|
|
|
{
|
|
|
|
case VT_EMPTY:
|
|
|
|
V_VT(pVar) = VT_I4;
|
|
|
|
/* fall through */
|
|
|
|
case VT_I4:
|
|
|
|
case VT_UI4:
|
2014-09-02 23:17:37 +02:00
|
|
|
V_I4(pVar) = *(DWORD *)pData;
|
2003-08-05 21:19:21 +02:00
|
|
|
res = S_OK;
|
|
|
|
break;
|
2003-07-01 06:30:30 +02:00
|
|
|
}
|
|
|
|
break;
|
|
|
|
case REG_BINARY:
|
|
|
|
{
|
|
|
|
SAFEARRAYBOUND bound;
|
|
|
|
void * pArrayElements;
|
|
|
|
bound.lLbound = 0;
|
|
|
|
bound.cElements = received;
|
2006-10-08 18:58:22 +02:00
|
|
|
TRACE("REG_BINARY: len = %d\n", received);
|
2003-07-01 06:30:30 +02:00
|
|
|
switch (V_VT(pVar))
|
|
|
|
{
|
|
|
|
case VT_EMPTY:
|
2008-06-24 15:45:16 +02:00
|
|
|
V_VT(pVar) = VT_ARRAY | VT_UI1;
|
|
|
|
/* fall through */
|
2003-07-01 06:30:30 +02:00
|
|
|
case VT_ARRAY | VT_UI1:
|
2014-09-02 23:17:37 +02:00
|
|
|
if (!(V_ARRAY(pVar) = SafeArrayCreate(VT_UI1, 1, &bound)))
|
2003-08-05 21:19:21 +02:00
|
|
|
res = E_OUTOFMEMORY;
|
2008-06-24 15:45:16 +02:00
|
|
|
else
|
|
|
|
res = S_OK;
|
2003-07-01 06:30:30 +02:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
2003-08-05 21:19:21 +02:00
|
|
|
if (res == E_INVALIDARG)
|
|
|
|
break;
|
|
|
|
|
2014-09-02 23:17:37 +02:00
|
|
|
res = SafeArrayAccessData(V_ARRAY(pVar), &pArrayElements);
|
2003-07-01 06:30:30 +02:00
|
|
|
if (FAILED(res))
|
2003-08-05 21:19:21 +02:00
|
|
|
break;
|
|
|
|
|
|
|
|
CopyMemory(pArrayElements, pData, received);
|
2014-09-02 23:17:37 +02:00
|
|
|
res = SafeArrayUnaccessData(V_ARRAY(pVar));
|
2003-08-05 21:19:21 +02:00
|
|
|
break;
|
2003-07-01 06:30:30 +02:00
|
|
|
}
|
|
|
|
}
|
2003-08-05 21:19:21 +02:00
|
|
|
if (res == E_INVALIDARG)
|
2006-10-08 18:58:22 +02:00
|
|
|
FIXME("Variant type %x not supported for regtype %x\n", V_VT(pVar), type);
|
2003-07-01 06:30:30 +02:00
|
|
|
}
|
|
|
|
|
2004-12-23 18:06:43 +01:00
|
|
|
HeapFree(GetProcessHeap(), 0, pData);
|
2003-08-05 21:19:21 +02:00
|
|
|
|
2018-03-07 03:57:11 +01:00
|
|
|
RegCloseKey(hkey);
|
|
|
|
|
2006-10-08 18:58:22 +02:00
|
|
|
TRACE("<- %x\n", res);
|
2003-07-01 06:30:30 +02:00
|
|
|
return res;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI DEVENUM_IPropertyBag_Write(
|
|
|
|
LPPROPERTYBAG iface,
|
|
|
|
LPCOLESTR pszPropName,
|
|
|
|
VARIANT* pVar)
|
|
|
|
{
|
2010-12-04 22:13:13 +01:00
|
|
|
RegPropBagImpl *This = impl_from_IPropertyBag(iface);
|
2003-07-01 06:30:30 +02:00
|
|
|
LPVOID lpData = NULL;
|
|
|
|
DWORD cbData = 0;
|
|
|
|
DWORD dwType = 0;
|
|
|
|
HRESULT res = S_OK;
|
2018-03-07 03:57:11 +01:00
|
|
|
LONG lres = ERROR_SUCCESS;
|
|
|
|
HKEY hkey;
|
2003-07-01 06:30:30 +02:00
|
|
|
|
|
|
|
TRACE("(%p)->(%s, %p)\n", This, debugstr_w(pszPropName), pVar);
|
|
|
|
|
2018-06-25 00:20:29 +02:00
|
|
|
if (This->type == DEVICE_DMO)
|
|
|
|
return E_ACCESSDENIED;
|
|
|
|
|
2003-07-01 06:30:30 +02:00
|
|
|
switch (V_VT(pVar))
|
|
|
|
{
|
|
|
|
case VT_BSTR:
|
2013-05-10 10:07:09 +02:00
|
|
|
case VT_LPWSTR:
|
2014-09-02 23:17:37 +02:00
|
|
|
TRACE("writing %s\n", debugstr_w(V_BSTR(pVar)));
|
|
|
|
lpData = V_BSTR(pVar);
|
2003-07-01 06:30:30 +02:00
|
|
|
dwType = REG_SZ;
|
2014-09-02 23:17:37 +02:00
|
|
|
cbData = (lstrlenW(V_BSTR(pVar)) + 1) * sizeof(WCHAR);
|
2003-07-01 06:30:30 +02:00
|
|
|
break;
|
|
|
|
case VT_I4:
|
|
|
|
case VT_UI4:
|
2014-09-02 23:17:37 +02:00
|
|
|
TRACE("writing %u\n", V_UI4(pVar));
|
|
|
|
lpData = &V_UI4(pVar);
|
2003-07-01 06:30:30 +02:00
|
|
|
dwType = REG_DWORD;
|
|
|
|
cbData = sizeof(DWORD);
|
|
|
|
break;
|
|
|
|
case VT_ARRAY | VT_UI1:
|
|
|
|
{
|
|
|
|
LONG lUbound = 0;
|
|
|
|
LONG lLbound = 0;
|
|
|
|
dwType = REG_BINARY;
|
2014-09-02 23:17:37 +02:00
|
|
|
res = SafeArrayGetLBound(V_ARRAY(pVar), 1, &lLbound);
|
|
|
|
res = SafeArrayGetUBound(V_ARRAY(pVar), 1, &lUbound);
|
2003-07-01 06:30:30 +02:00
|
|
|
cbData = (lUbound - lLbound + 1) /* * sizeof(BYTE)*/;
|
2006-10-08 18:58:22 +02:00
|
|
|
TRACE("cbData: %d\n", cbData);
|
2014-09-02 23:17:37 +02:00
|
|
|
res = SafeArrayAccessData(V_ARRAY(pVar), &lpData);
|
2003-07-01 06:30:30 +02:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
default:
|
|
|
|
FIXME("Variant type %d not handled\n", V_VT(pVar));
|
|
|
|
return E_FAIL;
|
|
|
|
}
|
|
|
|
|
2018-03-07 03:57:11 +01:00
|
|
|
if (This->type == DEVICE_FILTER)
|
|
|
|
lres = RegCreateKeyW(HKEY_CLASSES_ROOT, This->path, &hkey);
|
|
|
|
else if (This->type == DEVICE_CODEC)
|
|
|
|
lres = RegCreateKeyW(HKEY_CURRENT_USER, This->path, &hkey);
|
|
|
|
res = HRESULT_FROM_WIN32(lres);
|
|
|
|
|
|
|
|
if (SUCCEEDED(res))
|
|
|
|
{
|
|
|
|
lres = RegSetValueExW(hkey, pszPropName, 0, dwType, lpData, cbData);
|
|
|
|
res = HRESULT_FROM_WIN32(lres);
|
|
|
|
RegCloseKey(hkey);
|
|
|
|
}
|
2003-07-01 06:30:30 +02:00
|
|
|
|
|
|
|
if (V_VT(pVar) & VT_ARRAY)
|
2014-09-02 23:17:37 +02:00
|
|
|
res = SafeArrayUnaccessData(V_ARRAY(pVar));
|
2003-07-01 06:30:30 +02:00
|
|
|
|
|
|
|
return res;
|
|
|
|
}
|
|
|
|
|
2005-05-30 12:01:08 +02:00
|
|
|
static const IPropertyBagVtbl IPropertyBag_Vtbl =
|
2003-07-01 06:30:30 +02:00
|
|
|
{
|
|
|
|
DEVENUM_IPropertyBag_QueryInterface,
|
|
|
|
DEVENUM_IPropertyBag_AddRef,
|
|
|
|
DEVENUM_IPropertyBag_Release,
|
|
|
|
DEVENUM_IPropertyBag_Read,
|
|
|
|
DEVENUM_IPropertyBag_Write
|
|
|
|
};
|
|
|
|
|
2018-03-07 03:57:11 +01:00
|
|
|
static HRESULT create_PropertyBag(MediaCatMoniker *mon, IPropertyBag **ppBag)
|
2004-12-07 15:37:11 +01:00
|
|
|
{
|
|
|
|
RegPropBagImpl * rpb = CoTaskMemAlloc(sizeof(RegPropBagImpl));
|
|
|
|
if (!rpb)
|
|
|
|
return E_OUTOFMEMORY;
|
2010-12-04 22:13:13 +01:00
|
|
|
rpb->IPropertyBag_iface.lpVtbl = &IPropertyBag_Vtbl;
|
2004-12-07 15:37:11 +01:00
|
|
|
rpb->ref = 1;
|
2018-03-07 03:57:11 +01:00
|
|
|
rpb->type = mon->type;
|
|
|
|
|
2018-06-25 00:20:29 +02:00
|
|
|
if (rpb->type == DEVICE_DMO)
|
|
|
|
rpb->clsid = mon->clsid;
|
|
|
|
else if (rpb->type == DEVICE_FILTER)
|
|
|
|
{
|
2019-05-31 08:49:22 +02:00
|
|
|
lstrcpyW(rpb->path, clsidW);
|
|
|
|
lstrcatW(rpb->path, backslashW);
|
2018-06-25 00:20:29 +02:00
|
|
|
if (mon->has_class)
|
|
|
|
{
|
2019-05-31 08:49:22 +02:00
|
|
|
StringFromGUID2(&mon->class, rpb->path + lstrlenW(rpb->path), CHARS_IN_GUID);
|
|
|
|
lstrcatW(rpb->path, instanceW);
|
|
|
|
lstrcatW(rpb->path, backslashW);
|
2018-06-25 00:20:29 +02:00
|
|
|
}
|
2019-05-31 08:49:22 +02:00
|
|
|
lstrcatW(rpb->path, mon->name);
|
2018-06-25 00:20:29 +02:00
|
|
|
}
|
2018-03-07 03:57:11 +01:00
|
|
|
else if (rpb->type == DEVICE_CODEC)
|
|
|
|
{
|
2019-05-31 08:49:22 +02:00
|
|
|
lstrcpyW(rpb->path, wszActiveMovieKey);
|
2018-06-25 00:20:29 +02:00
|
|
|
if (mon->has_class)
|
|
|
|
{
|
2019-05-31 08:49:22 +02:00
|
|
|
StringFromGUID2(&mon->class, rpb->path + lstrlenW(rpb->path), CHARS_IN_GUID);
|
|
|
|
lstrcatW(rpb->path, backslashW);
|
2018-06-25 00:20:29 +02:00
|
|
|
}
|
2019-05-31 08:49:22 +02:00
|
|
|
lstrcatW(rpb->path, mon->name);
|
2018-03-07 03:57:11 +01:00
|
|
|
}
|
|
|
|
|
2010-12-04 22:13:13 +01:00
|
|
|
*ppBag = &rpb->IPropertyBag_iface;
|
2004-12-07 15:37:11 +01:00
|
|
|
DEVENUM_LockModule();
|
|
|
|
return S_OK;
|
|
|
|
}
|
2003-07-01 06:30:30 +02:00
|
|
|
|
|
|
|
|
2012-04-03 00:18:39 +02:00
|
|
|
static inline MediaCatMoniker *impl_from_IMoniker(IMoniker *iface)
|
2003-07-01 06:30:30 +02:00
|
|
|
{
|
2012-04-03 00:18:39 +02:00
|
|
|
return CONTAINING_RECORD(iface, MediaCatMoniker, IMoniker_iface);
|
|
|
|
}
|
2003-07-01 06:30:30 +02:00
|
|
|
|
2012-04-03 00:18:39 +02:00
|
|
|
static HRESULT WINAPI DEVENUM_IMediaCatMoniker_QueryInterface(IMoniker *iface, REFIID riid,
|
|
|
|
void **ppv)
|
|
|
|
{
|
|
|
|
TRACE("\n\tIID:\t%s\n",debugstr_guid(riid));
|
2003-07-01 06:30:30 +02:00
|
|
|
|
2012-04-03 00:18:39 +02:00
|
|
|
if (!ppv)
|
|
|
|
return E_POINTER;
|
2003-07-01 06:30:30 +02:00
|
|
|
|
|
|
|
if (IsEqualGUID(riid, &IID_IUnknown) ||
|
|
|
|
IsEqualGUID(riid, &IID_IPersist) ||
|
|
|
|
IsEqualGUID(riid, &IID_IPersistStream) ||
|
|
|
|
IsEqualGUID(riid, &IID_IMoniker))
|
|
|
|
{
|
2012-04-03 00:18:39 +02:00
|
|
|
*ppv = iface;
|
|
|
|
IMoniker_AddRef(iface);
|
2003-07-01 06:30:30 +02:00
|
|
|
return S_OK;
|
|
|
|
}
|
|
|
|
|
2010-01-11 23:47:51 +01:00
|
|
|
FIXME("- no interface IID: %s\n", debugstr_guid(riid));
|
2012-04-03 00:18:39 +02:00
|
|
|
*ppv = NULL;
|
2003-07-01 06:30:30 +02:00
|
|
|
return E_NOINTERFACE;
|
|
|
|
}
|
|
|
|
|
2012-04-03 00:18:39 +02:00
|
|
|
static ULONG WINAPI DEVENUM_IMediaCatMoniker_AddRef(IMoniker *iface)
|
2003-07-01 06:30:30 +02:00
|
|
|
{
|
2012-04-03 00:18:39 +02:00
|
|
|
MediaCatMoniker *This = impl_from_IMoniker(iface);
|
|
|
|
ULONG ref = InterlockedIncrement(&This->ref);
|
2003-07-01 06:30:30 +02:00
|
|
|
|
2012-04-03 00:18:39 +02:00
|
|
|
TRACE("(%p) ref=%d\n", This, ref);
|
|
|
|
|
|
|
|
return ref;
|
2003-07-01 06:30:30 +02:00
|
|
|
}
|
|
|
|
|
2012-04-03 00:18:39 +02:00
|
|
|
static ULONG WINAPI DEVENUM_IMediaCatMoniker_Release(IMoniker *iface)
|
2003-07-01 06:30:30 +02:00
|
|
|
{
|
2012-04-03 00:18:39 +02:00
|
|
|
MediaCatMoniker *This = impl_from_IMoniker(iface);
|
|
|
|
ULONG ref = InterlockedDecrement(&This->ref);
|
|
|
|
|
|
|
|
TRACE("(%p) ref=%d\n", This, ref);
|
2003-07-01 06:30:30 +02:00
|
|
|
|
|
|
|
if (ref == 0) {
|
2018-03-07 03:57:09 +01:00
|
|
|
CoTaskMemFree(This->name);
|
2003-07-01 06:30:30 +02:00
|
|
|
CoTaskMemFree(This);
|
2004-12-07 15:37:11 +01:00
|
|
|
DEVENUM_UnlockModule();
|
2003-07-01 06:30:30 +02:00
|
|
|
}
|
|
|
|
return ref;
|
|
|
|
}
|
|
|
|
|
2012-04-03 00:18:39 +02:00
|
|
|
static HRESULT WINAPI DEVENUM_IMediaCatMoniker_GetClassID(IMoniker *iface, CLSID *pClassID)
|
2003-07-01 06:30:30 +02:00
|
|
|
{
|
2012-04-03 00:18:39 +02:00
|
|
|
MediaCatMoniker *This = impl_from_IMoniker(iface);
|
|
|
|
|
2017-03-10 11:26:53 +01:00
|
|
|
TRACE("(%p)->(%p)\n", This, pClassID);
|
2003-07-01 06:30:30 +02:00
|
|
|
|
|
|
|
if (pClassID == NULL)
|
2017-03-10 11:26:53 +01:00
|
|
|
return E_INVALIDARG;
|
2003-07-01 06:30:30 +02:00
|
|
|
|
2017-03-10 11:26:53 +01:00
|
|
|
*pClassID = CLSID_CDeviceMoniker;
|
|
|
|
|
|
|
|
return S_OK;
|
2003-07-01 06:30:30 +02:00
|
|
|
}
|
|
|
|
|
2012-04-03 00:18:39 +02:00
|
|
|
static HRESULT WINAPI DEVENUM_IMediaCatMoniker_IsDirty(IMoniker *iface)
|
2003-07-01 06:30:30 +02:00
|
|
|
{
|
2008-12-07 11:38:12 +01:00
|
|
|
FIXME("(%p)->(): stub\n", iface);
|
2003-07-01 06:30:30 +02:00
|
|
|
|
|
|
|
return S_FALSE;
|
|
|
|
}
|
|
|
|
|
2012-04-03 00:18:39 +02:00
|
|
|
static HRESULT WINAPI DEVENUM_IMediaCatMoniker_Load(IMoniker *iface, IStream *pStm)
|
2003-07-01 06:30:30 +02:00
|
|
|
{
|
2008-12-07 11:38:12 +01:00
|
|
|
FIXME("(%p)->(%p): stub\n", iface, pStm);
|
2003-07-01 06:30:30 +02:00
|
|
|
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
2012-04-03 00:18:39 +02:00
|
|
|
static HRESULT WINAPI DEVENUM_IMediaCatMoniker_Save(IMoniker *iface, IStream *pStm, BOOL fClearDirty)
|
2003-07-01 06:30:30 +02:00
|
|
|
{
|
2008-12-07 11:38:12 +01:00
|
|
|
FIXME("(%p)->(%p, %s): stub\n", iface, pStm, fClearDirty ? "true" : "false");
|
2003-07-01 06:30:30 +02:00
|
|
|
|
|
|
|
return STG_E_CANTSAVE;
|
|
|
|
}
|
|
|
|
|
2012-04-03 00:18:39 +02:00
|
|
|
static HRESULT WINAPI DEVENUM_IMediaCatMoniker_GetSizeMax(IMoniker *iface, ULARGE_INTEGER *pcbSize)
|
2003-07-01 06:30:30 +02:00
|
|
|
{
|
2008-12-07 11:38:12 +01:00
|
|
|
FIXME("(%p)->(%p): stub\n", iface, pcbSize);
|
2003-07-01 06:30:30 +02:00
|
|
|
|
|
|
|
ZeroMemory(pcbSize, sizeof(*pcbSize));
|
|
|
|
|
|
|
|
return S_OK;
|
|
|
|
}
|
|
|
|
|
2012-04-03 00:18:39 +02:00
|
|
|
static HRESULT WINAPI DEVENUM_IMediaCatMoniker_BindToObject(IMoniker *iface, IBindCtx *pbc,
|
|
|
|
IMoniker *pmkToLeft, REFIID riidResult, void **ppvResult)
|
2003-07-01 06:30:30 +02:00
|
|
|
{
|
2012-04-03 00:18:39 +02:00
|
|
|
MediaCatMoniker *This = impl_from_IMoniker(iface);
|
2003-07-01 06:30:30 +02:00
|
|
|
IUnknown * pObj = NULL;
|
|
|
|
IPropertyBag * pProp = NULL;
|
|
|
|
CLSID clsID;
|
|
|
|
VARIANT var;
|
|
|
|
HRESULT res = E_FAIL;
|
|
|
|
|
|
|
|
TRACE("(%p)->(%p, %p, %s, %p)\n", This, pbc, pmkToLeft, debugstr_guid(riidResult), ppvResult);
|
|
|
|
|
2018-04-28 19:30:09 +02:00
|
|
|
if (!ppvResult)
|
|
|
|
return E_POINTER;
|
|
|
|
|
2012-04-03 00:18:39 +02:00
|
|
|
VariantInit(&var);
|
2003-07-01 06:30:30 +02:00
|
|
|
*ppvResult = NULL;
|
|
|
|
|
|
|
|
if(pmkToLeft==NULL)
|
|
|
|
{
|
|
|
|
/* first activation of this class */
|
2003-07-22 05:14:25 +02:00
|
|
|
LPVOID pvptr;
|
|
|
|
res=IMoniker_BindToStorage(iface, NULL, NULL, &IID_IPropertyBag, &pvptr);
|
2009-01-13 10:57:39 +01:00
|
|
|
pProp = pvptr;
|
2003-07-01 06:30:30 +02:00
|
|
|
if (SUCCEEDED(res))
|
|
|
|
{
|
|
|
|
V_VT(&var) = VT_LPWSTR;
|
2018-06-26 16:05:31 +02:00
|
|
|
res = IPropertyBag_Read(pProp, clsidW, &var, NULL);
|
2003-07-01 06:30:30 +02:00
|
|
|
}
|
|
|
|
if (SUCCEEDED(res))
|
|
|
|
{
|
2014-09-02 23:17:37 +02:00
|
|
|
res = CLSIDFromString(V_BSTR(&var), &clsID);
|
|
|
|
CoTaskMemFree(V_BSTR(&var));
|
2003-07-01 06:30:30 +02:00
|
|
|
}
|
|
|
|
if (SUCCEEDED(res))
|
|
|
|
{
|
2003-07-22 05:14:25 +02:00
|
|
|
res=CoCreateInstance(&clsID,NULL,CLSCTX_ALL,&IID_IUnknown,&pvptr);
|
2009-01-13 10:57:39 +01:00
|
|
|
pObj = pvptr;
|
2003-07-01 06:30:30 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if (pObj!=NULL)
|
|
|
|
{
|
|
|
|
/* get the requested interface from the loaded class */
|
2005-05-18 20:20:39 +02:00
|
|
|
res = S_OK;
|
|
|
|
if (pProp) {
|
|
|
|
HRESULT res2;
|
|
|
|
LPVOID ppv = NULL;
|
|
|
|
res2 = IUnknown_QueryInterface(pObj, &IID_IPersistPropertyBag, &ppv);
|
|
|
|
if (SUCCEEDED(res2)) {
|
|
|
|
res = IPersistPropertyBag_Load((IPersistPropertyBag *) ppv, pProp, NULL);
|
|
|
|
IPersistPropertyBag_Release((IPersistPropertyBag *) ppv);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (SUCCEEDED(res))
|
|
|
|
res= IUnknown_QueryInterface(pObj,riidResult,ppvResult);
|
2005-04-26 10:15:38 +02:00
|
|
|
IUnknown_Release(pObj);
|
2003-07-01 06:30:30 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
if (pProp)
|
|
|
|
{
|
|
|
|
IPropertyBag_Release(pProp);
|
|
|
|
}
|
|
|
|
|
2006-10-08 18:58:22 +02:00
|
|
|
TRACE("<- 0x%x\n", res);
|
2003-07-01 06:30:30 +02:00
|
|
|
|
|
|
|
return res;
|
|
|
|
}
|
|
|
|
|
2012-04-03 00:18:39 +02:00
|
|
|
static HRESULT WINAPI DEVENUM_IMediaCatMoniker_BindToStorage(IMoniker *iface, IBindCtx *pbc,
|
|
|
|
IMoniker *pmkToLeft, REFIID riid, void **ppvObj)
|
2003-07-01 06:30:30 +02:00
|
|
|
{
|
2012-04-03 00:18:39 +02:00
|
|
|
MediaCatMoniker *This = impl_from_IMoniker(iface);
|
|
|
|
|
2003-07-01 06:30:30 +02:00
|
|
|
TRACE("(%p)->(%p, %p, %s, %p)\n", This, pbc, pmkToLeft, debugstr_guid(riid), ppvObj);
|
|
|
|
|
|
|
|
*ppvObj = NULL;
|
|
|
|
|
2012-06-16 19:36:24 +02:00
|
|
|
if (pmkToLeft)
|
2003-07-01 06:30:30 +02:00
|
|
|
return MK_E_NOSTORAGE;
|
|
|
|
|
2012-06-16 19:36:24 +02:00
|
|
|
if (pbc != NULL)
|
|
|
|
{
|
|
|
|
static DWORD reported;
|
|
|
|
if (!reported)
|
|
|
|
{
|
|
|
|
FIXME("ignoring IBindCtx %p\n", pbc);
|
|
|
|
reported++;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2003-07-01 06:30:30 +02:00
|
|
|
if (IsEqualGUID(riid, &IID_IPropertyBag))
|
|
|
|
{
|
2018-03-07 03:57:11 +01:00
|
|
|
return create_PropertyBag(This, (IPropertyBag**)ppvObj);
|
2003-07-01 06:30:30 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
return MK_E_NOSTORAGE;
|
|
|
|
}
|
|
|
|
|
2012-04-03 00:18:39 +02:00
|
|
|
static HRESULT WINAPI DEVENUM_IMediaCatMoniker_Reduce(IMoniker *iface, IBindCtx *pbc,
|
|
|
|
DWORD dwReduceHowFar, IMoniker **ppmkToLeft, IMoniker **ppmkReduced)
|
2003-07-01 06:30:30 +02:00
|
|
|
{
|
2008-12-07 11:38:12 +01:00
|
|
|
TRACE("(%p)->(%p, %d, %p, %p)\n", iface, pbc, dwReduceHowFar, ppmkToLeft, ppmkReduced);
|
2003-07-01 06:30:30 +02:00
|
|
|
|
|
|
|
if (ppmkToLeft)
|
|
|
|
*ppmkToLeft = NULL;
|
|
|
|
*ppmkReduced = iface;
|
|
|
|
|
|
|
|
return MK_S_REDUCED_TO_SELF;
|
|
|
|
}
|
|
|
|
|
2012-04-03 00:18:39 +02:00
|
|
|
static HRESULT WINAPI DEVENUM_IMediaCatMoniker_ComposeWith(IMoniker *iface, IMoniker *pmkRight,
|
|
|
|
BOOL fOnlyIfNotGeneric, IMoniker **ppmkComposite)
|
2003-07-01 06:30:30 +02:00
|
|
|
{
|
2008-12-07 11:38:12 +01:00
|
|
|
FIXME("(%p)->(%p, %s, %p): stub\n", iface, pmkRight, fOnlyIfNotGeneric ? "true" : "false", ppmkComposite);
|
2003-07-01 06:30:30 +02:00
|
|
|
|
|
|
|
/* FIXME: use CreateGenericComposite? */
|
|
|
|
*ppmkComposite = NULL;
|
|
|
|
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
2012-04-03 00:18:39 +02:00
|
|
|
static HRESULT WINAPI DEVENUM_IMediaCatMoniker_Enum(IMoniker *iface, BOOL fForward,
|
|
|
|
IEnumMoniker **ppenumMoniker)
|
2003-07-01 06:30:30 +02:00
|
|
|
{
|
2008-12-07 11:38:12 +01:00
|
|
|
FIXME("(%p)->(%s, %p): stub\n", iface, fForward ? "true" : "false", ppenumMoniker);
|
2003-07-01 06:30:30 +02:00
|
|
|
|
|
|
|
*ppenumMoniker = NULL;
|
|
|
|
|
|
|
|
return S_OK;
|
|
|
|
}
|
|
|
|
|
2012-04-03 00:18:39 +02:00
|
|
|
static HRESULT WINAPI DEVENUM_IMediaCatMoniker_IsEqual(IMoniker *iface, IMoniker *pmkOtherMoniker)
|
2003-07-01 06:30:30 +02:00
|
|
|
{
|
2017-03-27 17:41:23 +02:00
|
|
|
CLSID clsid;
|
|
|
|
LPOLESTR this_name, other_name;
|
|
|
|
IBindCtx *bind;
|
|
|
|
HRESULT res;
|
2003-07-01 06:30:30 +02:00
|
|
|
|
2017-03-27 17:41:23 +02:00
|
|
|
TRACE("(%p)->(%p)\n", iface, pmkOtherMoniker);
|
|
|
|
|
|
|
|
if (!pmkOtherMoniker)
|
|
|
|
return E_INVALIDARG;
|
|
|
|
|
|
|
|
IMoniker_GetClassID(pmkOtherMoniker, &clsid);
|
|
|
|
if (!IsEqualCLSID(&clsid, &CLSID_CDeviceMoniker))
|
|
|
|
return S_FALSE;
|
|
|
|
|
|
|
|
res = CreateBindCtx(0, &bind);
|
|
|
|
if (FAILED(res))
|
|
|
|
return res;
|
|
|
|
|
|
|
|
res = S_FALSE;
|
|
|
|
if (SUCCEEDED(IMoniker_GetDisplayName(iface, bind, NULL, &this_name)) &&
|
|
|
|
SUCCEEDED(IMoniker_GetDisplayName(pmkOtherMoniker, bind, NULL, &other_name)))
|
|
|
|
{
|
|
|
|
int result = lstrcmpiW(this_name, other_name);
|
|
|
|
CoTaskMemFree(this_name);
|
|
|
|
CoTaskMemFree(other_name);
|
|
|
|
if (!result)
|
|
|
|
res = S_OK;
|
|
|
|
}
|
|
|
|
IBindCtx_Release(bind);
|
|
|
|
return res;
|
2003-07-01 06:30:30 +02:00
|
|
|
}
|
|
|
|
|
2012-04-03 00:18:39 +02:00
|
|
|
static HRESULT WINAPI DEVENUM_IMediaCatMoniker_Hash(IMoniker *iface, DWORD *pdwHash)
|
2003-07-01 06:30:30 +02:00
|
|
|
{
|
2008-12-07 11:38:12 +01:00
|
|
|
TRACE("(%p)->(%p)\n", iface, pdwHash);
|
2003-07-01 06:30:30 +02:00
|
|
|
|
|
|
|
*pdwHash = 0;
|
|
|
|
|
|
|
|
return S_OK;
|
|
|
|
}
|
|
|
|
|
2012-04-03 00:18:39 +02:00
|
|
|
static HRESULT WINAPI DEVENUM_IMediaCatMoniker_IsRunning(IMoniker *iface, IBindCtx *pbc,
|
|
|
|
IMoniker *pmkToLeft, IMoniker *pmkNewlyRunning)
|
2003-07-01 06:30:30 +02:00
|
|
|
{
|
2008-12-07 11:38:12 +01:00
|
|
|
FIXME("(%p)->(%p, %p, %p): stub\n", iface, pbc, pmkToLeft, pmkNewlyRunning);
|
2003-07-01 06:30:30 +02:00
|
|
|
|
|
|
|
return S_FALSE;
|
|
|
|
}
|
|
|
|
|
2012-04-03 00:18:39 +02:00
|
|
|
static HRESULT WINAPI DEVENUM_IMediaCatMoniker_GetTimeOfLastChange(IMoniker *iface, IBindCtx *pbc,
|
|
|
|
IMoniker *pmkToLeft, FILETIME *pFileTime)
|
2003-07-01 06:30:30 +02:00
|
|
|
{
|
2008-12-07 11:38:12 +01:00
|
|
|
TRACE("(%p)->(%p, %p, %p)\n", iface, pbc, pmkToLeft, pFileTime);
|
2003-07-01 06:30:30 +02:00
|
|
|
|
|
|
|
pFileTime->dwLowDateTime = 0xFFFFFFFF;
|
|
|
|
pFileTime->dwHighDateTime = 0x7FFFFFFF;
|
|
|
|
|
|
|
|
return MK_E_UNAVAILABLE;
|
|
|
|
}
|
|
|
|
|
2012-04-03 00:18:39 +02:00
|
|
|
static HRESULT WINAPI DEVENUM_IMediaCatMoniker_Inverse(IMoniker *iface, IMoniker **ppmk)
|
2003-07-01 06:30:30 +02:00
|
|
|
{
|
2008-12-07 11:38:12 +01:00
|
|
|
TRACE("(%p)->(%p)\n", iface, ppmk);
|
2003-07-01 06:30:30 +02:00
|
|
|
|
|
|
|
*ppmk = NULL;
|
|
|
|
|
|
|
|
return MK_E_NOINVERSE;
|
|
|
|
}
|
|
|
|
|
2012-04-03 00:18:39 +02:00
|
|
|
static HRESULT WINAPI DEVENUM_IMediaCatMoniker_CommonPrefixWith(IMoniker *iface,
|
|
|
|
IMoniker *pmkOtherMoniker, IMoniker **ppmkPrefix)
|
2003-07-01 06:30:30 +02:00
|
|
|
{
|
2008-12-07 11:38:12 +01:00
|
|
|
TRACE("(%p)->(%p, %p)\n", iface, pmkOtherMoniker, ppmkPrefix);
|
2003-07-01 06:30:30 +02:00
|
|
|
|
|
|
|
*ppmkPrefix = NULL;
|
|
|
|
|
|
|
|
return MK_E_NOPREFIX;
|
|
|
|
}
|
|
|
|
|
2012-04-03 00:18:39 +02:00
|
|
|
static HRESULT WINAPI DEVENUM_IMediaCatMoniker_RelativePathTo(IMoniker *iface, IMoniker *pmkOther,
|
|
|
|
IMoniker **ppmkRelPath)
|
2003-07-01 06:30:30 +02:00
|
|
|
{
|
2008-12-07 11:38:12 +01:00
|
|
|
TRACE("(%p)->(%p, %p)\n", iface, pmkOther, ppmkRelPath);
|
2003-07-01 06:30:30 +02:00
|
|
|
|
|
|
|
*ppmkRelPath = pmkOther;
|
|
|
|
|
|
|
|
return MK_S_HIM;
|
|
|
|
}
|
|
|
|
|
2012-04-03 00:18:39 +02:00
|
|
|
static HRESULT WINAPI DEVENUM_IMediaCatMoniker_GetDisplayName(IMoniker *iface, IBindCtx *pbc,
|
|
|
|
IMoniker *pmkToLeft, LPOLESTR *ppszDisplayName)
|
2003-07-01 06:30:30 +02:00
|
|
|
{
|
2012-04-03 00:18:39 +02:00
|
|
|
MediaCatMoniker *This = impl_from_IMoniker(iface);
|
2018-03-07 03:57:10 +01:00
|
|
|
WCHAR *buffer;
|
2003-07-01 06:30:30 +02:00
|
|
|
|
2008-12-07 11:38:12 +01:00
|
|
|
TRACE("(%p)->(%p, %p, %p)\n", iface, pbc, pmkToLeft, ppszDisplayName);
|
2003-07-01 06:30:30 +02:00
|
|
|
|
|
|
|
*ppszDisplayName = NULL;
|
|
|
|
|
2018-06-25 00:20:29 +02:00
|
|
|
if (This->type == DEVICE_DMO)
|
2003-07-01 06:30:30 +02:00
|
|
|
{
|
2019-05-31 08:49:22 +02:00
|
|
|
buffer = CoTaskMemAlloc((lstrlenW(deviceW) + lstrlenW(dmoW)
|
2018-06-25 00:20:29 +02:00
|
|
|
+ 2 * CHARS_IN_GUID + 1) * sizeof(WCHAR));
|
|
|
|
if (!buffer) return E_OUTOFMEMORY;
|
|
|
|
|
2019-05-31 08:49:22 +02:00
|
|
|
lstrcpyW(buffer, deviceW);
|
|
|
|
lstrcatW(buffer, dmoW);
|
|
|
|
StringFromGUID2(&This->clsid, buffer + lstrlenW(buffer), CHARS_IN_GUID);
|
|
|
|
StringFromGUID2(&This->class, buffer + lstrlenW(buffer), CHARS_IN_GUID);
|
2003-07-01 06:30:30 +02:00
|
|
|
}
|
2018-06-25 00:20:29 +02:00
|
|
|
else
|
|
|
|
{
|
2019-05-31 08:49:22 +02:00
|
|
|
buffer = CoTaskMemAlloc((lstrlenW(deviceW) + 3 + (This->has_class ? CHARS_IN_GUID : 0)
|
|
|
|
+ lstrlenW(This->name) + 1) * sizeof(WCHAR));
|
2018-06-25 00:20:29 +02:00
|
|
|
if (!buffer) return E_OUTOFMEMORY;
|
|
|
|
|
2019-05-31 08:49:22 +02:00
|
|
|
lstrcpyW(buffer, deviceW);
|
2018-06-25 00:20:29 +02:00
|
|
|
if (This->type == DEVICE_FILTER)
|
2019-05-31 08:49:22 +02:00
|
|
|
lstrcatW(buffer, swW);
|
2018-06-25 00:20:29 +02:00
|
|
|
else if (This->type == DEVICE_CODEC)
|
2019-05-31 08:49:22 +02:00
|
|
|
lstrcatW(buffer, cmW);
|
2018-06-25 00:20:29 +02:00
|
|
|
|
|
|
|
if (This->has_class)
|
|
|
|
{
|
2019-05-31 08:49:22 +02:00
|
|
|
StringFromGUID2(&This->class, buffer + lstrlenW(buffer), CHARS_IN_GUID);
|
|
|
|
lstrcatW(buffer, backslashW);
|
2018-06-25 00:20:29 +02:00
|
|
|
}
|
2019-05-31 08:49:22 +02:00
|
|
|
lstrcatW(buffer, This->name);
|
2018-06-25 00:20:29 +02:00
|
|
|
}
|
2003-07-01 06:30:30 +02:00
|
|
|
|
2018-03-07 03:57:10 +01:00
|
|
|
*ppszDisplayName = buffer;
|
|
|
|
return S_OK;
|
2003-07-01 06:30:30 +02:00
|
|
|
}
|
|
|
|
|
2012-04-03 00:18:39 +02:00
|
|
|
static HRESULT WINAPI DEVENUM_IMediaCatMoniker_ParseDisplayName(IMoniker *iface, IBindCtx *pbc,
|
|
|
|
IMoniker *pmkToLeft, LPOLESTR pszDisplayName, ULONG *pchEaten, IMoniker **ppmkOut)
|
2003-07-01 06:30:30 +02:00
|
|
|
{
|
2008-12-07 11:38:12 +01:00
|
|
|
FIXME("(%p)->(%p, %p, %s, %p, %p)\n", iface, pbc, pmkToLeft, debugstr_w(pszDisplayName), pchEaten, ppmkOut);
|
2003-07-01 06:30:30 +02:00
|
|
|
|
|
|
|
*pchEaten = 0;
|
|
|
|
*ppmkOut = NULL;
|
|
|
|
|
|
|
|
return MK_E_SYNTAX;
|
|
|
|
}
|
|
|
|
|
2012-04-03 00:18:39 +02:00
|
|
|
static HRESULT WINAPI DEVENUM_IMediaCatMoniker_IsSystemMoniker(IMoniker *iface, DWORD *pdwMksys)
|
2003-07-01 06:30:30 +02:00
|
|
|
{
|
2008-12-07 11:38:12 +01:00
|
|
|
TRACE("(%p)->(%p)\n", iface, pdwMksys);
|
2003-07-01 06:30:30 +02:00
|
|
|
|
|
|
|
return S_FALSE;
|
|
|
|
}
|
|
|
|
|
2005-05-30 12:01:08 +02:00
|
|
|
static const IMonikerVtbl IMoniker_Vtbl =
|
2003-07-01 06:30:30 +02:00
|
|
|
{
|
|
|
|
DEVENUM_IMediaCatMoniker_QueryInterface,
|
|
|
|
DEVENUM_IMediaCatMoniker_AddRef,
|
|
|
|
DEVENUM_IMediaCatMoniker_Release,
|
|
|
|
DEVENUM_IMediaCatMoniker_GetClassID,
|
|
|
|
DEVENUM_IMediaCatMoniker_IsDirty,
|
|
|
|
DEVENUM_IMediaCatMoniker_Load,
|
|
|
|
DEVENUM_IMediaCatMoniker_Save,
|
|
|
|
DEVENUM_IMediaCatMoniker_GetSizeMax,
|
|
|
|
DEVENUM_IMediaCatMoniker_BindToObject,
|
|
|
|
DEVENUM_IMediaCatMoniker_BindToStorage,
|
|
|
|
DEVENUM_IMediaCatMoniker_Reduce,
|
|
|
|
DEVENUM_IMediaCatMoniker_ComposeWith,
|
|
|
|
DEVENUM_IMediaCatMoniker_Enum,
|
|
|
|
DEVENUM_IMediaCatMoniker_IsEqual,
|
|
|
|
DEVENUM_IMediaCatMoniker_Hash,
|
|
|
|
DEVENUM_IMediaCatMoniker_IsRunning,
|
|
|
|
DEVENUM_IMediaCatMoniker_GetTimeOfLastChange,
|
|
|
|
DEVENUM_IMediaCatMoniker_Inverse,
|
|
|
|
DEVENUM_IMediaCatMoniker_CommonPrefixWith,
|
|
|
|
DEVENUM_IMediaCatMoniker_RelativePathTo,
|
|
|
|
DEVENUM_IMediaCatMoniker_GetDisplayName,
|
|
|
|
DEVENUM_IMediaCatMoniker_ParseDisplayName,
|
|
|
|
DEVENUM_IMediaCatMoniker_IsSystemMoniker
|
|
|
|
};
|
|
|
|
|
2007-03-10 22:00:47 +01:00
|
|
|
MediaCatMoniker * DEVENUM_IMediaCatMoniker_Construct(void)
|
2003-07-01 06:30:30 +02:00
|
|
|
{
|
|
|
|
MediaCatMoniker * pMoniker = NULL;
|
|
|
|
pMoniker = CoTaskMemAlloc(sizeof(MediaCatMoniker));
|
|
|
|
if (!pMoniker)
|
|
|
|
return NULL;
|
|
|
|
|
2012-04-03 00:18:39 +02:00
|
|
|
pMoniker->IMoniker_iface.lpVtbl = &IMoniker_Vtbl;
|
2003-07-01 06:30:30 +02:00
|
|
|
pMoniker->ref = 0;
|
2018-03-07 03:57:09 +01:00
|
|
|
pMoniker->has_class = FALSE;
|
|
|
|
pMoniker->name = NULL;
|
2003-07-01 06:30:30 +02:00
|
|
|
|
2012-04-03 00:18:39 +02:00
|
|
|
DEVENUM_IMediaCatMoniker_AddRef(&pMoniker->IMoniker_iface);
|
2003-07-01 06:30:30 +02:00
|
|
|
|
2004-12-07 15:37:11 +01:00
|
|
|
DEVENUM_LockModule();
|
|
|
|
|
2003-07-01 06:30:30 +02:00
|
|
|
return pMoniker;
|
|
|
|
}
|
|
|
|
|
2012-04-03 00:16:52 +02:00
|
|
|
static inline EnumMonikerImpl *impl_from_IEnumMoniker(IEnumMoniker *iface)
|
2003-07-01 06:30:30 +02:00
|
|
|
{
|
2012-04-03 00:16:52 +02:00
|
|
|
return CONTAINING_RECORD(iface, EnumMonikerImpl, IEnumMoniker_iface);
|
|
|
|
}
|
2008-12-07 11:38:12 +01:00
|
|
|
|
2012-04-03 00:16:52 +02:00
|
|
|
static HRESULT WINAPI DEVENUM_IEnumMoniker_QueryInterface(IEnumMoniker *iface, REFIID riid,
|
|
|
|
void **ppv)
|
|
|
|
{
|
|
|
|
TRACE("(%p)->(%s, %p)\n", iface, debugstr_guid(riid), ppv);
|
2003-07-01 06:30:30 +02:00
|
|
|
|
2012-04-03 00:16:52 +02:00
|
|
|
if (!ppv)
|
|
|
|
return E_POINTER;
|
2003-07-01 06:30:30 +02:00
|
|
|
|
|
|
|
if (IsEqualGUID(riid, &IID_IUnknown) ||
|
|
|
|
IsEqualGUID(riid, &IID_IEnumMoniker))
|
|
|
|
{
|
2012-04-03 00:16:52 +02:00
|
|
|
*ppv = iface;
|
|
|
|
IEnumMoniker_AddRef(iface);
|
2003-07-01 06:30:30 +02:00
|
|
|
return S_OK;
|
|
|
|
}
|
|
|
|
|
2010-01-11 23:47:51 +01:00
|
|
|
FIXME("- no interface IID: %s\n", debugstr_guid(riid));
|
2012-04-03 00:16:52 +02:00
|
|
|
*ppv = NULL;
|
2003-07-01 06:30:30 +02:00
|
|
|
return E_NOINTERFACE;
|
|
|
|
}
|
|
|
|
|
2012-04-03 00:16:52 +02:00
|
|
|
static ULONG WINAPI DEVENUM_IEnumMoniker_AddRef(IEnumMoniker *iface)
|
2003-07-01 06:30:30 +02:00
|
|
|
{
|
2012-04-03 00:16:52 +02:00
|
|
|
EnumMonikerImpl *This = impl_from_IEnumMoniker(iface);
|
2005-01-09 19:24:41 +01:00
|
|
|
ULONG ref = InterlockedIncrement(&This->ref);
|
2003-07-01 06:30:30 +02:00
|
|
|
|
2012-04-03 00:16:52 +02:00
|
|
|
TRACE("(%p) ref=%d\n", This, ref);
|
2003-07-01 06:30:30 +02:00
|
|
|
|
2005-01-09 19:24:41 +01:00
|
|
|
return ref;
|
2003-07-01 06:30:30 +02:00
|
|
|
}
|
|
|
|
|
2012-04-03 00:16:52 +02:00
|
|
|
static ULONG WINAPI DEVENUM_IEnumMoniker_Release(IEnumMoniker *iface)
|
2003-07-01 06:30:30 +02:00
|
|
|
{
|
2012-04-03 00:16:52 +02:00
|
|
|
EnumMonikerImpl *This = impl_from_IEnumMoniker(iface);
|
2005-01-09 19:24:41 +01:00
|
|
|
ULONG ref = InterlockedDecrement(&This->ref);
|
2003-07-01 06:30:30 +02:00
|
|
|
|
2012-04-03 00:16:52 +02:00
|
|
|
TRACE("(%p) ref=%d\n", This, ref);
|
2003-07-01 06:30:30 +02:00
|
|
|
|
2005-01-09 19:24:41 +01:00
|
|
|
if (!ref)
|
2003-07-01 06:30:30 +02:00
|
|
|
{
|
2018-06-25 00:20:30 +02:00
|
|
|
IEnumDMO_Release(This->dmo_enum);
|
2018-03-07 03:57:08 +01:00
|
|
|
RegCloseKey(This->sw_key);
|
|
|
|
RegCloseKey(This->cm_key);
|
2003-07-01 06:30:30 +02:00
|
|
|
CoTaskMemFree(This);
|
2004-12-07 15:37:11 +01:00
|
|
|
DEVENUM_UnlockModule();
|
2003-07-01 06:30:30 +02:00
|
|
|
return 0;
|
|
|
|
}
|
2005-01-09 19:24:41 +01:00
|
|
|
return ref;
|
2003-07-01 06:30:30 +02:00
|
|
|
}
|
|
|
|
|
2012-04-03 00:16:52 +02:00
|
|
|
static HRESULT WINAPI DEVENUM_IEnumMoniker_Next(IEnumMoniker *iface, ULONG celt, IMoniker **rgelt,
|
|
|
|
ULONG *pceltFetched)
|
2003-07-01 06:30:30 +02:00
|
|
|
{
|
2012-04-03 00:16:52 +02:00
|
|
|
EnumMonikerImpl *This = impl_from_IEnumMoniker(iface);
|
2003-07-01 06:30:30 +02:00
|
|
|
WCHAR buffer[MAX_PATH + 1];
|
|
|
|
LONG res;
|
|
|
|
ULONG fetched = 0;
|
|
|
|
MediaCatMoniker * pMoniker;
|
2018-06-25 00:20:30 +02:00
|
|
|
CLSID clsid;
|
|
|
|
HRESULT hr;
|
2018-03-07 03:57:08 +01:00
|
|
|
HKEY hkey;
|
2003-07-01 06:30:30 +02:00
|
|
|
|
2006-10-08 18:58:22 +02:00
|
|
|
TRACE("(%p)->(%d, %p, %p)\n", iface, celt, rgelt, pceltFetched);
|
2003-07-01 06:30:30 +02:00
|
|
|
|
|
|
|
while (fetched < celt)
|
|
|
|
{
|
2018-06-25 00:20:30 +02:00
|
|
|
/* FIXME: try PNP devices first */
|
|
|
|
|
|
|
|
/* try DMOs */
|
2019-02-24 20:46:35 +01:00
|
|
|
if ((hr = IEnumDMO_Next(This->dmo_enum, 1, &clsid, NULL, NULL)) == S_OK)
|
2018-06-25 00:20:30 +02:00
|
|
|
{
|
|
|
|
if (!(pMoniker = DEVENUM_IMediaCatMoniker_Construct()))
|
|
|
|
return E_OUTOFMEMORY;
|
2018-03-07 03:57:08 +01:00
|
|
|
|
2018-06-25 00:20:30 +02:00
|
|
|
pMoniker->type = DEVICE_DMO;
|
|
|
|
pMoniker->clsid = clsid;
|
|
|
|
|
|
|
|
StringFromGUID2(&clsid, buffer, CHARS_IN_GUID);
|
|
|
|
StringFromGUID2(&This->class, buffer + CHARS_IN_GUID - 1, CHARS_IN_GUID);
|
|
|
|
}
|
2018-03-07 03:57:08 +01:00
|
|
|
/* try DirectShow filters */
|
2018-08-04 22:45:40 +02:00
|
|
|
else if (!(res = RegEnumKeyW(This->sw_key, This->sw_index, buffer, ARRAY_SIZE(buffer))))
|
2003-07-01 06:30:30 +02:00
|
|
|
{
|
2018-03-07 03:57:08 +01:00
|
|
|
This->sw_index++;
|
|
|
|
if ((res = RegOpenKeyExW(This->sw_key, buffer, 0, KEY_QUERY_VALUE, &hkey)))
|
|
|
|
break;
|
2018-03-07 03:57:10 +01:00
|
|
|
|
|
|
|
if (!(pMoniker = DEVENUM_IMediaCatMoniker_Construct()))
|
|
|
|
return E_OUTOFMEMORY;
|
|
|
|
|
|
|
|
pMoniker->type = DEVICE_FILTER;
|
2018-06-25 00:20:30 +02:00
|
|
|
|
2019-05-31 08:49:22 +02:00
|
|
|
if (!(pMoniker->name = CoTaskMemAlloc((lstrlenW(buffer) + 1) * sizeof(WCHAR))))
|
2018-06-25 00:20:30 +02:00
|
|
|
{
|
|
|
|
IMoniker_Release(&pMoniker->IMoniker_iface);
|
|
|
|
return E_OUTOFMEMORY;
|
|
|
|
}
|
2019-05-31 08:49:22 +02:00
|
|
|
lstrcpyW(pMoniker->name, buffer);
|
2003-07-01 06:30:30 +02:00
|
|
|
}
|
2018-03-07 03:57:08 +01:00
|
|
|
/* then try codecs */
|
2018-08-04 22:45:40 +02:00
|
|
|
else if (!(res = RegEnumKeyW(This->cm_key, This->cm_index, buffer, ARRAY_SIZE(buffer))))
|
2018-03-07 03:57:08 +01:00
|
|
|
{
|
|
|
|
This->cm_index++;
|
|
|
|
|
|
|
|
if ((res = RegOpenKeyExW(This->cm_key, buffer, 0, KEY_QUERY_VALUE, &hkey)))
|
|
|
|
break;
|
2018-03-07 03:57:10 +01:00
|
|
|
|
|
|
|
if (!(pMoniker = DEVENUM_IMediaCatMoniker_Construct()))
|
|
|
|
return E_OUTOFMEMORY;
|
|
|
|
|
|
|
|
pMoniker->type = DEVICE_CODEC;
|
2018-06-25 00:20:30 +02:00
|
|
|
|
2019-05-31 08:49:22 +02:00
|
|
|
if (!(pMoniker->name = CoTaskMemAlloc((lstrlenW(buffer) + 1) * sizeof(WCHAR))))
|
2018-06-25 00:20:30 +02:00
|
|
|
{
|
|
|
|
IMoniker_Release(&pMoniker->IMoniker_iface);
|
|
|
|
return E_OUTOFMEMORY;
|
|
|
|
}
|
2019-05-31 08:49:22 +02:00
|
|
|
lstrcpyW(pMoniker->name, buffer);
|
2018-03-07 03:57:08 +01:00
|
|
|
}
|
|
|
|
else
|
|
|
|
break;
|
|
|
|
|
2018-03-07 03:57:10 +01:00
|
|
|
pMoniker->has_class = TRUE;
|
|
|
|
pMoniker->class = This->class;
|
2018-03-07 03:57:08 +01:00
|
|
|
|
2012-04-03 00:18:39 +02:00
|
|
|
rgelt[fetched] = &pMoniker->IMoniker_iface;
|
2003-07-01 06:30:30 +02:00
|
|
|
fetched++;
|
|
|
|
}
|
|
|
|
|
2006-10-08 18:58:22 +02:00
|
|
|
TRACE("-- fetched %d\n", fetched);
|
2003-07-01 06:30:30 +02:00
|
|
|
|
|
|
|
if (pceltFetched)
|
|
|
|
*pceltFetched = fetched;
|
|
|
|
|
|
|
|
if (fetched != celt)
|
|
|
|
return S_FALSE;
|
|
|
|
else
|
|
|
|
return S_OK;
|
|
|
|
}
|
|
|
|
|
2012-04-03 00:16:52 +02:00
|
|
|
static HRESULT WINAPI DEVENUM_IEnumMoniker_Skip(IEnumMoniker *iface, ULONG celt)
|
2003-07-01 06:30:30 +02:00
|
|
|
{
|
2012-04-03 00:16:52 +02:00
|
|
|
EnumMonikerImpl *This = impl_from_IEnumMoniker(iface);
|
2003-07-01 06:30:30 +02:00
|
|
|
|
2006-10-08 18:58:22 +02:00
|
|
|
TRACE("(%p)->(%d)\n", iface, celt);
|
2003-07-01 06:30:30 +02:00
|
|
|
|
2018-03-07 03:57:08 +01:00
|
|
|
while (celt--)
|
2008-01-05 00:05:34 +01:00
|
|
|
{
|
2018-06-25 00:20:30 +02:00
|
|
|
/* FIXME: try PNP devices first */
|
2008-01-05 00:05:34 +01:00
|
|
|
|
2018-06-25 00:20:30 +02:00
|
|
|
/* try DMOs */
|
|
|
|
if (IEnumDMO_Skip(This->dmo_enum, 1) == S_OK)
|
|
|
|
;
|
2018-03-07 03:57:08 +01:00
|
|
|
/* try DirectShow filters */
|
2018-06-25 00:20:30 +02:00
|
|
|
else if (RegEnumKeyW(This->sw_key, This->sw_index, NULL, 0) != ERROR_NO_MORE_ITEMS)
|
2018-03-07 03:57:08 +01:00
|
|
|
{
|
|
|
|
This->sw_index++;
|
|
|
|
}
|
|
|
|
/* then try codecs */
|
|
|
|
else if (RegEnumKeyW(This->cm_key, This->cm_index, NULL, 0) != ERROR_NO_MORE_ITEMS)
|
|
|
|
{
|
|
|
|
This->cm_index++;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
return S_FALSE;
|
|
|
|
}
|
2003-07-01 06:30:30 +02:00
|
|
|
|
|
|
|
return S_OK;
|
|
|
|
}
|
|
|
|
|
2012-04-03 00:16:52 +02:00
|
|
|
static HRESULT WINAPI DEVENUM_IEnumMoniker_Reset(IEnumMoniker *iface)
|
2003-07-01 06:30:30 +02:00
|
|
|
{
|
2012-04-03 00:16:52 +02:00
|
|
|
EnumMonikerImpl *This = impl_from_IEnumMoniker(iface);
|
2003-07-01 06:30:30 +02:00
|
|
|
|
2005-01-09 19:24:41 +01:00
|
|
|
TRACE("(%p)->()\n", iface);
|
2003-07-01 06:30:30 +02:00
|
|
|
|
2018-06-25 00:20:30 +02:00
|
|
|
IEnumDMO_Reset(This->dmo_enum);
|
2018-03-07 03:57:08 +01:00
|
|
|
This->sw_index = 0;
|
|
|
|
This->cm_index = 0;
|
2003-07-01 06:30:30 +02:00
|
|
|
|
|
|
|
return S_OK;
|
|
|
|
}
|
|
|
|
|
2012-04-03 00:16:52 +02:00
|
|
|
static HRESULT WINAPI DEVENUM_IEnumMoniker_Clone(IEnumMoniker *iface, IEnumMoniker **ppenum)
|
2003-07-01 06:30:30 +02:00
|
|
|
{
|
2005-01-09 19:24:41 +01:00
|
|
|
FIXME("(%p)->(%p): stub\n", iface, ppenum);
|
2003-07-01 06:30:30 +02:00
|
|
|
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**********************************************************************
|
|
|
|
* IEnumMoniker_Vtbl
|
|
|
|
*/
|
2005-05-30 12:01:08 +02:00
|
|
|
static const IEnumMonikerVtbl IEnumMoniker_Vtbl =
|
2003-07-01 06:30:30 +02:00
|
|
|
{
|
|
|
|
DEVENUM_IEnumMoniker_QueryInterface,
|
|
|
|
DEVENUM_IEnumMoniker_AddRef,
|
|
|
|
DEVENUM_IEnumMoniker_Release,
|
|
|
|
DEVENUM_IEnumMoniker_Next,
|
|
|
|
DEVENUM_IEnumMoniker_Skip,
|
|
|
|
DEVENUM_IEnumMoniker_Reset,
|
|
|
|
DEVENUM_IEnumMoniker_Clone
|
|
|
|
};
|
2004-12-07 15:37:11 +01:00
|
|
|
|
2018-03-07 03:57:08 +01:00
|
|
|
HRESULT create_EnumMoniker(REFCLSID class, IEnumMoniker **ppEnumMoniker)
|
2004-12-07 15:37:11 +01:00
|
|
|
{
|
|
|
|
EnumMonikerImpl * pEnumMoniker = CoTaskMemAlloc(sizeof(EnumMonikerImpl));
|
2018-03-07 03:57:08 +01:00
|
|
|
WCHAR buffer[78];
|
2018-06-25 00:20:30 +02:00
|
|
|
HRESULT hr;
|
2018-03-07 03:57:08 +01:00
|
|
|
|
2004-12-07 15:37:11 +01:00
|
|
|
if (!pEnumMoniker)
|
|
|
|
return E_OUTOFMEMORY;
|
|
|
|
|
2012-04-03 00:16:52 +02:00
|
|
|
pEnumMoniker->IEnumMoniker_iface.lpVtbl = &IEnumMoniker_Vtbl;
|
2004-12-07 15:37:11 +01:00
|
|
|
pEnumMoniker->ref = 1;
|
2018-03-07 03:57:08 +01:00
|
|
|
pEnumMoniker->sw_index = 0;
|
|
|
|
pEnumMoniker->cm_index = 0;
|
2018-03-07 03:57:10 +01:00
|
|
|
pEnumMoniker->class = *class;
|
2004-12-07 15:37:11 +01:00
|
|
|
|
2019-05-31 08:49:22 +02:00
|
|
|
lstrcpyW(buffer, clsidW);
|
|
|
|
lstrcatW(buffer, backslashW);
|
|
|
|
StringFromGUID2(class, buffer + lstrlenW(buffer), CHARS_IN_GUID);
|
|
|
|
lstrcatW(buffer, instanceW);
|
2018-03-07 03:57:08 +01:00
|
|
|
if (RegOpenKeyExW(HKEY_CLASSES_ROOT, buffer, 0, KEY_ENUMERATE_SUB_KEYS, &pEnumMoniker->sw_key))
|
|
|
|
pEnumMoniker->sw_key = NULL;
|
2004-12-07 15:37:11 +01:00
|
|
|
|
2019-05-31 08:49:22 +02:00
|
|
|
lstrcpyW(buffer, wszActiveMovieKey);
|
|
|
|
StringFromGUID2(class, buffer + lstrlenW(buffer), CHARS_IN_GUID);
|
2018-03-07 03:57:08 +01:00
|
|
|
if (RegOpenKeyExW(HKEY_CURRENT_USER, buffer, 0, KEY_ENUMERATE_SUB_KEYS, &pEnumMoniker->cm_key))
|
|
|
|
pEnumMoniker->cm_key = NULL;
|
2014-01-08 14:12:11 +01:00
|
|
|
|
2018-06-25 00:20:30 +02:00
|
|
|
hr = DMOEnum(class, 0, 0, NULL, 0, NULL, &pEnumMoniker->dmo_enum);
|
|
|
|
if (FAILED(hr))
|
|
|
|
{
|
|
|
|
IEnumMoniker_Release(&pEnumMoniker->IEnumMoniker_iface);
|
|
|
|
return hr;
|
|
|
|
}
|
|
|
|
|
2018-03-07 03:57:08 +01:00
|
|
|
*ppEnumMoniker = &pEnumMoniker->IEnumMoniker_iface;
|
2014-01-08 14:12:11 +01:00
|
|
|
|
2004-12-07 15:37:11 +01:00
|
|
|
DEVENUM_LockModule();
|
|
|
|
|
|
|
|
return S_OK;
|
|
|
|
}
|