/* sanity check */
ASSERT(Header);
- /* iterate through all stream headers and collect size */
- do
- {
- if (Context->Function == IOCTL_KS_READ_STREAM)
- {
- /* length is stored in DataUsed */
- Length += Header->DataUsed;
- }
- else
- {
- /* length stored in frameextend */
- Length += Header->FrameExtent;
- }
-
- /* subtract size */
- Context->Length -= Header->Size;
-
- /* move to next stream header */
- Header = (PKSSTREAM_HEADER)((ULONG_PTR)Header + Header->Size);
-
- }while(Context->Length);
-
/* time to free all allocated mdls */
Mdl = Irp->MdlAddress;
/* now free the mdl */
IoFreeMdl(Context->Mdl);
- /* now free the stream header */
- ExFreePool(Irp->AssociatedIrp.SystemBuffer);
-
DPRINT("IoCompletion Irp %p IoStatus %lx Information %lx Length %lu\n", Irp, Irp->IoStatus.Status, Irp->IoStatus.Information, Length);
- if (Irp->IoStatus.Status == STATUS_SUCCESS)
+ if (!NT_SUCCESS(Irp->IoStatus.Status))
{
- /* store the length */
- Irp->IoStatus.Information = Length;
+ /* failed */
+ Irp->IoStatus.Information = 0;
}
/* free context */
return STATUS_SUCCESS;
}
-
NTSTATUS
NTAPI
WdmAudReadWrite(