mirror of
https://github.com/reactos/reactos.git
synced 2024-08-29 14:48:37 +00:00
- Handle KSPROPERTY_PIN_DATAINTERSECTION
svn path=/trunk/; revision=40499
This commit is contained in:
parent
cfa7241c88
commit
0a61df10e6
|
@ -33,13 +33,19 @@ IPortFilterWaveCyclic_fnQueryInterface(
|
|||
IPortFilterWaveCyclicImpl * This = (IPortFilterWaveCyclicImpl*)iface;
|
||||
|
||||
if (IsEqualGUIDAligned(refiid, &IID_IIrpTarget) ||
|
||||
//IsEqualGUIDAligned(refiid, &IID_IPortFilterWaveCyclic) ||
|
||||
IsEqualGUIDAligned(refiid, &IID_IUnknown))
|
||||
{
|
||||
*Output = &This->lpVtbl;
|
||||
InterlockedIncrement(&This->ref);
|
||||
return STATUS_SUCCESS;
|
||||
}
|
||||
else if (IsEqualGUIDAligned(refiid, &IID_IPort))
|
||||
{
|
||||
*Output = This->Port;
|
||||
This->Port->lpVtbl->AddRef(This->Port);
|
||||
return STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
|
||||
return STATUS_UNSUCCESSFUL;
|
||||
}
|
||||
|
|
|
@ -65,6 +65,74 @@ HandleNecessaryPropertyInstances(
|
|||
return STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
NTSTATUS
|
||||
HandleDataIntersection(
|
||||
IN PIRP Irp,
|
||||
IN PKSIDENTIFIER Request,
|
||||
IN OUT PVOID Data,
|
||||
IN PSUBDEVICE_DESCRIPTOR Descriptor)
|
||||
{
|
||||
IIrpTarget * IrpTarget;
|
||||
IPort *Port;
|
||||
ISubdevice *SubDevice;
|
||||
KSP_PIN * Pin = (KSP_PIN*)Request;
|
||||
PKSOBJECT_CREATE_ITEM CreateItem;
|
||||
PKSMULTIPLE_ITEM MultipleItem;
|
||||
PKSDATARANGE DataRange;
|
||||
PIO_STACK_LOCATION IoStack;
|
||||
NTSTATUS Status;
|
||||
ULONG Index, Length;
|
||||
|
||||
/* Access the create item */
|
||||
CreateItem = KSCREATE_ITEM_IRP_STORAGE(Irp);
|
||||
/* Get the IrpTarget */
|
||||
IrpTarget = (IIrpTarget*)CreateItem->Context;
|
||||
/* Get the parent */
|
||||
Status = IrpTarget->lpVtbl->QueryInterface(IrpTarget, &IID_IPort, (PVOID*)&Port);
|
||||
if (!NT_SUCCESS(Status))
|
||||
{
|
||||
DPRINT1("Failed to obtain IPort interface from filter\n");
|
||||
Irp->IoStatus.Information = 0;
|
||||
Irp->IoStatus.Status = STATUS_UNSUCCESSFUL;
|
||||
return STATUS_UNSUCCESSFUL;
|
||||
}
|
||||
|
||||
/* Get private ISubdevice interface */
|
||||
Status = Port->lpVtbl->QueryInterface(Port, &IID_ISubdevice, (PVOID*)&SubDevice);
|
||||
if (!NT_SUCCESS(Status))
|
||||
{
|
||||
DPRINT1("Failed to obtain ISubdevice interface from port driver\n");
|
||||
KeBugCheck(0);
|
||||
}
|
||||
|
||||
/* Access parameters */
|
||||
MultipleItem = (PKSMULTIPLE_ITEM)(Request + 1);
|
||||
DataRange = (PKSDATARANGE)(MultipleItem + 1);
|
||||
|
||||
/* Get current stack location */
|
||||
IoStack = IoGetCurrentIrpStackLocation(Irp);
|
||||
|
||||
for(Index = 0; Index < MultipleItem->Count; Index++)
|
||||
{
|
||||
/* Call miniport's properitary handler */
|
||||
Status = SubDevice->lpVtbl->DataRangeIntersection(SubDevice, Pin->PinId, DataRange, (PKSDATARANGE)&Descriptor->Factory.KsPinDescriptor[Pin->PinId].DataRanges[0],
|
||||
IoStack->Parameters.DeviceIoControl.OutputBufferLength, Data, &Length);
|
||||
|
||||
if (Status == STATUS_SUCCESS)
|
||||
{
|
||||
Irp->IoStatus.Information = Length;
|
||||
break;
|
||||
}
|
||||
DataRange = UlongToPtr(PtrToUlong(DataRange) + DataRange->FormatSize);
|
||||
}
|
||||
|
||||
/* Release reference */
|
||||
Port->lpVtbl->Release(Port);
|
||||
|
||||
Irp->IoStatus.Status = Status;
|
||||
return Status;
|
||||
}
|
||||
|
||||
|
||||
NTSTATUS
|
||||
NTAPI
|
||||
|
@ -103,6 +171,8 @@ PinPropertyHandler(
|
|||
break;
|
||||
|
||||
case KSPROPERTY_PIN_DATAINTERSECTION:
|
||||
Status = HandleDataIntersection(Irp, Request, Data, Descriptor);
|
||||
break;
|
||||
case KSPROPERTY_PIN_PHYSICALCONNECTION:
|
||||
case KSPROPERTY_PIN_CONSTRAINEDDATARANGES:
|
||||
DPRINT1("Unhandled %x\n", Request->Id);
|
||||
|
@ -141,7 +211,7 @@ PcPropertyHandler(
|
|||
PFNKSHANDLER PropertyHandler = NULL;
|
||||
UNICODE_STRING GuidString;
|
||||
NTSTATUS Status = STATUS_UNSUCCESSFUL;
|
||||
PCPROPERTY_REQUEST PropertyRequest;
|
||||
PPCPROPERTY_REQUEST PropertyRequest;
|
||||
|
||||
IoStack = IoGetCurrentIrpStackLocation(Irp);
|
||||
|
||||
|
@ -159,17 +229,25 @@ PcPropertyHandler(
|
|||
{
|
||||
if(Descriptor->DeviceDescriptor->AutomationTable->Properties[Index].Flags & Property->Flags)
|
||||
{
|
||||
RtlZeroMemory(&PropertyRequest, sizeof(PCPROPERTY_REQUEST));
|
||||
PropertyRequest.PropertyItem = &Descriptor->DeviceDescriptor->AutomationTable->Properties[Index];
|
||||
PropertyRequest.Verb = Property->Flags;
|
||||
PropertyRequest.Value = Irp->UserBuffer;
|
||||
PropertyRequest.ValueSize = IoStack->Parameters.DeviceIoControl.OutputBufferLength;
|
||||
PropertyRequest.Irp = Irp;
|
||||
PropertyRequest = ExAllocatePool(NonPagedPool, sizeof(PCPROPERTY_REQUEST));
|
||||
if (!PropertyRequest)
|
||||
{
|
||||
/* no memory */
|
||||
Irp->IoStatus.Information = 0;
|
||||
Irp->IoStatus.Status = STATUS_INSUFFICIENT_RESOURCES;
|
||||
IoCompleteRequest(Irp, IO_NO_INCREMENT);
|
||||
return STATUS_INSUFFICIENT_RESOURCES;
|
||||
}
|
||||
RtlZeroMemory(PropertyRequest, sizeof(PCPROPERTY_REQUEST));
|
||||
PropertyRequest->PropertyItem = &Descriptor->DeviceDescriptor->AutomationTable->Properties[Index];
|
||||
PropertyRequest->Verb = Property->Flags;
|
||||
PropertyRequest->Value = Irp->UserBuffer;
|
||||
PropertyRequest->ValueSize = IoStack->Parameters.DeviceIoControl.OutputBufferLength;
|
||||
PropertyRequest->Irp = Irp;
|
||||
|
||||
DPRINT("Calling handler %p\n", Descriptor->DeviceDescriptor->AutomationTable->Properties[Index].Handler);
|
||||
Status = Descriptor->DeviceDescriptor->AutomationTable->Properties[Index].Handler(&PropertyRequest);
|
||||
Status = Descriptor->DeviceDescriptor->AutomationTable->Properties[Index].Handler(PropertyRequest);
|
||||
|
||||
Irp->IoStatus.Information = PropertyRequest.ValueSize;
|
||||
Irp->IoStatus.Status = Status;
|
||||
IoCompleteRequest(Irp, IO_NO_INCREMENT);
|
||||
return Status;
|
||||
|
@ -236,5 +314,3 @@ PcPropertyHandler(
|
|||
IoCompleteRequest(Irp, IO_NO_INCREMENT);
|
||||
return STATUS_NOT_IMPLEMENTED;
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Reference in a new issue