Index: trunk/DirectShowSpy/BdaHooks/BdaHooks.rc
===================================================================
--- trunk/DirectShowSpy/BdaHooks/BdaHooks.rc (revision 117)
+++ trunk/DirectShowSpy/BdaHooks/BdaHooks.rc (revision 144)
@@ -63,5 +63,5 @@
VS_VERSION_INFO VERSIONINFO
- FILEVERSION 1, 0, 0, 76
+ FILEVERSION 1, 0, 0, 119
PRODUCTVERSION 1,0,0,1
FILEFLAGSMASK 0x3fL
@@ -82,5 +82,5 @@
VALUE "CompanyName", "Roman Ryltsov"
VALUE "FileDescription", "Alax.Info DirectShow Filter Graph Spy Module"
- VALUE "FileVersion", "1, 0, 0, 76\0"
+ VALUE "FileVersion", "1, 0, 0, 119\0"
VALUE "LegalCopyright", "Copyright © Alax.Info, Roman Ryltsov, 2008-2009"
VALUE "OLESelfRegister", "Yes"
Index: trunk/DirectShowSpy/BdaHooks/BdaHooks_i.c
===================================================================
--- trunk/DirectShowSpy/BdaHooks/BdaHooks_i.c (revision 117)
+++ trunk/DirectShowSpy/BdaHooks/BdaHooks_i.c (revision 144)
@@ -7,5 +7,5 @@
/* File created by MIDL compiler version 7.00.0500 */
-/* at Mon Aug 20 23:06:17 2012
+/* at Sat Nov 17 01:35:26 2012
*/
/* Compiler settings for .\BdaHooks.idl:
Index: trunk/DirectShowSpy/BdaHooks/BdaHooks_i.h
===================================================================
--- trunk/DirectShowSpy/BdaHooks/BdaHooks_i.h (revision 117)
+++ trunk/DirectShowSpy/BdaHooks/BdaHooks_i.h (revision 144)
@@ -5,5 +5,5 @@
/* File created by MIDL compiler version 7.00.0500 */
-/* at Mon Aug 20 23:06:17 2012
+/* at Sat Nov 17 01:35:26 2012
*/
/* Compiler settings for .\BdaHooks.idl:
Index: trunk/DirectShowSpy/BdaHooks/BdaHooks_p.c
===================================================================
--- trunk/DirectShowSpy/BdaHooks/BdaHooks_p.c (revision 117)
+++ trunk/DirectShowSpy/BdaHooks/BdaHooks_p.c (revision 144)
@@ -5,5 +5,5 @@
/* File created by MIDL compiler version 7.00.0500 */
-/* at Mon Aug 20 23:06:17 2012
+/* at Sat Nov 17 01:35:26 2012
*/
/* Compiler settings for .\BdaHooks.idl:
Index: trunk/DirectShowSpy/DirectShowSpy.idl
===================================================================
--- trunk/DirectShowSpy/DirectShowSpy.idl (revision 117)
+++ trunk/DirectShowSpy/DirectShowSpy.idl (revision 144)
@@ -30,4 +30,16 @@
]
interface IFilterMapperSpy : IDispatch
+{
+};
+[
+ object,
+ uuid(14EB119F-25CE-4654-ABE1-E6742AF03F2D),
+ dual,
+ oleautomation,
+ nonextensible,
+ helpstring("ISystemDeviceEnumeratorSpy Interface"),
+ pointer_default(unique)
+]
+interface ISystemDeviceEnumeratorSpy : IDispatch
{
};
@@ -106,3 +118,11 @@
[default] interface IFilterMapperSpy;
};
+ [
+ uuid(AD42E3BD-7B9B-4783-9DA2-61A9ACD0D4D2),
+ helpstring("SystemDeviceEnumeratorSpy Class")
+ ]
+ coclass SystemDeviceEnumeratorSpy
+ {
+ [default] interface ISystemDeviceEnumeratorSpy;
+ };
};
Index: trunk/DirectShowSpy/DirectShowSpy.rc
===================================================================
--- trunk/DirectShowSpy/DirectShowSpy.rc (revision 117)
+++ trunk/DirectShowSpy/DirectShowSpy.rc (revision 144)
@@ -62,5 +62,5 @@
VS_VERSION_INFO VERSIONINFO
- FILEVERSION 1, 0, 0, 647
+ FILEVERSION 1, 0, 0, 708
PRODUCTVERSION 1,0,0,1
FILEFLAGSMASK 0x3fL
@@ -81,5 +81,5 @@
VALUE "CompanyName", "Roman Ryltsov"
VALUE "FileDescription", "Alax.Info DirectShow Spy Module"
- VALUE "FileVersion", "1, 0, 0, 647\0"
+ VALUE "FileVersion", "1, 0, 0, 708\0"
VALUE "InternalName", "DirectShowSpy.dll"
VALUE "LegalCopyright", "Copyright © Alax.Info, Roman Ryltsov, 2008-2011"
@@ -103,7 +103,8 @@
IDR_MODULE REGISTRY "DirectShowSpy.rgs"
-IDR_FILTERGRAPHSPY REGISTRY "FilterGraphSpy.rgs"
-IDR_NOTHREADFILTERGRAPHSPY REGISTRY "FilterGraphSpy.rgs"
-IDR_FILTERMAPPERSPY REGISTRY "FilterMapperSpy.rgs"
+IDR_FILTERGRAPHSPY REGISTRY "GenericClass.rgs"
+IDR_NOTHREADFILTERGRAPHSPY REGISTRY "GenericClass.rgs"
+IDR_FILTERMAPPERSPY REGISTRY "GenericClass.rgs"
+IDR_SYSTEMDEVICEENUMERATORSPY REGISTRY "GenericClass.rgs"
/////////////////////////////////////////////////////////////////////////////
@@ -191,4 +192,5 @@
"\n\nAlax.Info DirectShow Filter Graph (No Thread) Spy\n"
IDR_FILTERMAPPERSPY "\n\nAlax.Info DirectShow Filter Mapper Spy\n"
+ IDR_SYSTEMDEVICEENUMERATORSPY "\n\nAlax.Info DirectShow System Device Enumerator Spy\n"
END
Index: trunk/DirectShowSpy/DirectShowSpy.vcproj
===================================================================
--- trunk/DirectShowSpy/DirectShowSpy.vcproj (revision 117)
+++ trunk/DirectShowSpy/DirectShowSpy.vcproj (revision 144)
@@ -767,4 +767,8 @@
+
+
@@ -888,8 +892,4 @@
-
-
Index: trunk/DirectShowSpy/DirectShowSpy_i.c
===================================================================
--- trunk/DirectShowSpy/DirectShowSpy_i.c (revision 117)
+++ trunk/DirectShowSpy/DirectShowSpy_i.c (revision 144)
@@ -7,5 +7,5 @@
/* File created by MIDL compiler version 7.00.0500 */
-/* at Wed Aug 22 01:07:15 2012
+/* at Sat Nov 17 01:35:16 2012
*/
/* Compiler settings for .\DirectShowSpy.idl:
@@ -74,4 +74,7 @@
+MIDL_DEFINE_GUID(IID, IID_ISystemDeviceEnumeratorSpy,0x14EB119F,0x25CE,0x4654,0xAB,0xE1,0xE6,0x74,0x2A,0xF0,0x3F,0x2D);
+
+
MIDL_DEFINE_GUID(IID, LIBID_AlaxInfoDirectShowSpy,0xB9EC374B,0x834B,0x4DA9,0xBF,0xB5,0xC1,0x87,0x2C,0xE7,0x36,0xFF);
@@ -94,4 +97,7 @@
MIDL_DEFINE_GUID(CLSID, CLSID_FilterMapperSpy,0xB6274D9B,0x1AD3,0x4c32,0x83,0xC5,0x35,0xDC,0x33,0xCA,0xFF,0x47);
+
+MIDL_DEFINE_GUID(CLSID, CLSID_SystemDeviceEnumeratorSpy,0xAD42E3BD,0x7B9B,0x4783,0x9D,0xA2,0x61,0xA9,0xAC,0xD0,0xD4,0xD2);
+
#undef MIDL_DEFINE_GUID
Index: trunk/DirectShowSpy/DirectShowSpy_i.h
===================================================================
--- trunk/DirectShowSpy/DirectShowSpy_i.h (revision 117)
+++ trunk/DirectShowSpy/DirectShowSpy_i.h (revision 144)
@@ -5,5 +5,5 @@
/* File created by MIDL compiler version 7.00.0500 */
-/* at Wed Aug 22 01:07:15 2012
+/* at Sat Nov 17 01:35:16 2012
*/
/* Compiler settings for .\DirectShowSpy.idl:
@@ -58,4 +58,10 @@
+#ifndef __ISystemDeviceEnumeratorSpy_FWD_DEFINED__
+#define __ISystemDeviceEnumeratorSpy_FWD_DEFINED__
+typedef interface ISystemDeviceEnumeratorSpy ISystemDeviceEnumeratorSpy;
+#endif /* __ISystemDeviceEnumeratorSpy_FWD_DEFINED__ */
+
+
#ifndef __IFilterGraphAddRemoveHook_FWD_DEFINED__
#define __IFilterGraphAddRemoveHook_FWD_DEFINED__
@@ -110,4 +116,16 @@
#endif /* __FilterMapperSpy_FWD_DEFINED__ */
+
+
+#ifndef __SystemDeviceEnumeratorSpy_FWD_DEFINED__
+#define __SystemDeviceEnumeratorSpy_FWD_DEFINED__
+
+#ifdef __cplusplus
+typedef class SystemDeviceEnumeratorSpy SystemDeviceEnumeratorSpy;
+#else
+typedef struct SystemDeviceEnumeratorSpy SystemDeviceEnumeratorSpy;
+#endif /* __cplusplus */
+
+#endif /* __SystemDeviceEnumeratorSpy_FWD_DEFINED__ */
@@ -343,4 +361,115 @@
+#ifndef __ISystemDeviceEnumeratorSpy_INTERFACE_DEFINED__
+#define __ISystemDeviceEnumeratorSpy_INTERFACE_DEFINED__
+
+/* interface ISystemDeviceEnumeratorSpy */
+/* [unique][helpstring][nonextensible][oleautomation][dual][uuid][object] */
+
+
+EXTERN_C const IID IID_ISystemDeviceEnumeratorSpy;
+
+#if defined(__cplusplus) && !defined(CINTERFACE)
+
+ MIDL_INTERFACE("14EB119F-25CE-4654-ABE1-E6742AF03F2D")
+ ISystemDeviceEnumeratorSpy : public IDispatch
+ {
+ public:
+ };
+
+#else /* C style interface */
+
+ typedef struct ISystemDeviceEnumeratorSpyVtbl
+ {
+ BEGIN_INTERFACE
+
+ HRESULT ( STDMETHODCALLTYPE *QueryInterface )(
+ ISystemDeviceEnumeratorSpy * This,
+ /* [in] */ REFIID riid,
+ /* [iid_is][out] */
+ __RPC__deref_out void **ppvObject);
+
+ ULONG ( STDMETHODCALLTYPE *AddRef )(
+ ISystemDeviceEnumeratorSpy * This);
+
+ ULONG ( STDMETHODCALLTYPE *Release )(
+ ISystemDeviceEnumeratorSpy * This);
+
+ HRESULT ( STDMETHODCALLTYPE *GetTypeInfoCount )(
+ ISystemDeviceEnumeratorSpy * This,
+ /* [out] */ UINT *pctinfo);
+
+ HRESULT ( STDMETHODCALLTYPE *GetTypeInfo )(
+ ISystemDeviceEnumeratorSpy * This,
+ /* [in] */ UINT iTInfo,
+ /* [in] */ LCID lcid,
+ /* [out] */ ITypeInfo **ppTInfo);
+
+ HRESULT ( STDMETHODCALLTYPE *GetIDsOfNames )(
+ ISystemDeviceEnumeratorSpy * This,
+ /* [in] */ REFIID riid,
+ /* [size_is][in] */ LPOLESTR *rgszNames,
+ /* [range][in] */ UINT cNames,
+ /* [in] */ LCID lcid,
+ /* [size_is][out] */ DISPID *rgDispId);
+
+ /* [local] */ HRESULT ( STDMETHODCALLTYPE *Invoke )(
+ ISystemDeviceEnumeratorSpy * This,
+ /* [in] */ DISPID dispIdMember,
+ /* [in] */ REFIID riid,
+ /* [in] */ LCID lcid,
+ /* [in] */ WORD wFlags,
+ /* [out][in] */ DISPPARAMS *pDispParams,
+ /* [out] */ VARIANT *pVarResult,
+ /* [out] */ EXCEPINFO *pExcepInfo,
+ /* [out] */ UINT *puArgErr);
+
+ END_INTERFACE
+ } ISystemDeviceEnumeratorSpyVtbl;
+
+ interface ISystemDeviceEnumeratorSpy
+ {
+ CONST_VTBL struct ISystemDeviceEnumeratorSpyVtbl *lpVtbl;
+ };
+
+
+
+#ifdef COBJMACROS
+
+
+#define ISystemDeviceEnumeratorSpy_QueryInterface(This,riid,ppvObject) \
+ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
+
+#define ISystemDeviceEnumeratorSpy_AddRef(This) \
+ ( (This)->lpVtbl -> AddRef(This) )
+
+#define ISystemDeviceEnumeratorSpy_Release(This) \
+ ( (This)->lpVtbl -> Release(This) )
+
+
+#define ISystemDeviceEnumeratorSpy_GetTypeInfoCount(This,pctinfo) \
+ ( (This)->lpVtbl -> GetTypeInfoCount(This,pctinfo) )
+
+#define ISystemDeviceEnumeratorSpy_GetTypeInfo(This,iTInfo,lcid,ppTInfo) \
+ ( (This)->lpVtbl -> GetTypeInfo(This,iTInfo,lcid,ppTInfo) )
+
+#define ISystemDeviceEnumeratorSpy_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) \
+ ( (This)->lpVtbl -> GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) )
+
+#define ISystemDeviceEnumeratorSpy_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) \
+ ( (This)->lpVtbl -> Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) )
+
+
+#endif /* COBJMACROS */
+
+
+#endif /* C style interface */
+
+
+
+
+#endif /* __ISystemDeviceEnumeratorSpy_INTERFACE_DEFINED__ */
+
+
#ifndef __AlaxInfoDirectShowSpy_LIBRARY_DEFINED__
@@ -765,4 +894,12 @@
FilterMapperSpy;
#endif
+
+EXTERN_C const CLSID CLSID_SystemDeviceEnumeratorSpy;
+
+#ifdef __cplusplus
+
+class DECLSPEC_UUID("AD42E3BD-7B9B-4783-9DA2-61A9ACD0D4D2")
+SystemDeviceEnumeratorSpy;
+#endif
#endif /* __AlaxInfoDirectShowSpy_LIBRARY_DEFINED__ */
Index: trunk/DirectShowSpy/DirectShowSpy_p.c
===================================================================
--- trunk/DirectShowSpy/DirectShowSpy_p.c (revision 117)
+++ trunk/DirectShowSpy/DirectShowSpy_p.c (revision 144)
@@ -5,5 +5,5 @@
/* File created by MIDL compiler version 7.00.0500 */
-/* at Wed Aug 22 01:07:15 2012
+/* at Sat Nov 17 01:35:16 2012
*/
/* Compiler settings for .\DirectShowSpy.idl:
@@ -98,4 +98,11 @@
+extern const MIDL_STUB_DESC Object_StubDesc;
+
+
+extern const MIDL_SERVER_INFO ISystemDeviceEnumeratorSpy_ServerInfo;
+extern const MIDL_STUBLESS_PROXY_INFO ISystemDeviceEnumeratorSpy_ProxyInfo;
+
+
#if !defined(__RPC_WIN32__)
@@ -270,4 +277,70 @@
};
+
+/* Object interface: ISystemDeviceEnumeratorSpy, ver. 0.0,
+ GUID={0x14EB119F,0x25CE,0x4654,{0xAB,0xE1,0xE6,0x74,0x2A,0xF0,0x3F,0x2D}} */
+
+#pragma code_seg(".orpc")
+static const unsigned short ISystemDeviceEnumeratorSpy_FormatStringOffsetTable[] =
+ {
+ (unsigned short) -1,
+ (unsigned short) -1,
+ (unsigned short) -1,
+ (unsigned short) -1,
+ 0
+ };
+
+static const MIDL_STUBLESS_PROXY_INFO ISystemDeviceEnumeratorSpy_ProxyInfo =
+ {
+ &Object_StubDesc,
+ DirectShowSpy__MIDL_ProcFormatString.Format,
+ &ISystemDeviceEnumeratorSpy_FormatStringOffsetTable[-3],
+ 0,
+ 0,
+ 0
+ };
+
+
+static const MIDL_SERVER_INFO ISystemDeviceEnumeratorSpy_ServerInfo =
+ {
+ &Object_StubDesc,
+ 0,
+ DirectShowSpy__MIDL_ProcFormatString.Format,
+ &ISystemDeviceEnumeratorSpy_FormatStringOffsetTable[-3],
+ 0,
+ 0,
+ 0,
+ 0};
+CINTERFACE_PROXY_VTABLE(7) _ISystemDeviceEnumeratorSpyProxyVtbl =
+{
+ 0,
+ &IID_ISystemDeviceEnumeratorSpy,
+ IUnknown_QueryInterface_Proxy,
+ IUnknown_AddRef_Proxy,
+ IUnknown_Release_Proxy ,
+ 0 /* (void *) (INT_PTR) -1 /* IDispatch::GetTypeInfoCount */ ,
+ 0 /* (void *) (INT_PTR) -1 /* IDispatch::GetTypeInfo */ ,
+ 0 /* (void *) (INT_PTR) -1 /* IDispatch::GetIDsOfNames */ ,
+ 0 /* IDispatch_Invoke_Proxy */
+};
+
+
+static const PRPC_STUB_FUNCTION ISystemDeviceEnumeratorSpy_table[] =
+{
+ STUB_FORWARDING_FUNCTION,
+ STUB_FORWARDING_FUNCTION,
+ STUB_FORWARDING_FUNCTION,
+ STUB_FORWARDING_FUNCTION
+};
+
+CInterfaceStubVtbl _ISystemDeviceEnumeratorSpyStubVtbl =
+{
+ &IID_ISystemDeviceEnumeratorSpy,
+ &ISystemDeviceEnumeratorSpy_ServerInfo,
+ 7,
+ &ISystemDeviceEnumeratorSpy_table[-3],
+ CStdStubBuffer_DELEGATING_METHODS
+};
+
static const MIDL_STUB_DESC Object_StubDesc =
{
@@ -297,4 +370,5 @@
{
( CInterfaceProxyVtbl *) &_ISpyProxyVtbl,
+ ( CInterfaceProxyVtbl *) &_ISystemDeviceEnumeratorSpyProxyVtbl,
( CInterfaceProxyVtbl *) &_IFilterMapperSpyProxyVtbl,
0
@@ -304,4 +378,5 @@
{
( CInterfaceStubVtbl *) &_ISpyStubVtbl,
+ ( CInterfaceStubVtbl *) &_ISystemDeviceEnumeratorSpyStubVtbl,
( CInterfaceStubVtbl *) &_IFilterMapperSpyStubVtbl,
0
@@ -311,4 +386,5 @@
{
"ISpy",
+ "ISystemDeviceEnumeratorSpy",
"IFilterMapperSpy",
0
@@ -319,4 +395,5 @@
&IID_IDispatch,
&IID_IDispatch,
+ &IID_IDispatch,
0
};
@@ -329,6 +406,7 @@
IID_BS_LOOKUP_SETUP
- IID_BS_LOOKUP_INITIAL_TEST( _DirectShowSpy, 2, 1 )
- IID_BS_LOOKUP_RETURN_RESULT( _DirectShowSpy, 2, *pIndex )
+ IID_BS_LOOKUP_INITIAL_TEST( _DirectShowSpy, 3, 2 )
+ IID_BS_LOOKUP_NEXT_TEST( _DirectShowSpy, 1 )
+ IID_BS_LOOKUP_RETURN_RESULT( _DirectShowSpy, 3, *pIndex )
}
@@ -341,5 +419,5 @@
(const IID ** ) & _DirectShowSpy_BaseIIDList,
& _DirectShowSpy_IID_Lookup,
- 2,
+ 3,
2,
0, /* table of [async_uuid] interfaces */
Index: trunk/DirectShowSpy/FilterGraphSpy.cpp
===================================================================
--- trunk/DirectShowSpy/FilterGraphSpy.cpp (revision 117)
+++ trunk/DirectShowSpy/FilterGraphSpy.cpp (revision 144)
@@ -10,4 +10,5 @@
#include "FilterMapperSpy.h"
#include "GraphBuilderCallbackPropertySheet.h"
+#include "SystemDeviceEnumeratorSpy.h"
////////////////////////////////////////////////////////////
Index: trunk/DirectShowSpy/FilterGraphSpy.rgs
===================================================================
--- trunk/DirectShowSpy/FilterGraphSpy.rgs (revision 117)
+++ (revision )
@@ -1,27 +1,0 @@
-HKCR
-{
- %PROGID% = s '%DESCRIPTION%'
- {
- CLSID = s '%CLSID%'
- }
- %VIPROGID% = s '%DESCRIPTION%'
- {
- CLSID = s '%CLSID%'
- CurVer = s '%PROGID%'
- }
- NoRemove CLSID
- {
- ForceRemove %CLSID% = s '%DESCRIPTION%'
- {
- ProgID = s '%PROGID%'
- VersionIndependentProgID = s '%VIPROGID%'
- ForceRemove 'Programmable'
- InprocServer32 = s '%MODULE%'
- {
- val ThreadingModel = s 'Both'
- }
- val AppID = s '%APPID%'
- TypeLib = s '%LIBID%'
- }
- }
-}
Index: trunk/DirectShowSpy/FilterMapperSpy.h
===================================================================
--- trunk/DirectShowSpy/FilterMapperSpy.h (revision 117)
+++ trunk/DirectShowSpy/FilterMapperSpy.h (revision 144)
@@ -104,9 +104,9 @@
m_hQuartzModule(NULL)
{
- _Z4(atlTraceRefcount, 4, _T("this 0x%08x\n"), this);
+ _Z4(atlTraceRefcount, 4, _T("this 0x%p\n"), this);
}
~CFilterMapperSpyT() throw()
{
- _Z4(atlTraceRefcount, 4, _T("this 0x%08x\n"), this);
+ _Z4(atlTraceRefcount, 4, _T("this 0x%p\n"), this);
}
HRESULT FinalConstruct() throw()
@@ -118,5 +118,5 @@
_W(GetModuleFileName(NULL, pszPath, DIM(pszPath)));
_Z4(atlTraceRefcount, 4, _T("pszPath \"%s\", this 0x%08x, m_dwRef %d, m_bIsAggregated %d\n"), pszPath, this, m_dwRef, m_bIsAggregated);
- const HINSTANCE hModule = CoLoadLibrary(_T("quartz.dll"), TRUE);
+ const HINSTANCE hModule = CoLoadLibrary(const_cast((LPCOLESTR) CT2COLE(GetOriginalLibraryName())), TRUE);
_ATLTRY
{
Index: trunk/DirectShowSpy/FilterMapperSpy.rgs
===================================================================
--- trunk/DirectShowSpy/FilterMapperSpy.rgs (revision 117)
+++ (revision )
@@ -1,27 +1,0 @@
-HKCR
-{
- %PROGID% = s '%DESCRIPTION%'
- {
- CLSID = s '%CLSID%'
- }
- %VIPROGID% = s '%DESCRIPTION%'
- {
- CLSID = s '%CLSID%'
- CurVer = s '%PROGID%'
- }
- NoRemove CLSID
- {
- ForceRemove %CLSID% = s '%DESCRIPTION%'
- {
- ProgID = s '%PROGID%'
- VersionIndependentProgID = s '%VIPROGID%'
- ForceRemove 'Programmable'
- InprocServer32 = s '%MODULE%'
- {
- val ThreadingModel = s 'Both'
- }
- val AppID = s '%APPID%'
- TypeLib = s '%LIBID%'
- }
- }
-}
Index: trunk/DirectShowSpy/GenericClass.rgs
===================================================================
--- trunk/DirectShowSpy/GenericClass.rgs (revision 144)
+++ trunk/DirectShowSpy/GenericClass.rgs (revision 144)
@@ -0,0 +1,27 @@
+HKCR
+{
+ %PROGID% = s '%DESCRIPTION%'
+ {
+ CLSID = s '%CLSID%'
+ }
+ %VIPROGID% = s '%DESCRIPTION%'
+ {
+ CLSID = s '%CLSID%'
+ CurVer = s '%PROGID%'
+ }
+ NoRemove CLSID
+ {
+ ForceRemove %CLSID% = s '%DESCRIPTION%'
+ {
+ ProgID = s '%PROGID%'
+ VersionIndependentProgID = s '%VIPROGID%'
+ ForceRemove 'Programmable'
+ InprocServer32 = s '%MODULE%'
+ {
+ val ThreadingModel = s 'Both'
+ }
+ val AppID = s '%APPID%'
+ TypeLib = s '%LIBID%'
+ }
+ }
+}
Index: trunk/DirectShowSpy/ReadMe.txt
===================================================================
--- trunk/DirectShowSpy/ReadMe.txt (revision 117)
+++ (revision )
@@ -1,69 +1,0 @@
-========================================================================
- ACTIVE TEMPLATE LIBRARY : DirectShowSpy Project Overview
-========================================================================
-
-AppWizard has created this DirectShowSpy project for you to use as the starting point for
-writing your Dynamic Link Library (DLL).
-
-This file contains a summary of what you will find in each of the files that
-make up your project.
-
-DirectShowSpy.vcproj
- This is the main project file for VC++ projects generated using an Application Wizard.
- It contains information about the version of Visual C++ that generated the file, and
- information about the platforms, configurations, and project features selected with the
- Application Wizard.
-
-DirectShowSpy.idl
- This file contains the IDL definitions of the type library, the interfaces
- and co-classes defined in your project.
- This file will be processed by the MIDL compiler to generate:
- C++ interface definitions and GUID declarations (DirectShowSpy.h)
- GUID definitions (DirectShowSpy_i.c)
- A type library (DirectShowSpy.tlb)
- Marshaling code (DirectShowSpy_p.c and dlldata.c)
-
-DirectShowSpy.h
- This file contains the C++ interface definitions and GUID declarations of the
- items defined in DirectShowSpy.idl. It will be regenerated by MIDL during compilation.
-
-DirectShowSpy.cpp
- This file contains the object map and the implementation of your DLL's exports.
-
-DirectShowSpy.rc
- This is a listing of all of the Microsoft Windows resources that the
- program uses.
-
-DirectShowSpy.def
- This module-definition file provides the linker with information about the exports
- required by your DLL. It contains exports for:
- DllGetClassObject
- DllCanUnloadNow
- DllRegisterServer
- DllUnregisterServer
-
-/////////////////////////////////////////////////////////////////////////////
-Other standard files:
-
-StdAfx.h, StdAfx.cpp
- These files are used to build a precompiled header (PCH) file
- named DirectShowSpy.pch and a precompiled types file named StdAfx.obj.
-
-Resource.h
- This is the standard header file that defines resource IDs.
-
-/////////////////////////////////////////////////////////////////////////////
-Proxy/stub DLL project and module definition file:
-
-DirectShowSpyps.vcproj
- This file is the project file for building a proxy/stub DLL if necessary.
- The IDL file in the main project must contain at least one interface and you must
- first compile the IDL file before building the proxy/stub DLL. This process generates
- dlldata.c, DirectShowSpy_i.c and DirectShowSpy_p.c which are required
- to build the proxy/stub DLL.
-
-DirectShowSpyps.def
- This module definition file provides the linker with information about the exports
- required by the proxy/stub.
-
-/////////////////////////////////////////////////////////////////////////////
Index: trunk/DirectShowSpy/SystemDeviceEnumeratorSpy.h
===================================================================
--- trunk/DirectShowSpy/SystemDeviceEnumeratorSpy.h (revision 144)
+++ trunk/DirectShowSpy/SystemDeviceEnumeratorSpy.h (revision 144)
@@ -0,0 +1,800 @@
+////////////////////////////////////////////////////////////
+// Copyright (C) Roman Ryltsov, 2008-2011
+// Created by Roman Ryltsov roman@alax.info
+//
+// $Id$
+
+#pragma once
+
+#include "rodshow.h"
+#include "DirectShowSpy_i.h"
+#include "Common.h"
+
+////////////////////////////////////////////////////////////
+// CSystemDeviceEnumeratorSpyT
+
+// NOTE: Original CLSID_SystemDeviceEnum does not support aggregation
+
+template
+class ATL_NO_VTABLE CSystemDeviceEnumeratorSpyT :
+ public CComObjectRootEx,
+ //public CComCoClass,
+ public CTransparentCoClassT,
+ public IDispatchImpl,
+ public ICreateDevEnum
+{
+ typedef CSystemDeviceEnumeratorSpyT CSystemDeviceEnumeratorSpy;
+
+public:
+ //enum { IDR = IDR_SYSTEMDEVICEENUMERATORSPY };
+
+//DECLARE_REGISTRY_RESOURCEID(IDR)
+
+DECLARE_PROTECT_FINAL_CONSTRUCT()
+
+DECLARE_GET_CONTROLLING_UNKNOWN()
+
+DECLARE_QI_TRACE(CSystemDeviceEnumeratorSpy)
+
+BEGIN_COM_MAP(CSystemDeviceEnumeratorSpy)
+ COM_INTERFACE_ENTRY(ISystemDeviceEnumeratorSpy)
+ COM_INTERFACE_ENTRY(ICreateDevEnum)
+ COM_INTERFACE_ENTRY_FUNC(CLSID_SystemDeviceEnum, 0, QuerySystemDeviceEnumInterface)
+ //COM_INTERFACE_ENTRY(IDispatch)
+END_COM_MAP()
+
+public:
+
+ ////////////////////////////////////////////////////////
+ // CPropertyBag
+
+ class ATL_NO_VTABLE CPropertyBag :
+ public CComObjectRootEx,
+ public IPropertyBag,
+ public IPropertyBag2
+ {
+ public:
+
+ DECLARE_QI_TRACE(CPropertyBag)
+
+ BEGIN_COM_MAP(CPropertyBag)
+ COM_INTERFACE_ENTRY(IPropertyBag2)
+ COM_INTERFACE_ENTRY(IPropertyBag)
+ END_COM_MAP()
+
+ private:
+ CComPtr m_pPropertyBag;
+ CComPtr m_pPropertyBag2;
+
+ public:
+ // CPropertyBag
+ CPropertyBag()
+ {
+ _Z4(atlTraceRefcount, 4, _T("this 0x%p\n"), this);
+ }
+ ~CPropertyBag()
+ {
+ _Z4(atlTraceRefcount, 4, _T("this 0x%p\n"), this);
+ }
+ VOID Initialize(IPropertyBag* pPropertyBag)
+ {
+ _A(pPropertyBag);
+ _A(!m_pPropertyBag);
+ m_pPropertyBag = pPropertyBag;
+ m_pPropertyBag2 = CComQIPtr(pPropertyBag);
+ }
+
+ // IPropertyBag
+ STDMETHOD(Read)(LPCOLESTR pszPropertyName, VARIANT* pvValue, IErrorLog* pErrorLog) throw()
+ {
+ _Z4(atlTraceCOM, 4, _T("pszPropertyName %s\n"), CString(pszPropertyName));
+ _ATLTRY
+ {
+ HRESULT nResult = m_pPropertyBag->Read(pszPropertyName, pvValue, pErrorLog);
+ #pragma region DevicePath Fix for Skype 6.0.0.126
+ //if(nResult == HRESULT_FROM_WIN32(ERROR_FILE_NOT_FOUND) && pszPropertyName && _wcsicmp(pszPropertyName, L"DevicePath") == 0 && pvValue)
+ //{
+ // _Z4(atlTraceGeneral, 4, _T("nResult 0x%08x\n"), nResult);
+ // CComVariant vValue = L"\\\\?\\fake";
+ // _V(vValue.Detach(pvValue));
+ // nResult = S_OK;
+ //}
+ #pragma endregion
+ if(SUCCEEDED(nResult))
+ {
+ CString sValue = _T("???");
+ CComVariant vStringValue;
+ if(SUCCEEDED(vStringValue.ChangeType(VT_BSTR, pvValue)))
+ sValue = CString(vStringValue.bstrVal);
+ _Z4(atlTraceGeneral, 4, _T("nResult 0x%08x, pvValue->vt 0x%x, %s\n"), nResult, pvValue->vt, sValue);
+ } else
+ {
+ _Z4(atlTraceGeneral, 4, _T("nResult 0x%08x\n"), nResult);
+ }
+ return nResult;
+ }
+ _ATLCATCH(Exception)
+ {
+ _C(Exception);
+ }
+ return S_OK;
+ }
+ STDMETHOD(Write)(LPCOLESTR pszPropertyName, VARIANT* pvValue) throw()
+ {
+ _Z4(atlTraceCOM, 4, _T("pszPropertyName %s, pvValue->vt 0x%x\n"), CString(pszPropertyName), pvValue->vt);
+ _ATLTRY
+ {
+ const HRESULT nResult = m_pPropertyBag->Write(pszPropertyName, pvValue);
+ _Z4(atlTraceGeneral, 4, _T("nResult 0x%08x\n"), nResult);
+ return nResult;
+ }
+ _ATLCATCH(Exception)
+ {
+ _C(Exception);
+ }
+ return S_OK;
+ }
+
+ // IPropertyBag2
+ STDMETHOD(Read)(ULONG cProperties, PROPBAG2 *pPropBag, IErrorLog *pErrLog, VARIANT *pvarValue, HRESULT *phrError) throw()
+ {
+ _Z4(atlTraceCOM, 4, _T("...\n"));
+ _ATLTRY
+ {
+ const HRESULT nResult = m_pPropertyBag2->Read(cProperties, pPropBag, pErrLog, pvarValue, phrError);
+ _Z4(atlTraceGeneral, 4, _T("nResult 0x%08x\n"), nResult);
+ return nResult;
+ }
+ _ATLCATCH(Exception)
+ {
+ _C(Exception);
+ }
+ return S_OK;
+ }
+ STDMETHOD(Write)(ULONG cProperties, PROPBAG2 *pPropBag, VARIANT *pvarValue) throw()
+ {
+ _Z4(atlTraceCOM, 4, _T("...\n"));
+ _ATLTRY
+ {
+ const HRESULT nResult = m_pPropertyBag2->Write(cProperties, pPropBag, pvarValue);
+ _Z4(atlTraceGeneral, 4, _T("nResult 0x%08x\n"), nResult);
+ return nResult;
+ }
+ _ATLCATCH(Exception)
+ {
+ _C(Exception);
+ }
+ return S_OK;
+ }
+ STDMETHOD(CountProperties)(ULONG *pcProperties) throw()
+ {
+ _Z4(atlTraceCOM, 4, _T("...\n"));
+ _ATLTRY
+ {
+ const HRESULT nResult = m_pPropertyBag2->CountProperties(pcProperties);
+ _Z4(atlTraceGeneral, 4, _T("nResult 0x%08x\n"), nResult);
+ return nResult;
+ }
+ _ATLCATCH(Exception)
+ {
+ _C(Exception);
+ }
+ return S_OK;
+ }
+ STDMETHOD(GetPropertyInfo)(ULONG iProperty, ULONG cProperties, PROPBAG2* pPropBag, ULONG *pcProperties) throw()
+ {
+ _Z4(atlTraceCOM, 4, _T("...\n"));
+ _ATLTRY
+ {
+ const HRESULT nResult = m_pPropertyBag2->GetPropertyInfo(iProperty, cProperties, pPropBag, pcProperties);
+ _Z4(atlTraceGeneral, 4, _T("nResult 0x%08x\n"), nResult);
+ return nResult;
+ }
+ _ATLCATCH(Exception)
+ {
+ _C(Exception);
+ }
+ return S_OK;
+ }
+ STDMETHOD(LoadObject)(LPCOLESTR pstrName, DWORD dwHint, IUnknown *pUnkObject, IErrorLog *pErrLog) throw()
+ {
+ _Z4(atlTraceCOM, 4, _T("...\n"));
+ _ATLTRY
+ {
+ const HRESULT nResult = m_pPropertyBag2->LoadObject(pstrName, dwHint, pUnkObject, pErrLog);
+ _Z4(atlTraceGeneral, 4, _T("nResult 0x%08x\n"), nResult);
+ return nResult;
+ }
+ _ATLCATCH(Exception)
+ {
+ _C(Exception);
+ }
+ return S_OK;
+ }
+ };
+
+ ////////////////////////////////////////////////////////
+ // CMoniker
+
+ class ATL_NO_VTABLE CMoniker :
+ public CComObjectRootEx,
+ public IMoniker
+ {
+ public:
+
+ DECLARE_QI_TRACE(CMoniker)
+
+ BEGIN_COM_MAP(CMoniker)
+ COM_INTERFACE_ENTRY(IMoniker)
+ COM_INTERFACE_ENTRY(IPersistStream)
+ COM_INTERFACE_ENTRY(IPersist)
+ END_COM_MAP()
+
+ private:
+ CComPtr m_pMoniker;
+
+ public:
+ // CMoniker
+ CMoniker()
+ {
+ _Z4(atlTraceRefcount, 4, _T("this 0x%p\n"), this);
+ }
+ ~CMoniker()
+ {
+ _Z4(atlTraceRefcount, 4, _T("this 0x%p\n"), this);
+ }
+ VOID Initialize(IMoniker* pMoniker)
+ {
+ _A(pMoniker);
+ _A(!m_pMoniker);
+ m_pMoniker = pMoniker;
+ }
+
+ // IPersist
+ STDMETHOD(GetClassID)(CLSID* pClassIdentifier) throw()
+ {
+ _Z4(atlTraceCOM, 4, _T("...\n"));
+ return m_pMoniker->GetClassID(pClassIdentifier);
+ }
+
+ // IPersistStream
+ STDMETHOD(IsDirty)() throw()
+ {
+ _Z4(atlTraceCOM, 4, _T("...\n"));
+ return m_pMoniker->IsDirty();
+ }
+ STDMETHOD(Load)(IStream* pStream) throw()
+ {
+ _Z4(atlTraceCOM, 4, _T("...\n"));
+ return m_pMoniker->Load(pStream);
+ }
+ STDMETHOD(Save)(IStream* pStream, BOOL bClearDirty) throw()
+ {
+ _Z4(atlTraceCOM, 4, _T("...\n"));
+ return m_pMoniker->Save(pStream, bClearDirty);
+ }
+ STDMETHOD(GetSizeMax)(ULARGE_INTEGER* pnMaximalSize) throw()
+ {
+ _Z4(atlTraceCOM, 4, _T("...\n"));
+ return m_pMoniker->GetSizeMax(pnMaximalSize);
+ }
+
+ // IMoniker
+ STDMETHOD(BindToObject)(IBindCtx* pBindCtx, IMoniker* pLeftMoniker, REFIID InterfaceIdentifier, VOID** ppvObject) throw()
+ {
+ _Z4(atlTraceCOM, 4, _T("pBindCtx 0x%p, pLeftMoniker 0x%p, InterfaceIdentifier %ls\n"), pBindCtx, pLeftMoniker, _PersistHelper::StringFromInterfaceIdentifier(InterfaceIdentifier));
+ _ATLTRY
+ {
+ return m_pMoniker->BindToObject(pBindCtx, pLeftMoniker, InterfaceIdentifier, ppvObject);
+ }
+ _ATLCATCH(Exception)
+ {
+ _C(Exception);
+ }
+ return S_OK;
+ }
+ STDMETHOD(BindToStorage)(IBindCtx* pBindCtx, IMoniker* pLeftMoniker, REFIID InterfaceIdentifier, VOID** ppvObject) throw()
+ {
+ _Z4(atlTraceCOM, 4, _T("pBindCtx 0x%p, pLeftMoniker 0x%p, InterfaceIdentifier %ls\n"), pBindCtx, pLeftMoniker, _PersistHelper::StringFromInterfaceIdentifier(InterfaceIdentifier));
+ _ATLTRY
+ {
+ const HRESULT nResult = m_pMoniker->BindToStorage(pBindCtx, pLeftMoniker, InterfaceIdentifier, ppvObject);
+ if(SUCCEEDED(nResult) && *ppvObject)
+ {
+ if(InterfaceIdentifier == __uuidof(IPropertyBag) || InterfaceIdentifier == __uuidof(IPropertyBag2))
+ {
+ CComPtr& pPropertyBag = reinterpret_cast&>(*ppvObject);
+ CObjectPtr pPropertyBagWrapper;
+ pPropertyBagWrapper.Construct()->Initialize(pPropertyBag);
+ pPropertyBag = pPropertyBagWrapper;
+ }
+ }
+ return nResult;
+ }
+ _ATLCATCH(Exception)
+ {
+ _C(Exception);
+ }
+ return S_OK;
+ }
+ STDMETHOD(Reduce)(IBindCtx* pBindCtx, DWORD nDepth, IMoniker** ppLeftMoniker, IMoniker** ppReducedMoniker) throw()
+ {
+ _Z4(atlTraceCOM, 4, _T("...\n"));
+ _ATLTRY
+ {
+ return m_pMoniker->Reduce(pBindCtx, nDepth, ppLeftMoniker, ppReducedMoniker);
+ }
+ _ATLCATCH(Exception)
+ {
+ _C(Exception);
+ }
+ return S_OK;
+ }
+ STDMETHOD(ComposeWith)(IMoniker* pRightMoniker, BOOL bOnlyIfNotGeneric, IMoniker** ppCompositeMoniker) throw()
+ {
+ _Z4(atlTraceCOM, 4, _T("...\n"));
+ _ATLTRY
+ {
+ return m_pMoniker->ComposeWith(pRightMoniker, bOnlyIfNotGeneric, ppCompositeMoniker);
+ }
+ _ATLCATCH(Exception)
+ {
+ _C(Exception);
+ }
+ return S_OK;
+ }
+ STDMETHOD(Enum)(BOOL bForward, IEnumMoniker** ppEnumMoniker) throw()
+ {
+ _Z4(atlTraceCOM, 4, _T("bForward %d\n"), bForward);
+ _ATLTRY
+ {
+ return m_pMoniker->Enum(bForward, ppEnumMoniker);
+ }
+ _ATLCATCH(Exception)
+ {
+ _C(Exception);
+ }
+ return S_OK;
+ }
+ STDMETHOD(IsEqual)(IMoniker* pMoniker) throw()
+ {
+ _Z4(atlTraceCOM, 4, _T("...\n"));
+ _ATLTRY
+ {
+ return m_pMoniker->IsEqual(pMoniker);
+ }
+ _ATLCATCH(Exception)
+ {
+ _C(Exception);
+ }
+ return S_OK;
+ }
+ STDMETHOD(Hash)(DWORD* pnHashValue) throw()
+ {
+ _Z4(atlTraceCOM, 4, _T("...\n"));
+ _ATLTRY
+ {
+ return m_pMoniker->Hash(pnHashValue);
+ }
+ _ATLCATCH(Exception)
+ {
+ _C(Exception);
+ }
+ return S_OK;
+ }
+ STDMETHOD(IsRunning)(IBindCtx* pBindCtx, IMoniker* pLeftMoniker, IMoniker* pNewlyRunning) throw()
+ {
+ _Z4(atlTraceCOM, 4, _T("...\n"));
+ _ATLTRY
+ {
+ return m_pMoniker->IsRunning(pBindCtx, pLeftMoniker, pNewlyRunning);
+ }
+ _ATLCATCH(Exception)
+ {
+ _C(Exception);
+ }
+ return S_OK;
+ }
+ STDMETHOD(GetTimeOfLastChange)(IBindCtx* pBindCtx, IMoniker* pLeftMoniker, FILETIME* pFileTime) throw()
+ {
+ _Z4(atlTraceCOM, 4, _T("...\n"));
+ _ATLTRY
+ {
+ return m_pMoniker->GetTimeOfLastChange(pBindCtx, pLeftMoniker, pFileTime);
+ }
+ _ATLCATCH(Exception)
+ {
+ _C(Exception);
+ }
+ return S_OK;
+ }
+ STDMETHOD(Inverse)(IMoniker** ppMoniker) throw()
+ {
+ _Z4(atlTraceCOM, 4, _T("...\n"));
+ _ATLTRY
+ {
+ return m_pMoniker->Inverse(ppMoniker);
+ }
+ _ATLCATCH(Exception)
+ {
+ _C(Exception);
+ }
+ return S_OK;
+ }
+ STDMETHOD(CommonPrefixWith)(IMoniker* pMoniker, IMoniker** ppPrefixMoniker) throw()
+ {
+ _Z4(atlTraceCOM, 4, _T("...\n"));
+ _ATLTRY
+ {
+ return m_pMoniker->CommonPrefixWith(pMoniker, ppPrefixMoniker);
+ }
+ _ATLCATCH(Exception)
+ {
+ _C(Exception);
+ }
+ return S_OK;
+ }
+ STDMETHOD(RelativePathTo)(IMoniker* pMoniker, IMoniker** ppRelativeMoniker) throw()
+ {
+ _Z4(atlTraceCOM, 4, _T("...\n"));
+ _ATLTRY
+ {
+ return m_pMoniker->RelativePathTo(pMoniker, ppRelativeMoniker);
+ }
+ _ATLCATCH(Exception)
+ {
+ _C(Exception);
+ }
+ return S_OK;
+ }
+ STDMETHOD(GetDisplayName)(IBindCtx* pBindCtx, IMoniker* pLeftMoniker, LPOLESTR* ppszDisplayName) throw()
+ {
+ _Z4(atlTraceCOM, 4, _T("pBindCtx 0x%p, pLeftMoniker 0x%p\n"), pBindCtx, pLeftMoniker);
+ _ATLTRY
+ {
+ const HRESULT nResult = m_pMoniker->GetDisplayName(pBindCtx, pLeftMoniker, ppszDisplayName);
+ if(SUCCEEDED(nResult))
+ _Z4(atlTraceGeneral, 4, _T("nResult 0x%08x, *ppszDisplayName %s\n"), nResult, CString(*ppszDisplayName));
+ else
+ _Z4(atlTraceGeneral, 4, _T("nResult 0x%08x\n"), nResult);
+ return nResult;
+ }
+ _ATLCATCH(Exception)
+ {
+ _C(Exception);
+ }
+ return S_OK;
+ }
+ STDMETHOD(ParseDisplayName)(IBindCtx* pBindCtx, IMoniker* pLeftMoniker, LPOLESTR pszDisplayName, ULONG* pnEatenLength, IMoniker** ppOutputMoniker) throw()
+ {
+ _Z4(atlTraceCOM, 4, _T("pBindCtx 0x%p, pLeftMoniker 0x%p, pszDisplayName %s\n"), pBindCtx, pLeftMoniker, CString(pszDisplayName));
+ _ATLTRY
+ {
+ return m_pMoniker->ParseDisplayName(pBindCtx, pLeftMoniker, pszDisplayName, pnEatenLength, ppOutputMoniker);
+ }
+ _ATLCATCH(Exception)
+ {
+ _C(Exception);
+ }
+ return S_OK;
+ }
+ STDMETHOD(IsSystemMoniker)(DWORD* pnSystemMonikerType) throw()
+ {
+ _Z4(atlTraceCOM, 4, _T("...\n"));
+ _ATLTRY
+ {
+ return m_pMoniker->IsSystemMoniker(pnSystemMonikerType);
+ }
+ _ATLCATCH(Exception)
+ {
+ _C(Exception);
+ }
+ return S_OK;
+ }
+ };
+
+ ////////////////////////////////////////////////////////
+ // CEnumMoniker
+
+ class ATL_NO_VTABLE CEnumMoniker :
+ public CComObjectRootEx,
+ public IEnumMoniker
+ {
+ public:
+
+ DECLARE_QI_TRACE(CEnumMoniker)
+
+ BEGIN_COM_MAP(CEnumMoniker)
+ COM_INTERFACE_ENTRY(IEnumMoniker)
+ END_COM_MAP()
+
+ private:
+ CComPtr m_pEnumMoniker;
+
+ public:
+ // CEnumMoniker
+ CEnumMoniker()
+ {
+ _Z4(atlTraceRefcount, 4, _T("this 0x%p\n"), this);
+ }
+ ~CEnumMoniker()
+ {
+ _Z4(atlTraceRefcount, 4, _T("this 0x%p\n"), this);
+ }
+ VOID Initialize(IEnumMoniker* pEnumMoniker)
+ {
+ _A(pEnumMoniker);
+ _A(!m_pEnumMoniker);
+ m_pEnumMoniker = pEnumMoniker;
+ }
+
+ // IEnumMoniker
+ STDMETHOD(Next)(ULONG nElementCount, IMoniker** ppMoniker, ULONG* pnFetchedElementCount) throw()
+ {
+ _Z4(atlTraceCOM, 4, _T("nElementCount %d\n"), nElementCount);
+ _ATLTRY
+ {
+ const HRESULT nNextResult = m_pEnumMoniker->Next(nElementCount, ppMoniker, pnFetchedElementCount);
+ _Z4(atlTraceGeneral, 4, _T("nNextResult 0x%08x, *pnFetchedElementCount %s\n"), nNextResult, pnFetchedElementCount ? (LPCTSTR) AtlFormatString(_T("%d"), *pnFetchedElementCount) : _T("(null)"));
+ if(SUCCEEDED(nNextResult))
+ {
+ ULONG nFetchedElementCount = nElementCount;
+ if(nNextResult != S_OK && pnFetchedElementCount)
+ nFetchedElementCount = *pnFetchedElementCount;
+ for(SIZE_T nIndex = 0; nIndex < nFetchedElementCount; nIndex++)
+ {
+ CComPtr& pMoniker = reinterpret_cast&>(ppMoniker[nIndex]);
+ if(!pMoniker)
+ break;
+ CObjectPtr pMonikerWrapper;
+ pMonikerWrapper.Construct()->Initialize(pMoniker);
+ pMoniker = pMonikerWrapper;
+ }
+ }
+ return nNextResult;
+ }
+ _ATLCATCH(Exception)
+ {
+ _C(Exception);
+ }
+ return S_OK;
+ }
+ STDMETHOD(Skip)(ULONG nElementCount) throw()
+ {
+ _Z4(atlTraceCOM, 4, _T("nElementCount %d\n"), nElementCount);
+ _ATLTRY
+ {
+ return m_pEnumMoniker->Skip(nElementCount);
+ }
+ _ATLCATCH(Exception)
+ {
+ _C(Exception);
+ }
+ return S_OK;
+ }
+ STDMETHOD(Reset)() throw()
+ {
+ _Z4(atlTraceCOM, 4, _T("...\n"));
+ _ATLTRY
+ {
+ return m_pEnumMoniker->Reset();
+ }
+ _ATLCATCH(Exception)
+ {
+ _C(Exception);
+ }
+ return S_OK;
+ }
+ STDMETHOD(Clone)(IEnumMoniker** ppEnumMoniker) throw()
+ {
+ _Z4(atlTraceCOM, 4, _T("...\n"));
+ _ATLTRY
+ {
+ __C(m_pEnumMoniker->Clone(ppEnumMoniker));
+ CComPtr& pEnumMoniker = reinterpret_cast&>(*ppEnumMoniker);
+ _A(pEnumMoniker);
+ CObjectPtr pEnumMonikerWrapper;
+ pEnumMonikerWrapper.Construct()->Initialize(pEnumMoniker);
+ pEnumMoniker = pEnumMonikerWrapper;
+ }
+ _ATLCATCH(Exception)
+ {
+ _C(Exception);
+ }
+ return S_OK;
+ }
+ };
+
+private:
+ HINSTANCE m_hDevEnumModule;
+ CComPtr m_pSystemDeviceEnum;
+ CComPtr m_pCreateDevEnum;
+
+ HRESULT QuerySystemDeviceEnumInterface(REFIID InterfaceIdentifier, VOID** ppvObject)
+ {
+ _A(InterfaceIdentifier == CLSID_SystemDeviceEnum);
+ _A(ppvObject);
+ *ppvObject = CComPtr(m_pSystemDeviceEnum).Detach();
+ return S_OK;
+ }
+ static HRESULT WINAPI QuerySystemDeviceEnumInterface(VOID* pvInstance, REFIID InterfaceIdentifier, VOID** ppvObject, DWORD)
+ {
+ return ((CSystemDeviceEnumeratorSpy*) pvInstance)->QuerySystemDeviceEnumInterface(InterfaceIdentifier, ppvObject);
+ }
+
+public:
+// CSystemDeviceEnumeratorSpyT
+ static LPCTSTR GetOriginalLibraryName() throw()
+ {
+ return _T("devenum.dll");
+ }
+ static CString GetObjectFriendlyName()
+ {
+ return _StringHelper::GetLine(T::IDR, 2);
+ }
+ static HRESULT WINAPI UpdateRegistry(BOOL bRegister) throw()
+ {
+ _Z2(atlTraceRegistrar, 2, _T("bRegister %d\n"), bRegister);
+ _ATLTRY
+ {
+ TreatAsUpdateRegistryFromResource(*t_pSystemDeviceEnumeratorClassIdentifier, bRegister);
+ }
+ _ATLCATCH(Exception)
+ {
+ _C(Exception);
+ }
+ return S_OK;
+ }
+ CSystemDeviceEnumeratorSpyT() throw() :
+ m_hDevEnumModule(NULL)
+ {
+ _Z4(atlTraceRefcount, 4, _T("this 0x%p\n"), this);
+ }
+ ~CSystemDeviceEnumeratorSpyT() throw()
+ {
+ _Z4(atlTraceRefcount, 4, _T("this 0x%p\n"), this);
+ }
+ HRESULT FinalConstruct() throw()
+ {
+ _ATLTRY
+ {
+ TCHAR pszPath[MAX_PATH] = { 0 };
+ _W(GetModuleFileName(NULL, pszPath, DIM(pszPath)));
+ _Z4(atlTraceRefcount, 4, _T("pszPath \"%s\", this 0x%08x, m_dwRef %d\n"), pszPath, this, m_dwRef);
+ const HINSTANCE hModule = CoLoadLibrary(const_cast((LPCOLESTR) CT2COLE(GetOriginalLibraryName())), TRUE);
+ _ATLTRY
+ {
+ typedef HRESULT (WINAPI *DLLGETCLASSOBJECT)(REFCLSID, REFIID, VOID**);
+ DLLGETCLASSOBJECT DllGetClassObject = (DLLGETCLASSOBJECT) GetProcAddress(hModule, "DllGetClassObject");
+ __E(DllGetClassObject);
+ CComPtr pClassFactory;
+ __C(DllGetClassObject(*t_pSystemDeviceEnumeratorClassIdentifier, __uuidof(IClassFactory), (VOID**) &pClassFactory));
+ _A(pClassFactory);
+ CComPtr pUnknown;
+ __C(pClassFactory->CreateInstance(NULL, __uuidof(IUnknown), (VOID**) &pUnknown));
+ __D(pUnknown, E_NOINTERFACE);
+ CComPtr pSystemDeviceEnum;
+ __C(pUnknown->QueryInterface(CLSID_SystemDeviceEnum, (VOID**) &pSystemDeviceEnum));
+ const CComQIPtr pCreateDevEnum = pUnknown;
+ __D(pCreateDevEnum, E_NOINTERFACE);
+ m_pSystemDeviceEnum = pSystemDeviceEnum;
+ m_pCreateDevEnum = pCreateDevEnum;
+ }
+ _ATLCATCHALL()
+ {
+ CoFreeLibrary(hModule);
+ _ATLRETHROW;
+ }
+ _A(!m_hDevEnumModule);
+ m_hDevEnumModule = hModule;
+ }
+ _ATLCATCH(Exception)
+ {
+ _C(Exception);
+ }
+ return S_OK;
+ }
+ VOID FinalRelease() throw()
+ {
+ _Z5(atlTraceRefcount, 5, _T("m_dwRef 0x%x\n"), m_dwRef);
+ m_pSystemDeviceEnum = NULL;
+ m_pCreateDevEnum = NULL;
+ if(m_hDevEnumModule)
+ {
+ CoFreeLibrary(m_hDevEnumModule);
+ m_hDevEnumModule = NULL;
+ }
+ }
+ static CString FormatDeviceCategory(const GUID& DeviceCategory)
+ {
+ static const struct { const GUID* pIdentifier; LPCSTR pszName; } g_pMap[] =
+ {
+ #define A(x) { &x, #x },
+ A(CLSID_VideoInputDeviceCategory)
+ A(CLSID_LegacyAmFilterCategory)
+ A(CLSID_VideoCompressorCategory)
+ A(CLSID_AudioCompressorCategory)
+ A(CLSID_AudioInputDeviceCategory)
+ A(CLSID_AudioRendererCategory)
+ A(CLSID_MidiRendererCategory)
+ A(CLSID_TransmitCategory)
+ A(CLSID_DeviceControlCategory)
+ A(CLSID_ActiveMovieCategories)
+ A(CLSID_DVDHWDecodersCategory)
+ A(CLSID_MediaEncoderCategory)
+ A(CLSID_MediaMultiplexerCategory)
+ #undef A
+ };
+ for(SIZE_T nIndex = 0; nIndex < DIM(g_pMap); nIndex++)
+ if(*g_pMap[nIndex].pIdentifier == DeviceCategory)
+ return CString(g_pMap[nIndex].pszName);
+ return CString(_PersistHelper::StringFromIdentifier(DeviceCategory));
+ }
+
+// ISystemDeviceEnumeratorSpy
+
+// ICreateDevEnum
+ STDMETHOD(CreateClassEnumerator)(REFCLSID DeviceCategory, IEnumMoniker** ppEnumMoniker, DWORD nFlags) throw()
+ {
+ _Z4(atlTraceCOM, 4, _T("DeviceCategory %s, nFlags 0x%x\n"), FormatDeviceCategory(DeviceCategory), nFlags);
+ _ATLTRY
+ {
+ __C(m_pCreateDevEnum->CreateClassEnumerator(DeviceCategory, ppEnumMoniker, nFlags));
+ CComPtr& pEnumMoniker = reinterpret_cast&>(*ppEnumMoniker);
+ if(pEnumMoniker)
+ {
+ #pragma region Trace Monikers
+ __C(pEnumMoniker->Reset());
+ CComPtr pMoniker;
+ while(pEnumMoniker->Next(1, &pMoniker, NULL) == S_OK)
+ {
+ _Z4(atlTraceCOM, 4, _T("pMoniker %ls\n"), _FilterGraphHelper::GetMonikerDisplayName(pMoniker));
+ CComPtr pBindCtx;
+ __C(CreateBindCtx(0, &pBindCtx));
+ CComPtr pPropertyBag;
+ __C(pMoniker->BindToStorage(pBindCtx, NULL, __uuidof(IPropertyBag), (VOID**) &pPropertyBag));
+ const CStringW sFriendlyName = _FilterGraphHelper::ReadPropertyBagString(pPropertyBag, OLESTR("FriendlyName"));
+ const CStringW sDescription = _FilterGraphHelper::ReadPropertyBagString(pPropertyBag, OLESTR("Description"));
+ const CStringW sDevicePath = _FilterGraphHelper::ReadPropertyBagString(pPropertyBag, OLESTR("DevicePath"));
+ _Z4(atlTraceCOM, 4, _T("sFriendlyName \"%ls\", sDescription \"%ls\", sDevicePath \"%ls\"\n"), sFriendlyName, sDescription, sDevicePath);
+ pMoniker.Release();
+ }
+ __C(pEnumMoniker->Reset());
+ #pragma endregion
+ CObjectPtr pEnumMonikerWrapper;
+ pEnumMonikerWrapper.Construct()->Initialize(pEnumMoniker);
+ pEnumMoniker = pEnumMonikerWrapper;
+ }
+ }
+ _ATLCATCH(Exception)
+ {
+ _C(Exception);
+ }
+ return S_OK;
+ }
+};
+
+////////////////////////////////////////////////////////////
+// CSystemDeviceEnumeratorSpy
+
+class ATL_NO_VTABLE CSystemDeviceEnumeratorSpy :
+ public CSystemDeviceEnumeratorSpyT,
+ public CComCoClass
+{
+public:
+ enum { IDR = IDR_SYSTEMDEVICEENUMERATORSPY };
+
+private:
+ static LPCTSTR g_pszClassName;
+
+public:
+ //typedef CBlackListAwareComCreatorT, CSystemDeviceEnumeratorSpy, &g_pszClassName> _ClassFactoryCreatorClass; // DECLARE_CLASSFACTORY override
+ typedef CComCreator2, CSystemDeviceEnumeratorSpy, &g_pszClassName>, CBlackListAwareComCreatorT, CSystemDeviceEnumeratorSpy, &g_pszClassName> > _CreatorClass; // DECLARE_AGGREGATABLE override
+
+public:
+// CSystemDeviceEnumeratorSpy
+};
+
+__declspec(selectany) LPCTSTR CSystemDeviceEnumeratorSpy::g_pszClassName = _T("CSystemDeviceEnumeratorSpy");
+
+OBJECT_ENTRY_AUTO(__uuidof(SystemDeviceEnumeratorSpy), CSystemDeviceEnumeratorSpy)
Index: trunk/DirectShowSpy/dllmain.h
===================================================================
--- trunk/DirectShowSpy/dllmain.h (revision 117)
+++ trunk/DirectShowSpy/dllmain.h (revision 144)
@@ -28,9 +28,9 @@
_W(CExceptionFilter::Initialize());
TraceModuleVersion();
- _Z4(atlTraceRefcount, 4, _T("this 0x%08x\n"), this);
+ _Z4(atlTraceRefcount, 4, _T("this 0x%p\n"), this);
}
~CDirectShowSpyModule() throw()
{
- _Z4(atlTraceRefcount, 4, _T("this 0x%08x\n"), this);
+ _Z4(atlTraceRefcount, 4, _T("this 0x%p\n"), this);
CExceptionFilter::Terminate();
}
Index: trunk/DirectShowSpy/resource.h
===================================================================
--- trunk/DirectShowSpy/resource.h (revision 117)
+++ trunk/DirectShowSpy/resource.h (revision 144)
@@ -11,4 +11,5 @@
#define IDR_NOTHREADFILTERGRAPHSPY 103
#define IDR_FILTERMAPPERSPY 104
+#define IDR_SYSTEMDEVICEENUMERATORSPY 105
#define IDC_PROGRESS 202
#define IDS_GRAPHBUILDERCALLBACK_GRAPH_PROPERTYSHEETCAPTION 1000