Hi guys,

I'm tearing my hair out on this one! I have a rendering minidriver, and I
want it to implement frame stepping, which is IVideoFrameStep to user mode,
and AM_KSPROPSETID_FrameStep to the driver.

The code I'm working on already has examples of custom interfaces aggregated
via KsProxy to do property pages. However, in all those cases, the property
set ID is the same as the user mode IID - and it works fine.

However, when it comes to trying to get my new interface working, nothing
happens!

More specifically KsProxy seems to instantiate the user mode COM object in
my helper DLL, but it never queries that same object for IVideoFrameStep,
and trying to single step in GraphEdit does nothing. I suspect the problem
may be due to confusion between IID's and Prop set ID's.

The .INF file for the driver registers the aggregated interface via KsProxy
as follows:

;IVideoFrameStep
HKCR,CLSID\%AM_KSPROPSETID_FrameStep%,,,%PlugIn_IVideoFrameStep%
HKCR,CLSID\%AM_KSPROPSETID_FrameStep%\InprocServer32,,,mediaxks.dll
HKCR,CLSID\%AM_KSPROPSETID_FrameStep%\InprocServer32,ThreadingModel,,Both
; N.B. IID_IVideoFrameStep is NOT the same as AM_KSPROPSETID_FrameStep
; There is no absolute requirement for User mode IID to be the same as
property set GUID.
;AM_KSPROPSETID_FrameStep = "{C830ACBD-AB07-492F-8852-45B6987C2979}"
;IID_IVideoFrameStep = "{E46A9787-2B71-444D-A4B5-1FAB7B708D6A}"
HKLM,%MediaInterfaces%\%AM_KSPROPSETID_FrameStep%,,,%PlugIn_IVideoFrameStep%
HKLM,%MediaInterfaces%\%AM_KSPROPSETID_FrameStep%,IID,%REG_BINARY%,87,97,6A,E4,71,2B,4D,44,A4,B5,1F,AB,7B,70,8D,6A
; Note binary coding is for IID_IVideoFrameStep

And since the property set is meant to be exposed on a pin, I've also got
this little gem, which doesn't appear to be documented anywhere, but seems
to be the way of indicating that the interface is meant to be exposed on a
pin:

; Registry for interfaces
[InterfaceRender.AddReg]
HKR,,CLSID,,%CLSID_PROXY%
HKR,,FriendlyName,,%mediaxm2v.DeviceDesc%
HKR,PinFactory\0\Interfaces\%PROPSETID_CONNECTION%,,,%PROPSETID_CONNECTION%
; TODO - should the IID below be the user mode IID or the KS Propsetid?
HKR,PinFactory\0\Interfaces\%IID_IVideoFrameStep%,,,%IID_IVideoFrameStep%

(The propsetid_connection is there so we can suggest an allocator framing).

In my user mode DLL that implements the plug in, I then have code very
similar to the sample available on MSDN (which, ISTR is IAMCameraControl or
such like). Most of the code is not that relevant, except, perhaps, the
QueryInterface, which (not unsurprisingly) looks like this:

STDMETHODIMP CFrameStepInterfaceHandler::NonDelegatingQueryInterface(REFIID
riid, void ** ppv)
{
HRESULT result;
CheckPointer(ppv,E_POINTER);

PrintGUID("CFrameStepInterfaceHandler::NDQI", &riid);

if (riid == __uuidof(IVideoFrameStep))
{
MYTRACE(("IID_IVideoFrameStep\n"));
result = GetInterface(static_cast<IVideoFrameStep*>(this), ppv);
}
else
{
result = CUnknown::NonDelegatingQueryInterface(riid, ppv);
}

MYTRACE(("CFrameStepInterfaceHandler::NDQI %08X\n", result));
return result;
}

Anyways, to cut a long story short, in my DLL, I see something like this
from the debug output of my DLL, which indicates the COM object is
instantiated, but unfortunately, none of the methods in it are called - and
I don't get any debug from my methods or from my driver upon trying to frame
step.

CFrameStepInterfaceHandler::CreateInstance pOuter 009667DC
CFrameStepInterfaceHandler::CFrameStepInterfaceHandler pOuter 009667DC
CFrameStepInterfaceHandler::CFrameStepInterfaceHandler QI 00000000
CFrameStepInterfaceHandler::CreateInstance hr 00000000 pObj 00EC3E28
CFrameStepInterfaceHandler::NDQI: 00000000-0000-0000-C0-00-00-00-00-00-00-46
CFrameStepInterfaceHandler::NDQI 00000000
CFrameStepInterfaceHandler::NDQI: 00000000-0000-0000-C0-00-00-00-00-00-00-46
CFrameStepInterfaceHandler::NDQI 00000000
CFrameStepInterfaceHandler::NDQI: 56A868AF-0AD4-11ce-B0-3A-00-20-AF-0B-A7-70
CFrameStepInterfaceHandler::NDQI 80004002

Any ideas? I'm at my wits end on this one.

MH.

Re: KsProxy interface aggregation. by Max

Max
Mon Dec 13 13:56:59 CST 2004

I don't remember that for sure, but I seems to me that the property set GUID
must be equal to interface IID.
Try to do the following. Temporary change the GUID of the property set to
IID and see if that helps.

-- Max.



"Martin Harvey (work)" <m.harvey@nospam.snellwilcox.com> wrote in message
news:OZ13Ach3EHA.924@TK2MSFTNGP14.phx.gbl...
> Hi guys,
>
> I'm tearing my hair out on this one! I have a rendering minidriver, and I
> want it to implement frame stepping, which is IVideoFrameStep to user
> mode, and AM_KSPROPSETID_FrameStep to the driver.
>
> The code I'm working on already has examples of custom interfaces
> aggregated via KsProxy to do property pages. However, in all those cases,
> the property set ID is the same as the user mode IID - and it works fine.
>
> However, when it comes to trying to get my new interface working, nothing
> happens!
>
> More specifically KsProxy seems to instantiate the user mode COM object in
> my helper DLL, but it never queries that same object for IVideoFrameStep,
> and trying to single step in GraphEdit does nothing. I suspect the problem
> may be due to confusion between IID's and Prop set ID's.
>
> The .INF file for the driver registers the aggregated interface via
> KsProxy as follows:
>
> ;IVideoFrameStep
> HKCR,CLSID\%AM_KSPROPSETID_FrameStep%,,,%PlugIn_IVideoFrameStep%
> HKCR,CLSID\%AM_KSPROPSETID_FrameStep%\InprocServer32,,,mediaxks.dll
> HKCR,CLSID\%AM_KSPROPSETID_FrameStep%\InprocServer32,ThreadingModel,,Both
> ; N.B. IID_IVideoFrameStep is NOT the same as AM_KSPROPSETID_FrameStep
> ; There is no absolute requirement for User mode IID to be the same as
> property set GUID.
> ;AM_KSPROPSETID_FrameStep = "{C830ACBD-AB07-492F-8852-45B6987C2979}"
> ;IID_IVideoFrameStep = "{E46A9787-2B71-444D-A4B5-1FAB7B708D6A}"
> HKLM,%MediaInterfaces%\%AM_KSPROPSETID_FrameStep%,,,%PlugIn_IVideoFrameStep%
> HKLM,%MediaInterfaces%\%AM_KSPROPSETID_FrameStep%,IID,%REG_BINARY%,87,97,6A,E4,71,2B,4D,44,A4,B5,1F,AB,7B,70,8D,6A
> ; Note binary coding is for IID_IVideoFrameStep
>
> And since the property set is meant to be exposed on a pin, I've also got
> this little gem, which doesn't appear to be documented anywhere, but seems
> to be the way of indicating that the interface is meant to be exposed on a
> pin:
>
> ; Registry for interfaces
> [InterfaceRender.AddReg]
> HKR,,CLSID,,%CLSID_PROXY%
> HKR,,FriendlyName,,%mediaxm2v.DeviceDesc%
> HKR,PinFactory\0\Interfaces\%PROPSETID_CONNECTION%,,,%PROPSETID_CONNECTION%
> ; TODO - should the IID below be the user mode IID or the KS Propsetid?
> HKR,PinFactory\0\Interfaces\%IID_IVideoFrameStep%,,,%IID_IVideoFrameStep%
>
> (The propsetid_connection is there so we can suggest an allocator
> framing).
>
> In my user mode DLL that implements the plug in, I then have code very
> similar to the sample available on MSDN (which, ISTR is IAMCameraControl
> or such like). Most of the code is not that relevant, except, perhaps, the
> QueryInterface, which (not unsurprisingly) looks like this:
>
> STDMETHODIMP
> CFrameStepInterfaceHandler::NonDelegatingQueryInterface(REFIID riid, void
> ** ppv)
> {
> HRESULT result;
> CheckPointer(ppv,E_POINTER);
>
> PrintGUID("CFrameStepInterfaceHandler::NDQI", &riid);
>
> if (riid == __uuidof(IVideoFrameStep))
> {
> MYTRACE(("IID_IVideoFrameStep\n"));
> result = GetInterface(static_cast<IVideoFrameStep*>(this), ppv);
> }
> else
> {
> result = CUnknown::NonDelegatingQueryInterface(riid, ppv);
> }
>
> MYTRACE(("CFrameStepInterfaceHandler::NDQI %08X\n", result));
> return result;
> }
>
> Anyways, to cut a long story short, in my DLL, I see something like this
> from the debug output of my DLL, which indicates the COM object is
> instantiated, but unfortunately, none of the methods in it are called -
> and I don't get any debug from my methods or from my driver upon trying to
> frame step.
>
> CFrameStepInterfaceHandler::CreateInstance pOuter 009667DC
> CFrameStepInterfaceHandler::CFrameStepInterfaceHandler pOuter 009667DC
> CFrameStepInterfaceHandler::CFrameStepInterfaceHandler QI 00000000
> CFrameStepInterfaceHandler::CreateInstance hr 00000000 pObj 00EC3E28
> CFrameStepInterfaceHandler::NDQI:
> 00000000-0000-0000-C0-00-00-00-00-00-00-46
> CFrameStepInterfaceHandler::NDQI 00000000
> CFrameStepInterfaceHandler::NDQI:
> 00000000-0000-0000-C0-00-00-00-00-00-00-46
> CFrameStepInterfaceHandler::NDQI 00000000
> CFrameStepInterfaceHandler::NDQI:
> 56A868AF-0AD4-11ce-B0-3A-00-20-AF-0B-A7-70
> CFrameStepInterfaceHandler::NDQI 80004002
>
> Any ideas? I'm at my wits end on this one.
>
> MH.
>
>
>
>



Re: KsProxy interface aggregation. by Martin

Martin
Tue Dec 14 05:56:59 CST 2004


"Max Paklin" <mpaklin@hotmail.com> wrote in message
news:eHRNp3U4EHA.1392@tk2msftngp13.phx.gbl...
>I don't remember that for sure, but I seems to me that the property set
>GUID must be equal to interface IID.
> Try to do the following. Temporary change the GUID of the property set to
> IID and see if that helps.

Thanks Max, I'll give it a whirl, and see what happens :-)

Martin H.



Re: KsProxy interface aggregation. by Martin

Martin
Wed Dec 22 08:58:08 CST 2004


"Martin Harvey (work)" <m.harvey@nospam.snellwilcox.com> wrote in message
news:%23nIMGQd4EHA.4008@TK2MSFTNGP15.phx.gbl...
>
> "Max Paklin" <mpaklin@hotmail.com> wrote in message
> news:eHRNp3U4EHA.1392@tk2msftngp13.phx.gbl...
>>I don't remember that for sure, but I seems to me that the property set
>>GUID must be equal to interface IID.
>> Try to do the following. Temporary change the GUID of the property set to
>> IID and see if that helps.
>
> Thanks Max, I'll give it a whirl, and see what happens :-)
>

As a follow up, it's okay, you can have a separate IID from property set
guid - it just requires a little thought. Still can't get frame stepping to
work with GraphEdit, but I suspect that's because I'm exposing the interface
on a pin, and perhaps GraphEdit expects it to be on the filter. Despite
this, I can query for the interface on the pin, and use it in a test
application.

MH.