1
0
mirror of https://github.com/alliedmodders/hl2sdk.git synced 2025-01-09 10:39:03 +08:00
hl2sdk/public/tier0/interface.h
Nick Hastings f60592b4f9 More Source 2 / Dota shuffling.
- Remove tier1 interface/factory funcs that no longer exist.
- Add/fix tier0 interface funcs.
- Fix tier0 win64 link lib to have correct decorated names for Msg, Warning, etc.
- Update Error() shim to act more closely to old behavior.
- Moved CreateInterface impl to interfaces lib (appears to not be in tier1 anymore).
- Removed exports log channels that aren't exported in S2.
2018-06-30 08:15:58 -04:00

48 lines
1.8 KiB
C

//========= Copyright ? 1996-2005, Valve Corporation, All rights reserved. ============//
//
// Purpose:
//
// $NoKeywords: $
//
//=============================================================================//
#pragma once
#include "platform.h"
#if defined( _WIN32 ) && !defined( _X360 )
#define WIN32_LEAN_AND_MEAN
#include "windows.h"
#endif
#if !defined COMPILER_MSVC && !defined HMODULE
#define HMODULE void *
#endif
//-----------------------------------------------------------------------------
// Interface creation function
//-----------------------------------------------------------------------------
typedef void* (*CreateInterfaceFn)(const char *pName, int *pReturnCode);
//-----------------------------------------------------------------------------
// Load & Unload should be called in exactly one place for each module
// The factory for that module should be passed on to dependent components for
// proper versioning.
//-----------------------------------------------------------------------------
PLATFORM_INTERFACE HMODULE Plat_LoadModule( const char *pModuleName );
PLATFORM_INTERFACE void Plat_UnloadModule( HMODULE module );
// Determines if current process is running with any debug modules
PLATFORM_INTERFACE bool Plat_RunningWithDebugModules();
PLATFORM_INTERFACE HMODULE Plat_FindModuleByAddress( void *pAddress );
PLATFORM_INTERFACE CreateInterfaceFn Plat_GetModuleInterfaceFactory( HMODULE module, int *pReturnCode = NULL );
// This is a helper function to load a module, get its factory, and get a specific interface.
// You are expected to free all of these things.
// Returns false and cleans up if any of the steps fail.
PLATFORM_INTERFACE bool Plat_LoadInterface(
const char *pModuleName,
const char *pInterfaceVersionName,
HMODULE *pOutModule,
void **pOutInterface );