mirror of
https://github.com/ApfelTeeSaft/reactos.git
synced 2026-09-03 04:13:31 +00:00
Implement AUXDM_GETVOLUME
svn path=/trunk/; revision=19394
This commit is contained in:
@@ -23,8 +23,12 @@ APIENTRY DWORD auxMessage(UINT dwId,
|
||||
DWORD dwParam2)
|
||||
|
||||
{
|
||||
MMRESULT Result;
|
||||
AUX_DD_VOLUME Volume;
|
||||
|
||||
DPRINT("auxMessage\n");
|
||||
|
||||
|
||||
// the following cases are documented by DDK
|
||||
switch (uMessage)
|
||||
{
|
||||
@@ -37,7 +41,15 @@ APIENTRY DWORD auxMessage(UINT dwId,
|
||||
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 @@ APIENTRY DWORD auxMessage(UINT dwId,
|
||||
}
|
||||
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
|
||||
@@ -85,7 +85,7 @@ MMRESULT OpenDevice(UINT DeviceType, DWORD ID, PHANDLE pDeviceHandle,
|
||||
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 */
|
||||
};
|
||||
|
||||
@@ -79,5 +79,13 @@ typedef struct tag_WAVEALLOC {
|
||||
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;
|
||||
|
||||
Reference in New Issue
Block a user