Andrew Eikum : wineoss.drv: Prefix device names with direction indication.

Alexandre Julliard julliard at winehq.org
Thu Apr 5 12:31:45 CDT 2012


Module: wine
Branch: master
Commit: 81ca5d09b6b4f488c57bc958009bd89981119385
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=81ca5d09b6b4f488c57bc958009bd89981119385

Author: Andrew Eikum <aeikum at codeweavers.com>
Date:   Wed Apr  4 13:16:09 2012 -0500

wineoss.drv: Prefix device names with direction indication.

---

 dlls/wineoss.drv/mmdevdrv.c |   18 ++++++++++++++++--
 1 files changed, 16 insertions(+), 2 deletions(-)

diff --git a/dlls/wineoss.drv/mmdevdrv.c b/dlls/wineoss.drv/mmdevdrv.c
index d8e6468..70ea416 100644
--- a/dlls/wineoss.drv/mmdevdrv.c
+++ b/dlls/wineoss.drv/mmdevdrv.c
@@ -458,6 +458,9 @@ HRESULT WINAPI AUDDRV_GetEndpointIDs(EDataFlow flow, WCHAR ***ids, GUID **guids,
     oss_sysinfo sysinfo;
     static int print_once = 0;
 
+    static const WCHAR outW[] = {'O','u','t',':',' ',0};
+    static const WCHAR inW[] = {'I','n',':',' ',0};
+
     TRACE("%d %p %p %p %p\n", flow, ids, guids, num, def_index);
 
     mixer_fd = open("/dev/mixer", O_RDONLY, 0);
@@ -536,7 +539,8 @@ HRESULT WINAPI AUDDRV_GetEndpointIDs(EDataFlow flow, WCHAR ***ids, GUID **guids,
 
         if((flow == eCapture && (ai.caps & PCM_CAP_INPUT)) ||
                 (flow == eRender && (ai.caps & PCM_CAP_OUTPUT))){
-            size_t len;
+            size_t len, prefix_len;
+            const WCHAR *prefix;
 
             dev_item = HeapAlloc(GetProcessHeap(), 0, sizeof(*dev_item));
 
@@ -547,6 +551,15 @@ HRESULT WINAPI AUDDRV_GetEndpointIDs(EDataFlow flow, WCHAR ***ids, GUID **guids,
             (*guids)[*num] = dev_item->guid;
 
             len = MultiByteToWideChar(CP_UNIXCP, 0, ai.name, -1, NULL, 0);
+            if(flow == eRender){
+                prefix = outW;
+                prefix_len = (sizeof(outW) / sizeof(*outW)) - 1;
+                len += prefix_len;
+            }else{
+                prefix = inW;
+                prefix_len = (sizeof(inW) / sizeof(*inW)) - 1;
+                len += prefix_len;
+            }
             (*ids)[*num] = HeapAlloc(GetProcessHeap(), 0,
                     len * sizeof(WCHAR));
             if(!(*ids)[*num]){
@@ -558,8 +571,9 @@ HRESULT WINAPI AUDDRV_GetEndpointIDs(EDataFlow flow, WCHAR ***ids, GUID **guids,
                 close(mixer_fd);
                 return E_OUTOFMEMORY;
             }
+            memcpy((*ids)[*num], prefix, prefix_len * sizeof(WCHAR));
             MultiByteToWideChar(CP_UNIXCP, 0, ai.name, -1,
-                    (*ids)[*num], len);
+                    (*ids)[*num] + prefix_len, len - prefix_len);
 
             list_add_tail(&g_devices, &dev_item->entry);
 




More information about the wine-cvs mailing list