{"id":930,"date":"2009-06-11T15:14:21","date_gmt":"2009-06-11T13:14:21","guid":{"rendered":"https:\/\/alax.info\/blog\/?p=930"},"modified":"2009-06-11T15:21:29","modified_gmt":"2009-06-11T13:21:29","slug":"hint-on-how-to-easily-find-your-filter-graph-on-running-object-table-rot","status":"publish","type":"post","link":"https:\/\/alax.info\/blog\/930","title":{"rendered":"Hint on how to easily find your filter graph on running object table (ROT)"},"content":{"rendered":"<p>With a lot of <a href=\"http:\/\/msdn.microsoft.com\/en-us\/library\/dd407188(VS.85).aspx\">DirectShow Filter Graphs<\/a> published on <a href=\"http:\/\/msdn.microsoft.com\/en-us\/library\/ms684004(VS.85).aspx\">Running Object Table<\/a>, especially those automatically published by <a href=\"https:\/\/alax.info\/blog\/793\">Filter Graph Spy utility<\/a>, it might be a bit tricky to locate your graph of interest in the list.<\/p>\n<p>Filter graphs are published with a textual <a href=\"http:\/\/msdn.microsoft.com\/en-us\/library\/ms680140(VS.85).aspx\">moniker item name<\/a> of predefined format, which is recognized by <a href=\"http:\/\/msdn.microsoft.com\/en-us\/library\/ms787460(VS.85).aspx\">GraphEdit<\/a> or <a href=\"http:\/\/blog.monogram.sk\/janos\/tools\/monogram-graphstudio\/\">GraphStudio<\/a>, or similar utilities as an item corresponding to a filter graph. A template for such a string is &#8220;<em>FilterGraph %08x pid %08x<\/em>&#8220;, 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 <a href=\"http:\/\/dev.monogram.sk\/websvn\/listing.php?repname=graphstudio\">does it<\/a> the following way:<\/p>\n<pre>rot<span style=\"color: #808030;\">-<\/span><span style=\"color: #808030;\">&gt;<\/span>EnumRunning<span style=\"color: #808030;\">(<\/span><span style=\"color: #808030;\">&amp;<\/span>emon<span style=\"color: #808030;\">)<\/span><span style=\"color: #800080;\">;<\/span>\r\nemon<span style=\"color: #808030;\">-<\/span><span style=\"color: #808030;\">&gt;<\/span>Reset<span style=\"color: #808030;\">(<\/span><span style=\"color: #808030;\">)<\/span><span style=\"color: #800080;\">;<\/span>\r\n<span style=\"color: #800000; font-weight: bold;\">while<\/span> <span style=\"color: #808030;\">(<\/span>emon<span style=\"color: #808030;\">-<\/span><span style=\"color: #808030;\">&gt;<\/span>Next<span style=\"color: #808030;\">(<\/span><span style=\"color: #008c00;\">1<\/span><span style=\"color: #808030;\">,<\/span> <span style=\"color: #808030;\">&amp;<\/span>moniker<span style=\"color: #808030;\">,<\/span> <span style=\"color: #808030;\">&amp;<\/span>f<span style=\"color: #808030;\">)<\/span> <span style=\"color: #808030;\">=<\/span><span style=\"color: #808030;\">=<\/span> NOERROR<span style=\"color: #808030;\">)<\/span> <span style=\"color: #800080;\">{<\/span>\r\n\r\n    <span style=\"color: #696969;\">\/\/ is this a graph object ?<\/span>\r\n    LPOLESTR    displayname<span style=\"color: #800080;\">;<\/span>\r\n    moniker<span style=\"color: #808030;\">-<\/span><span style=\"color: #808030;\">&gt;<\/span>GetDisplayName<span style=\"color: #808030;\">(<\/span>bindctx<span style=\"color: #808030;\">,<\/span> <span style=\"color: #7d0045;\">NULL<\/span><span style=\"color: #808030;\">,<\/span> <span style=\"color: #808030;\">&amp;<\/span>displayname<span style=\"color: #808030;\">)<\/span><span style=\"color: #800080;\">;<\/span>\r\n\r\n    <span style=\"color: #603000;\">CString<\/span>        name<span style=\"color: #808030;\">(<\/span>displayname<span style=\"color: #808030;\">)<\/span><span style=\"color: #800080;\">;<\/span>\r\n    <span style=\"color: #800000; font-weight: bold;\">if<\/span> <span style=\"color: #808030;\">(<\/span>name<span style=\"color: #808030;\">.<\/span>Find<span style=\"color: #808030;\">(<\/span>_T<span style=\"color: #808030;\">(<\/span><span style=\"color: #800000;\">\"<\/span><span style=\"color: #0000e6;\">!FilterGraph<\/span><span style=\"color: #800000;\">\"<\/span><span style=\"color: #808030;\">)<\/span><span style=\"color: #808030;\">)<\/span> <span style=\"color: #808030;\">=<\/span><span style=\"color: #808030;\">=<\/span> <span style=\"color: #008c00;\">0<\/span><span style=\"color: #808030;\">)<\/span> <span style=\"color: #800080;\">{<\/span><\/pre>\n<p>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 (&#8220;; process: &#8230;&#8221; was appended to the item name):<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-932\" title=\"GraphStudio's ROT Items\" src=\"https:\/\/alax.info\/blog\/wp-content\/uploads\/2009\/06\/11-image001.png\" alt=\"GraphStudio's ROT Items\" width=\"400\" height=\"249\" srcset=\"https:\/\/alax.info\/blog\/wp-content\/uploads\/2009\/06\/11-image001.png 400w, https:\/\/alax.info\/blog\/wp-content\/uploads\/2009\/06\/11-image001-300x186.png 300w\" sizes=\"auto, (max-width: 400px) 100vw, 400px\" \/><\/p>\n<p>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&#8217;s original item name, so suffixes are merely useless with GraphEdit.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-933\" title=\"GraphEdit ROT Items\" src=\"https:\/\/alax.info\/blog\/wp-content\/uploads\/2009\/06\/11-image002.png\" alt=\"GraphEdit ROT Items\" width=\"314\" height=\"215\" srcset=\"https:\/\/alax.info\/blog\/wp-content\/uploads\/2009\/06\/11-image002.png 314w, https:\/\/alax.info\/blog\/wp-content\/uploads\/2009\/06\/11-image002-300x205.png 300w\" sizes=\"auto, (max-width: 314px) 100vw, 314px\" \/><\/p>\n<p><a href=\"https:\/\/alax.info\/blog\/793\">Filter Graph Spy utility<\/a> 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 &#8220;<em>Enable ROT Moniker Item Name Suffix<\/em>&#8221; under <em>HKEY_LOCAL_MACHINE\\SOFTWARE\\Alax.Info\\Utilities<\/em>. 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.<\/p>\n<pre><span style=\"color: #800000; font-weight: bold;\">static<\/span> CConstIntegerRegistryValue g_nEnableRotMonikerItemNameSuffix<span style=\"color: #808030;\">(<\/span>_T<span style=\"color: #808030;\">(<\/span><span style=\"color: #800000;\">\"<\/span><span style=\"color: #0000e6;\">Enable ROT Moniker Item Name Suffix<\/span><span style=\"color: #800000;\">\"<\/span><span style=\"color: #808030;\">)<\/span><span style=\"color: #808030;\">)<\/span><span style=\"color: #800080;\">;<\/span> <span style=\"color: #696969;\">\/\/ 0 Default, 1 Disable, 2 Enable<\/span>\r\n<span style=\"color: #800000; font-weight: bold;\">if<\/span><span style=\"color: #808030;\">(<\/span>g_nEnableRotMonikerItemNameSuffix <span style=\"color: #808030;\">!<\/span><span style=\"color: #808030;\">=<\/span> <span style=\"color: #008c00;\">1<\/span><span style=\"color: #808030;\">)<\/span>\r\n<span style=\"color: #800080;\">{<\/span>\r\n    <span style=\"color: #603000;\">TCHAR<\/span> pszPath<span style=\"color: #808030;\">[<\/span>MAX_PATH<span style=\"color: #808030;\">]<\/span> <span style=\"color: #808030;\">=<\/span> <span style=\"color: #800080;\">{<\/span> <span style=\"color: #008c00;\">0<\/span> <span style=\"color: #800080;\">}<\/span><span style=\"color: #800080;\">;<\/span>\r\n    _W<span style=\"color: #808030;\">(<\/span><span style=\"color: #400000;\">GetModuleFileName<\/span><span style=\"color: #808030;\">(<\/span><span style=\"color: #7d0045;\">NULL<\/span><span style=\"color: #808030;\">,<\/span> pszPath<span style=\"color: #808030;\">,<\/span> DIM<span style=\"color: #808030;\">(<\/span>pszPath<span style=\"color: #808030;\">)<\/span><span style=\"color: #808030;\">)<\/span><span style=\"color: #808030;\">)<\/span><span style=\"color: #800080;\">;<\/span>\r\n    <span style=\"color: #603000;\">CString<\/span> sItemName <span style=\"color: #808030;\">=<\/span> AtlFormatString<span style=\"color: #808030;\">(<\/span>_T<span style=\"color: #808030;\">(<\/span><span style=\"color: #800000;\">\"<\/span><span style=\"color: #0f69ff;\">%s<\/span><span style=\"color: #0000e6;\">; process: <\/span><span style=\"color: #0f69ff;\">%s<\/span><span style=\"color: #800000;\">\"<\/span><span style=\"color: #808030;\">)<\/span><span style=\"color: #808030;\">,<\/span> m_RunningFilterGraph<span style=\"color: #808030;\">.<\/span>GetDefaultMonikerItemName<span style=\"color: #808030;\">(<\/span>GetControllingUnknown<span style=\"color: #808030;\">(<\/span><span style=\"color: #808030;\">)<\/span><span style=\"color: #808030;\">)<\/span><span style=\"color: #808030;\">,<\/span> FindFileName<span style=\"color: #808030;\">(<\/span>pszPath<span style=\"color: #808030;\">)<\/span><span style=\"color: #808030;\">)<\/span><span style=\"color: #800080;\">;<\/span>\r\n    m_RunningFilterGraph<span style=\"color: #808030;\">.<\/span>SetFilterGraph<span style=\"color: #808030;\">(<\/span>GetControllingUnknown<span style=\"color: #808030;\">(<\/span><span style=\"color: #808030;\">)<\/span><span style=\"color: #808030;\">,<\/span> CStringW<span style=\"color: #808030;\">(<\/span>sItemName<span style=\"color: #808030;\">)<\/span><span style=\"color: #808030;\">)<\/span><span style=\"color: #800080;\">;<\/span>\r\n<span style=\"color: #800080;\">}<\/span> <span style=\"color: #800000; font-weight: bold;\">else<\/span>\r\n    m_RunningFilterGraph<span style=\"color: #808030;\">.<\/span>SetFilterGraph<span style=\"color: #808030;\">(<\/span>GetControllingUnknown<span style=\"color: #808030;\">(<\/span><span style=\"color: #808030;\">)<\/span><span style=\"color: #808030;\">)<\/span><\/pre>\n<p>A partial Visual C++ .NET 2008 source code is <a href=\"http:\/\/code.assembla.com\/roatl-utilities\/subversion\/nodes\/trunk\/FilterGraphSpy\">available from SVN<\/a>, release binary <a href=\"http:\/\/code.assembla.com\/roatl-utilities\/subversion\/nodes\/trunk\/FilterGraphSpy\/Release%20Trace\/FilterGraphSpy.dll?format=raw\">included<\/a>.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>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&hellip; <\/p>\n<p><a class=\"moretag\" href=\"https:\/\/alax.info\/blog\/930\">Read the full article<\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[11,2],"tags":[487,78,119,163,204,205,203,202,164],"class_list":["post-930","post","type-post","status-publish","format-standard","hentry","category-atl","category-utilities","tag-atl","tag-directshow","tag-filter","tag-graph","tag-graphedit","tag-graphstudio","tag-moniker","tag-rot","tag-spy"],"_links":{"self":[{"href":"https:\/\/alax.info\/blog\/wp-json\/wp\/v2\/posts\/930","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/alax.info\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/alax.info\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/alax.info\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/alax.info\/blog\/wp-json\/wp\/v2\/comments?post=930"}],"version-history":[{"count":0,"href":"https:\/\/alax.info\/blog\/wp-json\/wp\/v2\/posts\/930\/revisions"}],"wp:attachment":[{"href":"https:\/\/alax.info\/blog\/wp-json\/wp\/v2\/media?parent=930"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/alax.info\/blog\/wp-json\/wp\/v2\/categories?post=930"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/alax.info\/blog\/wp-json\/wp\/v2\/tags?post=930"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}