mirror of
https://github.com/geode-sdk/geode.git
synced 2024-11-14 19:15:05 -05:00
Fix proxy
This commit is contained in:
parent
9b361b11b8
commit
fe7d24cd01
3 changed files with 9 additions and 10 deletions
|
@ -1,6 +1,6 @@
|
|||
cmake_minimum_required(VERSION 3.21)
|
||||
|
||||
add_library(ProxyLoader SHARED proxyLoader.cpp)
|
||||
add_library(ProxyLoader SHARED proxyLoader.cpp proxyLoader.def)
|
||||
set_target_properties(ProxyLoader PROPERTIES
|
||||
PREFIX ""
|
||||
OUTPUT_NAME "XInput1_4"
|
||||
|
|
|
@ -2,16 +2,12 @@
|
|||
#include <string>
|
||||
|
||||
// https://github.com/mrexodia/perfect-dll-proxy
|
||||
#define PROXY_PATH(export) \
|
||||
"/export:" #export "=\\\\.\\GLOBALROOT\\SystemRoot\\System32\\XInput1_4.dll." #export
|
||||
#define PROXY(export, ordinal) \
|
||||
"/export:" #export "=\\\\.\\GLOBALROOT\\SystemRoot\\System32\\XInput1_4.dll.#" #ordinal
|
||||
|
||||
#pragma comment(linker, PROXY_PATH(XInputEnable))
|
||||
#pragma comment(linker, PROXY_PATH(XInputGetAudioDeviceIds))
|
||||
#pragma comment(linker, PROXY_PATH(XInputGetBatteryInformation))
|
||||
#pragma comment(linker, PROXY_PATH(XInputGetCapabilities))
|
||||
#pragma comment(linker, PROXY_PATH(XInputGetKeystroke))
|
||||
#pragma comment(linker, PROXY_PATH(XInputGetState))
|
||||
#pragma comment(linker, PROXY_PATH(XInputSetState))
|
||||
// This is the only function required by libcocos2d.dll.
|
||||
#pragma comment(linker, PROXY(XInputGetAudioDeviceIds, 2))
|
||||
extern "C" void XInputGetAudioDeviceIds() {}
|
||||
|
||||
static std::wstring getErrorString() {
|
||||
return L"Could not load Geode. Error code: " + std::to_wstring(GetLastError());
|
||||
|
|
3
loader/launcher/windows/proxyLoader.def
Normal file
3
loader/launcher/windows/proxyLoader.def
Normal file
|
@ -0,0 +1,3 @@
|
|||
LIBRARY XINPUT1_4
|
||||
EXPORTS
|
||||
XInputGetAudioDeviceIds @2
|
Loading…
Reference in a new issue