1 | //////////////////////////////////////////////////////////// |
---|
2 | // Copyright (C) Roman Ryltsov, 2008-2014 |
---|
3 | // Created by Roman Ryltsov roman@alax.info, http://alax.info |
---|
4 | // |
---|
5 | // This source code is published to complement DirectShowSpy developer powertoy |
---|
6 | // and demonstrate the internal use of APIs and tricks powering the tool. It is |
---|
7 | // allowed to freely re-use the portions of the code in other projects, commercial |
---|
8 | // or otherwise (provided that you dont pretend that you wrote the original tool). |
---|
9 | // |
---|
10 | // Please keep in mind that DirectShowSpy is a developer tool, it is strongly recommended |
---|
11 | // that it is not shipped with release grade software. It is allowed to distribute |
---|
12 | // DirectShowSpy if only it is not registered with Windows by default and either |
---|
13 | // used privately, or registered on specific throubleshooting request. The advice applies |
---|
14 | // to hooking methods used by DirectShowSpy in general as well. |
---|
15 | |
---|
16 | import "oaidl.idl"; |
---|
17 | import "ocidl.idl"; |
---|
18 | |
---|
19 | [ |
---|
20 | object, |
---|
21 | uuid(968E0597-E713-4EF5-A6F3-780B816204C2), |
---|
22 | dual, |
---|
23 | oleautomation, |
---|
24 | nonextensible, |
---|
25 | helpstring("IModuleVersionInformation Interface"), |
---|
26 | pointer_default(unique) |
---|
27 | ] |
---|
28 | interface IModuleVersionInformation : IDispatch |
---|
29 | { |
---|
30 | [id(1), propget] HRESULT Path([out, retval] BSTR* psPath); |
---|
31 | [id(2), propget] HRESULT FileVersion([out, retval] LONGLONG* pnFileVersion); |
---|
32 | [id(3), propget] HRESULT FileVersionString([out, retval] BSTR* psFileVersionString); |
---|
33 | }; |
---|
34 | [ |
---|
35 | object, |
---|
36 | uuid(6945711B-FE0F-4C54-965F-5B67969C28B7), |
---|
37 | dual, |
---|
38 | oleautomation, |
---|
39 | nonextensible, |
---|
40 | helpstring("ISpy Interface"), |
---|
41 | pointer_default(unique) |
---|
42 | ] |
---|
43 | interface ISpy : IDispatch |
---|
44 | { |
---|
45 | [id(1), propget] HRESULT MonikerDisplayName([out, retval] BSTR* psMonikerDisplayName); |
---|
46 | [id(2), propget] HRESULT CreationTime([out, retval] DATE* pfTime); |
---|
47 | [id(3), propget] HRESULT FriendlyName([out, retval] BSTR* psFriendlyName); |
---|
48 | [id(3), propput] HRESULT FriendlyName([in] BSTR sFriendlyName); |
---|
49 | [id(4)] HRESULT DoPropertyFrameModal([in] LONG nParentWindowHandle); |
---|
50 | [id(5)] HRESULT DoFilterGraphListModal([in] LONG nParentWindowHandle); |
---|
51 | [id(6)] HRESULT OpenGraphStudioNext([in] LONG nParentWindowHandle, [out, retval] VARIANT_BOOL* pbResult); |
---|
52 | [id(7)] HRESULT OpenGraphEdit([in] LONG nParentWindowHandle, [out, retval] VARIANT_BOOL* pbResult); |
---|
53 | [id(8)] HRESULT ReadRunPropertyBag([in] IUnknown* pBaseFilterUnknown, [in] VARIANT_BOOL bAllowExtension, [out, retval] VARIANT* pvValue); |
---|
54 | }; |
---|
55 | [ |
---|
56 | object, |
---|
57 | uuid(E59EED72-E94A-44D9-8C1F-6535A4C1D6C9), |
---|
58 | dual, |
---|
59 | oleautomation, |
---|
60 | nonextensible, |
---|
61 | helpstring("IFilterGraphMemoryAllocatorData Interface"), |
---|
62 | pointer_default(unique) |
---|
63 | ] |
---|
64 | interface IFilterGraphMemoryAllocatorData : IDispatch |
---|
65 | { |
---|
66 | [id(DISPID_VALUE), propget] HRESULT Value([out, retval] VARIANT* pvValue); |
---|
67 | }; |
---|
68 | [ |
---|
69 | object, |
---|
70 | uuid(A7490000-3A5D-455D-9B81-2025B74CD4CD), |
---|
71 | nonextensible, |
---|
72 | helpstring("ISpyEx Interface"), |
---|
73 | pointer_default(unique) |
---|
74 | ] |
---|
75 | interface ISpyEx : IUnknown |
---|
76 | { |
---|
77 | }; |
---|
78 | [ |
---|
79 | object, |
---|
80 | uuid(34B280D7-A144-4a64-BCB9-3616896F6877), |
---|
81 | dual, |
---|
82 | oleautomation, |
---|
83 | nonextensible, |
---|
84 | helpstring("IFilterMapperSpy Interface"), |
---|
85 | pointer_default(unique) |
---|
86 | ] |
---|
87 | interface IFilterMapperSpy : IDispatch |
---|
88 | { |
---|
89 | }; |
---|
90 | [ |
---|
91 | object, |
---|
92 | uuid(14EB119F-25CE-4654-ABE1-E6742AF03F2D), |
---|
93 | dual, |
---|
94 | oleautomation, |
---|
95 | nonextensible, |
---|
96 | helpstring("ISystemDeviceEnumeratorSpy Interface"), |
---|
97 | pointer_default(unique) |
---|
98 | ] |
---|
99 | interface ISystemDeviceEnumeratorSpy : IDispatch |
---|
100 | { |
---|
101 | }; |
---|
102 | [ |
---|
103 | uuid(B9EC374B-834B-4DA9-BFB5-C1872CE736FF), |
---|
104 | version(1.0), |
---|
105 | helpstring("Alax.Info Filter Graph Spy 1.0 Type Library") |
---|
106 | ] |
---|
107 | library AlaxInfoDirectShowSpy |
---|
108 | { |
---|
109 | importlib("stdole2.tlb"); |
---|
110 | [ |
---|
111 | object, |
---|
112 | uuid(ACBECDFD-D8CA-49c8-B799-D23225D5BFAD), |
---|
113 | nonextensible, |
---|
114 | helpstring("IFilterGraphAddRemoveHook Interface"), |
---|
115 | pointer_default(unique) |
---|
116 | ] |
---|
117 | interface IFilterGraphAddRemoveHook : IUnknown |
---|
118 | { |
---|
119 | HRESULT OnAddFilter([in] ISpy* pSpy, [in] IUnknown* pBaseFilterUnknown, [in] LPCWSTR pszName, [in, out] BOOL* pbDefault); |
---|
120 | HRESULT OnRemoveFilter([in] ISpy* pSpy, [in] IUnknown* pBaseFilterUnknown, [in, out] BOOL* pbDefault); |
---|
121 | HRESULT OnAddSourceFilter([in] ISpy* pSpy, [in] LPCWSTR pszFileName, [in] LPCWSTR pszFilterName, [out] IUnknown** ppBaseFilterUnknown, [in, out] BOOL* pbDefault); |
---|
122 | HRESULT OnAddSourceFilterForMoniker([in] ISpy* pSpy, [in] IUnknown* pMonikerUnknown, [in] IUnknown* pBindCtxUnknown, [in] LPCWSTR pszFilterName, [out] IUnknown** ppBaseFilterUnknown, [in, out] BOOL* pbDefault); |
---|
123 | }; |
---|
124 | [ |
---|
125 | object, |
---|
126 | uuid(D0F4C168-D09D-481e-903D-7461CE69E391), |
---|
127 | nonextensible, |
---|
128 | helpstring("IFilterGraphConnectHook Interface"), |
---|
129 | pointer_default(unique) |
---|
130 | ] |
---|
131 | interface IFilterGraphConnectHook : IUnknown |
---|
132 | { |
---|
133 | HRESULT OnConnectDirect([in] ISpy* pSpy, [in] IUnknown* pOutputPinUnknown, [in] IUnknown* pInputPinUnknown, [in] const BYTE* pMediaTypeData, [in, out] BOOL* pbDefault); |
---|
134 | HRESULT OnReconnect([in] ISpy* pSpy, [in] IUnknown* pPinUnknown, [in, out] BOOL* pbDefault); |
---|
135 | HRESULT OnDisconnect([in] ISpy* pSpy, [in] IUnknown* pPinUnknown, [in, out] BOOL* pbDefault); |
---|
136 | HRESULT OnConnect([in] ISpy* pSpy, [in] IUnknown* pOutputPinUnknown, [in] IUnknown* pInputPinUnknown, [in, out] BOOL* pbDefault); |
---|
137 | HRESULT OnReconnectEx([in] ISpy* pSpy, [in] IUnknown* pPinUnknown, [in] const BYTE* pMediaTypeData, [in, out] BOOL* pbDefault); |
---|
138 | }; |
---|
139 | [ |
---|
140 | object, |
---|
141 | uuid(65FA1519-A935-4fa9-A15D-9426457E02F6), |
---|
142 | nonextensible, |
---|
143 | helpstring("IFilterGraphStateControlHook Interface"), |
---|
144 | pointer_default(unique) |
---|
145 | ] |
---|
146 | interface IFilterGraphStateControlHook : IUnknown |
---|
147 | { |
---|
148 | HRESULT OnRun([in] ISpy* pSpy, [in, out] BOOL* pbDefault); |
---|
149 | HRESULT OnPause([in] ISpy* pSpy, [in, out] BOOL* pbDefault); |
---|
150 | HRESULT OnStop([in] ISpy* pSpy, [in, out] BOOL* pbDefault); |
---|
151 | }; |
---|
152 | [ |
---|
153 | uuid(F552C23D-F088-41C3-A080-8464D7BB9BAD), |
---|
154 | helpstring("Spy Class") |
---|
155 | ] |
---|
156 | coclass Spy |
---|
157 | { |
---|
158 | [default] interface ISpy; |
---|
159 | //interface ISpyEx; |
---|
160 | interface IModuleVersionInformation; |
---|
161 | interface IFilterGraphMemoryAllocatorData; |
---|
162 | }; |
---|
163 | [ |
---|
164 | uuid(2C281C40-8853-4a30-99D3-9DCFF2C015C9), |
---|
165 | helpstring("NoThreadSpy Class") |
---|
166 | ] |
---|
167 | coclass NoThreadSpy |
---|
168 | { |
---|
169 | [default] interface ISpy; |
---|
170 | //interface ISpyEx; |
---|
171 | interface IModuleVersionInformation; |
---|
172 | interface IFilterGraphMemoryAllocatorData; |
---|
173 | }; |
---|
174 | [ |
---|
175 | uuid(B6274D9B-1AD3-4c32-83C5-35DC33CAFF47), |
---|
176 | helpstring("FilterMapperSpy Class") |
---|
177 | ] |
---|
178 | coclass FilterMapperSpy |
---|
179 | { |
---|
180 | [default] interface IFilterMapperSpy; |
---|
181 | }; |
---|
182 | [ |
---|
183 | uuid(AD42E3BD-7B9B-4783-9DA2-61A9ACD0D4D2), |
---|
184 | helpstring("SystemDeviceEnumeratorSpy Class") |
---|
185 | ] |
---|
186 | coclass SystemDeviceEnumeratorSpy |
---|
187 | { |
---|
188 | [default] interface ISystemDeviceEnumeratorSpy; |
---|
189 | }; |
---|
190 | [ |
---|
191 | object, |
---|
192 | uuid(3D1AF248-DEF1-4E26-A071-FEDF15FED6A8), |
---|
193 | dual, |
---|
194 | oleautomation, |
---|
195 | nonextensible, |
---|
196 | helpstring("IFilterGraphHelper Interface"), |
---|
197 | pointer_default(unique) |
---|
198 | ] |
---|
199 | interface IFilterGraphHelper : IDispatch |
---|
200 | { |
---|
201 | [id(DISPID_VALUE), propget] HRESULT FilterGraph([out, retval] IUnknown** ppFilterGraphUnknown); |
---|
202 | [id(DISPID_VALUE), propput] HRESULT FilterGraph([in] IUnknown* pFilterGraphUnknown); |
---|
203 | [id(1), propget] HRESULT Text([out, retval] BSTR* psText); |
---|
204 | [id(2)] HRESULT DoPropertyFrameModal([in] LONG nParentWindowHandle); |
---|
205 | [id(3)] HRESULT DoFilterGraphListModal([in] LONG nParentWindowHandle); |
---|
206 | [id(4)] HRESULT OpenGraphStudioNext([in] LONG nParentWindowHandle, [in] BSTR sMonikerDisplayName, [out, retval] VARIANT_BOOL* pbResult); |
---|
207 | [id(5)] HRESULT OpenGraphEdit([in] LONG nParentWindowHandle, [in] BSTR sMonikerDisplayName, [out, retval] VARIANT_BOOL* pbResult); |
---|
208 | [id(6), propget] HRESULT Options([out, retval] VARIANT* pvOptions); |
---|
209 | [id(6), propput] HRESULT Options([in] VARIANT vOptions); |
---|
210 | }; |
---|
211 | [ |
---|
212 | uuid(5A9A684C-A891-4032-8D31-FF6EAB5A0C1E), |
---|
213 | helpstring("FilterGraphHelper Class") |
---|
214 | ] |
---|
215 | coclass FilterGraphHelper |
---|
216 | { |
---|
217 | [default] interface IFilterGraphHelper; |
---|
218 | }; |
---|
219 | [ |
---|
220 | object, |
---|
221 | uuid(E267813C-8F29-4D69-A776-CD462494FCE4), |
---|
222 | dual, |
---|
223 | oleautomation, |
---|
224 | nonextensible, |
---|
225 | helpstring("IRunPropertyBagAware Interface"), |
---|
226 | pointer_default(unique) |
---|
227 | ] |
---|
228 | interface IRunPropertyBagAware : IDispatch |
---|
229 | { |
---|
230 | [propget, id(DISPID_VALUE)] HRESULT Value([out, retval] IUnknown** ppPropertyBagUnknown); |
---|
231 | }; |
---|
232 | [ |
---|
233 | uuid(76127943-D22E-4C4E-9D9B-173C224D0EE4), |
---|
234 | helpstring("RunPropertyBagPropertyPage Class") |
---|
235 | ] |
---|
236 | coclass RunPropertyBagPropertyPage |
---|
237 | { |
---|
238 | [default] interface IUnknown; //IPropertyPage; |
---|
239 | }; |
---|
240 | [ |
---|
241 | object, |
---|
242 | uuid(DA0D924F-1AC0-496D-AE44-CC2BD8CE7CFA), |
---|
243 | dual, |
---|
244 | oleautomation, |
---|
245 | nonextensible, |
---|
246 | helpstring("IRunEventAware Interface"), |
---|
247 | pointer_default(unique) |
---|
248 | ] |
---|
249 | interface IRunEventAware : IDispatch |
---|
250 | { |
---|
251 | [propget, id(DISPID_VALUE)] HRESULT Value([out, retval] VARIANT* pvValue); |
---|
252 | [propget, id(1)] HRESULT Capture([out, retval] VARIANT_BOOL* pbCapture); |
---|
253 | [propput, id(1)] HRESULT Capture([in] VARIANT_BOOL bCapture); |
---|
254 | }; |
---|
255 | [ |
---|
256 | uuid(AD0E84E9-DE25-4C1A-85A5-47406604E144), |
---|
257 | helpstring("RunEventPropertyPage Class") |
---|
258 | ] |
---|
259 | coclass RunEventPropertyPage |
---|
260 | { |
---|
261 | [default] interface IUnknown; //IPropertyPage; |
---|
262 | }; |
---|
263 | }; |
---|