{"id":2171,"date":"2021-04-18T13:41:53","date_gmt":"2021-04-18T11:41:53","guid":{"rendered":"https:\/\/alax.info\/blog\/?p=2171"},"modified":"2021-04-18T13:41:53","modified_gmt":"2021-04-18T11:41:53","slug":"directshow-filter-built-with-visual-studio-2019-preview-to-run-on-windows-server-2012","status":"publish","type":"post","link":"https:\/\/alax.info\/blog\/2171","title":{"rendered":"DirectShow filter built with Visual Studio 2019 Preview to run on Windows Server 2012"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">I pushed a few commits to my fork of DirectShow Win7 Samples (BaseClasses library specifically). <\/p>\n\n\n\n<figure class=\"wp-block-embed is-type-wp-embed is-provider-fooling-around wp-block-embed-fooling-around\"><div class=\"wp-block-embed__wrapper\">\n<blockquote class=\"wp-embedded-content\" data-secret=\"JZPdOi09Gs\"><a href=\"https:\/\/alax.info\/blog\/2157\">Windows SDK DirectShow Samples adapted for Visual Studio 2019<\/a><\/blockquote><iframe loading=\"lazy\" class=\"wp-embedded-content\" sandbox=\"allow-scripts\" security=\"restricted\" style=\"position: absolute; clip: rect(1px, 1px, 1px, 1px);\" title=\"&#8220;Windows SDK DirectShow Samples adapted for Visual Studio 2019&#8221; &#8212; Fooling Around\" src=\"https:\/\/alax.info\/blog\/2157\/embed#?secret=JZPdOi09Gs\" data-secret=\"JZPdOi09Gs\" width=\"600\" height=\"338\" frameborder=\"0\" marginwidth=\"0\" marginheight=\"0\" scrolling=\"no\"><\/iframe>\n<\/div><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">One of small problems I happened to deal with is that a filter built with current\/recent toolset produces code incompatible with legacy operating systems, which are still widely present in the wild. This could be solved by using outdated versions of Visual Studio, outdated Windows SDK etc. This is however not really necessary because even Visual Studio 2019 Preview builds DirectShow code perfectly (including using <code>v142<\/code> toolset), and you are generally not limited in using 30 year old codebase alone. I had a filter using <a href=\"https:\/\/github.com\/Microsoft\/wil\">Windows Implementation Libraries (WIL)<\/a> helpers, C++17 code and C++\/WinRT for COM object implementation, however a few rough places of BaseClasses resulted in filter binary incompatible with Windows Server 2012 runtime.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">A bit of massaging of BaseClasses fixed the problem. I also enabled SDL checks (and this made me fix something <a href=\"https:\/\/docs.microsoft.com\/en-us\/windows\/win32\/directshow\/coutputqueue\"><code>COutputQueue<\/code> <\/a>implementation &#8211; not really a bug, but it could be more accurate, and got rid of strsafe.h in favor of safe CRT string functions.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">While doing that, I noticed that ancient <a href=\"https:\/\/docs.microsoft.com\/en-us\/windows\/win32\/api\/winbase\/nf-winbase-lstrcmpw\"><code>lstrcmpW<\/code> <\/a>API function is documented <a href=\"https:\/\/github.com\/MicrosoftDocs\/sdk-api\/pull\/741\/files\">incorrectly<\/a> on MSDN.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I pushed a few commits to my fork of DirectShow Win7 Samples (BaseClasses library specifically). One of small problems I happened to deal with is that a filter built with current\/recent toolset produces code incompatible with legacy operating systems, which are still widely present in the wild. This could be solved by using outdated versions&hellip; <\/p>\n<p><a class=\"moretag\" href=\"https:\/\/alax.info\/blog\/2171\">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":[1],"tags":[78],"class_list":["post-2171","post","type-post","status-publish","format-standard","hentry","category-uncategorized","tag-directshow"],"_links":{"self":[{"href":"https:\/\/alax.info\/blog\/wp-json\/wp\/v2\/posts\/2171","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=2171"}],"version-history":[{"count":0,"href":"https:\/\/alax.info\/blog\/wp-json\/wp\/v2\/posts\/2171\/revisions"}],"wp:attachment":[{"href":"https:\/\/alax.info\/blog\/wp-json\/wp\/v2\/media?parent=2171"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/alax.info\/blog\/wp-json\/wp\/v2\/categories?post=2171"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/alax.info\/blog\/wp-json\/wp\/v2\/tags?post=2171"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}