hi,
I have a HLK test for camera properties (ev compensatin)
that fails with status_bad_configuration this is not a status I return.
my GetProperty handler is called and I see in my logs that the handler
returns with status success, but yet the test fails with the bad
confguration
my Get Handler is the following:
NTSTATUS CCaptureFilter::GetEvCompensation(IN PIRP Irp,
IN PKSPROPERTY Property,
OUT PVOID Data)
{
PAGED_CODE();
NTSTATUS Status = STATUS_SUCCESS;
ASSERT(Irp);
ASSERT(Property);
PIO_STACK_LOCATION pIrpStack = IoGetCurrentIrpStackLocation(Irp);
ULONG ulOutputBufferLength =
pIrpStack->Parameters.DeviceIoControl.OutputBufferLength;
ULONG ulExpectedLength = sizeof(KSCAMERA_EXTENDEDPROP_HEADER) +
sizeof(KSCAMERA_EXTENDEDPROP_EVCOMPENSATION);
if (ulOutputBufferLength == 0)
{
Irp->IoStatus.Information = ulExpectedLength;
Status = STATUS_BUFFER_OVERFLOW;
}
else if (ulOutputBufferLength < ulExpectedLength)
{
Status = STATUS_BUFFER_TOO_SMALL;
}
else if (Data && ulOutputBufferLength >= ulExpectedLength)
{
PKSCAMERA_EXTENDEDPROP_HEADER pKsExtPropHeader =
(PKSCAMERA_EXTENDEDPROP_HEADER)Data;
ASSERT(pKsExtPropHeader->Version == 1);
ASSERT(pKsExtPropHeader->PinId ==
KSCAMERA_EXTENDEDPROP_FILTERSCOPE);
pKsExtPropHeader->Size = ulExpectedLength;
pKsExtPropHeader->Result= 0;
pKsExtPropHeader->Flags = KSCAMERA_EXTENDEDPROP_EVCOMP_SIXTHSTEP;
pKsExtPropHeader->Capability =
KSCAMERA_EXTENDEDPROP_EVCOMP_SIXTHSTEP;
PKSCAMERA_EXTENDEDPROP_EVCOMPENSATION pEvCompensation \
= (PKSCAMERA_EXTENDEDPROP_EVCOMPENSATION)(pKsExtPropHeader + 1);
pEvCompensation->Mode = 0; // Unused. Must be 0.
pEvCompensation->Min = (LONG)-1;
pEvCompensation->Max = (LONG)0;
pEvCompensation->Value = 0;
Irp->IoStatus.Information = ulExpectedLength;
}
else
{
Status = STATUS_INVALID_PARAMETER;
}
TRACE_FUNC(status);
return Status;
}