Author: akhaldi
Date: Wed Apr 8 17:10:40 2015
New Revision: 67085
URL:
http://svn.reactos.org/svn/reactos?rev=67085&view=rev
Log:
[MMDEVAPI] Sync with Wine Staging 1.7.37. CORE-9246
Modified:
trunk/reactos/dll/win32/mmdevapi/CMakeLists.txt
trunk/reactos/dll/win32/mmdevapi/audiovolume.c
trunk/reactos/dll/win32/mmdevapi/devenum.c
trunk/reactos/dll/win32/mmdevapi/main.c
trunk/reactos/dll/win32/mmdevapi/mmdevapi.h
trunk/reactos/media/doc/README.WINE
Modified: trunk/reactos/dll/win32/mmdevapi/CMakeLists.txt
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/mmdevapi/CMakeLi…
==============================================================================
--- trunk/reactos/dll/win32/mmdevapi/CMakeLists.txt [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/mmdevapi/CMakeLists.txt [iso-8859-1] Wed Apr 8 17:10:40 2015
@@ -23,4 +23,5 @@
target_link_libraries(mmdevapi uuid wine)
add_importlibs(mmdevapi ole32 oleaut32 user32 advapi32 msvcrt kernel32 ntdll)
add_pch(mmdevapi mmdevapi.h SOURCE)
+add_dependencies(mmdevapi dxsdk)
add_cd_file(TARGET mmdevapi DESTINATION reactos/system32 FOR all)
Modified: trunk/reactos/dll/win32/mmdevapi/audiovolume.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/mmdevapi/audiovo…
==============================================================================
--- trunk/reactos/dll/win32/mmdevapi/audiovolume.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/mmdevapi/audiovolume.c [iso-8859-1] Wed Apr 8 17:10:40 2015
@@ -23,6 +23,8 @@
typedef struct AEVImpl {
IAudioEndpointVolumeEx IAudioEndpointVolumeEx_iface;
LONG ref;
+ float level;
+ BOOL mute;
} AEVImpl;
static inline AEVImpl *impl_from_IAudioEndpointVolumeEx(IAudioEndpointVolumeEx *iface)
@@ -39,6 +41,8 @@
return E_OUTOFMEMORY;
This->IAudioEndpointVolumeEx_iface.lpVtbl = &AEVImpl_Vtbl;
This->ref = 1;
+ This->level = 1.0f;
+ This->mute = FALSE;
return S_OK;
}
@@ -112,9 +116,13 @@
static HRESULT WINAPI AEV_SetMasterVolumeLevel(IAudioEndpointVolumeEx *iface, float
leveldb, const GUID *ctx)
{
- TRACE("(%p)->(%f,%s)\n", iface, leveldb, debugstr_guid(ctx));
- FIXME("stub\n");
- return E_NOTIMPL;
+ AEVImpl *This = impl_from_IAudioEndpointVolumeEx(iface);
+
+ FIXME("(%p)->(%f,%s): stub\n", iface, leveldb, debugstr_guid(ctx));
+
+ This->level = leveldb;
+
+ return S_OK;
}
static HRESULT WINAPI AEV_SetMasterVolumeLevelScalar(IAudioEndpointVolumeEx *iface, float
level, const GUID *ctx)
@@ -126,11 +134,16 @@
static HRESULT WINAPI AEV_GetMasterVolumeLevel(IAudioEndpointVolumeEx *iface, float
*leveldb)
{
- TRACE("(%p)->(%p)\n", iface, leveldb);
+ AEVImpl *This = impl_from_IAudioEndpointVolumeEx(iface);
+
+ FIXME("(%p)->(%p): stub\n", iface, leveldb);
+
if (!leveldb)
return E_POINTER;
- FIXME("stub\n");
- return E_NOTIMPL;
+
+ *leveldb = This->level;
+
+ return S_OK;
}
static HRESULT WINAPI AEV_GetMasterVolumeLevelScalar(IAudioEndpointVolumeEx *iface, float
*level)
@@ -176,18 +189,27 @@
static HRESULT WINAPI AEV_SetMute(IAudioEndpointVolumeEx *iface, BOOL mute, const GUID
*ctx)
{
- TRACE("(%p)->(%u,%s)\n", iface, mute, debugstr_guid(ctx));
- FIXME("stub\n");
- return E_NOTIMPL;
+ AEVImpl *This = impl_from_IAudioEndpointVolumeEx(iface);
+
+ FIXME("(%p)->(%u,%s): stub\n", iface, mute, debugstr_guid(ctx));
+
+ This->mute = mute;
+
+ return S_OK;
}
static HRESULT WINAPI AEV_GetMute(IAudioEndpointVolumeEx *iface, BOOL *mute)
{
- TRACE("(%p)->(%p)\n", iface, mute);
+ AEVImpl *This = impl_from_IAudioEndpointVolumeEx(iface);
+
+ FIXME("(%p)->(%p): stub\n", iface, mute);
+
if (!mute)
return E_POINTER;
- FIXME("stub\n");
- return E_NOTIMPL;
+
+ *mute = This->mute;
+
+ return S_OK;
}
static HRESULT WINAPI AEV_GetVolumeStepInfo(IAudioEndpointVolumeEx *iface, UINT
*stepsize, UINT *stepcount)
@@ -224,11 +246,16 @@
static HRESULT WINAPI AEV_GetVolumeRange(IAudioEndpointVolumeEx *iface, float *mindb,
float *maxdb, float *inc)
{
- TRACE("(%p)->(%p,%p,%p)\n", iface, mindb, maxdb, inc);
+ FIXME("(%p)->(%p,%p,%p): stub\n", iface, mindb, maxdb, inc);
+
if (!mindb || !maxdb || !inc)
return E_POINTER;
- FIXME("stub\n");
- return E_NOTIMPL;
+
+ *mindb = 0.0f;
+ *maxdb = 1.0f;
+ *inc = 0.1f;
+
+ return S_OK;
}
static HRESULT WINAPI AEV_GetVolumeRangeChannel(IAudioEndpointVolumeEx *iface, UINT chan,
float *mindb, float *maxdb, float *inc)
Modified: trunk/reactos/dll/win32/mmdevapi/devenum.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/mmdevapi/devenum…
==============================================================================
--- trunk/reactos/dll/win32/mmdevapi/devenum.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/mmdevapi/devenum.c [iso-8859-1] Wed Apr 8 17:10:40 2015
@@ -246,6 +246,25 @@
return hr;
}
+static HRESULT set_driver_prop_value(GUID *id, const EDataFlow flow, const PROPERTYKEY
*prop)
+{
+ HRESULT hr;
+ PROPVARIANT pv;
+
+ if (!drvs.pGetPropValue)
+ return E_NOTIMPL;
+
+ hr = drvs.pGetPropValue(id, prop, &pv);
+
+ if (SUCCEEDED(hr))
+ {
+ MMDevice_SetPropValue(id, flow, prop, &pv);
+ PropVariantClear(&pv);
+ }
+
+ return hr;
+}
+
/* Creates or updates the state of a device
* If GUID is null, a random guid will be assigned
* and the device will be created
@@ -259,6 +278,10 @@
static const PROPERTYKEY deviceinterface_key = {
{0x233164c8, 0x1b2c, 0x4c7d, {0xbc, 0x68, 0xb6, 0x71, 0x68, 0x7a, 0x25, 0x67}},
1
+ };
+
+ static const PROPERTYKEY devicepath_key = {
+ {0xb3f8fa53, 0x0004, 0x438e, {0x90, 0x03, 0x51, 0xa4, 0x6e, 0x13, 0x9b, 0xfc}},
2
};
for (i = 0; i < MMDevice_count; ++i)
@@ -319,6 +342,29 @@
pv.u.pwszVal = guidstr;
MMDevice_SetPropValue(id, flow, &deviceinterface_key, &pv);
+
+ set_driver_prop_value(id, flow, &devicepath_key);
+
+ if (FAILED(set_driver_prop_value(id, flow,
&PKEY_AudioEndpoint_FormFactor)))
+ {
+ pv.vt = VT_UI4;
+ pv.u.ulVal = (flow == eCapture) ? Microphone : Speakers;
+
+ MMDevice_SetPropValue(id, flow, &PKEY_AudioEndpoint_FormFactor,
&pv);
+ }
+
+ if (flow != eCapture)
+ {
+ PROPVARIANT pv2;
+
+ PropVariantInit(&pv2);
+
+ /* make read-write by not overwriting if already set */
+ if (FAILED(MMDevice_GetPropValue(id, flow,
&PKEY_AudioEndpoint_PhysicalSpeakers, &pv2)) || pv2.vt != VT_UI4)
+ set_driver_prop_value(id, flow,
&PKEY_AudioEndpoint_PhysicalSpeakers);
+
+ PropVariantClear(&pv2);
+ }
RegCloseKey(keyprop);
}
@@ -1405,8 +1451,17 @@
static HRESULT WINAPI MMDevPropStore_Commit(IPropertyStore *iface)
{
- FIXME("stub\n");
- return E_NOTIMPL;
+ MMDevPropStore *This = impl_from_IPropertyStore(iface);
+ TRACE("(%p)\n", iface);
+
+ if (This->access != STGM_WRITE
+ && This->access != STGM_READWRITE)
+ return STG_E_ACCESSDENIED;
+
+ /* Does nothing - for mmdevapi, the propstore values are written on SetValue,
+ * not on Commit. */
+
+ return S_OK;
}
static const IPropertyStoreVtbl MMDevPropVtbl =
Modified: trunk/reactos/dll/win32/mmdevapi/main.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/mmdevapi/main.c?…
==============================================================================
--- trunk/reactos/dll/win32/mmdevapi/main.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/mmdevapi/main.c [iso-8859-1] Wed Apr 8 17:10:40 2015
@@ -70,6 +70,9 @@
LDFC(GetAudioSessionManager);
#undef LDFC
+ /* optional - do not fail if not found */
+ driver->pGetPropValue = (void*)GetProcAddress(driver->module,
"GetPropValue");
+
driver->priority = driver->pGetPriority();
lstrcpyW(driver->module_name, driver_module);
@@ -83,7 +86,7 @@
{
static const WCHAR drv_value[] =
{'A','u','d','i','o',0};
- static WCHAR default_list[] =
{'a','l','s','a',',','o','s','s',',',
+ static WCHAR default_list[] =
{'p','u','l','s','e',',','a','l','s','a',',','o','s','s',',',
'c','o','r','e','a','u','d','i','o',0};
DriverFuncs driver;
Modified: trunk/reactos/dll/win32/mmdevapi/mmdevapi.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/mmdevapi/mmdevap…
==============================================================================
--- trunk/reactos/dll/win32/mmdevapi/mmdevapi.h [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/mmdevapi/mmdevapi.h [iso-8859-1] Wed Apr 8 17:10:40 2015
@@ -79,6 +79,8 @@
IAudioClient **out);
HRESULT (WINAPI *pGetAudioSessionManager)(IMMDevice *device,
IAudioSessionManager2 **out);
+ HRESULT (WINAPI *pGetPropValue)(GUID *guid,
+ const PROPERTYKEY *prop, PROPVARIANT *out);
} DriverFuncs;
extern DriverFuncs drvs DECLSPEC_HIDDEN;
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] Wed Apr 8 17:10:40 2015
@@ -108,7 +108,7 @@
reactos/dll/win32/mciwave # Synced to WineStaging-1.7.37
reactos/dll/win32/mgmtapi # Synced to Wine-1.7.27
reactos/dll/win32/mlang # Synced to WineStaging-1.7.37
-reactos/dll/win32/mmdevapi # Synced to Wine-1.7.27
+reactos/dll/win32/mmdevapi # Synced to WineStaging-1.7.37
reactos/dll/win32/mpr # Synced to Wine-1.7.27
reactos/dll/win32/mprapi # Synced to Wine-1.7.27
reactos/dll/win32/msacm32 # Synced to Wine-1.7.27