-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
added delayhook to fix delay-load issues
- Loading branch information
1 parent
7179b3d
commit 1e1129b
Showing
2 changed files
with
22 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
#ifndef WIN32_LEAN_AND_MEAN | ||
#define WIN32_LEAN_AND_MEAN | ||
#endif | ||
|
||
#include <windows.h> | ||
#include <delayimp.h> | ||
#include <string.h> | ||
|
||
static FARPROC WINAPI delayHook(unsigned int dliNotify, DelayLoadInfo* dli) { | ||
HMODULE m; | ||
if (dliNotify != dliNotePreLoadLibrary) | ||
return NULL; | ||
|
||
if (_stricmp(dli->szDll, "node.exe") != 0) | ||
return NULL; | ||
|
||
m = GetModuleHandle(NULL); | ||
return (FARPROC) m; | ||
} | ||
|
||
PfnDliHook __pfnDliNotifyHook2 = delayHook; |