Author: akhaldi
Date: Tue Oct 1 22:07:54 2013
New Revision: 60507
URL:
http://svn.reactos.org/svn/reactos?rev=60507&view=rev
Log:
[DEVENUM]
* Sync with Wine 1.7.1.
CORE-7469
Added:
trunk/reactos/dll/directx/wine/devenum/devenum_classes.idl (with props)
trunk/reactos/dll/directx/wine/devenum/devenum_classes.rgs (with props)
Removed:
trunk/reactos/dll/directx/wine/devenum/Makefile.in
Modified:
trunk/reactos/dll/directx/wine/devenum/CMakeLists.txt
trunk/reactos/dll/directx/wine/devenum/createdevenum.c
trunk/reactos/dll/directx/wine/devenum/devenum.rc
trunk/reactos/dll/directx/wine/devenum/devenum_main.c
trunk/reactos/dll/directx/wine/devenum/devenum_private.h
trunk/reactos/dll/directx/wine/devenum/factory.c
trunk/reactos/dll/directx/wine/devenum/mediacatenum.c
trunk/reactos/dll/directx/wine/devenum/parsedisplayname.c
trunk/reactos/media/doc/README.WINE
Modified: trunk/reactos/dll/directx/wine/devenum/CMakeLists.txt
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/wine/devenum/C…
==============================================================================
--- trunk/reactos/dll/directx/wine/devenum/CMakeLists.txt [iso-8859-1] (original)
+++ trunk/reactos/dll/directx/wine/devenum/CMakeLists.txt [iso-8859-1] Tue Oct 1 22:07:54
2013
@@ -2,22 +2,22 @@
remove_definitions(-D_WIN32_WINNT=0x502)
add_definitions(-D_WIN32_WINNT=0x600)
+add_definitions(-D__WINESRC__)
include_directories(${REACTOS_SOURCE_DIR}/include/reactos/wine)
-
spec2def(devenum.dll devenum.spec)
-add_library(devenum SHARED
+list(APPEND SOURCE
createdevenum.c
devenum_main.c
factory.c
mediacatenum.c
parsedisplayname.c
- devenum.rc
${CMAKE_CURRENT_BINARY_DIR}/devenum.def)
+add_library(devenum SHARED ${SOURCE} devenum.rc)
+set_source_files_properties(devenum.rc PROPERTIES OBJECT_DEPENDS
${CMAKE_CURRENT_SOURCE_DIR}/devenum_classes.rgs)
set_module_type(devenum win32dll UNICODE)
target_link_libraries(devenum strmiids uuid wine)
add_importlibs(devenum advapi32 ole32 oleaut32 winmm user32 avicap32 msvcrt kernel32
ntdll)
add_pch(devenum devenum_private.h)
-add_dependencies(devenum dxsdk)
add_cd_file(TARGET devenum DESTINATION reactos/system32 FOR all)
Removed: trunk/reactos/dll/directx/wine/devenum/Makefile.in
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/wine/devenum/M…
==============================================================================
--- trunk/reactos/dll/directx/wine/devenum/Makefile.in [iso-8859-1] (original)
+++ trunk/reactos/dll/directx/wine/devenum/Makefile.in (removed)
@@ -1,20 +0,0 @@
-TOPSRCDIR = @top_srcdir@
-TOPOBJDIR = ../..
-SRCDIR = @srcdir@
-VPATH = @srcdir@
-MODULE = devenum.dll
-IMPORTS = ole32 oleaut32 winmm user32 advapi32 kernel32
-EXTRALIBS = -lstrmiids -luuid
-
-C_SRCS = \
- createdevenum.c \
- devenum_main.c \
- factory.c \
- mediacatenum.c \
- parsedisplayname.c
-
-RC_SRCS = devenum.rc
-
-@MAKE_DLL_RULES@
-
-### Dependencies:
Modified: trunk/reactos/dll/directx/wine/devenum/createdevenum.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/wine/devenum/c…
==============================================================================
--- trunk/reactos/dll/directx/wine/devenum/createdevenum.c [iso-8859-1] (original)
+++ trunk/reactos/dll/directx/wine/devenum/createdevenum.c [iso-8859-1] Tue Oct 1
22:07:54 2013
@@ -52,6 +52,9 @@
static const WCHAR wszDirection[] =
{'D','i','r','e','c','t','i','o','n',0};
static const WCHAR wszIsRendered[] =
{'I','s','R','e','n','d','e','r','e','d',0};
static const WCHAR wszTypes[] =
{'T','y','p','e','s',0};
+static const WCHAR wszFriendlyName[] =
{'F','r','i','e','n','d','l','y','N','a','m','e',0};
+static const WCHAR wszWaveInID[] =
{'W','a','v','e','I','n','I','D',0};
+static const WCHAR wszWaveOutID[] =
{'W','a','v','e','O','u','t','I','D',0};
static ULONG WINAPI DEVENUM_ICreateDevEnum_AddRef(ICreateDevEnum * iface);
static HRESULT DEVENUM_CreateSpecialCategories(void);
@@ -59,24 +62,24 @@
/**********************************************************************
* DEVENUM_ICreateDevEnum_QueryInterface (also IUnknown)
*/
-static HRESULT WINAPI DEVENUM_ICreateDevEnum_QueryInterface(
- ICreateDevEnum * iface,
- REFIID riid,
- LPVOID *ppvObj)
-{
- TRACE("\n\tIID:\t%s\n",debugstr_guid(riid));
-
- if (ppvObj == NULL) return E_POINTER;
+static HRESULT WINAPI DEVENUM_ICreateDevEnum_QueryInterface(ICreateDevEnum *iface, REFIID
riid,
+ void **ppv)
+{
+ TRACE("(%p)->(%s, %p)\n", iface, debugstr_guid(riid), ppv);
+
+ if (!ppv)
+ return E_POINTER;
if (IsEqualGUID(riid, &IID_IUnknown) ||
IsEqualGUID(riid, &IID_ICreateDevEnum))
{
- *ppvObj = iface;
+ *ppv = iface;
DEVENUM_ICreateDevEnum_AddRef(iface);
return S_OK;
}
FIXME("- no interface IID: %s\n", debugstr_guid(riid));
+ *ppv = NULL;
return E_NOINTERFACE;
}
@@ -171,10 +174,10 @@
for (i1 = 0; i1 < dwMinorTypes; i1++)
{
WCHAR wszMinorTypeName[64];
- DWORD cName = sizeof(wszMinorTypeName) / sizeof(WCHAR);
CLSID *clsMajorType = NULL, *clsMinorType = NULL;
HRESULT hr;
+ cName = sizeof(wszMinorTypeName) / sizeof(WCHAR);
if (RegEnumKeyExW(hkeyMajorType, i1, wszMinorTypeName, &cName, NULL,
NULL, NULL, NULL) != ERROR_SUCCESS) continue;
clsMinorType = CoTaskMemAlloc(sizeof(CLSID));
@@ -349,7 +352,6 @@
HKEY hkeyCategoryBaseKey;
WCHAR wszRegKey[MAX_PATH];
HKEY hkeyInstance = NULL;
- HRESULT hr;
if (RegEnumKeyExW(hkeyFilter, i, wszFilterSubkeyName, &cName, NULL, NULL,
NULL, NULL) != ERROR_SUCCESS) continue;
@@ -463,9 +465,8 @@
HKEY hkey;
HKEY hbasekey;
HRESULT hr;
- CreateDevEnumImpl *This = (CreateDevEnumImpl *)iface;
-
- TRACE("(%p)->(%s, %p, %x)\n\tDeviceClass:\t%s\n", This,
debugstr_guid(clsidDeviceClass), ppEnumMoniker, dwFlags,
debugstr_guid(clsidDeviceClass));
+
+ TRACE("(%p)->(%s, %p, %x)\n", iface, debugstr_guid(clsidDeviceClass),
ppEnumMoniker, dwFlags);
if (!ppEnumMoniker)
return E_POINTER;
@@ -519,7 +520,7 @@
/**********************************************************************
* static CreateDevEnum instance
*/
-CreateDevEnumImpl DEVENUM_CreateDevEnum = { &ICreateDevEnum_Vtbl };
+ICreateDevEnum DEVENUM_CreateDevEnum = { &ICreateDevEnum_Vtbl };
/**********************************************************************
* DEVENUM_CreateAMCategoryKey (INTERNAL)
@@ -631,6 +632,7 @@
WAVEINCAPSW wicaps;
MIDIOUTCAPSW mocaps;
REGPINTYPES * pTypes;
+ IPropertyBag * pPropBag = NULL;
numDevs = waveOutGetNumDevs();
@@ -668,10 +670,27 @@
wocaps.szPname,
&rf2);
- /* FIXME: do additional stuff with IMoniker here, depending on what
RegisterFilter does */
-
- if (pMoniker)
- IMoniker_Release(pMoniker);
+ if (pMoniker)
+ {
+ VARIANT var;
+
+ V_VT(&var) = VT_I4;
+ V_UNION(&var, ulVal) = i;
+ res = IMoniker_BindToStorage(pMoniker, NULL, NULL,
&IID_IPropertyBag, (LPVOID)&pPropBag);
+ if (SUCCEEDED(res))
+ res = IPropertyBag_Write(pPropBag, wszWaveOutID, &var);
+ else
+ pPropBag = NULL;
+
+ V_VT(&var) = VT_LPWSTR;
+ V_UNION(&var, bstrVal) = wocaps.szPname;
+ if (SUCCEEDED(res))
+ res = IPropertyBag_Write(pPropBag, wszFriendlyName, &var);
+ if (pPropBag)
+ IPropertyBag_Release(pPropBag);
+ IMoniker_Release(pMoniker);
+ pMoniker = NULL;
+ }
wsprintfW(szDSoundName, szDSoundNameFormat, wocaps.szPname);
res = IFilterMapper2_RegisterFilter(pMapper,
@@ -724,7 +743,7 @@
rfp2.lpMediaType = pTypes;
- res = IFilterMapper2_RegisterFilter(pMapper,
+ res = IFilterMapper2_RegisterFilter(pMapper,
&CLSID_AudioRecord,
wicaps.szPname,
&pMoniker,
@@ -732,10 +751,27 @@
wicaps.szPname,
&rf2);
- /* FIXME: do additional stuff with IMoniker here, depending on what
RegisterFilter does */
-
- if (pMoniker)
- IMoniker_Release(pMoniker);
+
+ if (pMoniker) {
+ VARIANT var;
+
+ V_VT(&var) = VT_I4;
+ V_UNION(&var, ulVal) = i;
+ res = IMoniker_BindToStorage(pMoniker, NULL, NULL,
&IID_IPropertyBag, (LPVOID)&pPropBag);
+ if (SUCCEEDED(res))
+ res = IPropertyBag_Write(pPropBag, wszWaveInID, &var);
+ else
+ pPropBag = NULL;
+
+ V_VT(&var) = VT_LPWSTR;
+ V_UNION(&var, bstrVal) = wicaps.szPname;
+ if (SUCCEEDED(res))
+ res = IPropertyBag_Write(pPropBag, wszFriendlyName, &var);
+
+ if (pPropBag)
+ IPropertyBag_Release(pPropBag);
+ IMoniker_Release(pMoniker);
+ }
CoTaskMemFree(pTypes);
}
@@ -802,7 +838,6 @@
szDeviceVersion,
sizeof(szDeviceVersion)/sizeof(WCHAR)))
{
IMoniker * pMoniker = NULL;
- IPropertyBag * pPropBag = NULL;
WCHAR dprintf[] = {
'v','i','d','e','o','%','d',0 };
snprintfW(szDevicePath, sizeof(szDevicePath)/sizeof(WCHAR), dprintf,
i);
/* The above code prevents 1 device with a different ID overwriting
another */
@@ -833,8 +868,10 @@
V_VT(&var) = VT_I4;
V_UNION(&var, ulVal) = i;
res = IMoniker_BindToStorage(pMoniker, NULL, NULL,
&IID_IPropertyBag, (LPVOID)&pPropBag);
- if (SUCCEEDED(res))
- res = IPropertyBag_Write(pPropBag, wszVfwIndex, &var);
+ if (SUCCEEDED(res)) {
+ res = IPropertyBag_Write(pPropBag, wszVfwIndex, &var);
+ IPropertyBag_Release(pPropBag);
+ }
IMoniker_Release(pMoniker);
}
Modified: trunk/reactos/dll/directx/wine/devenum/devenum.rc
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/wine/devenum/d…
==============================================================================
--- trunk/reactos/dll/directx/wine/devenum/devenum.rc [iso-8859-1] (original)
+++ trunk/reactos/dll/directx/wine/devenum/devenum.rc [iso-8859-1] Tue Oct 1 22:07:54
2013
@@ -20,9 +20,20 @@
#pragma code_page(65001)
-#include "windef.h"
+//#include "windef.h"
//#include "winbase.h"
//#include "winnls.h"
+#include "devenum_private.h"
+
+LANGUAGE LANG_ENGLISH, SUBLANG_DEFAULT
+
+STRINGTABLE
+{
+ IDS_DEVENUM_DSDEFAULT "Default DirectSound"
+ IDS_DEVENUM_DS "DirectSound: %s"
+ IDS_DEVENUM_WODEFAULT "Default WaveOut Device"
+ IDS_DEVENUM_MIDEFAULT "Default MidiOut Device"
+}
LANGUAGE LANG_NEUTRAL, SUBLANG_NEUTRAL
@@ -33,4 +44,6 @@
#define WINE_PRODUCTVERSION 6,5,1,902
#define WINE_PRODUCTVERSION_STR "6.5"
-#include "wine/wine_common_ver.rc"
+#include <wine/wine_common_ver.rc>
+
+1 WINE_REGISTRY devenum_classes.rgs
Added: trunk/reactos/dll/directx/wine/devenum/devenum_classes.idl
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/wine/devenum/d…
==============================================================================
--- trunk/reactos/dll/directx/wine/devenum/devenum_classes.idl (added)
+++ trunk/reactos/dll/directx/wine/devenum/devenum_classes.idl [iso-8859-1] Tue Oct 1
22:07:54 2013
@@ -0,0 +1,90 @@
+/*
+ * COM Classes for devenum
+ *
+ * Copyright 2010 Alexandre Julliard
+ *
+ * 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
+ */
+
+[
+ helpstring("System Device Enum"),
+ threading(both),
+ uuid(62be5d10-60eb-11d0-bd3b-00a0c911ce86)
+]
+coclass SystemDeviceEnum { interface ICreateDevEnum; }
+
+[
+ threading(both),
+ progid("device.1"),
+ vi_progid("device"),
+ uuid(4315d437-5b8c-11d0-bd3b-00a0c911ce86)
+]
+coclass DeviceMoniker { interface IParseDisplayName; }
+
+[
+ helpstring("ACM Class Manager"),
+ threading(both),
+ uuid(33d9a761-90c8-11d0-bd43-00a0c911ce86)
+]
+coclass AudioCompressorCategory { }
+
+[
+ helpstring("ICM Class Manager"),
+ threading(both),
+ uuid(33d9a760-90c8-11d0-bd43-00a0c911ce86)
+]
+coclass VideoCompressorCategory { }
+
+[
+ helpstring("ActiveMovie Filter Class Manager"),
+ threading(both),
+ uuid(083863f1-70de-11d0-bd40-00a0c911ce86)
+]
+coclass LegacyAmFilterCategory { }
+
+[
+ helpstring("VFW Capture Class Manager"),
+ threading(both),
+ uuid(860bb310-5d01-11d0-bd3b-00a0c911ce86)
+]
+coclass VideoInputDeviceCategory { }
+
+[
+ helpstring("WaveIn Class Manager"),
+ threading(both),
+ uuid(33d9a762-90c8-11d0-bd43-00a0c911ce86)
+]
+coclass AudioInputDeviceCategory { }
+
+[
+ helpstring("WaveOut and DSound Class Manager"),
+ threading(both),
+ uuid(e0f158e1-cb04-11d0-bd4e-00a0c911ce86)
+]
+coclass AudioRendererCategory { }
+
+[
+ helpstring("MidiOut Class Manager"),
+ threading(both),
+ uuid(4efe2452-168a-11d1-bc76-00c04fb9453b)
+]
+coclass MidiRendererCategory { }
+
+[
+ helpstring("ActiveMovie Filter Categories"),
+ threading(both),
+ uuid(da4e3da0-d07d-11d0-bd50-00a0c911ce86)
+]
+coclass ActiveMovieCategories { }
Propchange: trunk/reactos/dll/directx/wine/devenum/devenum_classes.idl
------------------------------------------------------------------------------
svn:eol-style = native
Added: trunk/reactos/dll/directx/wine/devenum/devenum_classes.rgs
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/wine/devenum/d…
==============================================================================
--- trunk/reactos/dll/directx/wine/devenum/devenum_classes.rgs (added)
+++ trunk/reactos/dll/directx/wine/devenum/devenum_classes.rgs [iso-8859-1] Tue Oct 1
22:07:54 2013
@@ -0,0 +1,60 @@
+HKCR
+{
+ NoRemove Interface
+ {
+ }
+ NoRemove CLSID
+ {
+ '{62BE5D10-60EB-11D0-BD3B-00A0C911CE86}' = s 'System Device
Enum'
+ {
+ InprocServer32 = s '%MODULE%' { val ThreadingModel = s 'Both'
}
+ }
+ '{4315D437-5B8C-11D0-BD3B-00A0C911CE86}' = s 'DeviceMoniker'
+ {
+ InprocServer32 = s '%MODULE%' { val ThreadingModel = s 'Both'
}
+ ProgId = s 'device.1'
+ VersionIndependentProgId = s 'device'
+ }
+ '{33D9A761-90C8-11D0-BD43-00A0C911CE86}' = s 'ACM Class Manager'
+ {
+ InprocServer32 = s '%MODULE%' { val ThreadingModel = s 'Both'
}
+ }
+ '{33D9A760-90C8-11D0-BD43-00A0C911CE86}' = s 'ICM Class Manager'
+ {
+ InprocServer32 = s '%MODULE%' { val ThreadingModel = s 'Both'
}
+ }
+ '{083863F1-70DE-11D0-BD40-00A0C911CE86}' = s 'ActiveMovie Filter
Class Manager'
+ {
+ InprocServer32 = s '%MODULE%' { val ThreadingModel = s 'Both'
}
+ }
+ '{860BB310-5D01-11D0-BD3B-00A0C911CE86}' = s 'VFW Capture Class
Manager'
+ {
+ InprocServer32 = s '%MODULE%' { val ThreadingModel = s 'Both'
}
+ }
+ '{33D9A762-90C8-11D0-BD43-00A0C911CE86}' = s 'WaveIn Class
Manager'
+ {
+ InprocServer32 = s '%MODULE%' { val ThreadingModel = s 'Both'
}
+ }
+ '{E0F158E1-CB04-11D0-BD4E-00A0C911CE86}' = s 'WaveOut and DSound
Class Manager'
+ {
+ InprocServer32 = s '%MODULE%' { val ThreadingModel = s 'Both'
}
+ }
+ '{4EFE2452-168A-11D1-BC76-00C04FB9453B}' = s 'MidiOut Class
Manager'
+ {
+ InprocServer32 = s '%MODULE%' { val ThreadingModel = s 'Both'
}
+ }
+ '{DA4E3DA0-D07D-11D0-BD50-00A0C911CE86}' = s 'ActiveMovie Filter
Categories'
+ {
+ InprocServer32 = s '%MODULE%' { val ThreadingModel = s 'Both'
}
+ }
+ }
+ 'device.1' = s 'DeviceMoniker'
+ {
+ CLSID = s '{4315D437-5B8C-11D0-BD3B-00A0C911CE86}'
+ }
+ 'device' = s 'DeviceMoniker'
+ {
+ CLSID = s '{4315D437-5B8C-11D0-BD3B-00A0C911CE86}'
+ CurVer = s 'device.1'
+ }
+}
Propchange: trunk/reactos/dll/directx/wine/devenum/devenum_classes.rgs
------------------------------------------------------------------------------
svn:eol-style = native
Modified: trunk/reactos/dll/directx/wine/devenum/devenum_main.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/wine/devenum/d…
==============================================================================
--- trunk/reactos/dll/directx/wine/devenum/devenum_main.c [iso-8859-1] (original)
+++ trunk/reactos/dll/directx/wine/devenum/devenum_main.c [iso-8859-1] Tue Oct 1 22:07:54
2013
@@ -20,13 +20,13 @@
*/
#include "devenum_private.h"
+#include <rpcproxy.h>
#include <wine/debug.h>
-//#include "winreg.h"
WINE_DEFAULT_DEBUG_CHANNEL(devenum);
-LONG dll_refs;
-HINSTANCE DEVENUM_hInstance;
+DECLSPEC_HIDDEN LONG dll_refs;
+DECLSPEC_HIDDEN HINSTANCE DEVENUM_hInstance;
typedef struct
{
@@ -35,7 +35,6 @@
BOOL instance;
} register_info;
-static HRESULT register_clsids(int count, const register_info * pRegInfo, LPCWSTR
pszThreadingModel);
static void DEVENUM_RegisterQuartz(void);
/***********************************************************************
@@ -55,10 +54,6 @@
DEVENUM_hInstance = hinstDLL;
DisableThreadLibraryCalls(hinstDLL);
break;
-
- case DLL_PROCESS_DETACH:
- DEVENUM_hInstance = 0;
- break;
}
return TRUE;
}
@@ -76,7 +71,7 @@
* Oh well - works just fine as it is */
if (IsEqualGUID(rclsid, &CLSID_SystemDeviceEnum) ||
IsEqualGUID(rclsid, &CLSID_CDeviceMoniker))
- return IClassFactory_QueryInterface((IClassFactory*)&DEVENUM_ClassFactory,
iid, ppv);
+ return
IClassFactory_QueryInterface(&DEVENUM_ClassFactory.IClassFactory_iface, iid, ppv);
FIXME("CLSID: %s, IID: %s\n", debugstr_guid(rclsid), debugstr_guid(iid));
return CLASS_E_CLASSNOTAVAILABLE;
@@ -96,42 +91,12 @@
HRESULT WINAPI DllRegisterServer(void)
{
HRESULT res;
- HKEY hkeyClsid = NULL;
- HKEY hkey1 = NULL;
- HKEY hkey2 = NULL;
- LPOLESTR pszClsidDevMon = NULL;
IFilterMapper2 * pMapper = NULL;
LPVOID mapvptr;
- static const WCHAR threadingModel[] =
{'B','o','t','h',0};
- static const WCHAR sysdevenum[] =
{'S','y','s','t','e','m','
','D','e','v','i','c','e','
','E','n','u','m',0};
- static const WCHAR devmon[] =
{'D','e','v','i','c','e','M','o','n','i','k','e','r',0};
- static const WCHAR acmcat[] = {'A','C','M','
','C','l','a','s','s','
','M','a','n','a','g','e','r',0};
- static const WCHAR vidcat[] = {'I','C','M','
','C','l','a','s','s','
','M','a','n','a','g','e','r',0};
- static const WCHAR filtcat[] =
{'A','c','t','i','v','e','M','o','v','i','e','
','F','i','l','t','e','r','
','C','l','a','s','s','
','M','a','n','a','g','e','r',0};
- static const WCHAR vfwcat[] = {'V','F','W','
','C','a','p','t','u','r','e','
','C','l','a','s','s','
','M','a','n','a','g','e','r',0};
- static const WCHAR wavein[] =
{'W','a','v','e','I','n','
','C','l','a','s','s','
','M','a','n','a','g','e','r',
0};
- static const WCHAR waveout[] =
{'W','a','v','e','O','u','t','
','a','n','d','
','D','S','o','u','n','d','
','C','l','a','s','s','
','M','a','n','a','g','e','r',0};
- static const WCHAR midiout[] =
{'M','i','d','i','O','u','t','
','C','l','a','s','s','
','M','a','n','a','g','e','r',0};
- static const WCHAR amcat[] =
{'A','c','t','i','v','e','M','o','v','i','e','
','F','i','l','t','e','r','
','C','a','t','e','g','o','r','i','e','s',0};
- static const WCHAR device[] =
{'d','e','v','i','c','e',0};
- static const WCHAR device_1[] =
{'d','e','v','i','c','e','.','1',0};
- static const register_info ri[] =
- {
- {&CLSID_SystemDeviceEnum, sysdevenum, FALSE},
- {&CLSID_CDeviceMoniker, devmon, FALSE},
- {&CLSID_AudioCompressorCategory, acmcat, TRUE},
- {&CLSID_VideoCompressorCategory, vidcat, TRUE},
- {&CLSID_LegacyAmFilterCategory, filtcat, TRUE},
- {&CLSID_VideoInputDeviceCategory, vfwcat, FALSE},
- {&CLSID_AudioInputDeviceCategory, wavein, FALSE},
- {&CLSID_AudioRendererCategory, waveout, FALSE},
- {&CLSID_MidiRendererCategory, midiout, FALSE},
- {&CLSID_ActiveMovieCategories, amcat, TRUE}
- };
TRACE("\n");
- res = register_clsids(sizeof(ri) / sizeof(register_info), ri, threadingModel);
+ res = __wine_register_resources( DEVENUM_hInstance );
/* Quartz is needed for IFilterMapper2 */
DEVENUM_RegisterQuartz();
@@ -169,116 +134,6 @@
IFilterMapper2_Release(pMapper);
}
-/*** CDeviceMoniker ***/
- if (SUCCEEDED(res))
- {
- res = StringFromCLSID(&CLSID_CDeviceMoniker, &pszClsidDevMon);
- }
- if (SUCCEEDED(res))
- {
- res = RegOpenKeyW(HKEY_CLASSES_ROOT, clsid_keyname, &hkeyClsid)
- == ERROR_SUCCESS ? S_OK : E_FAIL;
- }
- if (SUCCEEDED(res))
- {
- res = RegOpenKeyW(hkeyClsid, pszClsidDevMon, &hkey1)
- == ERROR_SUCCESS ? S_OK : E_FAIL;
- }
- if (SUCCEEDED(res))
- {
- static const WCHAR wszProgID[] =
{'P','r','o','g','I','D',0};
- res = RegCreateKeyW(hkey1, wszProgID, &hkey2)
- == ERROR_SUCCESS ? S_OK : E_FAIL;
- }
- if (SUCCEEDED(res))
- {
- res = RegSetValueW(hkey2, NULL, REG_SZ, device_1, (lstrlenW(device_1) + 1) *
sizeof(WCHAR))
- == ERROR_SUCCESS ? S_OK : E_FAIL;
- }
-
- if (hkey2)
- {
- RegCloseKey(hkey2);
- hkey2 = NULL;
- }
-
- if (SUCCEEDED(res))
- {
- static const WCHAR wszVProgID[] =
{'V','e','r','s','i','o','n','I','n','d','e','p','e','d','e','n','t','P','r','o','g','I','D',0};
- res = RegCreateKeyW(hkey1, wszVProgID, &hkey2)
- == ERROR_SUCCESS ? S_OK : E_FAIL;
- }
- if (SUCCEEDED(res))
- {
- res = RegSetValueW(hkey2, NULL, REG_SZ, device, (lstrlenW(device) + 1) *
sizeof(WCHAR))
- == ERROR_SUCCESS ? S_OK : E_FAIL;
- }
-
- if (hkey2)
- {
- RegCloseKey(hkey2);
- hkey2 = NULL;
- }
-
- if (hkey1)
- {
- RegCloseKey(hkey1);
- hkey1 = NULL;
- }
-
- if (SUCCEEDED(res))
- {
- res = RegCreateKeyW(HKEY_CLASSES_ROOT, device, &hkey1)
- == ERROR_SUCCESS ? S_OK : E_FAIL;
- }
- if (SUCCEEDED(res))
- {
- res = RegCreateKeyW(hkey1, clsid_keyname, &hkey2)
- == ERROR_SUCCESS ? S_OK : E_FAIL;
- }
- if (SUCCEEDED(res))
- {
- res = RegSetValueW(hkey2, NULL, REG_SZ, pszClsidDevMon, (lstrlenW(pszClsidDevMon)
+ 1) * sizeof(WCHAR))
- == ERROR_SUCCESS ? S_OK : E_FAIL;
- }
- if (hkey2)
- {
- RegCloseKey(hkey2);
- hkey2 = NULL;
- }
-
- if (hkey1)
- {
- RegCloseKey(hkey1);
- hkey1 = NULL;
- }
-
- if (SUCCEEDED(res))
- {
- res = RegCreateKeyW(HKEY_CLASSES_ROOT, device_1, &hkey1)
- == ERROR_SUCCESS ? S_OK : E_FAIL;
- }
- if (SUCCEEDED(res))
- {
- res = RegCreateKeyW(hkey1, clsid_keyname, &hkey2)
- == ERROR_SUCCESS ? S_OK : E_FAIL;
- }
- if (SUCCEEDED(res))
- {
- res = RegSetValueW(hkey2, NULL, REG_SZ, pszClsidDevMon, (lstrlenW(pszClsidDevMon)
+ 1) * sizeof(WCHAR))
- == ERROR_SUCCESS ? S_OK : E_FAIL;
- }
-
- if (hkey2)
- RegCloseKey(hkey2);
-
- if (hkey1)
- RegCloseKey(hkey1);
-
- if (hkeyClsid)
- RegCloseKey(hkeyClsid);
-
- CoTaskMemFree(pszClsidDevMon);
CoUninitialize();
return res;
@@ -289,77 +144,8 @@
*/
HRESULT WINAPI DllUnregisterServer(void)
{
- FIXME("stub!\n");
- return E_FAIL;
-}
-
-static HRESULT register_clsids(int count, const register_info * pRegInfo, LPCWSTR
pszThreadingModel)
-{
- HRESULT res = S_OK;
- LPOLESTR clsidString = NULL;
- HKEY hkeyClsid;
- HKEY hkeySub;
- HKEY hkeyInproc32;
- HKEY hkeyInstance = NULL;
- int i;
- static const WCHAR wcszInproc32[] =
{'I','n','p','r','o','c','S','e','r','v','e','r','3','2',0};
- static const WCHAR wcszThreadingModel[] =
{'T','h','r','e','a','d','i','n','g','M','o','d','e','l',0};
- static const WCHAR dll_module[] =
{'d','e','v','e','n','u','m','.','d','l','l',0};
-
- res = RegOpenKeyW(HKEY_CLASSES_ROOT, clsid_keyname, &hkeyClsid)
- == ERROR_SUCCESS ? S_OK : E_FAIL;
-
- for (i = 0; i < count; i++)
- {
- hkeySub = 0;
- if (SUCCEEDED(res))
- {
- res = StringFromCLSID(pRegInfo[i].clsid, &clsidString);
- }
- if (SUCCEEDED(res))
- {
- res = RegCreateKeyW(hkeyClsid, clsidString, &hkeySub)
- == ERROR_SUCCESS ? S_OK : E_FAIL;
- }
- if (pRegInfo[i].instance && SUCCEEDED(res))
- {
- res = RegCreateKeyW(hkeySub, wszInstanceKeyName, &hkeyInstance)
- == ERROR_SUCCESS ? S_OK : E_FAIL;
- RegCloseKey(hkeyInstance);
- }
- if (SUCCEEDED(res))
- {
- RegSetValueW(hkeySub,
- NULL,
- REG_SZ,
- pRegInfo->friendly_name ? pRegInfo[i].friendly_name : clsidString,
- (lstrlenW(pRegInfo[i].friendly_name ? pRegInfo->friendly_name :
clsidString) + 1) * sizeof(WCHAR));
- res = RegCreateKeyW(hkeySub, wcszInproc32, &hkeyInproc32)
- == ERROR_SUCCESS ? S_OK : E_FAIL;
- }
- if (SUCCEEDED(res))
- {
- RegSetValueW(hkeyInproc32,
- NULL,
- REG_SZ,
- dll_module,
- (lstrlenW(dll_module) + 1) * sizeof(WCHAR));
- RegSetValueExW(hkeyInproc32,
- wcszThreadingModel,
- 0,
- REG_SZ,
- (LPCVOID)pszThreadingModel,
- (lstrlenW(pszThreadingModel) + 1) * sizeof(WCHAR));
- RegCloseKey(hkeyInproc32);
- }
- if (hkeySub) RegCloseKey(hkeySub);
- CoTaskMemFree(clsidString);
- clsidString = NULL;
- }
-
- RegCloseKey(hkeyClsid);
-
- return res;
+ FIXME("stub!\n");
+ return __wine_unregister_resources( DEVENUM_hInstance );
}
typedef HRESULT (WINAPI *DllRegisterServer_func)(void);
Modified: trunk/reactos/dll/directx/wine/devenum/devenum_private.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/wine/devenum/d…
==============================================================================
--- trunk/reactos/dll/directx/wine/devenum/devenum_private.h [iso-8859-1] (original)
+++ trunk/reactos/dll/directx/wine/devenum/devenum_private.h [iso-8859-1] Tue Oct 1
22:07:54 2013
@@ -51,7 +51,7 @@
/**********************************************************************
* Dll lifetime tracking declaration for devenum.dll
*/
-extern LONG dll_refs;
+extern LONG dll_refs DECLSPEC_HIDDEN;
static inline void DEVENUM_LockModule(void) { InterlockedIncrement(&dll_refs); }
static inline void DEVENUM_UnlockModule(void) { InterlockedDecrement(&dll_refs); }
@@ -61,45 +61,27 @@
*/
typedef struct
{
- const IClassFactoryVtbl *lpVtbl;
+ IClassFactory IClassFactory_iface;
} ClassFactoryImpl;
typedef struct
{
- const ICreateDevEnumVtbl *lpVtbl;
-} CreateDevEnumImpl;
-
-typedef struct
-{
- const IParseDisplayNameVtbl *lpVtbl;
-} ParseDisplayNameImpl;
-
-typedef struct
-{
- const IEnumMonikerVtbl *lpVtbl;
- LONG ref;
- DWORD index;
- HKEY hkey;
-} EnumMonikerImpl;
-
-typedef struct
-{
- const IMonikerVtbl *lpVtbl;
+ IMoniker IMoniker_iface;
LONG ref;
HKEY hkey;
} MediaCatMoniker;
-MediaCatMoniker * DEVENUM_IMediaCatMoniker_Construct(void);
-HRESULT DEVENUM_IEnumMoniker_Construct(HKEY hkey, IEnumMoniker ** ppEnumMoniker);
+MediaCatMoniker * DEVENUM_IMediaCatMoniker_Construct(void) DECLSPEC_HIDDEN;
+HRESULT DEVENUM_IEnumMoniker_Construct(HKEY hkey, IEnumMoniker ** ppEnumMoniker)
DECLSPEC_HIDDEN;
-extern ClassFactoryImpl DEVENUM_ClassFactory;
-extern CreateDevEnumImpl DEVENUM_CreateDevEnum;
-extern ParseDisplayNameImpl DEVENUM_ParseDisplayName;
+extern ClassFactoryImpl DEVENUM_ClassFactory DECLSPEC_HIDDEN;
+extern ICreateDevEnum DEVENUM_CreateDevEnum DECLSPEC_HIDDEN;
+extern IParseDisplayName DEVENUM_ParseDisplayName DECLSPEC_HIDDEN;
/**********************************************************************
* Private helper function to get AM filter category key location
*/
-HRESULT DEVENUM_GetCategoryKey(REFCLSID clsidDeviceClass, HKEY *pBaseKey, WCHAR
*wszRegKeyName, UINT maxLen);
+HRESULT DEVENUM_GetCategoryKey(REFCLSID clsidDeviceClass, HKEY *pBaseKey, WCHAR
*wszRegKeyName, UINT maxLen) DECLSPEC_HIDDEN;
/**********************************************************************
* Global string constant declarations
Modified: trunk/reactos/dll/directx/wine/devenum/factory.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/wine/devenum/f…
==============================================================================
--- trunk/reactos/dll/directx/wine/devenum/factory.c [iso-8859-1] (original)
+++ trunk/reactos/dll/directx/wine/devenum/factory.c [iso-8859-1] Tue Oct 1 22:07:54
2013
@@ -28,12 +28,10 @@
/**********************************************************************
* DEVENUM_IClassFactory_QueryInterface (also IUnknown)
*/
-static HRESULT WINAPI DEVENUM_IClassFactory_QueryInterface(
- LPCLASSFACTORY iface,
- REFIID riid,
- LPVOID *ppvObj)
+static HRESULT WINAPI DEVENUM_IClassFactory_QueryInterface(IClassFactory *iface, REFIID
riid,
+ void **ppvObj)
{
- TRACE("\n\tIID:\t%s\n",debugstr_guid(riid));
+ TRACE("(%p)->(%s, %p)\n", iface, debugstr_guid(riid), ppvObj);
if (ppvObj == NULL) return E_POINTER;
@@ -56,7 +54,7 @@
/**********************************************************************
* DEVENUM_IClassFactory_AddRef (also IUnknown)
*/
-static ULONG WINAPI DEVENUM_IClassFactory_AddRef(LPCLASSFACTORY iface)
+static ULONG WINAPI DEVENUM_IClassFactory_AddRef(IClassFactory *iface)
{
TRACE("\n");
@@ -68,7 +66,7 @@
/**********************************************************************
* DEVENUM_IClassFactory_Release (also IUnknown)
*/
-static ULONG WINAPI DEVENUM_IClassFactory_Release(LPCLASSFACTORY iface)
+static ULONG WINAPI DEVENUM_IClassFactory_Release(IClassFactory *iface)
{
TRACE("\n");
@@ -80,13 +78,10 @@
/**********************************************************************
* DEVENUM_IClassFactory_CreateInstance
*/
-static HRESULT WINAPI DEVENUM_IClassFactory_CreateInstance(
- LPCLASSFACTORY iface,
- LPUNKNOWN pUnkOuter,
- REFIID riid,
- LPVOID *ppvObj)
+static HRESULT WINAPI DEVENUM_IClassFactory_CreateInstance(IClassFactory *iface,
+ IUnknown *pUnkOuter, REFIID riid, void **ppvObj)
{
- TRACE("\n\tIID:\t%s\n",debugstr_guid(riid));
+ TRACE("(%p)->(%p, %s, %p)\n", iface, pUnkOuter, debugstr_guid(riid),
ppvObj);
if (ppvObj == NULL) return E_POINTER;
@@ -110,9 +105,7 @@
/**********************************************************************
* DEVENUM_IClassFactory_LockServer
*/
-static HRESULT WINAPI DEVENUM_IClassFactory_LockServer(
- LPCLASSFACTORY iface,
- BOOL fLock)
+static HRESULT WINAPI DEVENUM_IClassFactory_LockServer(IClassFactory *iface, BOOL fLock)
{
TRACE("\n");
@@ -138,4 +131,4 @@
/**********************************************************************
* static ClassFactory instance
*/
-ClassFactoryImpl DEVENUM_ClassFactory = { &IClassFactory_Vtbl };
+ClassFactoryImpl DEVENUM_ClassFactory = { { &IClassFactory_Vtbl } };
Modified: trunk/reactos/dll/directx/wine/devenum/mediacatenum.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/wine/devenum/m…
==============================================================================
--- trunk/reactos/dll/directx/wine/devenum/mediacatenum.c [iso-8859-1] (original)
+++ trunk/reactos/dll/directx/wine/devenum/mediacatenum.c [iso-8859-1] Tue Oct 1 22:07:54
2013
@@ -30,24 +30,33 @@
WINE_DEFAULT_DEBUG_CHANNEL(devenum);
-static ULONG WINAPI DEVENUM_IEnumMoniker_AddRef(LPENUMMONIKER iface);
-static ULONG WINAPI DEVENUM_IMediaCatMoniker_AddRef(LPMONIKER iface);
-static ULONG WINAPI DEVENUM_IPropertyBag_AddRef(LPPROPERTYBAG iface);
-
typedef struct
{
- const IPropertyBagVtbl *lpVtbl;
+ IEnumMoniker IEnumMoniker_iface;
+ LONG ref;
+ DWORD index;
+ HKEY hkey;
+} EnumMonikerImpl;
+
+typedef struct
+{
+ IPropertyBag IPropertyBag_iface;
LONG ref;
HKEY hkey;
} RegPropBagImpl;
+
+static inline RegPropBagImpl *impl_from_IPropertyBag(IPropertyBag *iface)
+{
+ return CONTAINING_RECORD(iface, RegPropBagImpl, IPropertyBag_iface);
+}
static HRESULT WINAPI DEVENUM_IPropertyBag_QueryInterface(
LPPROPERTYBAG iface,
REFIID riid,
LPVOID *ppvObj)
{
- RegPropBagImpl *This = (RegPropBagImpl *)iface;
+ RegPropBagImpl *This = impl_from_IPropertyBag(iface);
TRACE("(%p)->(%s, %p)\n", iface, debugstr_guid(riid), ppvObj);
@@ -57,7 +66,7 @@
IsEqualGUID(riid, &IID_IPropertyBag))
{
*ppvObj = iface;
- DEVENUM_IPropertyBag_AddRef(iface);
+ IPropertyBag_AddRef(iface);
return S_OK;
}
@@ -70,7 +79,7 @@
*/
static ULONG WINAPI DEVENUM_IPropertyBag_AddRef(LPPROPERTYBAG iface)
{
- RegPropBagImpl *This = (RegPropBagImpl *)iface;
+ RegPropBagImpl *This = impl_from_IPropertyBag(iface);
TRACE("(%p)->() AddRef from %d\n", iface, This->ref);
@@ -82,7 +91,7 @@
*/
static ULONG WINAPI DEVENUM_IPropertyBag_Release(LPPROPERTYBAG iface)
{
- RegPropBagImpl *This = (RegPropBagImpl *)iface;
+ RegPropBagImpl *This = impl_from_IPropertyBag(iface);
ULONG ref;
TRACE("(%p)->() ReleaseThis->ref from %d\n", iface, This->ref);
@@ -105,7 +114,7 @@
LPVOID pData = NULL;
DWORD received;
DWORD type = 0;
- RegPropBagImpl *This = (RegPropBagImpl *)iface;
+ RegPropBagImpl *This = impl_from_IPropertyBag(iface);
HRESULT res = S_OK;
LONG reswin32;
@@ -212,7 +221,7 @@
LPCOLESTR pszPropName,
VARIANT* pVar)
{
- RegPropBagImpl *This = (RegPropBagImpl *)iface;
+ RegPropBagImpl *This = impl_from_IPropertyBag(iface);
LPVOID lpData = NULL;
DWORD cbData = 0;
DWORD dwType = 0;
@@ -223,6 +232,7 @@
switch (V_VT(pVar))
{
case VT_BSTR:
+ case VT_LPWSTR:
TRACE("writing %s\n", debugstr_w(V_UNION(pVar, bstrVal)));
lpData = V_UNION(pVar, bstrVal);
dwType = REG_SZ;
@@ -277,62 +287,60 @@
RegPropBagImpl * rpb = CoTaskMemAlloc(sizeof(RegPropBagImpl));
if (!rpb)
return E_OUTOFMEMORY;
- rpb->lpVtbl = &IPropertyBag_Vtbl;
+ rpb->IPropertyBag_iface.lpVtbl = &IPropertyBag_Vtbl;
rpb->ref = 1;
rpb->hkey = hkey;
- *ppBag = (IPropertyBag*)rpb;
+ *ppBag = &rpb->IPropertyBag_iface;
DEVENUM_LockModule();
return S_OK;
}
-static HRESULT WINAPI DEVENUM_IMediaCatMoniker_QueryInterface(
- LPMONIKER iface,
- REFIID riid,
- LPVOID *ppvObj)
-{
- MediaCatMoniker *This = (MediaCatMoniker *)iface;
+static inline MediaCatMoniker *impl_from_IMoniker(IMoniker *iface)
+{
+ return CONTAINING_RECORD(iface, MediaCatMoniker, IMoniker_iface);
+}
+
+static HRESULT WINAPI DEVENUM_IMediaCatMoniker_QueryInterface(IMoniker *iface, REFIID
riid,
+ void **ppv)
+{
TRACE("\n\tIID:\t%s\n",debugstr_guid(riid));
- if (This == NULL || ppvObj == NULL) return E_POINTER;
-
- *ppvObj = NULL;
+ if (!ppv)
+ return E_POINTER;
if (IsEqualGUID(riid, &IID_IUnknown) ||
IsEqualGUID(riid, &IID_IPersist) ||
IsEqualGUID(riid, &IID_IPersistStream) ||
IsEqualGUID(riid, &IID_IMoniker))
{
- *ppvObj = iface;
- DEVENUM_IMediaCatMoniker_AddRef(iface);
+ *ppv = iface;
+ IMoniker_AddRef(iface);
return S_OK;
}
FIXME("- no interface IID: %s\n", debugstr_guid(riid));
+ *ppv = NULL;
return E_NOINTERFACE;
}
-/**********************************************************************
- * DEVENUM_IMediaCatMoniker_AddRef (also IUnknown)
- */
-static ULONG WINAPI DEVENUM_IMediaCatMoniker_AddRef(LPMONIKER iface)
-{
- MediaCatMoniker *This = (MediaCatMoniker *)iface;
- TRACE("\n");
-
- return InterlockedIncrement(&This->ref);
-}
-
-/**********************************************************************
- * DEVENUM_IMediaCatMoniker_Release (also IUnknown)
- */
-static ULONG WINAPI DEVENUM_IMediaCatMoniker_Release(LPMONIKER iface)
-{
- MediaCatMoniker *This = (MediaCatMoniker *)iface;
- ULONG ref;
- TRACE("\n");
-
- ref = InterlockedDecrement(&This->ref);
+static ULONG WINAPI DEVENUM_IMediaCatMoniker_AddRef(IMoniker *iface)
+{
+ MediaCatMoniker *This = impl_from_IMoniker(iface);
+ ULONG ref = InterlockedIncrement(&This->ref);
+
+ TRACE("(%p) ref=%d\n", This, ref);
+
+ return ref;
+}
+
+static ULONG WINAPI DEVENUM_IMediaCatMoniker_Release(IMoniker *iface)
+{
+ MediaCatMoniker *This = impl_from_IMoniker(iface);
+ ULONG ref = InterlockedDecrement(&This->ref);
+
+ TRACE("(%p) ref=%d\n", This, ref);
+
if (ref == 0) {
RegCloseKey(This->hkey);
CoTaskMemFree(This);
@@ -341,11 +349,10 @@
return ref;
}
-static HRESULT WINAPI DEVENUM_IMediaCatMoniker_GetClassID(
- LPMONIKER iface,
- CLSID* pClassID)
-{
- MediaCatMoniker *This = (MediaCatMoniker *)iface;
+static HRESULT WINAPI DEVENUM_IMediaCatMoniker_GetClassID(IMoniker *iface, CLSID
*pClassID)
+{
+ MediaCatMoniker *This = impl_from_IMoniker(iface);
+
FIXME("(%p)->(%p): stub\n", This, pClassID);
if (pClassID == NULL)
@@ -354,30 +361,28 @@
return E_NOTIMPL;
}
-static HRESULT WINAPI DEVENUM_IMediaCatMoniker_IsDirty(LPMONIKER iface)
+static HRESULT WINAPI DEVENUM_IMediaCatMoniker_IsDirty(IMoniker *iface)
{
FIXME("(%p)->(): stub\n", iface);
return S_FALSE;
}
-static HRESULT WINAPI DEVENUM_IMediaCatMoniker_Load(LPMONIKER iface, IStream* pStm)
+static HRESULT WINAPI DEVENUM_IMediaCatMoniker_Load(IMoniker *iface, IStream *pStm)
{
FIXME("(%p)->(%p): stub\n", iface, pStm);
return E_NOTIMPL;
}
-static HRESULT WINAPI DEVENUM_IMediaCatMoniker_Save(LPMONIKER iface, IStream* pStm, BOOL
fClearDirty)
+static HRESULT WINAPI DEVENUM_IMediaCatMoniker_Save(IMoniker *iface, IStream *pStm, BOOL
fClearDirty)
{
FIXME("(%p)->(%p, %s): stub\n", iface, pStm, fClearDirty ?
"true" : "false");
return STG_E_CANTSAVE;
}
-static HRESULT WINAPI DEVENUM_IMediaCatMoniker_GetSizeMax(
- LPMONIKER iface,
- ULARGE_INTEGER* pcbSize)
+static HRESULT WINAPI DEVENUM_IMediaCatMoniker_GetSizeMax(IMoniker *iface, ULARGE_INTEGER
*pcbSize)
{
FIXME("(%p)->(%p): stub\n", iface, pcbSize);
@@ -386,25 +391,19 @@
return S_OK;
}
-static HRESULT WINAPI DEVENUM_IMediaCatMoniker_BindToObject(
- LPMONIKER iface,
- IBindCtx* pbc,
- IMoniker* pmkToLeft,
- REFIID riidResult,
- void** ppvResult)
-{
+static HRESULT WINAPI DEVENUM_IMediaCatMoniker_BindToObject(IMoniker *iface, IBindCtx
*pbc,
+ IMoniker *pmkToLeft, REFIID riidResult, void **ppvResult)
+{
+ MediaCatMoniker *This = impl_from_IMoniker(iface);
IUnknown * pObj = NULL;
IPropertyBag * pProp = NULL;
CLSID clsID;
VARIANT var;
HRESULT res = E_FAIL;
- MediaCatMoniker *This = (MediaCatMoniker *)iface;
+ TRACE("(%p)->(%p, %p, %s, %p)\n", This, pbc, pmkToLeft,
debugstr_guid(riidResult), ppvResult);
VariantInit(&var);
-
- TRACE("(%p)->(%p, %p, %s, %p)\n", This, pbc, pmkToLeft,
debugstr_guid(riidResult), ppvResult);
-
*ppvResult = NULL;
if(pmkToLeft==NULL)
@@ -458,20 +457,27 @@
return res;
}
-static HRESULT WINAPI DEVENUM_IMediaCatMoniker_BindToStorage(
- LPMONIKER iface,
- IBindCtx* pbc,
- IMoniker* pmkToLeft,
- REFIID riid,
- void** ppvObj)
-{
- MediaCatMoniker *This = (MediaCatMoniker *)iface;
+static HRESULT WINAPI DEVENUM_IMediaCatMoniker_BindToStorage(IMoniker *iface, IBindCtx
*pbc,
+ IMoniker *pmkToLeft, REFIID riid, void **ppvObj)
+{
+ MediaCatMoniker *This = impl_from_IMoniker(iface);
+
TRACE("(%p)->(%p, %p, %s, %p)\n", This, pbc, pmkToLeft,
debugstr_guid(riid), ppvObj);
*ppvObj = NULL;
- if (pbc || pmkToLeft)
+ if (pmkToLeft)
return MK_E_NOSTORAGE;
+
+ if (pbc != NULL)
+ {
+ static DWORD reported;
+ if (!reported)
+ {
+ FIXME("ignoring IBindCtx %p\n", pbc);
+ reported++;
+ }
+ }
if (IsEqualGUID(riid, &IID_IPropertyBag))
{
@@ -483,12 +489,8 @@
return MK_E_NOSTORAGE;
}
-static HRESULT WINAPI DEVENUM_IMediaCatMoniker_Reduce(
- LPMONIKER iface,
- IBindCtx* pbc,
- DWORD dwReduceHowFar,
- IMoniker** ppmkToLeft,
- IMoniker** ppmkReduced)
+static HRESULT WINAPI DEVENUM_IMediaCatMoniker_Reduce(IMoniker *iface, IBindCtx *pbc,
+ DWORD dwReduceHowFar, IMoniker **ppmkToLeft, IMoniker **ppmkReduced)
{
TRACE("(%p)->(%p, %d, %p, %p)\n", iface, pbc, dwReduceHowFar,
ppmkToLeft, ppmkReduced);
@@ -499,11 +501,8 @@
return MK_S_REDUCED_TO_SELF;
}
-static HRESULT WINAPI DEVENUM_IMediaCatMoniker_ComposeWith(
- LPMONIKER iface,
- IMoniker* pmkRight,
- BOOL fOnlyIfNotGeneric,
- IMoniker** ppmkComposite)
+static HRESULT WINAPI DEVENUM_IMediaCatMoniker_ComposeWith(IMoniker *iface, IMoniker
*pmkRight,
+ BOOL fOnlyIfNotGeneric, IMoniker **ppmkComposite)
{
FIXME("(%p)->(%p, %s, %p): stub\n", iface, pmkRight, fOnlyIfNotGeneric ?
"true" : "false", ppmkComposite);
@@ -513,10 +512,8 @@
return E_NOTIMPL;
}
-static HRESULT WINAPI DEVENUM_IMediaCatMoniker_Enum(
- LPMONIKER iface,
- BOOL fForward,
- IEnumMoniker** ppenumMoniker)
+static HRESULT WINAPI DEVENUM_IMediaCatMoniker_Enum(IMoniker *iface, BOOL fForward,
+ IEnumMoniker **ppenumMoniker)
{
FIXME("(%p)->(%s, %p): stub\n", iface, fForward ? "true" :
"false", ppenumMoniker);
@@ -525,18 +522,14 @@
return S_OK;
}
-static HRESULT WINAPI DEVENUM_IMediaCatMoniker_IsEqual(
- LPMONIKER iface,
- IMoniker* pmkOtherMoniker)
+static HRESULT WINAPI DEVENUM_IMediaCatMoniker_IsEqual(IMoniker *iface, IMoniker
*pmkOtherMoniker)
{
FIXME("(%p)->(%p): stub\n", iface, pmkOtherMoniker);
return E_NOTIMPL;
}
-static HRESULT WINAPI DEVENUM_IMediaCatMoniker_Hash(
- LPMONIKER iface,
- DWORD* pdwHash)
+static HRESULT WINAPI DEVENUM_IMediaCatMoniker_Hash(IMoniker *iface, DWORD *pdwHash)
{
TRACE("(%p)->(%p)\n", iface, pdwHash);
@@ -545,22 +538,16 @@
return S_OK;
}
-static HRESULT WINAPI DEVENUM_IMediaCatMoniker_IsRunning(
- LPMONIKER iface,
- IBindCtx* pbc,
- IMoniker* pmkToLeft,
- IMoniker* pmkNewlyRunning)
+static HRESULT WINAPI DEVENUM_IMediaCatMoniker_IsRunning(IMoniker *iface, IBindCtx *pbc,
+ IMoniker *pmkToLeft, IMoniker *pmkNewlyRunning)
{
FIXME("(%p)->(%p, %p, %p): stub\n", iface, pbc, pmkToLeft,
pmkNewlyRunning);
return S_FALSE;
}
-static HRESULT WINAPI DEVENUM_IMediaCatMoniker_GetTimeOfLastChange(
- LPMONIKER iface,
- IBindCtx* pbc,
- IMoniker* pmkToLeft,
- FILETIME* pFileTime)
+static HRESULT WINAPI DEVENUM_IMediaCatMoniker_GetTimeOfLastChange(IMoniker *iface,
IBindCtx *pbc,
+ IMoniker *pmkToLeft, FILETIME *pFileTime)
{
TRACE("(%p)->(%p, %p, %p)\n", iface, pbc, pmkToLeft, pFileTime);
@@ -570,9 +557,7 @@
return MK_E_UNAVAILABLE;
}
-static HRESULT WINAPI DEVENUM_IMediaCatMoniker_Inverse(
- LPMONIKER iface,
- IMoniker** ppmk)
+static HRESULT WINAPI DEVENUM_IMediaCatMoniker_Inverse(IMoniker *iface, IMoniker **ppmk)
{
TRACE("(%p)->(%p)\n", iface, ppmk);
@@ -581,10 +566,8 @@
return MK_E_NOINVERSE;
}
-static HRESULT WINAPI DEVENUM_IMediaCatMoniker_CommonPrefixWith(
- LPMONIKER iface,
- IMoniker* pmkOtherMoniker,
- IMoniker** ppmkPrefix)
+static HRESULT WINAPI DEVENUM_IMediaCatMoniker_CommonPrefixWith(IMoniker *iface,
+ IMoniker *pmkOtherMoniker, IMoniker **ppmkPrefix)
{
TRACE("(%p)->(%p, %p)\n", iface, pmkOtherMoniker, ppmkPrefix);
@@ -593,10 +576,8 @@
return MK_E_NOPREFIX;
}
-static HRESULT WINAPI DEVENUM_IMediaCatMoniker_RelativePathTo(
- LPMONIKER iface,
- IMoniker* pmkOther,
- IMoniker** ppmkRelPath)
+static HRESULT WINAPI DEVENUM_IMediaCatMoniker_RelativePathTo(IMoniker *iface, IMoniker
*pmkOther,
+ IMoniker **ppmkRelPath)
{
TRACE("(%p)->(%p, %p)\n", iface, pmkOther, ppmkRelPath);
@@ -605,13 +586,10 @@
return MK_S_HIM;
}
-static HRESULT WINAPI DEVENUM_IMediaCatMoniker_GetDisplayName(
- LPMONIKER iface,
- IBindCtx* pbc,
- IMoniker* pmkToLeft,
- LPOLESTR* ppszDisplayName)
-{
- MediaCatMoniker *This = (MediaCatMoniker *)iface;
+static HRESULT WINAPI DEVENUM_IMediaCatMoniker_GetDisplayName(IMoniker *iface, IBindCtx
*pbc,
+ IMoniker *pmkToLeft, LPOLESTR *ppszDisplayName)
+{
+ MediaCatMoniker *This = impl_from_IMoniker(iface);
WCHAR wszBuffer[MAX_PATH];
static const WCHAR wszFriendlyName[] =
{'F','r','i','e','n','d','l','y','N','a','m','e',0};
LONG received = sizeof(wszFriendlyName);
@@ -631,13 +609,8 @@
return E_FAIL;
}
-static HRESULT WINAPI DEVENUM_IMediaCatMoniker_ParseDisplayName(
- LPMONIKER iface,
- IBindCtx* pbc,
- IMoniker* pmkToLeft,
- LPOLESTR pszDisplayName,
- ULONG* pchEaten,
- IMoniker** ppmkOut)
+static HRESULT WINAPI DEVENUM_IMediaCatMoniker_ParseDisplayName(IMoniker *iface, IBindCtx
*pbc,
+ IMoniker *pmkToLeft, LPOLESTR pszDisplayName, ULONG *pchEaten, IMoniker
**ppmkOut)
{
FIXME("(%p)->(%p, %p, %s, %p, %p)\n", iface, pbc, pmkToLeft,
debugstr_w(pszDisplayName), pchEaten, ppmkOut);
@@ -647,9 +620,7 @@
return MK_E_SYNTAX;
}
-static HRESULT WINAPI DEVENUM_IMediaCatMoniker_IsSystemMoniker(
- LPMONIKER iface,
- DWORD* pdwMksys)
+static HRESULT WINAPI DEVENUM_IMediaCatMoniker_IsSystemMoniker(IMoniker *iface, DWORD
*pdwMksys)
{
TRACE("(%p)->(%p)\n", iface, pdwMksys);
@@ -690,65 +661,59 @@
if (!pMoniker)
return NULL;
- pMoniker->lpVtbl = &IMoniker_Vtbl;
+ pMoniker->IMoniker_iface.lpVtbl = &IMoniker_Vtbl;
pMoniker->ref = 0;
pMoniker->hkey = NULL;
- DEVENUM_IMediaCatMoniker_AddRef((LPMONIKER)pMoniker);
+ DEVENUM_IMediaCatMoniker_AddRef(&pMoniker->IMoniker_iface);
DEVENUM_LockModule();
return pMoniker;
}
-/**********************************************************************
- * DEVENUM_IEnumMoniker_QueryInterface (also IUnknown)
- */
-static HRESULT WINAPI DEVENUM_IEnumMoniker_QueryInterface(
- LPENUMMONIKER iface,
- REFIID riid,
- LPVOID *ppvObj)
-{
- EnumMonikerImpl *This = (EnumMonikerImpl *)iface;
-
- TRACE("(%p)->(%s, %p)\n", iface, debugstr_guid(riid), ppvObj);
-
- if (This == NULL || ppvObj == NULL) return E_POINTER;
+static inline EnumMonikerImpl *impl_from_IEnumMoniker(IEnumMoniker *iface)
+{
+ return CONTAINING_RECORD(iface, EnumMonikerImpl, IEnumMoniker_iface);
+}
+
+static HRESULT WINAPI DEVENUM_IEnumMoniker_QueryInterface(IEnumMoniker *iface, REFIID
riid,
+ void **ppv)
+{
+ TRACE("(%p)->(%s, %p)\n", iface, debugstr_guid(riid), ppv);
+
+ if (!ppv)
+ return E_POINTER;
if (IsEqualGUID(riid, &IID_IUnknown) ||
IsEqualGUID(riid, &IID_IEnumMoniker))
{
- *ppvObj = iface;
- DEVENUM_IEnumMoniker_AddRef(iface);
+ *ppv = iface;
+ IEnumMoniker_AddRef(iface);
return S_OK;
}
FIXME("- no interface IID: %s\n", debugstr_guid(riid));
+ *ppv = NULL;
return E_NOINTERFACE;
}
-/**********************************************************************
- * DEVENUM_IEnumMoniker_AddRef (also IUnknown)
- */
-static ULONG WINAPI DEVENUM_IEnumMoniker_AddRef(LPENUMMONIKER iface)
-{
- EnumMonikerImpl *This = (EnumMonikerImpl *)iface;
+static ULONG WINAPI DEVENUM_IEnumMoniker_AddRef(IEnumMoniker *iface)
+{
+ EnumMonikerImpl *This = impl_from_IEnumMoniker(iface);
ULONG ref = InterlockedIncrement(&This->ref);
- TRACE("(%p)->() AddRef from %d\n", iface, ref - 1);
+ TRACE("(%p) ref=%d\n", This, ref);
return ref;
}
-/**********************************************************************
- * DEVENUM_IEnumMoniker_Release (also IUnknown)
- */
-static ULONG WINAPI DEVENUM_IEnumMoniker_Release(LPENUMMONIKER iface)
-{
- EnumMonikerImpl *This = (EnumMonikerImpl *)iface;
+static ULONG WINAPI DEVENUM_IEnumMoniker_Release(IEnumMoniker *iface)
+{
+ EnumMonikerImpl *This = impl_from_IEnumMoniker(iface);
ULONG ref = InterlockedDecrement(&This->ref);
- TRACE("(%p)->() Release from %d\n", iface, ref + 1);
+ TRACE("(%p) ref=%d\n", This, ref);
if (!ref)
{
@@ -760,13 +725,14 @@
return ref;
}
-static HRESULT WINAPI DEVENUM_IEnumMoniker_Next(LPENUMMONIKER iface, ULONG celt, IMoniker
** rgelt, ULONG * pceltFetched)
-{
+static HRESULT WINAPI DEVENUM_IEnumMoniker_Next(IEnumMoniker *iface, ULONG celt, IMoniker
**rgelt,
+ ULONG *pceltFetched)
+{
+ EnumMonikerImpl *This = impl_from_IEnumMoniker(iface);
WCHAR buffer[MAX_PATH + 1];
LONG res;
ULONG fetched = 0;
MediaCatMoniker * pMoniker;
- EnumMonikerImpl *This = (EnumMonikerImpl *)iface;
TRACE("(%p)->(%d, %p, %p)\n", iface, celt, rgelt, pceltFetched);
@@ -783,10 +749,10 @@
if (RegOpenKeyW(This->hkey, buffer, &pMoniker->hkey) != ERROR_SUCCESS)
{
- DEVENUM_IMediaCatMoniker_Release((LPMONIKER)pMoniker);
+ IMoniker_Release(&pMoniker->IMoniker_iface);
break;
}
- rgelt[fetched] = (LPMONIKER)pMoniker;
+ rgelt[fetched] = &pMoniker->IMoniker_iface;
fetched++;
}
@@ -803,15 +769,15 @@
return S_OK;
}
-static HRESULT WINAPI DEVENUM_IEnumMoniker_Skip(LPENUMMONIKER iface, ULONG celt)
-{
- EnumMonikerImpl *This = (EnumMonikerImpl *)iface;
+static HRESULT WINAPI DEVENUM_IEnumMoniker_Skip(IEnumMoniker *iface, ULONG celt)
+{
+ EnumMonikerImpl *This = impl_from_IEnumMoniker(iface);
DWORD subKeys;
TRACE("(%p)->(%d)\n", iface, celt);
- /* Before incrementing, check if there are any more values to run thru.
- Some programs use the Skip() function to get the amount of devices */
+ /* Before incrementing, check if there are any more values to run through.
+ Some programs use the Skip() function to get the number of devices */
if(RegQueryInfoKeyW(This->hkey, NULL, NULL, NULL, &subKeys, NULL, NULL, NULL,
NULL, NULL, NULL, NULL) != ERROR_SUCCESS)
{
return S_FALSE;
@@ -826,9 +792,9 @@
return S_OK;
}
-static HRESULT WINAPI DEVENUM_IEnumMoniker_Reset(LPENUMMONIKER iface)
-{
- EnumMonikerImpl *This = (EnumMonikerImpl *)iface;
+static HRESULT WINAPI DEVENUM_IEnumMoniker_Reset(IEnumMoniker *iface)
+{
+ EnumMonikerImpl *This = impl_from_IEnumMoniker(iface);
TRACE("(%p)->()\n", iface);
@@ -837,7 +803,7 @@
return S_OK;
}
-static HRESULT WINAPI DEVENUM_IEnumMoniker_Clone(LPENUMMONIKER iface, IEnumMoniker **
ppenum)
+static HRESULT WINAPI DEVENUM_IEnumMoniker_Clone(IEnumMoniker *iface, IEnumMoniker
**ppenum)
{
FIXME("(%p)->(%p): stub\n", iface, ppenum);
@@ -864,12 +830,12 @@
if (!pEnumMoniker)
return E_OUTOFMEMORY;
- pEnumMoniker->lpVtbl = &IEnumMoniker_Vtbl;
+ pEnumMoniker->IEnumMoniker_iface.lpVtbl = &IEnumMoniker_Vtbl;
pEnumMoniker->ref = 1;
pEnumMoniker->index = 0;
pEnumMoniker->hkey = hkey;
- *ppEnumMoniker = (IEnumMoniker *)pEnumMoniker;
+ *ppEnumMoniker = &pEnumMoniker->IEnumMoniker_iface;
DEVENUM_LockModule();
Modified: trunk/reactos/dll/directx/wine/devenum/parsedisplayname.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/wine/devenum/p…
==============================================================================
--- trunk/reactos/dll/directx/wine/devenum/parsedisplayname.c [iso-8859-1] (original)
+++ trunk/reactos/dll/directx/wine/devenum/parsedisplayname.c [iso-8859-1] Tue Oct 1
22:07:54 2013
@@ -27,31 +27,28 @@
WINE_DEFAULT_DEBUG_CHANNEL(devenum);
-static HRESULT WINAPI DEVENUM_IParseDisplayName_QueryInterface(
- LPPARSEDISPLAYNAME iface,
- REFIID riid,
- LPVOID *ppvObj)
+static HRESULT WINAPI DEVENUM_IParseDisplayName_QueryInterface(IParseDisplayName *iface,
+ REFIID riid, void **ppv)
{
TRACE("\n\tIID:\t%s\n",debugstr_guid(riid));
- if (ppvObj == NULL) return E_POINTER;
+ if (!ppv)
+ return E_POINTER;
if (IsEqualGUID(riid, &IID_IUnknown) ||
IsEqualGUID(riid, &IID_IParseDisplayName))
{
- *ppvObj = iface;
- IParseDisplayName_AddRef(iface);
- return S_OK;
+ *ppv = iface;
+ IParseDisplayName_AddRef(iface);
+ return S_OK;
}
FIXME("- no interface IID: %s\n", debugstr_guid(riid));
+ *ppv = NULL;
return E_NOINTERFACE;
}
-/**********************************************************************
- * DEVENUM_IParseDisplayName_AddRef (also IUnknown)
- */
-static ULONG WINAPI DEVENUM_IParseDisplayName_AddRef(LPPARSEDISPLAYNAME iface)
+static ULONG WINAPI DEVENUM_IParseDisplayName_AddRef(IParseDisplayName *iface)
{
TRACE("\n");
@@ -60,10 +57,7 @@
return 2; /* non-heap based object */
}
-/**********************************************************************
- * DEVENUM_IParseDisplayName_Release (also IUnknown)
- */
-static ULONG WINAPI DEVENUM_IParseDisplayName_Release(LPPARSEDISPLAYNAME iface)
+static ULONG WINAPI DEVENUM_IParseDisplayName_Release(IParseDisplayName *iface)
{
TRACE("\n");
@@ -81,12 +75,8 @@
* Might not handle more complicated strings properly (ie anything
* not in "@device:sw:{CLSID1}\<filter name or CLSID>" format
*/
-static HRESULT WINAPI DEVENUM_IParseDisplayName_ParseDisplayName(
- LPPARSEDISPLAYNAME iface,
- IBindCtx *pbc,
- LPOLESTR pszDisplayName,
- ULONG *pchEaten,
- IMoniker **ppmkOut)
+static HRESULT WINAPI DEVENUM_IParseDisplayName_ParseDisplayName(IParseDisplayName
*iface,
+ IBindCtx *pbc, LPOLESTR pszDisplayName, ULONG *pchEaten, IMoniker **ppmkOut)
{
LPOLESTR pszBetween = NULL;
LPOLESTR pszClass = NULL;
@@ -136,10 +126,10 @@
strcatW(wszRegKeyName, pszBetween);
if (RegCreateKeyW(hbasekey, wszRegKeyName, &pMoniker->hkey) ==
ERROR_SUCCESS)
- *ppmkOut = (LPMONIKER)pMoniker;
+ *ppmkOut = &pMoniker->IMoniker_iface;
else
{
- IMoniker_Release((LPMONIKER)pMoniker);
+ IMoniker_Release(&pMoniker->IMoniker_iface);
res = MK_E_NOOBJECT;
}
}
@@ -163,4 +153,4 @@
};
/* The one instance of this class */
-ParseDisplayNameImpl DEVENUM_ParseDisplayName = { &IParseDisplayName_Vtbl };
+IParseDisplayName DEVENUM_ParseDisplayName = { &IParseDisplayName_Vtbl };
Modified: trunk/reactos/media/doc/README.WINE
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/media/doc/README.WINE?rev=…
==============================================================================
--- trunk/reactos/media/doc/README.WINE [iso-8859-1] (original)
+++ trunk/reactos/media/doc/README.WINE [iso-8859-1] Tue Oct 1 22:07:54 2013
@@ -34,6 +34,7 @@
reactos/dll/directx/wine/d3dx9_24 => 43 # Synced to Wine-1.7.1
reactos/dll/directx/wine/d3dxof # Synced to Wine-1.7.1
reactos/dll/directx/wine/ddraw # Synced to Wine-1.7.1
+reactos/dll/directx/wine/devenum # Synced to Wine-1.7.1
reactos/dll/directx/wine/dinput # Synced to Wine-1.7.1
reactos/dll/directx/wine/dinput8 # Synced to Wine-1.5.26
reactos/dll/directx/wine/dmusic # Synced to Wine-1.5.26