Implement AUXDM_GETVOLUME
Modified: trunk/reactos/lib/mmdrv/auxil.c
Modified: trunk/reactos/lib/mmdrv/utils.c
Modified: trunk/reactos/lib/mmdrv/wave.h

Modified: trunk/reactos/lib/mmdrv/auxil.c
--- trunk/reactos/lib/mmdrv/auxil.c	2005-11-20 21:29:42 UTC (rev 19393)
+++ trunk/reactos/lib/mmdrv/auxil.c	2005-11-20 21:42:23 UTC (rev 19394)
@@ -23,8 +23,12 @@
                   DWORD dwParam2)
 
 {
+    MMRESULT Result;
+    AUX_DD_VOLUME Volume;
+
     DPRINT("auxMessage\n");
 
+
 	// the following cases are documented by DDK
 	switch (uMessage)
 	{
@@ -37,7 +41,15 @@
 		return GetDeviceCount(AuxDevice);
 		
 	case AUXDM_GETVOLUME:
-		return 0;
+         DPRINT("AUXDM_GETVOLUME");
+         Result = AuxGetAudio(dwId, (PBYTE) &Volume, sizeof(Volume));
+         
+         if (Result == MMSYSERR_NOERROR) 
+         {
+            *(LPDWORD)dwParam1 = (DWORD)MAKELONG(HIWORD(Volume.Left), HIWORD(Volume.Right));
+         }
+         return Result;
+		
 
 	case AUXDM_SETVOLUME:
 		return 0;
@@ -47,3 +59,23 @@
 }
 
 
+DWORD AuxGetAudio(DWORD dwID, PBYTE pVolume, DWORD sizeVolume)
+{
+    HANDLE DeviceHandle;
+    MMRESULT Result;
+    DWORD BytesReturned;
+
+    Result = OpenDevice(AuxDevice, dwID, &DeviceHandle, GENERIC_READ);
+    if (Result != MMSYSERR_NOERROR)
+         return Result;
+
+    
+    Result = DeviceIoControl(DeviceHandle, IOCTL_AUX_GET_VOLUME, NULL, 0, (LPVOID)pVolume, sizeVolume,
+                           &BytesReturned, NULL) ? MMSYSERR_NOERROR : TranslateStatus();
+
+
+    CloseHandle(DeviceHandle);
+
+    return Result;
+ }
+

Modified: trunk/reactos/lib/mmdrv/utils.c
--- trunk/reactos/lib/mmdrv/utils.c	2005-11-20 21:29:42 UTC (rev 19393)
+++ trunk/reactos/lib/mmdrv/utils.c	2005-11-20 21:42:23 UTC (rev 19394)
@@ -85,7 +85,7 @@
 		case AuxDevice :
 			 wsprintf(DeviceName, L"\\\\.%ls%d", AUX_DEVICE_NAME_U + strlen("\\Device"), ID);
 			 break;
-        default : // Aux
+        default : 
             DPRINT("No Auido Device Found");
             return MMSYSERR_BADDEVICEID; /* Maybe we should change error code */
     };

Modified: trunk/reactos/lib/mmdrv/wave.h
--- trunk/reactos/lib/mmdrv/wave.h	2005-11-20 21:29:42 UTC (rev 19393)
+++ trunk/reactos/lib/mmdrv/wave.h	2005-11-20 21:42:23 UTC (rev 19394)
@@ -79,5 +79,13 @@
     MMRESULT            AuxReturnCode;  // Return code from Aux task
 }WAVEALLOC, *PWAVEALLOC;
 
+/* Misc should move to own header */
 MMRESULT GetDeviceCapabilities(DWORD ID, UINT DeviceType,
                                       LPBYTE pCaps, DWORD Size);
+
+DWORD AuxGetAudio(DWORD dwID, PBYTE pVolume, DWORD sizeVolume);
+
+typedef struct _AUX_DD_VOLUME {
+        ULONG   Left;
+        ULONG   Right;
+} AUX_DD_VOLUME, *PAUX_DD_VOLUME;