[MMDEVAPI] Sync with Wine Staging 1.7.47. CORE-9924
authorAmine Khaldi <amine.khaldi@reactos.org>
Sun, 19 Jul 2015 22:39:34 +0000 (22:39 +0000)
committerAmine Khaldi <amine.khaldi@reactos.org>
Sun, 19 Jul 2015 22:39:34 +0000 (22:39 +0000)
svn path=/trunk/; revision=68449

reactos/dll/win32/mmdevapi/audiovolume.c
reactos/dll/win32/mmdevapi/devenum.c
reactos/media/doc/README.WINE

index 9c37cf8..63a414d 100644 (file)
@@ -18,8 +18,6 @@
 
 #include "mmdevapi.h"
 
-static const IAudioEndpointVolumeExVtbl AEVImpl_Vtbl;
-
 typedef struct AEVImpl {
     IAudioEndpointVolumeEx IAudioEndpointVolumeEx_iface;
     LONG ref;
@@ -32,20 +30,6 @@ static inline AEVImpl *impl_from_IAudioEndpointVolumeEx(IAudioEndpointVolumeEx *
     return CONTAINING_RECORD(iface, AEVImpl, IAudioEndpointVolumeEx_iface);
 }
 
-HRESULT AudioEndpointVolume_Create(MMDevice *parent, IAudioEndpointVolume **ppv)
-{
-    AEVImpl *This;
-    This = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*This));
-    *ppv = (IAudioEndpointVolume*)This;
-    if (!This)
-        return E_OUTOFMEMORY;
-    This->IAudioEndpointVolumeEx_iface.lpVtbl = &AEVImpl_Vtbl;
-    This->ref = 1;
-    This->level = 1.0f;
-    This->mute = FALSE;
-    return S_OK;
-}
-
 static void AudioEndpointVolume_Destroy(AEVImpl *This)
 {
     HeapFree(GetProcessHeap(), 0, This);
@@ -61,7 +45,7 @@ static HRESULT WINAPI AEV_QueryInterface(IAudioEndpointVolumeEx *iface, REFIID r
     if (IsEqualIID(riid, &IID_IUnknown) ||
         IsEqualIID(riid, &IID_IAudioEndpointVolume) ||
         IsEqualIID(riid, &IID_IAudioEndpointVolumeEx)) {
-        *ppv = This;
+        *ppv = &This->IAudioEndpointVolumeEx_iface;
     }
     else
         return E_NOINTERFACE;
@@ -291,3 +275,20 @@ static const IAudioEndpointVolumeExVtbl AEVImpl_Vtbl = {
     AEV_GetVolumeRange,
     AEV_GetVolumeRangeChannel
 };
+
+HRESULT AudioEndpointVolume_Create(MMDevice *parent, IAudioEndpointVolume **ppv)
+{
+    AEVImpl *This;
+
+    *ppv = NULL;
+    This = HeapAlloc(GetProcessHeap(), 0, sizeof(*This));
+    if (!This)
+        return E_OUTOFMEMORY;
+    This->IAudioEndpointVolumeEx_iface.lpVtbl = &AEVImpl_Vtbl;
+    This->ref = 1;
+    This->level = 1.0f;
+    This->mute = FALSE;
+
+    *ppv = (IAudioEndpointVolume*)&This->IAudioEndpointVolumeEx_iface;
+    return S_OK;
+}
index 1551b9e..7f1c1eb 100644 (file)
@@ -125,12 +125,12 @@ static HRESULT MMDevPropStore_OpenPropKey(const GUID *guid, DWORD flow, HKEY *pr
     LONG ret;
     HKEY key;
     StringFromGUID2(guid, buffer, 39);
-    if ((ret = RegOpenKeyExW(flow == eRender ? key_render : key_capture, buffer, 0, KEY_READ|KEY_WRITE, &key)) != ERROR_SUCCESS)
+    if ((ret = RegOpenKeyExW(flow == eRender ? key_render : key_capture, buffer, 0, KEY_READ|KEY_WRITE|KEY_WOW64_64KEY, &key)) != ERROR_SUCCESS)
     {
         WARN("Opening key %s failed with %u\n", debugstr_w(buffer), ret);
         return E_FAIL;
     }
-    ret = RegOpenKeyExW(key, reg_properties, 0, KEY_READ|KEY_WRITE, propkey);
+    ret = RegOpenKeyExW(key, reg_properties, 0, KEY_READ|KEY_WRITE|KEY_WOW64_64KEY, propkey);
     RegCloseKey(key);
     if (ret != ERROR_SUCCESS)
     {
@@ -327,11 +327,11 @@ static MMDevice *MMDevice_Create(WCHAR *name, GUID *id, EDataFlow flow, DWORD st
     else
         root = key_capture;
 
-    if (RegCreateKeyExW(root, guidstr, 0, NULL, 0, KEY_WRITE|KEY_READ, NULL, &key, NULL) == ERROR_SUCCESS)
+    if (RegCreateKeyExW(root, guidstr, 0, NULL, 0, KEY_WRITE|KEY_READ|KEY_WOW64_64KEY, NULL, &key, NULL) == ERROR_SUCCESS)
     {
         HKEY keyprop;
         RegSetValueExW(key, reg_devicestate, 0, REG_DWORD, (const BYTE*)&state, sizeof(DWORD));
-        if (!RegCreateKeyExW(key, reg_properties, 0, NULL, 0, KEY_WRITE|KEY_READ, NULL, &keyprop, NULL))
+        if (!RegCreateKeyExW(key, reg_properties, 0, NULL, 0, KEY_WRITE|KEY_READ|KEY_WOW64_64KEY, NULL, &keyprop, NULL))
         {
             PROPVARIANT pv;
 
@@ -388,11 +388,11 @@ static HRESULT load_devices_from_reg(void)
     LONG ret;
     DWORD curflow;
 
-    ret = RegCreateKeyExW(HKEY_LOCAL_MACHINE, software_mmdevapi, 0, NULL, 0, KEY_WRITE|KEY_READ, NULL, &root, NULL);
+    ret = RegCreateKeyExW(HKEY_LOCAL_MACHINE, software_mmdevapi, 0, NULL, 0, KEY_WRITE|KEY_READ|KEY_WOW64_64KEY, NULL, &root, NULL);
     if (ret == ERROR_SUCCESS)
-        ret = RegCreateKeyExW(root, reg_capture, 0, NULL, 0, KEY_READ|KEY_WRITE, NULL, &key_capture, NULL);
+        ret = RegCreateKeyExW(root, reg_capture, 0, NULL, 0, KEY_READ|KEY_WRITE|KEY_WOW64_64KEY, NULL, &key_capture, NULL);
     if (ret == ERROR_SUCCESS)
-        ret = RegCreateKeyExW(root, reg_render, 0, NULL, 0, KEY_READ|KEY_WRITE, NULL, &key_render, NULL);
+        ret = RegCreateKeyExW(root, reg_render, 0, NULL, 0, KEY_READ|KEY_WRITE|KEY_WOW64_64KEY, NULL, &key_render, NULL);
     RegCloseKey(root);
     cur = key_capture;
     curflow = eCapture;
@@ -467,6 +467,7 @@ static HRESULT set_format(MMDevice *dev)
             &PKEY_AudioEngine_DeviceFormat, &pv);
     MMDevice_SetPropValue(&dev->devguid, dev->flow,
             &PKEY_AudioEngine_OEMFormat, &pv);
+    CoTaskMemFree(fmt);
 
     return S_OK;
 }
@@ -532,7 +533,7 @@ static HRESULT WINAPI MMDevice_QueryInterface(IMMDevice *iface, REFIID riid, voi
     *ppv = NULL;
     if (IsEqualIID(riid, &IID_IUnknown)
         || IsEqualIID(riid, &IID_IMMDevice))
-        *ppv = This;
+        *ppv = &This->IMMDevice_iface;
     else if (IsEqualIID(riid, &IID_IMMEndpoint))
         *ppv = &This->IMMEndpoint_iface;
     if (*ppv)
@@ -627,8 +628,7 @@ static HRESULT WINAPI MMDevice_Activate(IMMDevice *iface, REFIID riid, DWORD cls
                 IDirectSound_Release((IDirectSound*)*ppv);
         }
     }
-    else if (IsEqualIID(riid, &IID_IDirectSoundCapture)
-             || IsEqualIID(riid, &IID_IDirectSoundCapture8))
+    else if (IsEqualIID(riid, &IID_IDirectSoundCapture))
     {
         if (This->flow == eCapture)
             hr = CoCreateInstance(&CLSID_DirectSoundCapture8, NULL, clsctx, riid, ppv);
@@ -779,7 +779,7 @@ static HRESULT WINAPI MMDevCol_QueryInterface(IMMDeviceCollection *iface, REFIID
         return E_POINTER;
     if (IsEqualIID(riid, &IID_IUnknown)
         || IsEqualIID(riid, &IID_IMMDeviceCollection))
-        *ppv = This;
+        *ppv = &This->IMMDeviceCollection_iface;
     else
         *ppv = NULL;
     if (!*ppv)
@@ -879,7 +879,7 @@ HRESULT MMDevEnum_Create(REFIID riid, void **ppv)
         load_driver_devices(eRender);
         load_driver_devices(eCapture);
     }
-    return IUnknown_QueryInterface((IUnknown*)This, riid, ppv);
+    return IMMDeviceEnumerator_QueryInterface(&This->IMMDeviceEnumerator_iface, riid, ppv);
 }
 
 void MMDevEnum_Free(void)
@@ -902,7 +902,7 @@ static HRESULT WINAPI MMDevEnum_QueryInterface(IMMDeviceEnumerator *iface, REFII
         return E_POINTER;
     if (IsEqualIID(riid, &IID_IUnknown)
         || IsEqualIID(riid, &IID_IMMDeviceEnumerator))
-        *ppv = This;
+        *ppv = &This->IMMDeviceEnumerator_iface;
     else
         *ppv = NULL;
     if (!*ppv)
@@ -1327,7 +1327,7 @@ static HRESULT WINAPI MMDevPropStore_QueryInterface(IPropertyStore *iface, REFII
         return E_POINTER;
     if (IsEqualIID(riid, &IID_IUnknown)
         || IsEqualIID(riid, &IID_IPropertyStore))
-        *ppv = This;
+        *ppv = &This->IPropertyStore_iface;
     else
         *ppv = NULL;
     if (!*ppv)
index 91f9f40..8d99690 100644 (file)
@@ -102,7 +102,7 @@ reactos/dll/win32/mciseq              # Synced to WineStaging-1.7.37
 reactos/dll/win32/mciwave             # Synced to WineStaging-1.7.37
 reactos/dll/win32/mgmtapi             # Synced to WineStaging-1.7.37
 reactos/dll/win32/mlang               # Synced to WineStaging-1.7.37
-reactos/dll/win32/mmdevapi            # Synced to WineStaging-1.7.37
+reactos/dll/win32/mmdevapi            # Synced to WineStaging-1.7.47
 reactos/dll/win32/mpr                 # Synced to WineStaging-1.7.37
 reactos/dll/win32/mprapi              # Synced to WineStaging-1.7.37
 reactos/dll/win32/msacm32             # Synced to WineStaging-1.7.37