Re: Supporting KSPROPERTY_PIN_CONSTRAINEDDATARANGES under AVStream



yinmun <yinmun@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote:
>
>I have tried the method you proposed, but when I tried to retrieve the pin
>properties of my filter loaded using GraphEdit, it'll prompt me KSPROXY.AX
>encountered Access Violation error.
>
>My approach is as follows, please advise and point out my mistake, thanks.

Well, I see a mistake, but I'm not sure it's related. You don't set
IoStatus.Information in the "success" case.

I'm still confused as to why you have to do this. If you have your data
structures set up properly, AVStream should be handling this property for
you automatically.

> PKSMULTIPLE_ITEM pItem;
> PKSDATAFORMAT pDataRangePtr;
> switch(pKsProperty->Id)
> {
> case KSPROPERTY_PIN_CONSTRAINEDDATARANGES:
> {
> ULONG ulOutputSize = IoGetCurrentIrpStackLocation(pIrp) ->
>
>Parameters.DeviceIoControl.OutputBufferLength;
>
> int nCount = 1;
> int nMinBufferSize = sizeof(KSMULTIPLE_ITEM) +
> (nCount *
>(sizeof(KSDATAFORMAT)));
>
> if(pData != NULL && ulOutputSize >= nMinBufferSize)
> {
> pItem = (PKSMULTIPLE_ITEM)pData;
> pItem->Count = nCount;
> pItem->Size = nMinBufferSize;
>
> pDataRangePtr = (PKSDATAFORMAT)(pItem + 1);
> for(i = 0; i < nCount; i++)
> {
> RtlCopyMemory(pDataRangePtr,
> PinDefaultDataRanges[i],
> sizeof(KSDATAFORMAT));
> pDataRangePtr++;
> }

pIrp->IoStatus.Information = nMinBufferSize;

> Status = STATUS_SUCCESS;
> }
> else
> {
> pIrp->IoStatus.Information = nMinBufferSize;
> Status = STATUS_BUFFER_OVERFLOW;
> }
> }
> break;

--
- Tim Roberts, timr@xxxxxxxxx
Providenza & Boekelheide, Inc
.



Relevant Pages

  • Re: Encription software info
    ... I am away dry, so I prompt you. ... Elmo, off timbers pregnant and strategic, screams past it, figuring ... mistake Francoise's psychologist with federations, ...
    (sci.crypt)
  • Re: best environment for learning Lisp?
    ... Okay, Pascal, I tried it. ... the prompt to make sure I didn't make a mistake. ... I'm not asking for help with dlls. ...
    (comp.lang.lisp)
  • Re: quite an achievement
    ... If this had been one isolated "thinko", followed by a prompt ... acknowledgement of the mistake, you might have got away with it. ...
    (uk.sport.cricket)
  • Re: Newbie wants Firefox and Tbird
    ... > require root; ... Sudo doesn't save you from the mistake in either case while looking at the ... The very same prompt which would let you know where you are, ...
    (Debian-User)

Loading