gbe_fork/steamclient/steamclient.cpp

22 lines
553 B
C++
Raw Normal View History

2024-05-24 16:01:25 +08:00
#define WIN32_LEAN_AND_MEAN
2024-08-25 01:57:23 +08:00
// #include "dll.h"
2019-04-14 00:21:56 +08:00
#include "Windows.h"
2024-08-25 01:57:23 +08:00
2019-04-14 00:21:56 +08:00
#ifdef _WIN64
#define DLL_NAME "steam_api64.dll"
#else
#define DLL_NAME "steam_api.dll"
#endif
2024-08-25 01:57:23 +08:00
extern "C" __declspec(dllexport) void *CreateInterface(const char *pName, int *pReturnCode)
2019-04-14 00:21:56 +08:00
{
2024-08-25 01:57:23 +08:00
// PRINT_DEBUG("%s", pName);
2019-04-14 00:21:56 +08:00
HMODULE steam_api = LoadLibraryA(DLL_NAME);
2024-08-25 01:57:23 +08:00
void *(__stdcall * create_interface)(const char *) = reinterpret_cast<void *(__stdcall *)(const char *)>(GetProcAddress(steam_api, "SteamInternal_CreateInterface"));
2019-04-14 00:21:56 +08:00
return create_interface(pName);
}