const GUID KSPROPSETID_Topology = {0x720D4AC0L, 0x7533, 0x11D0, {0xA5, 0xD6, 0x28, 0xDB, 0x04, 0xC1, 0x00, 0x00}};
const GUID KSPROPSETID_Pin = {0x8C134960L, 0x51AD, 0x11CF, {0x87, 0x8A, 0x94, 0xF8, 0x01, 0xC1, 0x00, 0x00}};
const GUID KSPROPSETID_Connection = {0x1D58C920L, 0xAC9B, 0x11CF, {0xA5, 0xD6, 0x28, 0xDB, 0x04, 0xC1, 0x00, 0x00}};
+const GUID KSPROPTYPESETID_General = {0x97E99BA0L, 0xBDEA, 0x11CF, {0xA5, 0xD6, 0x28, 0xDB, 0x04, 0xC1, 0x00, 0x00}};
const GUID IID_IAllocatorMXF = {0xa5f0d62cL, 0xb30f, 0x11d2, {0xb7, 0xa3, 0x00, 0x60, 0x08, 0x33, 0x16, 0xc1}};
Property = (PKSPROPERTY)IoStack->Parameters.DeviceIoControl.Type3InputBuffer;
+ if (IsEqualGUIDAligned(&Property->Set, &GUID_NULL))
+ {
+ if (Property->Flags & KSPROPERTY_TYPE_SETSUPPORT)
+ {
+ if (IoStack->Parameters.DeviceIoControl.OutputBufferLength < sizeof(GUID))
+ {
+ /* buffer too small */
+ Irp->IoStatus.Status = STATUS_BUFFER_OVERFLOW;
+ Irp->IoStatus.Information = sizeof(GUID);
+ IoCompleteRequest(Irp, IO_NO_INCREMENT);
+
+ return STATUS_BUFFER_OVERFLOW;
+ }
+ /* FIXME copy guids
+ * KSPROPSETID_Audio when available
+ * KSPROPSETID_Sysaudio_Pin
+ */
+ RtlMoveMemory(Irp->UserBuffer, &KSPROPSETID_Connection, sizeof(GUID));
+
+ Irp->IoStatus.Status = STATUS_SUCCESS;
+ Irp->IoStatus.Information = sizeof(GUID);
+ IoCompleteRequest(Irp, IO_NO_INCREMENT);
+
+ return STATUS_SUCCESS;
+ }
+ }
+
+
if (IsEqualGUIDAligned(&Property->Set, &KSPROPSETID_Connection))
{
if (Property->Id == KSPROPERTY_CONNECTION_STATE)
KeBugCheck(0);
}
+
Status = This->Miniport->lpVtbl->NewStream(This->Miniport,
&This->Stream,
NULL,
IN PKSPROPERTY Property,
IN ULONG InputBufferLength,
IN ULONG OutputBufferLength,
+ OUT PVOID OutputBuffer,
OUT PFNKSHANDLER *PropertyHandler);
NTSTATUS
}
/* property handler is used to verify input parameters */
- Status = FindPropertyHandler(IoStatus, Descriptor, Property, PropertyLength, DataLength, &PropertyHandler);
+ Status = FindPropertyHandler(IoStatus, Descriptor, Property, PropertyLength, DataLength, Data, &PropertyHandler);
if (!NT_SUCCESS(Status))
{
DPRINT("FindPropertyHandler failed with %x\n", Status);
IN PKSPROPERTY Property,
IN ULONG InputBufferLength,
IN ULONG OutputBufferLength,
+ OUT PVOID OutputBuffer,
OUT PFNKSHANDLER *PropertyHandler)
{
ULONG Index, ItemIndex;
+ PULONG Flags;
+ PKSPROPERTY_DESCRIPTION Description;
for(Index = 0; Index < Descriptor->FilterPropertySet.FreeKsPropertySetOffset; Index++)
{
if (Property->Flags & KSPROPERTY_TYPE_GET)
*PropertyHandler = Descriptor->FilterPropertySet.Properties[Index].PropertyItem[ItemIndex].GetPropertyHandler;
+ if (Property->Flags & KSPROPERTY_TYPE_BASICSUPPORT)
+ {
+ if (sizeof(ULONG) > OutputBufferLength)
+ {
+ /* too small buffer */
+ return STATUS_INVALID_PARAMETER;
+ }
+
+ /* get output buffer */
+ Flags = (PULONG)OutputBuffer;
+
+ /* clear flags */
+ *Flags = KSPROPERTY_TYPE_BASICSUPPORT;
+
+ if (Descriptor->FilterPropertySet.Properties[Index].PropertyItem[ItemIndex].GetSupported)
+ *Flags |= KSPROPERTY_TYPE_GET;
+
+ if (Descriptor->FilterPropertySet.Properties[Index].PropertyItem[ItemIndex].SetSupported)
+ *Flags |= KSPROPERTY_TYPE_SET;
+
+ IoStatus->Information = sizeof(ULONG);
+
+ if (OutputBufferLength >= sizeof(KSPROPERTY_DESCRIPTION))
+ {
+ /* get output buffer */
+ Description = (PKSPROPERTY_DESCRIPTION)OutputBuffer;
+
+ /* store result */
+ Description->DescriptionSize = sizeof(KSPROPERTY_DESCRIPTION);
+ Description->PropTypeSet.Set = KSPROPTYPESETID_General;
+ Description->PropTypeSet.Id = 0;
+ Description->PropTypeSet.Flags = 0;
+ Description->MembersListCount = 0;
+ Description->Reserved = 0;
+
+ IoStatus->Information = sizeof(KSPROPERTY_DESCRIPTION);
+ }
+
+ return STATUS_SUCCESS;
+ }
+
+
if (Descriptor->FilterPropertySet.Properties[Index].PropertyItem[ItemIndex].MinProperty > InputBufferLength)
{
/* too small input buffer */
}
}
- Status = FindPropertyHandler(&Irp->IoStatus, Descriptor, Property, IoStack->Parameters.DeviceIoControl.InputBufferLength, IoStack->Parameters.DeviceIoControl.OutputBufferLength, &PropertyHandler);
- if (PropertyHandler)
+ Status = FindPropertyHandler(&Irp->IoStatus, Descriptor, Property, IoStack->Parameters.DeviceIoControl.InputBufferLength, IoStack->Parameters.DeviceIoControl.OutputBufferLength, Irp->UserBuffer, &PropertyHandler);
+ if (NT_SUCCESS(Status) && PropertyHandler)
{
KSPROPERTY_ITEM_IRP_STORAGE(Irp) = (PVOID)Descriptor;
DPRINT("Calling property handler %p\n", PropertyHandler);
Status = PropertyHandler(Irp, Property, Irp->UserBuffer);
}
- else
+ else if (!NT_SUCCESS(Status))
{
RtlStringFromGUID(&Property->Set, &GuidString);
DPRINT1("Unhandeled property: Set %S Id %u Flags %x InputLength %u OutputLength %u\n", GuidString.Buffer, Property->Id, Property->Flags, IoStack->Parameters.DeviceIoControl.InputBufferLength, IoStack->Parameters.DeviceIoControl.OutputBufferLength);