1111#include < Versioning/BuildId.h>
1212#include < CommonUtilities/win/Utilities.h>
1313#include < PresentMonAPIWrapper/DiagnosticHandler.h>
14+ #include < PresentMonAPI2Loader/Loader.h>
1415#include < dwmapi.h>
1516
1617#pragma warning(push)
@@ -187,8 +188,6 @@ int APIENTRY WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLi
187188#else
188189 constexpr bool is_debug = true ;
189190#endif
190- // create logging system and ensure cleanup before main ext
191- LogChannelManager zLogMan_;
192191 // parse the command line arguments and make them globally available
193192 if (auto err = Options::Init (__argc, __argv, true )) {
194193 if (*err == 0 ) {
@@ -202,6 +201,12 @@ int APIENTRY WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLi
202201 return *err;
203202 }
204203 const auto & opt = Options::Get ();
204+ // optionally override the middleware dll path (typically when running from IDE in dev cycle)
205+ if (auto path = opt.middlewareDllPath .AsOptional ()) {
206+ pmLoaderSetPathToMiddlewareDll_ (path->c_str ());
207+ }
208+ // create logging system and ensure cleanup before main ext
209+ LogChannelManager zLogMan_;
205210 // wait for debugger connection
206211 if ((opt.cefType && *opt.cefType == " renderer" && opt.debugWaitRender ) ||
207212 (!opt.cefType && opt.debugWaitClient )) {
@@ -272,7 +277,7 @@ int APIENTRY WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLi
272277
273278 // code from here on is only executed by the root process (browser window process)
274279
275- pmlog_info (std::format (" == client section starting build#{} clean:{} ==" , BuildIdShortHash (), BuildIdDirtyFlag ()));
280+ pmlog_info (std::format (" == client section starting build#{} clean:{} ==" , BuildIdShortHash (), ! BuildIdDirtyFlag ()));
276281
277282 {
278283 auto & folderResolver = infra::util::FolderResolver::Get ();
0 commit comments