Author: janderwald
Date: Tue Oct 13 00:36:10 2009
New Revision: 43424
URL:
http://svn.reactos.org/svn/reactos?rev=43424&view=rev
Log:
- Pointer / handle values should be printed with %p. Found by Christoph
- Add the sum / mixer node to the destination pin
- Only create MIXERVOLUME_DATA when there is an actual range
- Use unsigned members to calculate the range
Modified:
trunk/reactos/drivers/wdm/audio/legacy/wdmaud/control.c
trunk/reactos/drivers/wdm/audio/legacy/wdmaud/mixer.c
trunk/reactos/drivers/wdm/audio/legacy/wdmaud/wdmaud.h
Modified: trunk/reactos/drivers/wdm/audio/legacy/wdmaud/control.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/wdm/audio/legacy/w…
==============================================================================
--- trunk/reactos/drivers/wdm/audio/legacy/wdmaud/control.c [iso-8859-1] (original)
+++ trunk/reactos/drivers/wdm/audio/legacy/wdmaud/control.c [iso-8859-1] Tue Oct 13
00:36:10 2009
@@ -48,7 +48,7 @@
IN PWDMAUD_CLIENT ClientInfo)
{
ULONG Result = 0;
- NTSTATUS Status;
+ NTSTATUS Status = STATUS_SUCCESS;
PWDMAUD_DEVICE_EXTENSION DeviceExtension;
DeviceExtension = (PWDMAUD_DEVICE_EXTENSION)DeviceObject->DeviceExtension;
@@ -179,7 +179,7 @@
Status = ObReferenceObjectByHandle(DeviceInfo->hDevice, GENERIC_WRITE,
IoFileObjectType, KernelMode, (PVOID*)&FileObject, NULL);
if (!NT_SUCCESS(Status))
{
- DPRINT1("Invalid buffer handle %x\n", DeviceInfo->hDevice);
+ DPRINT1("Invalid buffer handle %p\n", DeviceInfo->hDevice);
return SetIrpIoStatus(Irp, Status, 0);
}
@@ -343,7 +343,7 @@
Status = ObReferenceObjectByHandle(DeviceInfo->hDevice, GENERIC_WRITE,
IoFileObjectType, KernelMode, (PVOID*)&FileObject, NULL);
if (!NT_SUCCESS(Status))
{
- DPRINT1("Invalid pin handle %x\n", DeviceInfo->hDevice);
+ DPRINT1("Invalid pin handle %p\n", DeviceInfo->hDevice);
return SetIrpIoStatus(Irp, Status, 0);
}
Modified: trunk/reactos/drivers/wdm/audio/legacy/wdmaud/mixer.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/wdm/audio/legacy/w…
==============================================================================
--- trunk/reactos/drivers/wdm/audio/legacy/wdmaud/mixer.c [iso-8859-1] (original)
+++ trunk/reactos/drivers/wdm/audio/legacy/wdmaud/mixer.c [iso-8859-1] Tue Oct 13 00:36:10
2009
@@ -863,7 +863,7 @@
if (bUpDirection)
{
/* add the sum / mux node to destination line */
- //Nodes[NodeIndex] = TRUE;
+ Nodes[NodeIndex] = TRUE;
}
return STATUS_SUCCESS;
@@ -1005,7 +1005,27 @@
}
MixerInfo->ControlId++;
-
+#if 0
+ if (MixerControl->dwControlType == MIXERCONTROL_CONTROLTYPE_MUX)
+ {
+ KSNODEPROPERTY Property;
+ ULONG PinId = 2;
+
+ /* setup the request */
+ RtlZeroMemory(&Property, sizeof(KSNODEPROPERTY));
+
+ Property.NodeId = NodeIndex;
+ Property.Property.Id = KSPROPERTY_AUDIO_MUX_SOURCE;
+ Property.Property.Flags = KSPROPERTY_TYPE_SET;
+ Property.Property.Set = KSPROPSETID_Audio;
+
+ /* get node volume level info */
+ Status = KsSynchronousIoControlDevice(FileObject, KernelMode, IOCTL_KS_PROPERTY,
(PVOID)&Property, sizeof(KSNODEPROPERTY), (PVOID)&PinId, sizeof(ULONG),
&BytesReturned);
+
+ DPRINT1("Status %x NodeIndex %u PinId %u\n", Status, NodeIndex,
PinId);
+ //DbgBreakPoint();
+ }else
+#endif
if (MixerControl->dwControlType == MIXERCONTROL_CONTROLTYPE_VOLUME)
{
KSNODEPROPERTY_AUDIO_CHANNEL Property;
@@ -1041,37 +1061,42 @@
DPRINT("NodeIndex %u Range Min %d Max %d Steps %x UMin %x UMax
%x\n", NodeIndex, Range->Bounds.SignedMinimum, Range->Bounds.SignedMaximum,
Range->SteppingDelta, Range->Bounds.UnsignedMinimum,
Range->Bounds.UnsignedMaximum);
- VolumeData = ExAllocatePool(NonPagedPool, sizeof(MIXERVOLUME_DATA));
- if (!VolumeData)
- return STATUS_INSUFFICIENT_RESOURCES;
-
- MaxRange = (abs(Range->Bounds.SignedMinimum) +
abs(Range->Bounds.SignedMaximum));
- Steps = MaxRange / Range->SteppingDelta + 1;
-
- /* store mixer control info there */
- VolumeData->Header.dwControlID = MixerControl->dwControlID;
- VolumeData->SignedMaximum = Range->Bounds.SignedMaximum;
- VolumeData->SignedMinimum = Range->Bounds.SignedMinimum;
- VolumeData->SteppingDelta = Range->SteppingDelta;
- VolumeData->ValuesCount = Steps;
- VolumeData->InputSteppingDelta = 0x10000 / Steps;
-
- VolumeData->Values = ExAllocatePool(NonPagedPool, sizeof(LONG) * Steps);
- if (!VolumeData->Values)
- {
- ExFreePool(Desc);
- ExFreePool(VolumeData);
-
- return STATUS_INSUFFICIENT_RESOURCES;
- }
-
- Value = Range->Bounds.SignedMinimum;
- for(Index = 0; Index < Steps; Index++)
- {
- VolumeData->Values[Index] = Value;
- Value += Range->SteppingDelta;
- }
- InsertTailList(&MixerLine->LineControlsExtraData,
&VolumeData->Header.Entry);
+ MaxRange = Range->Bounds.UnsignedMaximum -
Range->Bounds.UnsignedMinimum;
+
+ if (MaxRange)
+ {
+ ASSERT(MaxRange);
+ VolumeData = ExAllocatePool(NonPagedPool, sizeof(MIXERVOLUME_DATA));
+ if (!VolumeData)
+ return STATUS_INSUFFICIENT_RESOURCES;
+
+ Steps = MaxRange / Range->SteppingDelta + 1;
+
+ /* store mixer control info there */
+ VolumeData->Header.dwControlID = MixerControl->dwControlID;
+ VolumeData->SignedMaximum = Range->Bounds.SignedMaximum;
+ VolumeData->SignedMinimum = Range->Bounds.SignedMinimum;
+ VolumeData->SteppingDelta = Range->SteppingDelta;
+ VolumeData->ValuesCount = Steps;
+ VolumeData->InputSteppingDelta = 0x10000 / Steps;
+
+ VolumeData->Values = ExAllocatePool(NonPagedPool, sizeof(LONG) *
Steps);
+ if (!VolumeData->Values)
+ {
+ ExFreePool(Desc);
+ ExFreePool(VolumeData);
+
+ return STATUS_INSUFFICIENT_RESOURCES;
+ }
+
+ Value = Range->Bounds.SignedMinimum;
+ for(Index = 0; Index < Steps; Index++)
+ {
+ VolumeData->Values[Index] = Value;
+ Value += Range->SteppingDelta;
+ }
+ InsertTailList(&MixerLine->LineControlsExtraData,
&VolumeData->Header.Entry);
+ }
}
ExFreePool(Desc);
}
@@ -1445,6 +1470,7 @@
PinsSrcRef[Index] = TRUE;
PinsSrcRef[OutConnection->Pin] = TRUE;
}
+ PinsSrcRef[OutConnection->Pin] = TRUE;
Status = AddMixerSourceLines(MixerInfo, FileObject, NodeConnections,
NodeTypes, DeviceIndex, PinsRefCount, OutConnection->Pin, Index, PinsSrcRef);
@@ -2208,6 +2234,7 @@
}
Status = STATUS_NOT_IMPLEMENTED;
+ DPRINT("dwLineId %x dwControlID %x dwControlType %x\n",
MixerLine->Line.dwLineID, MixerControl->dwControlID,
MixerControl->dwControlType);
if (MixerControl->dwControlType == MIXERCONTROL_CONTROLTYPE_MUTE)
{
/* send the request */
Modified: trunk/reactos/drivers/wdm/audio/legacy/wdmaud/wdmaud.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/wdm/audio/legacy/w…
==============================================================================
--- trunk/reactos/drivers/wdm/audio/legacy/wdmaud/wdmaud.h [iso-8859-1] (original)
+++ trunk/reactos/drivers/wdm/audio/legacy/wdmaud/wdmaud.h [iso-8859-1] Tue Oct 13
00:36:10 2009
@@ -5,7 +5,7 @@
#include <ntddk.h>
#include <portcls.h>
#include <ks.h>
-#define NDEBUG
+#define YDEBUG
#include <debug.h>
#include <ksmedia.h>
#include <mmreg.h>