Author: janderwald
Date: Sat Oct 31 19:00:05 2009
New Revision: 43879
URL:
http://svn.reactos.org/svn/reactos?rev=43879&view=rev
Log:
[KS]
- Add comment for using ms portcls in ReactOS
[WDMAUD_KERNEL]
- Handle error
[SYSAUDIO]
- Fix several bugs in the mixer handling code
- Disable kmixer untill all issues are resolved
Modified:
trunk/reactos/drivers/ksfilter/ks/irp.c
trunk/reactos/drivers/wdm/audio/legacy/wdmaud/mixer.c
trunk/reactos/drivers/wdm/audio/sysaudio/control.c
trunk/reactos/drivers/wdm/audio/sysaudio/pin.c
Modified: trunk/reactos/drivers/ksfilter/ks/irp.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/ksfilter/ks/irp.c?…
==============================================================================
--- trunk/reactos/drivers/ksfilter/ks/irp.c [iso-8859-1] (original)
+++ trunk/reactos/drivers/ksfilter/ks/irp.c [iso-8859-1] Sat Oct 31 19:00:05 2009
@@ -888,6 +888,10 @@
goto ProbeMdl;
}
+#if 0
+ // HACK for MS PORTCLS
+ HeaderSize = Length;
+#endif
/* probe user mode buffers */
if (Length && ( (!HeaderSize) || (Length % HeaderSize == 0) || ((ProbeFlags
& KSPROBE_ALLOWFORMATCHANGE) && (Length == sizeof(KSSTREAM_HEADER))) ) )
{
@@ -1940,7 +1944,7 @@
IN ULONG MajorFunction)
{
DPRINT("KsSetMajorFunctionHandler Function %x\n", MajorFunction);
-#if 0
+#if 1
// HACK
// for MS PORTCLS
//
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] Sat Oct 31 19:00:05
2009
@@ -1888,6 +1888,12 @@
}
MixerLineSrc =
GetSourceMixerLineByComponentType(&DeviceExtension->MixerInfo[(ULONG_PTR)DeviceInfo->hDevice],
DeviceInfo->u.MixLine.dwComponentType);
+ if (!MixerLineSrc)
+ {
+ DPRINT1("Failed to find component type %x\n",
DeviceInfo->u.MixLine.dwComponentType);
+ return SetIrpIoStatus(Irp, STATUS_UNSUCCESSFUL, 0);
+ }
+
ASSERT(MixerLineSrc);
/* copy cached data */
Modified: trunk/reactos/drivers/wdm/audio/sysaudio/control.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/wdm/audio/sysaudio…
==============================================================================
--- trunk/reactos/drivers/wdm/audio/sysaudio/control.c [iso-8859-1] (original)
+++ trunk/reactos/drivers/wdm/audio/sysaudio/control.c [iso-8859-1] Sat Oct 31 19:00:05
2009
@@ -208,7 +208,7 @@
MultipleItem = (PKSMULTIPLE_ITEM)(PinRequest + 1);
MultipleItem->Count = 1;
- MultipleItem->Size = sizeof(KSMULTIPLE_ITEM) +
ClientFormat->DataFormat.FormatSize;
+ MultipleItem->Size = ClientFormat->DataFormat.FormatSize;
RtlMoveMemory(MultipleItem + 1, ClientFormat,
ClientFormat->DataFormat.FormatSize);
/* Query the miniport data intersection handler */
@@ -229,7 +229,7 @@
if (Status != STATUS_MORE_ENTRIES)
{
- /* Failed to data ranges */
+ /* Failed to get data ranges */
return Status;
}
@@ -276,7 +276,7 @@
MixerFormat->WaveFormatEx.wBitsPerSample = 16;
#else
- MixerFormat->WaveFormatEx.nChannels =
min(ClientFormat->WaveFormatEx.nSamplesPerSec, AudioRange->MaximumChannels);
+ MixerFormat->WaveFormatEx.nChannels =
min(ClientFormat->WaveFormatEx.nChannels, AudioRange->MaximumChannels);
MixerFormat->WaveFormatEx.wBitsPerSample =
AudioRange->MaximumBitsPerSample;
#endif
Modified: trunk/reactos/drivers/wdm/audio/sysaudio/pin.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/wdm/audio/sysaudio…
==============================================================================
--- trunk/reactos/drivers/wdm/audio/sysaudio/pin.c [iso-8859-1] (original)
+++ trunk/reactos/drivers/wdm/audio/sysaudio/pin.c [iso-8859-1] Sat Oct 31 19:00:05 2009
@@ -17,7 +17,7 @@
PDISPATCH_CONTEXT Context;
NTSTATUS Status;
ULONG BytesReturned;
- PFILE_OBJECT FileObject;
+ PFILE_OBJECT FileObject = NULL;
PIO_STACK_LOCATION IoStack;
DPRINT("Pin_fnDeviceIoControl called DeviceObject %p Irp %p\n",
DeviceObject, Irp);
@@ -131,7 +131,7 @@
PDISPATCH_CONTEXT Context;
PIO_STACK_LOCATION IoStack;
- DPRINT("Pin_fnClose called DeviceObject %p Irp %p\n", DeviceObject, Irp);
+ //DPRINT("Pin_fnClose called DeviceObject %p Irp %p\n", DeviceObject,
Irp);
/* Get current stack location */
IoStack = IoGetCurrentIrpStackLocation(Irp);
@@ -143,7 +143,11 @@
{
ZwClose(Context->Handle);
}
- ZwClose(Context->hMixerPin);
+
+ if (Context->hMixerPin)
+ {
+ ZwClose(Context->hMixerPin);
+ }
ExFreePool(Context);
@@ -217,7 +221,7 @@
{
NTSTATUS Status;
HANDLE PinHandle;
- PFILE_OBJECT FileObject;
+ PFILE_OBJECT FileObject = NULL;
Status = KsCreatePin(KMixerHandle, PinConnect, GENERIC_READ | GENERIC_WRITE,
&PinHandle);
@@ -242,6 +246,7 @@
{
ObDereferenceObject(FileObject);
ZwClose(PinHandle);
+ return Status;
}
ObDereferenceObject(FileObject);
@@ -298,6 +303,13 @@
/* Let's try to create the audio irp pin */
Status = KsCreatePin(DeviceEntry->Handle, Connect, GENERIC_READ | GENERIC_WRITE,
&RealPinHandle);
+ if (!NT_SUCCESS(Status))
+ {
+ /* FIXME disable kmixer
+ */
+ return STATUS_UNSUCCESSFUL;
+ }
+#if 0
if (!NT_SUCCESS(Status))
{
/* the audio irp pin didnt accept the input format
@@ -340,6 +352,7 @@
return Status;
}
}
+#endif
DeviceEntry->Pins[Connect->PinId].References = 0;
@@ -348,6 +361,8 @@
DispatchContext->PinId = Connect->PinId;
DispatchContext->AudioEntry = DeviceEntry;
+
+ DPRINT1("RealPinHandle %p\n", RealPinHandle);
/* Do we need to transform the audio stream */
if (OutputFormat != NULL)