extern "C" FARPROC __stdcall dllWin32GetProcAddress(HMODULE hModule, LPCSTR function) { // first check whether this function is one of the ones we need to wrap void *fixup = NULL; if (FunctionNeedsWrapping(win32_exports, function, &fixup)) return (FARPROC)fixup; // Nope return GetProcAddress(hModule, function); }
extern "C" FARPROC __stdcall dllWin32GetProcAddress(HMODULE hModule, LPCSTR function) { // if the high-order word is zero, then lpProcName is the function's ordinal value if (reinterpret_cast<uintptr_t>(function) > std::numeric_limits<WORD>::max()) { // first check whether this function is one of the ones we need to wrap void *fixup = NULL; if (FunctionNeedsWrapping(win32_exports, function, &fixup)) return (FARPROC)fixup; } // Nope return GetProcAddress(hModule, function); }
bool Win32DllLoader::ResolveImport(const char *dllName, const char *functionName, void **fixup) { return FunctionNeedsWrapping(win32_exports, functionName, fixup); }