Fix proxy

This commit is contained in:
kynex7510 2024-06-02 17:10:44 +02:00
parent 9b361b11b8
commit fe7d24cd01
No known key found for this signature in database
GPG key ID: 8BBB0FD2C57920AD
3 changed files with 9 additions and 10 deletions

View file

@ -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"

View file

@ -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());

View file

@ -0,0 +1,3 @@
LIBRARY XINPUT1_4
EXPORTS
XInputGetAudioDeviceIds @2