The DataRangeIntersection method determines the highest quality intersection of two data ranges.
NTSTATUS
DataRangeIntersection(
IN ULONG PinId,
IN PKSDATARANGE DataRange,
IN PKSDATARANGE MatchingDataRange,
IN ULONG OutputBufferLength,
OUT PVOID ResultantFormat OPTIONAL,
OUT PULONG ResultantFormatLength
);
DataRangeIntersection returns STATUS_SUCCESS if the call was successful. Otherwise, the method returns an appropriate error code. The following table shows some of the possible return status codes.
| Error Code | Meaning |
|---|---|
| STATUS_NO_MATCH | There is no intersection. |
| STATUS_NOT_IMPLEMENTED | Defers data-intersection handling to the port driver's default data-intersection handler. |
| STATUS_BUFFER_OVERFLOW | The OutputBufferLength parameter was specified as zero. |
| STATUS_BUFFER_TOO_SMALL | The buffer length specified in OutputBufferLength was nonzero but was too small to hold the resultant format. |
Declared in portcls.h. Include portcls.h.
The DataRangeIntersection method is the miniport driver's data-intersection handler. The port driver calls this method when it receives a data-range intersection property request (see KSPROPERTY_PIN_DATAINTERSECTION) and the target for the request is a pin factory on a filter instance that the miniport driver implements.
The ResultantFormatBuffer parameter points to a buffer that begins with a KSDATAFORMAT_WAVEFORMATEX structure. Note that the WaveFormatEx member of this structure can be extended to include additional format information (for example, a channel configuration mask). For more information, see WAVEFORMATEXTENSIBLE.
The ResultantFormat parameter is optional and can be specified as NULL, in which case OutputBufferLength must be specified as zero. The caller can query for the required buffer length by making an initial call to DataRangeIntersection with an OutputBufferLength value of zero. The method responds by writing the required buffer length to the location pointed to by ResultantFormatLength and returning status code STATUS_BUFFER_OVERFLOW. The caller can then allocate a buffer of the required size and specify this buffer in a second call to DataRangeIntersection.
KSDATARANGE, KSPROPERTY_PIN_DATAINTERSECTION, KSDATAFORMAT_WAVEFORMATEX, WAVEFORMATEXTENSIBLE