diff options
Diffstat (limited to 'plugins/AssocMgr/src/main.cpp')
-rw-r--r-- | plugins/AssocMgr/src/main.cpp | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/plugins/AssocMgr/src/main.cpp b/plugins/AssocMgr/src/main.cpp index ddc2075d52..10bd63eaf9 100644 --- a/plugins/AssocMgr/src/main.cpp +++ b/plugins/AssocMgr/src/main.cpp @@ -21,6 +21,8 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #include "stdafx.h"
+#pragma comment(lib, "delayimp.lib")
+
HINSTANCE hInst;
static HANDLE hHookModulesLoaded;
int hLangpack;
@@ -39,6 +41,25 @@ PLUGININFOEX pluginInfo = { {0x52685cd7, 0xec7, 0x44c1, {0xa1, 0xa6, 0x38, 0x16, 0x12, 0x41, 0x82, 0x2}}
};
+/////////////////////////////////////////////////////////////////////////////////////////
+// if we run here, we're running from the command prompt
+
+static bool bPathSet = false;
+
+FARPROC WINAPI myDliHook(unsigned dliNotify, PDelayLoadInfo)
+{
+ if (dliNotify == dliNotePreLoadLibrary && !bPathSet) {
+ bPathSet = true;
+ SetCurrentDirectoryW(L"Libs");
+ LoadLibraryW(L"ucrtbase.dll");
+ }
+ return NULL;
+}
+
+PfnDliHook __pfnDliNotifyHook2 = &myDliHook;
+
+/////////////////////////////////////////////////////////////////////////////////////////
+
BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD, LPVOID)
{
hInst = hinstDLL;
|