summaryrefslogtreecommitdiff
path: root/plugins/AssocMgr/src/dde.cpp
diff options
context:
space:
mode:
authorGeorge Hazan <ghazan@miranda.im>2017-11-25 23:13:02 +0300
committerGeorge Hazan <ghazan@miranda.im>2017-11-25 23:13:02 +0300
commit4657d391c9f213c788e32347c083f2699aed672e (patch)
tree4c8d0376046ed3eec758534d5cd2f0a97dba48ce /plugins/AssocMgr/src/dde.cpp
parent71d2aa24a344c6e45d4632ea99fa1e5006367733 (diff)
more accurate solution for AssocMgr that doesn't change current working directory
Diffstat (limited to 'plugins/AssocMgr/src/dde.cpp')
-rw-r--r--plugins/AssocMgr/src/dde.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/plugins/AssocMgr/src/dde.cpp b/plugins/AssocMgr/src/dde.cpp
index 0e9d29fb0e..d1b4f30fa5 100644
--- a/plugins/AssocMgr/src/dde.cpp
+++ b/plugins/AssocMgr/src/dde.cpp
@@ -185,15 +185,16 @@ static HANDLE StartupMainProcess(wchar_t *pszDatabasePath)
// entry point for RunDll32, this is also WaitForDDEW
EXTERN_C __declspec(dllexport) void CALLBACK WaitForDDE(HWND, HINSTANCE, wchar_t *pszCmdLine, int)
{
- HANDLE pHandles[2];
- DWORD dwTick;
+ // executed to initialize path for delay-loaded libraries
+ DynamicLoadInit();
/* wait for dde window to be available (avoiding race condition) */
+ HANDLE pHandles[2];
pHandles[0] = CreateEvent(nullptr, TRUE, FALSE, WNDCLASS_DDEMSGWINDOW);
if (pHandles[0] != nullptr) {
pHandles[1] = StartupMainProcess(pszCmdLine); /* obeys nCmdShow using GetStartupInfo() */
if (pHandles[1] != nullptr) {
- dwTick = GetTickCount();
+ DWORD dwTick = GetTickCount();
/* either process terminated or dde window created */
if (WaitForMultipleObjects(_countof(pHandles), pHandles, FALSE, DDEMESSAGETIMEOUT) == WAIT_OBJECT_0) {
dwTick = GetTickCount() - dwTick;