Team Fortress 2 Source Code as on 22/4/2020
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

46 lines
1009 B

  1. //========= Copyright Valve Corporation, All rights reserved. ============//
  2. //
  3. // Purpose:
  4. //
  5. // $NoKeywords: $
  6. //=============================================================================//
  7. #include <stdio.h>
  8. #include "tier1/interface.h"
  9. #include "ilaunchabledll.h"
  10. int main( int argc, char **argv )
  11. {
  12. const char *pModuleName = "vtex_dll.dll";
  13. CSysModule *pModule = Sys_LoadModule( pModuleName );
  14. if ( !pModule )
  15. {
  16. printf( "Can't load %s.", pModuleName );
  17. return 1;
  18. }
  19. CreateInterfaceFn fn = Sys_GetFactory( pModule );
  20. if ( !fn )
  21. {
  22. printf( "Can't get factory from %s.", pModuleName );
  23. Sys_UnloadModule( pModule );
  24. return 1;
  25. }
  26. ILaunchableDLL *pInterface = (ILaunchableDLL*)fn( LAUNCHABLE_DLL_INTERFACE_VERSION, NULL );
  27. if ( !pInterface )
  28. {
  29. printf( "Can't get '%s' interface from %s.", LAUNCHABLE_DLL_INTERFACE_VERSION, pModuleName );
  30. Sys_UnloadModule( pModule );
  31. return 1;
  32. }
  33. int iRet = pInterface->main( argc, argv );
  34. Sys_UnloadModule( pModule );
  35. return iRet;
  36. }