With a lot of DirectShow Filter Graphs published on Running Object Table, especially those automatically published by Filter Graph Spy utility, it might be a bit tricky to locate your graph of interest in the list.
Filter graphs are published with a textual moniker item name of predefined format, which is recognized by GraphEdit or GraphStudio, or similar utilities as an item corresponding to a filter graph. A template for such a string is “FilterGraph %08x pid %08x“, which obviously only contains raw pointer address and process identifier, which only help a bit in looking up for proper graph interactively. However, it is important how exactly applications are recognizing filter graph related names. For example, GraphStudio does it the following way:
rot->EnumRunning(&emon); emon->Reset(); while (emon->Next(1, &moniker, &f) == NOERROR) { // is this a graph object ? LPOLESTR displayname; moniker->GetDisplayName(bindctx, NULL, &displayname); CString name(displayname); if (name.Find(_T("!FilterGraph")) == 0) {
The items that match are then listed in GUI with an original string, which means that it is possible to provide an informational suffix to be able to locate the graph in a more convenient way, e.g. with a process image name, not only identifier (“; process: …” was appended to the item name):
GraphEdit is using another method and is more strict in selecting among available items. AFAIR earlier versions did not allow custom suffixes in item names, however the latest version still picks the items up from the global list. However, GraphEdit does not show graph’s original item name, so suffixes are merely useless with GraphEdit.
Filter Graph Spy utility was updated to automatically append process name suffix, which should be OK for both GrapEdit and GraphStudio. Still, the feature can be disabled through registry DWORD value named “Enable ROT Moniker Item Name Suffix” under HKEY_LOCAL_MACHINE\SOFTWARE\Alax.Info\Utilities. The value of zero, or missing, is the default behavior to enable suffixes. The value of 1 disables the feature, the value of 2 makes sure it is enabled.
static CConstIntegerRegistryValue g_nEnableRotMonikerItemNameSuffix(_T("Enable ROT Moniker Item Name Suffix")); // 0 Default, 1 Disable, 2 Enable if(g_nEnableRotMonikerItemNameSuffix != 1) { TCHAR pszPath[MAX_PATH] = { 0 }; _W(GetModuleFileName(NULL, pszPath, DIM(pszPath))); CString sItemName = AtlFormatString(_T("%s; process: %s"), m_RunningFilterGraph.GetDefaultMonikerItemName(GetControllingUnknown()), FindFileName(pszPath)); m_RunningFilterGraph.SetFilterGraph(GetControllingUnknown(), CStringW(sItemName)); } else m_RunningFilterGraph.SetFilterGraph(GetControllingUnknown())
A partial Visual C++ .NET 2008 source code is available from SVN, release binary included.
it doesn’t work on my Vista SP2. Have you tried?
I did not try on Vista, although I don’t see why it should not work except one thing: on Vista you have UAC and connections through ROT are subject to COM security. So to make sure everything works you need to start applications, including regsvr32, with “As Administrator” privilege elevation. This may be the cause.
UPDATE: See DirectShow Filter Graph Spy on Vista post on how to have the tool running on Vista.
UPDATE: Update above worked for kudim.