summaryrefslogtreecommitdiff
path: root/utils/vtex/vtex_launcher.cpp
diff options
context:
space:
mode:
authorFluorescentCIAAfricanAmerican <[email protected]>2020-04-22 12:56:21 -0400
committerFluorescentCIAAfricanAmerican <[email protected]>2020-04-22 12:56:21 -0400
commit3bf9df6b2785fa6d951086978a3e66f49427166a (patch)
tree2c0f1f0c63c4832882bc93814ebd2c2b1c6224e5 /utils/vtex/vtex_launcher.cpp
downloadarchived-source-engine-2018-hl2-src-master.tar.xz
archived-source-engine-2018-hl2-src-master.zip
Diffstat (limited to 'utils/vtex/vtex_launcher.cpp')
-rw-r--r--utils/vtex/vtex_launcher.cpp46
1 files changed, 46 insertions, 0 deletions
diff --git a/utils/vtex/vtex_launcher.cpp b/utils/vtex/vtex_launcher.cpp
new file mode 100644
index 0000000..cd1842f
--- /dev/null
+++ b/utils/vtex/vtex_launcher.cpp
@@ -0,0 +1,46 @@
+//========= Copyright Valve Corporation, All rights reserved. ============//
+//
+// Purpose:
+//
+// $NoKeywords: $
+//=============================================================================//
+
+#include <stdio.h>
+#include "tier1/interface.h"
+#include "ilaunchabledll.h"
+
+
+int main( int argc, char **argv )
+{
+ const char *pModuleName = "vtex_dll.dll";
+
+ CSysModule *pModule = Sys_LoadModule( pModuleName );
+ if ( !pModule )
+ {
+ printf( "Can't load %s.", pModuleName );
+ return 1;
+ }
+
+ CreateInterfaceFn fn = Sys_GetFactory( pModule );
+ if ( !fn )
+ {
+ printf( "Can't get factory from %s.", pModuleName );
+ Sys_UnloadModule( pModule );
+ return 1;
+ }
+
+ ILaunchableDLL *pInterface = (ILaunchableDLL*)fn( LAUNCHABLE_DLL_INTERFACE_VERSION, NULL );
+ if ( !pInterface )
+ {
+ printf( "Can't get '%s' interface from %s.", LAUNCHABLE_DLL_INTERFACE_VERSION, pModuleName );
+ Sys_UnloadModule( pModule );
+ return 1;
+ }
+
+ int iRet = pInterface->main( argc, argv );
+ Sys_UnloadModule( pModule );
+ return iRet;
+}
+
+
+