Changeset 285
- Timestamp:
- May 8, 2014, 9:04:30 AM (10 years ago)
- Location:
- trunk/DirectShowSpy
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/DirectShowSpy/DirectShowSpy.idl
r280 r285 55 55 [ 56 56 object, 57 uuid(A7490000-3A5D-455D-9B81-2025B74CD4CD), 58 nonextensible, 59 helpstring("ISpyEx Interface"), 60 pointer_default(unique) 61 ] 62 interface ISpyEx : IUnknown 63 { 64 }; 65 [ 66 object, 57 67 uuid(34B280D7-A144-4a64-BCB9-3616896F6877), 58 68 dual, … … 153 163 { 154 164 [default] interface ISpy; 165 //interface ISpyEx; 155 166 interface IModuleVersionInformation; 156 167 }; … … 162 173 { 163 174 [default] interface ISpy; 175 //interface ISpyEx; 164 176 interface IModuleVersionInformation; 165 177 }; -
trunk/DirectShowSpy/DirectShowSpy.rc
r280 r285 60 60 61 61 VS_VERSION_INFO VERSIONINFO 62 FILEVERSION 1, 0, 0, 14 6662 FILEVERSION 1, 0, 0, 1483 63 63 PRODUCTVERSION 1,0,0,1 64 64 FILEFLAGSMASK 0x3fL … … 79 79 VALUE "CompanyName", "Roman Ryltsov" 80 80 VALUE "FileDescription", "Alax.Info DirectShow Spy Module" 81 VALUE "FileVersion", "1, 0, 0, 14 66\0"81 VALUE "FileVersion", "1, 0, 0, 1483\0" 82 82 VALUE "InternalName", "DirectShowSpy.dll" 83 83 VALUE "LegalCopyright", "Copyright © Alax.Info, Roman Ryltsov, 2008-2014" -
trunk/DirectShowSpy/DirectShowSpy_i.c
r280 r285 7 7 8 8 /* File created by MIDL compiler version 7.00.0555 */ 9 /* at Thu Mar 13 20:08:2920149 /* at Wed May 07 14:27:04 2014 10 10 */ 11 11 /* Compiler settings for DirectShowSpy.idl: … … 74 74 75 75 76 MIDL_DEFINE_GUID(IID, IID_ISpyEx,0xA7490000,0x3A5D,0x455D,0x9B,0x81,0x20,0x25,0xB7,0x4C,0xD4,0xCD); 77 78 76 79 MIDL_DEFINE_GUID(IID, IID_IFilterMapperSpy,0x34B280D7,0xA144,0x4a64,0xBC,0xB9,0x36,0x16,0x89,0x6F,0x68,0x77); 77 80 -
trunk/DirectShowSpy/DirectShowSpy_i.h
r280 r285 5 5 6 6 /* File created by MIDL compiler version 7.00.0555 */ 7 /* at Thu Mar 13 20:08:2920147 /* at Wed May 07 14:27:04 2014 8 8 */ 9 9 /* Compiler settings for DirectShowSpy.idl: … … 58 58 59 59 60 #ifndef __ISpyEx_FWD_DEFINED__ 61 #define __ISpyEx_FWD_DEFINED__ 62 typedef interface ISpyEx ISpyEx; 63 #endif /* __ISpyEx_FWD_DEFINED__ */ 64 65 60 66 #ifndef __IFilterMapperSpy_FWD_DEFINED__ 61 67 #define __IFilterMapperSpy_FWD_DEFINED__ … … 531 537 532 538 539 #ifndef __ISpyEx_INTERFACE_DEFINED__ 540 #define __ISpyEx_INTERFACE_DEFINED__ 541 542 /* interface ISpyEx */ 543 /* [unique][helpstring][nonextensible][uuid][object] */ 544 545 546 EXTERN_C const IID IID_ISpyEx; 547 548 #if defined(__cplusplus) && !defined(CINTERFACE) 549 550 MIDL_INTERFACE("A7490000-3A5D-455D-9B81-2025B74CD4CD") 551 ISpyEx : public IUnknown 552 { 553 public: 554 }; 555 556 #else /* C style interface */ 557 558 typedef struct ISpyExVtbl 559 { 560 BEGIN_INTERFACE 561 562 HRESULT ( STDMETHODCALLTYPE *QueryInterface )( 563 ISpyEx * This, 564 /* [in] */ REFIID riid, 565 /* [annotation][iid_is][out] */ 566 __RPC__deref_out void **ppvObject); 567 568 ULONG ( STDMETHODCALLTYPE *AddRef )( 569 ISpyEx * This); 570 571 ULONG ( STDMETHODCALLTYPE *Release )( 572 ISpyEx * This); 573 574 END_INTERFACE 575 } ISpyExVtbl; 576 577 interface ISpyEx 578 { 579 CONST_VTBL struct ISpyExVtbl *lpVtbl; 580 }; 581 582 583 584 #ifdef COBJMACROS 585 586 587 #define ISpyEx_QueryInterface(This,riid,ppvObject) \ 588 ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) 589 590 #define ISpyEx_AddRef(This) \ 591 ( (This)->lpVtbl -> AddRef(This) ) 592 593 #define ISpyEx_Release(This) \ 594 ( (This)->lpVtbl -> Release(This) ) 595 596 597 #endif /* COBJMACROS */ 598 599 600 #endif /* C style interface */ 601 602 603 604 605 #endif /* __ISpyEx_INTERFACE_DEFINED__ */ 606 607 533 608 #ifndef __IFilterMapperSpy_INTERFACE_DEFINED__ 534 609 #define __IFilterMapperSpy_INTERFACE_DEFINED__ -
trunk/DirectShowSpy/DirectShowSpy_p.c
r280 r285 5 5 6 6 /* File created by MIDL compiler version 7.00.0555 */ 7 /* at Thu Mar 13 20:08:2920147 /* at Wed May 07 14:27:04 2014 8 8 */ 9 9 /* Compiler settings for DirectShowSpy.idl: … … 96 96 extern const MIDL_SERVER_INFO ISpy_ServerInfo; 97 97 extern const MIDL_STUBLESS_PROXY_INFO ISpy_ProxyInfo; 98 99 100 extern const MIDL_STUB_DESC Object_StubDesc; 101 102 103 extern const MIDL_SERVER_INFO ISpyEx_ServerInfo; 104 extern const MIDL_STUBLESS_PROXY_INFO ISpyEx_ProxyInfo; 98 105 99 106 … … 1626 1633 1627 1634 1635 /* Object interface: ISpyEx, ver. 0.0, 1636 GUID={0xA7490000,0x3A5D,0x455D,{0x9B,0x81,0x20,0x25,0xB7,0x4C,0xD4,0xCD}} */ 1637 1638 #pragma code_seg(".orpc") 1639 static const unsigned short ISpyEx_FormatStringOffsetTable[] = 1640 { 1641 0 1642 }; 1643 1644 static const MIDL_STUBLESS_PROXY_INFO ISpyEx_ProxyInfo = 1645 { 1646 &Object_StubDesc, 1647 DirectShowSpy__MIDL_ProcFormatString.Format, 1648 &ISpyEx_FormatStringOffsetTable[-3], 1649 0, 1650 0, 1651 0 1652 }; 1653 1654 1655 static const MIDL_SERVER_INFO ISpyEx_ServerInfo = 1656 { 1657 &Object_StubDesc, 1658 0, 1659 DirectShowSpy__MIDL_ProcFormatString.Format, 1660 &ISpyEx_FormatStringOffsetTable[-3], 1661 0, 1662 0, 1663 0, 1664 0}; 1665 CINTERFACE_PROXY_VTABLE(3) _ISpyExProxyVtbl = 1666 { 1667 0, 1668 &IID_ISpyEx, 1669 IUnknown_QueryInterface_Proxy, 1670 IUnknown_AddRef_Proxy, 1671 IUnknown_Release_Proxy 1672 }; 1673 1674 const CInterfaceStubVtbl _ISpyExStubVtbl = 1675 { 1676 &IID_ISpyEx, 1677 &ISpyEx_ServerInfo, 1678 3, 1679 0, /* pure interpreted */ 1680 CStdStubBuffer_METHODS 1681 }; 1682 1683 1628 1684 /* Object interface: IFilterMapperSpy, ver. 0.0, 1629 1685 GUID={0x34B280D7,0xA144,0x4a64,{0xBC,0xB9,0x36,0x16,0x89,0x6F,0x68,0x77}} */ … … 1869 1925 const CInterfaceProxyVtbl * const _DirectShowSpy_ProxyVtblList[] = 1870 1926 { 1927 ( CInterfaceProxyVtbl *) &_ISpyExProxyVtbl, 1871 1928 ( CInterfaceProxyVtbl *) &_ISpyProxyVtbl, 1872 1929 ( CInterfaceProxyVtbl *) &_IFilterGraphHelperProxyVtbl, … … 1879 1936 const CInterfaceStubVtbl * const _DirectShowSpy_StubVtblList[] = 1880 1937 { 1938 ( CInterfaceStubVtbl *) &_ISpyExStubVtbl, 1881 1939 ( CInterfaceStubVtbl *) &_ISpyStubVtbl, 1882 1940 ( CInterfaceStubVtbl *) &_IFilterGraphHelperStubVtbl, … … 1889 1947 PCInterfaceName const _DirectShowSpy_InterfaceNamesList[] = 1890 1948 { 1949 "ISpyEx", 1891 1950 "ISpy", 1892 1951 "IFilterGraphHelper", … … 1899 1958 const IID * const _DirectShowSpy_BaseIIDList[] = 1900 1959 { 1960 0, 1901 1961 &IID_IDispatch, 1902 1962 &IID_IDispatch, … … 1914 1974 IID_BS_LOOKUP_SETUP 1915 1975 1916 IID_BS_LOOKUP_INITIAL_TEST( _DirectShowSpy, 5, 4 )1976 IID_BS_LOOKUP_INITIAL_TEST( _DirectShowSpy, 6, 4 ) 1917 1977 IID_BS_LOOKUP_NEXT_TEST( _DirectShowSpy, 2 ) 1918 1978 IID_BS_LOOKUP_NEXT_TEST( _DirectShowSpy, 1 ) 1919 IID_BS_LOOKUP_RETURN_RESULT( _DirectShowSpy, 5, *pIndex )1979 IID_BS_LOOKUP_RETURN_RESULT( _DirectShowSpy, 6, *pIndex ) 1920 1980 1921 1981 } … … 1928 1988 (const IID ** ) & _DirectShowSpy_BaseIIDList, 1929 1989 & _DirectShowSpy_IID_Lookup, 1930 5,1990 6, 1931 1991 2, 1932 1992 0, /* table of [async_uuid] interfaces */ -
trunk/DirectShowSpy/FilterGraphHelper.h
r280 r285 202 202 DWORD m_nIdentifier; 203 203 CPath m_sImagePath; 204 205 public: 206 // CProcessData 207 CProcessData() : 208 m_nIdentifier(0) 209 { 210 } 204 211 }; 205 212 … … 1888 1895 private: 1889 1896 mutable CRoCriticalSection m_DataCriticalSection; 1897 CProcessData m_ProcessData; 1890 1898 CComPtr<IFilterGraph> m_pFilterGraph; 1891 1899 … … 2025 2033 return _StringHelper::Join(Array, _T(", ")); 2026 2034 } 2027 static CString GetFilterText(IBaseFilter* pBaseFilter, IReferenceClock* pFilterGraphReferenceClock = NULL)2035 static CString GetFilterText(IBaseFilter* pBaseFilter, const CProcessData* pProcessData, IReferenceClock* pFilterGraphReferenceClock = NULL) 2028 2036 { 2029 2037 CString sText; 2030 2038 #pragma region COM 2039 CString sPath; 2031 2040 const CStringW sClassIdentifierString = _FilterGraphHelper::GetFilterClassIdentifierString(pBaseFilter); 2032 2041 if(!sClassIdentifierString.IsEmpty()) … … 2039 2048 _ATLTRY 2040 2049 { 2041 const CStringsPath = _RegKeyHelper::QueryStringValue(HKEY_CLASSES_ROOT, AtlFormatString(_T("CLSID\\%ls\\InprocServer32"), sClassIdentifierString));2050 sPath = _RegKeyHelper::QueryStringValue(HKEY_CLASSES_ROOT, AtlFormatString(_T("CLSID\\%ls\\InprocServer32"), sClassIdentifierString)); 2042 2051 if(!sPath.IsEmpty()) 2043 2052 { … … 2057 2066 } 2058 2067 } 2068 if(_tcslen(sPath) == 0 && pProcessData && pProcessData->m_nIdentifier == GetCurrentProcessId()) 2069 _ATLTRY 2070 { 2071 const VOID* pvVirtualTable = *((const VOID**) pBaseFilter); 2072 MEMORY_BASIC_INFORMATION Information; 2073 if(VirtualQueryEx(GetCurrentProcess(), pvVirtualTable, &Information, sizeof Information)) 2074 { 2075 TCHAR pszPath[MAX_PATH] = { 0 }; 2076 if(GetModuleFileName((HMODULE) Information.AllocationBase, pszPath, DIM(pszPath))) 2077 { 2078 sPath = pszPath; 2079 sText += AtlFormatString(_T(" * ") _T("Virtual Table Location: %s") _T("\r\n"), I(sPath)); 2080 const ULONGLONG nProductVersion = _VersionInfoHelper::GetProductVersion(sPath); 2081 if(nProductVersion && (nProductVersion + 1)) 2082 sText += AtlFormatString(_T(" * ") _T("Product Version: %s") _T("\r\n"), I(_VersionInfoHelper::GetVersionString(nProductVersion))); 2083 const ULONGLONG nFileVersion = _VersionInfoHelper::GetFileVersion(sPath); 2084 if(nFileVersion && (nFileVersion + 1)) 2085 sText += AtlFormatString(_T(" * ") _T("File Version: %s") _T("\r\n"), I(_VersionInfoHelper::GetVersionString(nFileVersion))); 2086 } 2087 } 2088 } 2089 _ATLCATCHALL() 2090 { 2091 _Z_EXCEPTION(); 2092 } 2059 2093 #pragma endregion 2094 #pragma region Pin 2060 2095 _FilterGraphHelper::CPinArray InputPinArray; 2061 2096 if(_FilterGraphHelper::GetFilterPins(pBaseFilter, PINDIR_INPUT, InputPinArray)) … … 2064 2099 if(_FilterGraphHelper::GetFilterPins(pBaseFilter, PINDIR_OUTPUT, OutputPinArray)) 2065 2100 sText += AtlFormatString(_T(" * ") _T("Output Pins: %s") _T("\r\n"), FormatPins(OutputPinArray)); 2101 #pragma endregion 2066 2102 #pragma region IReferenceClock 2067 2103 const CComQIPtr<IReferenceClock> pReferenceClock = pBaseFilter; … … 2454 2490 if(!pFilterGraph) 2455 2491 return (LPCTSTR) NULL; 2492 const CComQIPtr<ISpy> pSpy = pFilterGraph; 2456 2493 CString sText; 2457 2494 sText += AtlFormatString(_T("# ") _T("Filter Graph") _T("\r\n") _T("\r\n")); … … 2502 2539 if(!pProcessData->m_sDisplayName.IsEmpty()) 2503 2540 sText += AtlFormatString(_T("* ") _T("Display Name: %s") _T("\r\n"), I(pProcessData->m_sDisplayName)); 2504 const CString sDirectory = (LPCTSTR) GetPathDirectory(pProcessData->m_sImagePath); 2505 if(!sDirectory.IsEmpty()) 2506 sText += AtlFormatString(_T("* ") _T("Process Directory: %s") _T("\r\n"), I(sDirectory)); 2541 if(_tcslen(pProcessData->m_sImagePath)) 2542 { 2543 const CString sDirectory = (LPCTSTR) GetPathDirectory(pProcessData->m_sImagePath); 2544 if(!sDirectory.IsEmpty()) 2545 sText += AtlFormatString(_T("* ") _T("Process Directory: %s") _T("\r\n"), I(sDirectory)); 2546 } 2507 2547 } 2508 2548 const CComQIPtr<IMediaFilter> pMediaFilter = pFilterGraph; … … 2523 2563 const CComPtr<IBaseFilter>& pBaseFilter = FilterArray[nIndex]; 2524 2564 sText += AtlFormatString(_T("%d. ") _T("%ls") _T("\r\n"), nIndex + 1, _FilterGraphHelper::GetFilterName(pBaseFilter)); 2525 sText += GetFilterText(pBaseFilter, p FilterGraphReferenceClock);2565 sText += GetFilterText(pBaseFilter, pProcessData, pFilterGraphReferenceClock); 2526 2566 } 2527 2567 _ATLCATCHALL() … … 2645 2685 const CComPtr<IBaseFilter>& pBaseFilter = FilterArray[nIndex]; 2646 2686 //_Z4(atlTraceGeneral, 4, _T("pBaseFilter 0x%p \"%ls\"\n"), pBaseFilter, _FilterGraphHelper::GetFilterName(pBaseFilter)); 2647 const CString sPropertyBagText = CPropertyBagHelper::GetPropertyBagText(pBaseFilter, CComQIPtr<ISpy>(pFilterGraph));2687 const CString sPropertyBagText = CPropertyBagHelper::GetPropertyBagText(pBaseFilter, pSpy); 2648 2688 if(sPropertyBagText.IsEmpty()) 2649 2689 continue; … … 2672 2712 return m_pFilterGraph; 2673 2713 } 2674 VOID SetFilterGraph(IFilterGraph* pFilterGraph )2714 VOID SetFilterGraph(IFilterGraph* pFilterGraph, CProcessData* pProcessData = NULL) 2675 2715 { 2676 2716 CRoCriticalSectionLock DataLock(m_DataCriticalSection); 2717 if(!pProcessData) 2718 { 2719 m_ProcessData = CProcessData(); 2720 const CComQIPtr<ISpyEx> pSpyEx = pFilterGraph; 2721 if(pSpyEx) 2722 m_ProcessData.m_nIdentifier = GetCurrentProcessId(); 2723 } else 2724 m_ProcessData = *pProcessData; 2677 2725 m_pFilterGraph = pFilterGraph; 2678 2726 } 2679 BOOL SetFilterGraph(IUnknown* pFilterGraphUnknown )2727 BOOL SetFilterGraph(IUnknown* pFilterGraphUnknown, CProcessData* pProcessData = NULL) 2680 2728 { 2681 2729 CComQIPtr<IFilterGraph> pFilterGraph; … … 2695 2743 } 2696 2744 } 2745 SetFilterGraph(pFilterGraph, pProcessData); 2746 return pFilterGraph != NULL; 2747 } 2748 CString GetFilterText(IBaseFilter* pBaseFilter) const 2749 { 2750 return GetFilterText(pBaseFilter, m_ProcessData.m_nIdentifier ? &m_ProcessData : NULL); 2751 } 2752 CString GetText() const 2753 { 2697 2754 CRoCriticalSectionLock DataLock(m_DataCriticalSection); 2698 m_pFilterGraph = pFilterGraph; 2699 return m_pFilterGraph != NULL; 2700 } 2701 CString GetText() const 2702 { 2703 CRoCriticalSectionLock DataLock(m_DataCriticalSection); 2704 return GetText(m_pFilterGraph); 2755 return GetText(m_pFilterGraph, m_ProcessData.m_nIdentifier ? &m_ProcessData : NULL); 2705 2756 } 2706 2757 static LPCTSTR GetPlatformName() -
trunk/DirectShowSpy/FilterGraphList.h
r276 r285 148 148 return m_pFilterGraph; 149 149 } 150 CFilterGraphHelper::CProcessData GetProcessData() const 151 { 152 CFilterGraphHelper::CProcessData ProcessData; 153 ProcessData.m_sDisplayName = m_sDisplayName; 154 ProcessData.m_nIdentifier = m_nProcessIdentifier; 155 ProcessData.m_sImagePath = m_sProcessImagePath; 156 return ProcessData; 157 } 150 158 BOOL Check() 151 159 { … … 342 350 Item.Check(); 343 351 m_GraphListView.RedrawItems(nItem, nItem); 344 CFilterGraphHelper::CProcessData ProcessData; 345 ProcessData.m_sDisplayName = Item.m_sDisplayName; 346 ProcessData.m_nIdentifier = Item.m_nProcessIdentifier; 347 ProcessData.m_sImagePath = Item.m_sProcessImagePath; 348 GraphArray.Add(CFilterGraphHelper::GetText(Item.m_pFilterGraph, &ProcessData)); 352 GraphArray.Add(CFilterGraphHelper::GetText(Item.m_pFilterGraph, &Item.GetProcessData())); 349 353 } 350 354 } … … 568 572 Item.Check(); 569 573 CLocalObjectPtr<CFilterGraphHelper> pFilterGraphHelper; 570 pFilterGraphHelper->SetFilterGraph(Item.m_pFilterGraph );574 pFilterGraphHelper->SetFilterGraph(Item.m_pFilterGraph, &Item.GetProcessData()); 571 575 _V(pFilterGraphHelper->DoPropertyFrameModal((LONG) (LONG_PTR) m_hWnd)); 572 576 return 0; -
trunk/DirectShowSpy/FilterGraphSpy.h
r280 r285 92 92 public CTransparentCoClassT<T, t_pFilterGraphClassIdentifier>, 93 93 public IDispatchImpl<ISpy>, 94 public ISpyEx, 94 95 public IFilterGraph2, 95 96 public IDispatchImpl<IMediaControl, &__uuidof(IMediaControl), &__uuidof(Quartz::__QuartzTypeLib)>, … … 125 126 COM_INTERFACE_ENTRY(ISpy) 126 127 COM_INTERFACE_ENTRY_FUNC(__uuidof(IFilterGraph3), 0, QueryFilterGraph3Interface) 128 COM_INTERFACE_ENTRY(ISpyEx) 127 129 COM_INTERFACE_ENTRY(IFilterGraph2) 128 130 COM_INTERFACE_ENTRY(IGraphBuilder) … … 797 799 } 798 800 801 // ISpyEx 802 799 803 // IFilterGraph 800 804 STDMETHOD(AddFilter)(IBaseFilter* pBaseFilter, LPCWSTR pszName)
Note: See TracChangeset
for help on using the changeset viewer.