//////////////////////////////////////////////////////////// // Copyright (C) Roman Ryltsov, 2008-2014 // Created by Roman Ryltsov roman@alax.info, http://alax.info // // This source code is published to complement DirectShowSpy developer powertoy // and demonstrate the internal use of APIs and tricks powering the tool. It is // allowed to freely re-use the portions of the code in other projects, commercial // or otherwise (provided that you don’t pretend that you wrote the original tool). // // Please keep in mind that DirectShowSpy is a developer tool, it is strongly recommended // that it is not shipped with release grade software. It is allowed to distribute // DirectShowSpy if only it is not registered with Windows by default and either // used privately, or registered on specific throubleshooting request. The advice applies // to hooking methods used by DirectShowSpy in general as well. import "oaidl.idl"; import "ocidl.idl"; [ object, uuid(968E0597-E713-4EF5-A6F3-780B816204C2), dual, oleautomation, nonextensible, helpstring("IModuleVersionInformation Interface"), pointer_default(unique) ] interface IModuleVersionInformation : IDispatch { [id(1), propget] HRESULT Path([out, retval] BSTR* psPath); [id(2), propget] HRESULT FileVersion([out, retval] LONGLONG* pnFileVersion); [id(3), propget] HRESULT FileVersionString([out, retval] BSTR* psFileVersionString); }; [ object, uuid(6945711B-FE0F-4C54-965F-5B67969C28B7), dual, oleautomation, nonextensible, helpstring("ISpy Interface"), pointer_default(unique) ] interface ISpy : IDispatch { [id(1), propget] HRESULT MonikerDisplayName([out, retval] BSTR* psMonikerDisplayName); [id(2), propget] HRESULT CreationTime([out, retval] DATE* pfTime); [id(3), propget] HRESULT FriendlyName([out, retval] BSTR* psFriendlyName); [id(3), propput] HRESULT FriendlyName([in] BSTR sFriendlyName); [id(4)] HRESULT DoPropertyFrameModal([in] LONG nParentWindowHandle); [id(5)] HRESULT DoFilterGraphListModal([in] LONG nParentWindowHandle); [id(6)] HRESULT OpenGraphStudioNext([in] LONG nParentWindowHandle, [out, retval] VARIANT_BOOL* pbResult); [id(7)] HRESULT OpenGraphEdit([in] LONG nParentWindowHandle, [out, retval] VARIANT_BOOL* pbResult); [id(8)] HRESULT ReadRunPropertyBag([in] IUnknown* pBaseFilterUnknown, [in] VARIANT_BOOL bAllowExtension, [out, retval] VARIANT* pvValue); }; [ object, uuid(E59EED72-E94A-44D9-8C1F-6535A4C1D6C9), dual, oleautomation, nonextensible, helpstring("IFilterGraphMemoryAllocatorData Interface"), pointer_default(unique) ] interface IFilterGraphMemoryAllocatorData : IDispatch { [id(DISPID_VALUE), propget] HRESULT Value([out, retval] VARIANT* pvValue); }; [ object, uuid(A7490000-3A5D-455D-9B81-2025B74CD4CD), nonextensible, helpstring("ISpyEx Interface"), pointer_default(unique) ] interface ISpyEx : IUnknown { }; [ object, uuid(34B280D7-A144-4a64-BCB9-3616896F6877), dual, oleautomation, nonextensible, helpstring("IFilterMapperSpy Interface"), pointer_default(unique) ] interface IFilterMapperSpy : IDispatch { }; [ object, uuid(14EB119F-25CE-4654-ABE1-E6742AF03F2D), dual, oleautomation, nonextensible, helpstring("ISystemDeviceEnumeratorSpy Interface"), pointer_default(unique) ] interface ISystemDeviceEnumeratorSpy : IDispatch { }; [ uuid(B9EC374B-834B-4DA9-BFB5-C1872CE736FF), version(1.0), helpstring("Alax.Info Filter Graph Spy 1.0 Type Library") ] library AlaxInfoDirectShowSpy { importlib("stdole2.tlb"); [ object, uuid(ACBECDFD-D8CA-49c8-B799-D23225D5BFAD), nonextensible, helpstring("IFilterGraphAddRemoveHook Interface"), pointer_default(unique) ] interface IFilterGraphAddRemoveHook : IUnknown { HRESULT OnAddFilter([in] ISpy* pSpy, [in] IUnknown* pBaseFilterUnknown, [in] LPCWSTR pszName, [in, out] BOOL* pbDefault); HRESULT OnRemoveFilter([in] ISpy* pSpy, [in] IUnknown* pBaseFilterUnknown, [in, out] BOOL* pbDefault); HRESULT OnAddSourceFilter([in] ISpy* pSpy, [in] LPCWSTR pszFileName, [in] LPCWSTR pszFilterName, [out] IUnknown** ppBaseFilterUnknown, [in, out] BOOL* pbDefault); HRESULT OnAddSourceFilterForMoniker([in] ISpy* pSpy, [in] IUnknown* pMonikerUnknown, [in] IUnknown* pBindCtxUnknown, [in] LPCWSTR pszFilterName, [out] IUnknown** ppBaseFilterUnknown, [in, out] BOOL* pbDefault); }; [ object, uuid(D0F4C168-D09D-481e-903D-7461CE69E391), nonextensible, helpstring("IFilterGraphConnectHook Interface"), pointer_default(unique) ] interface IFilterGraphConnectHook : IUnknown { HRESULT OnConnectDirect([in] ISpy* pSpy, [in] IUnknown* pOutputPinUnknown, [in] IUnknown* pInputPinUnknown, [in] const BYTE* pMediaTypeData, [in, out] BOOL* pbDefault); HRESULT OnReconnect([in] ISpy* pSpy, [in] IUnknown* pPinUnknown, [in, out] BOOL* pbDefault); HRESULT OnDisconnect([in] ISpy* pSpy, [in] IUnknown* pPinUnknown, [in, out] BOOL* pbDefault); HRESULT OnConnect([in] ISpy* pSpy, [in] IUnknown* pOutputPinUnknown, [in] IUnknown* pInputPinUnknown, [in, out] BOOL* pbDefault); HRESULT OnReconnectEx([in] ISpy* pSpy, [in] IUnknown* pPinUnknown, [in] const BYTE* pMediaTypeData, [in, out] BOOL* pbDefault); }; [ object, uuid(65FA1519-A935-4fa9-A15D-9426457E02F6), nonextensible, helpstring("IFilterGraphStateControlHook Interface"), pointer_default(unique) ] interface IFilterGraphStateControlHook : IUnknown { HRESULT OnRun([in] ISpy* pSpy, [in, out] BOOL* pbDefault); HRESULT OnPause([in] ISpy* pSpy, [in, out] BOOL* pbDefault); HRESULT OnStop([in] ISpy* pSpy, [in, out] BOOL* pbDefault); }; [ uuid(F552C23D-F088-41C3-A080-8464D7BB9BAD), helpstring("Spy Class") ] coclass Spy { [default] interface ISpy; //interface ISpyEx; interface IModuleVersionInformation; interface IFilterGraphMemoryAllocatorData; }; [ uuid(2C281C40-8853-4a30-99D3-9DCFF2C015C9), helpstring("NoThreadSpy Class") ] coclass NoThreadSpy { [default] interface ISpy; //interface ISpyEx; interface IModuleVersionInformation; interface IFilterGraphMemoryAllocatorData; }; [ uuid(B6274D9B-1AD3-4c32-83C5-35DC33CAFF47), helpstring("FilterMapperSpy Class") ] coclass FilterMapperSpy { [default] interface IFilterMapperSpy; }; [ uuid(AD42E3BD-7B9B-4783-9DA2-61A9ACD0D4D2), helpstring("SystemDeviceEnumeratorSpy Class") ] coclass SystemDeviceEnumeratorSpy { [default] interface ISystemDeviceEnumeratorSpy; }; [ object, uuid(3D1AF248-DEF1-4E26-A071-FEDF15FED6A8), dual, oleautomation, nonextensible, helpstring("IFilterGraphHelper Interface"), pointer_default(unique) ] interface IFilterGraphHelper : IDispatch { [id(DISPID_VALUE), propget] HRESULT FilterGraph([out, retval] IUnknown** ppFilterGraphUnknown); [id(DISPID_VALUE), propput] HRESULT FilterGraph([in] IUnknown* pFilterGraphUnknown); [id(1), propget] HRESULT Text([out, retval] BSTR* psText); [id(2)] HRESULT DoPropertyFrameModal([in] LONG nParentWindowHandle); [id(3)] HRESULT DoFilterGraphListModal([in] LONG nParentWindowHandle); [id(4)] HRESULT OpenGraphStudioNext([in] LONG nParentWindowHandle, [in] BSTR sMonikerDisplayName, [out, retval] VARIANT_BOOL* pbResult); [id(5)] HRESULT OpenGraphEdit([in] LONG nParentWindowHandle, [in] BSTR sMonikerDisplayName, [out, retval] VARIANT_BOOL* pbResult); [id(6), propget] HRESULT Options([out, retval] VARIANT* pvOptions); [id(6), propput] HRESULT Options([in] VARIANT vOptions); }; [ uuid(5A9A684C-A891-4032-8D31-FF6EAB5A0C1E), helpstring("FilterGraphHelper Class") ] coclass FilterGraphHelper { [default] interface IFilterGraphHelper; }; [ object, uuid(E267813C-8F29-4D69-A776-CD462494FCE4), dual, oleautomation, nonextensible, helpstring("IRunPropertyBagAware Interface"), pointer_default(unique) ] interface IRunPropertyBagAware : IDispatch { [propget, id(DISPID_VALUE)] HRESULT Value([out, retval] IUnknown** ppPropertyBagUnknown); }; [ uuid(76127943-D22E-4C4E-9D9B-173C224D0EE4), helpstring("RunPropertyBagPropertyPage Class") ] coclass RunPropertyBagPropertyPage { [default] interface IUnknown; //IPropertyPage; }; [ object, uuid(DA0D924F-1AC0-496D-AE44-CC2BD8CE7CFA), dual, oleautomation, nonextensible, helpstring("IRunEventAware Interface"), pointer_default(unique) ] interface IRunEventAware : IDispatch { [propget, id(DISPID_VALUE)] HRESULT Value([out, retval] VARIANT* pvValue); [propget, id(1)] HRESULT Capture([out, retval] VARIANT_BOOL* pbCapture); [propput, id(1)] HRESULT Capture([in] VARIANT_BOOL bCapture); }; [ uuid(AD0E84E9-DE25-4C1A-85A5-47406604E144), helpstring("RunEventPropertyPage Class") ] coclass RunEventPropertyPage { [default] interface IUnknown; //IPropertyPage; }; };