Something went wrong. Try again.
All-in-one editor for Paper Mario (N64) mods diorama64.starhaven.dev
Something went wrong. Try again.
12345678910111213141516171819202122// SPDX-FileCopyrightText: 2026 Alexander Bates <alex@bates64.com>//// SPDX-License-Identifier: 0BSD
// Lets a native module built with MinGW find Node-API in the app's own// executable, whatever it's named. The module links against node.exe, as// node-gyp's do, but loads it lazily, and this hook hands the loader the// running executable instead. node-gyp's own hook only compiles under MSVC.
#define WIN32_LEAN_AND_MEAN#include <windows.h>#include <delayimp.h>#include <string.h>
static FARPROC WINAPI load_exe_hook(unsigned int event, DelayLoadInfo* info) { if (event != dliNotePreLoadLibrary || _stricmp(info->szDll, "node.exe") != 0) return NULL; return (FARPROC) GetModuleHandle(NULL);}
PfnDliHook __pfnDliNotifyHook2 = load_exe_hook;