Huw Davies : wineoss: Use AUXDM_GETNUMDEVS to retrieve the number of devices.

Alexandre Julliard julliard at winehq.org
Tue May 3 15:39:23 CDT 2022


Module: wine
Branch: master
Commit: f278194caf66cef40cc7e091b0c39cc1e22f94f6
URL:    https://source.winehq.org/git/wine.git/?a=commit;h=f278194caf66cef40cc7e091b0c39cc1e22f94f6

Author: Huw Davies <huw at codeweavers.com>
Date:   Tue May  3 07:42:28 2022 +0100

wineoss: Use AUXDM_GETNUMDEVS to retrieve the number of devices.

This is temporary and allows the global variable to move to the unixlib.

Signed-off-by: Huw Davies <huw at codeweavers.com>
Signed-off-by: Andrew Eikum <aeikum at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/wineoss.drv/mmaux.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/dlls/wineoss.drv/mmaux.c b/dlls/wineoss.drv/mmaux.c
index 7d0b8ed53cc..02ef912bd34 100644
--- a/dlls/wineoss.drv/mmaux.c
+++ b/dlls/wineoss.drv/mmaux.c
@@ -66,6 +66,9 @@ static LRESULT OSS_AuxExit(void)
     return 0;
 }
 
+DWORD WINAPI OSS_auxMessage(UINT wDevID, UINT wMsg, DWORD_PTR dwUser,
+			    DWORD_PTR dwParam1, DWORD_PTR dwParam2);
+
 /**************************************************************************
  * 				AUX_GetDevCaps			[internal]
  */
@@ -73,10 +76,11 @@ static DWORD AUX_GetDevCaps(WORD wDevID, LPAUXCAPSW lpCaps, DWORD dwSize)
 {
     int 	mixer, volume;
     static const WCHAR ini[] = {'O','S','S',' ','A','u','x',' ','#','0',0};
+    unsigned int num_aux = OSS_auxMessage(0, AUXDM_GETNUMDEVS, 0, 0, 0);
 
     TRACE("(%04X, %p, %u);\n", wDevID, lpCaps, dwSize);
     if (lpCaps == NULL) return MMSYSERR_NOTENABLED;
-    if (wDevID >= NumDev) return MMSYSERR_BADDEVICEID;
+    if (wDevID >= num_aux) return MMSYSERR_BADDEVICEID;
     if ((mixer = open(MIXER_DEV, O_RDWR)) < 0) {
 	WARN("mixer device not available !\n");
 	return MMSYSERR_NOTENABLED;




More information about the wine-cvs mailing list