Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- * steam_api.dll
- *
- * Generated from steam_api.dll by winedump.
- *
- * DO NOT SUBMIT GENERATED DLLS FOR INCLUSION INTO WINE!
- *
- */
- #include "config.h"
- #include <stdarg.h>
- #include <dlfcn.h>
- #include "windef.h"
- #include "winbase.h"
- #include "wine/debug.h"
- #include "steam_api_header.h"
- WINE_DEFAULT_DEBUG_CHANNEL(steam_api);
- struct _funcs_t {
- const char * fName;
- void (*ptr)();
- };
- void stubFn(void) {
- TRACE("steam_api.STUB\n");
- }
- #define STUB stubFn
- static struct _funcs_t funcs[] = {
- { "GetHSteamPipe", STUB }, { "GetHSteamUser", STUB }, { "SteamAPI_GetHSteamPipe", STUB }, { "SteamAPI_GetHSteamUser", STUB }, { "SteamAPI_GetSteamInstallPath", STUB },
- { "SteamAPI_InitSafe", STUB }, { "SteamAPI_Init", STUB }, { "SteamAPI_IsSteamRunning", STUB }, { "SteamAPI_RegisterCallback", STUB }, { "SteamAPI_RegisterCallResult", STUB },
- { "SteamAPI_UnregisterCallback", STUB }, // 10
- { "SteamAPI_UnregisterCallResult", STUB }, { "SteamAPI_RestartAppIfNecessary", STUB }, { "SteamAPI_RunCallbacks", STUB }, { "SteamAPI_SetBreakpadAppID", STUB },
- { "SteamAPI_SetMiniDumpComment", STUB }, { "SteamAPI_SetTryCatchCallbacks", STUB }, { "SteamAPI_Shutdown", STUB }, { "SteamAPI_UseBreakpadCrashHandler", STUB },
- { "SteamAPI_WriteMiniDump", STUB },
- { "SteamApps", STUB }, // 20
- { "SteamClient", STUB }, { "SteamContentServer", STUB }, { "SteamContentServerUtils", STUB }, { "SteamContentServer_Init", STUB }, { "SteamContentServer_RunCallbacks", STUB },
- { "SteamFriends", STUB }, { "SteamGameServer", STUB }, { "SteamGameServerUtils", STUB }, { "SteamMasterServerUpdater", STUB },
- { "SteamGameServerNetworking", STUB }, // 30
- { "SteamGameServerStats", STUB }, { "SteamGameServer_BSecure", STUB }, { "SteamGameServer_GetHSteamPipe", STUB }, { "SteamGameServer_GetHSteamUser", STUB },
- { "SteamGameServer_GetIPCCallCount", STUB }, { "SteamGameServer_GetSteamID", STUB }, { "SteamGameServer_Init", STUB }, { "SteamGameServer_InitSafe", STUB },
- { "SteamGameServer_RunCallbacks", STUB },
- { "SteamContentServer_Shutdown", STUB }, // 40
- { "SteamMatchmaking", STUB }, { "SteamMatchmakingServers", STUB }, { "SteamNetworking", STUB }, { "SteamRemoteStorage", STUB },
- { "SteamUser", STUB }, { "SteamUserStats", STUB }, { "SteamUtils", STUB }, { "Steam_GetHSteamUserCurrent", STUB }, { "Steam_RegisterInterfaceFuncs", STUB },
- { "Steam_RunCallbacks", STUB }, // 50
- { "SteamHTTP", STUB },
- { "SteamScreenshots", STUB }
- };
- #define JUMP(a) \
- TRACE("call proxy \n"); \
- asm("movl %0,%%eax; jmp %%eax" :: "r"(*funcs[a].ptr));
- S_API HSteamPipe STEAM_CALL
- GetHSteamPipe()
- {
- // 0
- JUMP(0);
- return 0;
- }
- S_API HSteamUser STEAM_CALL
- GetHSteamUser()
- {
- // 1
- JUMP(1);
- return 0;
- }
- S_API HSteamPipe STEAM_CALL
- SteamAPI_GetHSteamPipe()
- {
- // 2
- JUMP(2);
- return 0;
- }
- S_API HSteamUser STEAM_CALL
- SteamAPI_GetHSteamUser()
- {
- // 3
- JUMP(3);
- return 0;
- }
- S_API const char* STEAM_CALL
- SteamAPI_GetSteamInstallPath()
- {
- // 4
- JUMP(4);
- return NULL;
- }
- S_API bool STEAM_CALL
- SteamAPI_InitSafe()
- {
- // 5
- JUMP(5);
- return 0;
- }
- S_API bool STEAM_CALL
- SteamAPI_Init()
- {
- // 6
- JUMP(6);
- return 0;
- }
- S_API bool
- SteamAPI_IsSteamRunning()
- {
- // 7
- JUMP(7);
- return 1;
- }
- S_API void
- SteamAPI_RegisterCallback( PCallbackBase pCallback, int iCallback )
- {
- // 8
- JUMP(8);
- }
- S_API void
- SteamAPI_RegisterCallResult( PCallbackBase pCallback, SteamAPICall_t hAPICall )
- {
- // 9
- JUMP(9);
- }
- S_API void
- SteamAPI_UnregisterCallback( PCallbackBase pCallback )
- {
- // 10
- JUMP(10);
- }
- S_API void
- SteamAPI_UnregisterCallResult( PCallbackBase pCallback, SteamAPICall_t hAPICall )
- {
- // 11
- JUMP(11);
- }
- S_API bool
- SteamAPI_RestartAppIfNecessary( uint32_t unOwnAppID )
- {
- // 12
- JUMP(12);
- return 0;
- }
- S_API void
- SteamAPI_RunCallbacks()
- {
- // 13
- JUMP(13);
- }
- S_API void
- SteamAPI_SetBreakpadAppID( uint32_t unAppID )
- {
- // 14
- JUMP(14);
- }
- S_API void
- SteamAPI_SetMiniDumpComment( const char *pchMsg )
- {
- // 15
- JUMP(15);
- }
- S_API void STEAM_CALL
- SteamAPI_SetTryCatchCallbacks( bool bTryCatchCallbacks )
- {
- // 16
- JUMP(16);
- }
- S_API void
- SteamAPI_Shutdown()
- {
- // 17
- JUMP(17);
- }
- S_API void
- SteamAPI_UseBreakpadCrashHandler( char const *pchVersion, char const *pchDate, char const *pchTime, bool bFullMemoryDumps, void *pvContext, PFNPreMinidumpCallback m_pfnPreMinidumpCallback )
- {
- // 18
- JUMP(18);
- }
- S_API void
- SteamAPI_WriteMiniDump( uint32_t uStructuredExceptionCode, void* pvExceptionInfo, uint32_t uBuildID )
- {
- // 19
- JUMP(19);
- }
- S_API_UNSAFE /* ISteamApps003*/ void* STEAM_CALL
- SteamApps()
- {
- // 20
- JUMP(20);
- return NULL;
- }
- S_API_UNSAFE /* ISteamClient009*/ void* STEAM_CALL
- SteamClient()
- {
- // 21
- JUMP(21);
- return NULL;
- }
- S_API_UNSAFE /* ISteamContentServer002*/ void* STEAM_CALL
- SteamContentServer()
- {
- // 22
- JUMP(22);
- return NULL;
- }
- S_API_UNSAFE /* ISteamUtils005*/ void* STEAM_CALL
- SteamContentServerUtils()
- {
- // 23
- JUMP(23);
- return NULL;
- }
- S_API bool STEAM_CALL
- SteamContentServer_Init(uint32_t unIP, uint16_t usPort)
- {
- // 24
- JUMP(24);
- return 0;
- }
- S_API void STEAM_CALL
- SteamContentServer_RunCallbacks()
- {
- // 25
- JUMP(25);
- }
- S_API_UNSAFE /* ISteamFriends005*/ void* STEAM_CALL
- SteamFriends()
- {
- // 26
- JUMP(26);
- return NULL;
- }
- S_API_UNSAFE /* ISteamGameServer010*/ void* STEAM_CALL
- SteamGameServer()
- {
- // 27
- JUMP(27);
- return NULL;
- }
- S_API_UNSAFE /* ISteamUtils005*/ void* STEAM_CALL
- SteamGameServerUtils()
- {
- // 28
- JUMP(28);
- return NULL;
- }
- S_API_UNSAFE /* ISteamMasterServerUpdater001*/ void* STEAM_CALL
- SteamMasterServerUpdater()
- {
- // 29
- JUMP(29);
- return NULL;
- }
- S_API_UNSAFE /* ISteamNetworking003*/ void* STEAM_CALL
- SteamGameServerNetworking()
- {
- // 30
- JUMP(30);
- return NULL;
- }
- S_API_UNSAFE /* ISteamGameServerStats001*/ void* STEAM_CALL
- SteamGameServerStats()
- {
- // 31
- JUMP(31);
- return NULL;
- }
- S_API bool STEAM_CALL
- SteamGameServer_BSecure()
- {
- // 32
- JUMP(32);
- return 0;
- }
- S_API HSteamPipe STEAM_CALL
- SteamGameServer_GetHSteamPipe()
- {
- // 33
- JUMP(33);
- return 0;
- }
- S_API HSteamUser STEAM_CALL
- SteamGameServer_GetHSteamUser()
- {
- // 34
- JUMP(34);
- return 0;
- }
- S_API int32_t STEAM_CALL
- SteamGameServer_GetIPCCallCount()
- {
- // 35
- JUMP(35);
- return 0;
- }
- S_API uint64_t STEAM_CALL
- SteamGameServer_GetSteamID()
- {
- // 36
- JUMP(36);
- return 0;
- }
- S_API bool STEAM_CALL
- SteamGameServer_Init( uint32_t unIP, uint16_t usPort, uint16_t usGamePort, uint16_t usSpectatorPort, uint16_t usQueryPort, enum EServerMode eServerMode, const char *pchGameDir, const char *pchVersionString )
- {
- // 37
- JUMP(37);
- return 0;
- }
- S_API bool STEAM_CALL
- SteamGameServer_InitSafe( uint32_t unIP, uint16_t usPort, uint16_t usGamePort, uint16_t usSpectatorPort, uint16_t usQueryPort, enum EServerMode eServerMode, const char *pchGameDir, const char *pchVersionString )
- {
- // 38
- JUMP(38);
- return 0;
- }
- S_API void STEAM_CALL
- SteamGameServer_RunCallbacks()
- {
- // 39
- JUMP(39);
- }
- S_API void STEAM_CALL
- SteamContentServer_Shutdown()
- {
- // 40
- JUMP(40);
- }
- S_API_UNSAFE /* ISteamMatchmaking008*/ void* STEAM_CALL
- SteamMatchmaking()
- {
- // 41
- JUMP(41);
- return NULL;
- }
- S_API_UNSAFE /* ISteamMatchmakingServers002*/ void* STEAM_CALL
- SteamMatchmakingServers()
- {
- // 42
- JUMP(42);
- return NULL;
- }
- S_API_UNSAFE /* ISteamNetworking003*/ void* STEAM_CALL
- SteamNetworking()
- {
- // 43
- JUMP(43);
- return NULL;
- }
- S_API_UNSAFE /*ISteamRemoteStorage002*/ void* STEAM_CALL
- SteamRemoteStorage()
- {
- // 44
- JUMP(44);
- return NULL;
- }
- S_API_UNSAFE /* ISteamUser013*/ void* STEAM_CALL
- SteamUser()
- {
- // 45
- JUMP(45);
- return NULL;
- }
- S_API_UNSAFE /*ISteamUserStats007*/ void* STEAM_CALL
- SteamUserStats()
- {
- // 46
- JUMP(46);
- return NULL;
- }
- S_API_UNSAFE /*ISteamUtils005*/ void* STEAM_CALL
- SteamUtils()
- {
- // 47
- JUMP(47);
- return NULL;
- }
- S_API HSteamUser STEAM_CALL
- Steam_GetHSteamUserCurrent()
- {
- // 48
- JUMP(48);
- return 0;
- }
- S_API void STEAM_CALL
- Steam_RegisterInterfaceFuncs( void *hModule )
- {
- // 49
- JUMP(49);
- }
- S_API void STEAM_CALL
- Steam_RunCallbacks( HSteamPipe hSteamPipe, bool bGameServerCallbacks )
- {
- // 50
- JUMP(50);
- }
- S_API /*ISteamClient009 */ void *g_pSteamClientGameServer; // ??
- // SteamHTTP() - unknown // 51
- // SteamScreenshots - unknown // 52
- void * libsteam_api(void) {
- void *h = dlopen("/home/geek/Steam/SteamApps/common/Trine 2/lib/lib32/libsteam_api.so", RTLD_NOW);
- return h;
- }
- void fill_table(void *lib) {
- int i = 0;
- for (i=0; i<53; i++) {
- void *p = dlsym(lib,funcs[i].fName);
- if (p) {
- funcs[i].ptr = p;
- } else {
- TRACE("unknown symbol '%s' - leave stub\n", funcs[i].fName);
- }
- }
- }
- BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved)
- {
- TRACE("(0x%p, %d, %p)\n", hinstDLL, fdwReason, lpvReserved);
- fill_table(libsteam_api());
- switch (fdwReason)
- {
- case DLL_WINE_PREATTACH:
- return TRUE; /* prefer native version */
- case DLL_PROCESS_ATTACH:
- DisableThreadLibraryCalls(hinstDLL);
- break;
- case DLL_PROCESS_DETACH:
- break;
- }
- return TRUE;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement