From: Michael Jones on
I've added a custom property set to my AVStream driver, and I can access
it just fine from a test app which opens the driver and calls
DeviceIoControl directly to do the IOCTL_KS_PROPERTY.

Next I wrote a KsProxy plugin DLL using ATL, in order to wrap an
interface around the property set, and also to implement a property
page. The property page comes up just fine in GraphEdt, but when it
tries to query for my custom interface, it does not find it.

I suspect a registration problem, since I wrote this in ATL, and Visual
Studio auto-generated some of the IDL and the RGS file (shown below).
The only samples I can find use the DirectShow base classes, so I'm at a
bit of a loss.

Any suggestions on how to debug this, or pointers to documentation or
samples, are greatly appreciated.

---------- The IDL File ----------
import "oaidl.idl";
import "ocidl.idl";
import "unknwn.idl";
import "strmif.idl";

[
uuid(55EBF763-481C-469D-950A-0BF7BF05967C),
version(1.0),
helpstring("VpcVideoPlugin 1.0 Type Library")
]
library VPCVIDEOPLUGINLib
{
[
object,
uuid( 8E4B3A73-B4DA-4c4f-AEDB-E7ADF9CAC333 ),
helpstring("IVpcAudioEncoding Interface"),
pointer_default(unique)
]
interface IVpcAudioEncoding: IUnknown
{
[propget, helpstring("property AudioMute")] HRESULT AudioMute([out,
retval] BOOL *pVal);
[propput, helpstring("property AudioMute")] HRESULT AudioMute([in]
BOOL newVal);
};

[
uuid(4F758C07-AAC1-4DF8-A0C8-4BFA51C2BABF),
helpstring("VpcAudioEncoding Class")
]
coclass VpcAudioEncoding
{
[default] interface IVpcAudioEncoding;
};


[
uuid(6020BD8F-BF93-4E86-8B61-9DEBD75C6662),
helpstring("VpcAudioEncodingPage Class")
]
coclass VpcAudioEncodingPage
{
interface IUnknown;
};
};

---------- The RGS File ----------

HKCR
{
VpcVideoPlugin.VpcAudioEncoding.1 = s 'VpcAudioEncoding Class'
{
CLSID = s '{4F758C07-AAC1-4DF8-A0C8-4BFA51C2BABF}'
}
VpcVideoPlugin.VpcAudioEncoding = s 'VpcAudioEncoding Class'
{
CLSID = s '{4F758C07-AAC1-4DF8-A0C8-4BFA51C2BABF}'
}
NoRemove CLSID
{
ForceRemove {4F758C07-AAC1-4DF8-A0C8-4BFA51C2BABF} = s
'VpcAudioEncoding Class'
{
ProgID = s 'VpcVideoPlugin.VpcAudioEncoding.1'
VersionIndependentProgID = s 'VpcVideoPlugin.VpcAudioEncoding'
InprocServer32 = s '%MODULE%'
{
val ThreadingModel = s 'both'
}
}
}
}

HKLM
{
NoRemove System
{
NoRemove CurrentControlSet
{
NoRemove Control
{
NoRemove MediaInterfaces
{
ForceRemove {8E4B3A73-B4DA-4c4f-AEDB-E7ADF9CAC333} = s
'VpcAudioEncoding KsProxy Extension'
{
val IID = b '078c754fc1aaf84da0c84bfa51c2babf'
}
}
}
}
}
}

----------------------------------------------------------------------


Thanks in advance,

-- mkj
_______________________________________________
//
// Michael K. Jones
// Stone Hill Consulting, LLC
// http://www.stonehill.com
//_______________________________________________
From: Michael Jones on
Seems that the CLSID which implements the interface *must* be the same
as the GUID of the property set (in the driver). One of the articles I
read (by Max Paklin I think) led me to believe that was optional.
Indeed, it appeared that the registry allowed you to map the GUID of the
property set to to any old CLSID (via the IID value underneath the
MediaInterfaces key).

To get the IDL to compile, I had to remove the CoClass declaration from
the IDL (because it wouldn't allow me to use the same GUID for both the
interface and the coclass), and change the references to it's CLSID to
be the IID of the interface instead. Not intuitive, but it seems to work.

Or have I firmly grasped the wrong end of the stick here?

Cheers,

--mkj

Michael Jones wrote:
> I've added a custom property set to my AVStream driver, and I can access
> it just fine from a test app which opens the driver and calls
> DeviceIoControl directly to do the IOCTL_KS_PROPERTY.
>
> Next I wrote a KsProxy plugin DLL using ATL, in order to wrap an
> interface around the property set, and also to implement a property
> page. The property page comes up just fine in GraphEdt, but when it
> tries to query for my custom interface, it does not find it.
>
> I suspect a registration problem, since I wrote this in ATL, and Visual
> Studio auto-generated some of the IDL and the RGS file (shown below).
> The only samples I can find use the DirectShow base classes, so I'm at a
> bit of a loss.
>
> Any suggestions on how to debug this, or pointers to documentation or
> samples, are greatly appreciated.
>
> ---------- The IDL File ----------
> import "oaidl.idl";
> import "ocidl.idl";
> import "unknwn.idl";
> import "strmif.idl";
>
> [
> uuid(55EBF763-481C-469D-950A-0BF7BF05967C),
> version(1.0),
> helpstring("VpcVideoPlugin 1.0 Type Library")
> ]
> library VPCVIDEOPLUGINLib
> {
> [
> object,
> uuid( 8E4B3A73-B4DA-4c4f-AEDB-E7ADF9CAC333 ),
> helpstring("IVpcAudioEncoding Interface"),
> pointer_default(unique)
> ]
> interface IVpcAudioEncoding: IUnknown
> {
> [propget, helpstring("property AudioMute")] HRESULT
> AudioMute([out, retval] BOOL *pVal);
> [propput, helpstring("property AudioMute")] HRESULT
> AudioMute([in] BOOL newVal);
> };
>
> [
> uuid(4F758C07-AAC1-4DF8-A0C8-4BFA51C2BABF),
> helpstring("VpcAudioEncoding Class")
> ]
> coclass VpcAudioEncoding
> {
> [default] interface IVpcAudioEncoding;
> };
>
>
> [
> uuid(6020BD8F-BF93-4E86-8B61-9DEBD75C6662),
> helpstring("VpcAudioEncodingPage Class")
> ]
> coclass VpcAudioEncodingPage
> {
> interface IUnknown;
> };
> };
>
> ---------- The RGS File ----------
>
> HKCR
> {
> VpcVideoPlugin.VpcAudioEncoding.1 = s 'VpcAudioEncoding Class'
> {
> CLSID = s '{4F758C07-AAC1-4DF8-A0C8-4BFA51C2BABF}'
> }
> VpcVideoPlugin.VpcAudioEncoding = s 'VpcAudioEncoding Class'
> {
> CLSID = s '{4F758C07-AAC1-4DF8-A0C8-4BFA51C2BABF}'
> }
> NoRemove CLSID
> {
> ForceRemove {4F758C07-AAC1-4DF8-A0C8-4BFA51C2BABF} = s
> 'VpcAudioEncoding Class'
> {
> ProgID = s 'VpcVideoPlugin.VpcAudioEncoding.1'
> VersionIndependentProgID = s 'VpcVideoPlugin.VpcAudioEncoding'
> InprocServer32 = s '%MODULE%'
> {
> val ThreadingModel = s 'both'
> }
> }
> }
> }
>
> HKLM
> {
> NoRemove System
> {
> NoRemove CurrentControlSet
> {
> NoRemove Control
> {
> NoRemove MediaInterfaces
> {
> ForceRemove {8E4B3A73-B4DA-4c4f-AEDB-E7ADF9CAC333} = s
> 'VpcAudioEncoding KsProxy Extension'
> {
> val IID = b '078c754fc1aaf84da0c84bfa51c2babf'
> }
> }
> }
> }
> }
> }
>
> ----------------------------------------------------------------------
>
>
> Thanks in advance,
>
> -- mkj
> _______________________________________________
> //
> // Michael K. Jones
> // Stone Hill Consulting, LLC
> // http://www.stonehill.com
> //_______________________________________________