diff options
| author | Jørgen P. Tjernø <[email protected]> | 2013-12-02 19:31:46 -0800 |
|---|---|---|
| committer | Jørgen P. Tjernø <[email protected]> | 2013-12-02 19:46:31 -0800 |
| commit | f56bb35301836e56582a575a75864392a0177875 (patch) | |
| tree | de61ddd39de3e7df52759711950b4c288592f0dc /mp/src/utils/vvis_launcher/vvis_launcher.cpp | |
| parent | Mark some more files as text. (diff) | |
| download | source-sdk-2013-f56bb35301836e56582a575a75864392a0177875.tar.xz source-sdk-2013-f56bb35301836e56582a575a75864392a0177875.zip | |
Fix line endings. WHAMMY.
Diffstat (limited to 'mp/src/utils/vvis_launcher/vvis_launcher.cpp')
| -rw-r--r-- | mp/src/utils/vvis_launcher/vvis_launcher.cpp | 158 |
1 files changed, 79 insertions, 79 deletions
diff --git a/mp/src/utils/vvis_launcher/vvis_launcher.cpp b/mp/src/utils/vvis_launcher/vvis_launcher.cpp index 6d628040..edf03d25 100644 --- a/mp/src/utils/vvis_launcher/vvis_launcher.cpp +++ b/mp/src/utils/vvis_launcher/vvis_launcher.cpp @@ -1,79 +1,79 @@ -//========= Copyright Valve Corporation, All rights reserved. ============//
-//
-// Purpose:
-//
-// $NoKeywords: $
-//
-//=============================================================================//
-// vvis_launcher.cpp : Defines the entry point for the console application.
-//
-
-#include "stdafx.h"
-#include <direct.h>
-#include "tier1/strtools.h"
-#include "tier0/icommandline.h"
-#include "ilaunchabledll.h"
-
-
-
-char* GetLastErrorString()
-{
- static char err[2048];
-
- LPVOID lpMsgBuf;
- FormatMessage(
- FORMAT_MESSAGE_ALLOCATE_BUFFER |
- FORMAT_MESSAGE_FROM_SYSTEM |
- FORMAT_MESSAGE_IGNORE_INSERTS,
- NULL,
- GetLastError(),
- MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), // Default language
- (LPTSTR) &lpMsgBuf,
- 0,
- NULL
- );
-
- strncpy( err, (char*)lpMsgBuf, sizeof( err ) );
- LocalFree( lpMsgBuf );
-
- err[ sizeof( err ) - 1 ] = 0;
-
- return err;
-}
-
-
-int main(int argc, char* argv[])
-{
- CommandLine()->CreateCmdLine( argc, argv );
- const char *pDLLName = "vvis_dll.dll";
-
- CSysModule *pModule = Sys_LoadModule( pDLLName );
- if ( !pModule )
- {
- printf( "vvis launcher error: can't load %s\n%s", pDLLName, GetLastErrorString() );
- return 1;
- }
-
- CreateInterfaceFn fn = Sys_GetFactory( pModule );
- if( !fn )
- {
- printf( "vvis launcher error: can't get factory from %s\n", pDLLName );
- Sys_UnloadModule( pModule );
- return 2;
- }
-
- int retCode = 0;
- ILaunchableDLL *pDLL = (ILaunchableDLL*)fn( LAUNCHABLE_DLL_INTERFACE_VERSION, &retCode );
- if( !pDLL )
- {
- printf( "vvis launcher error: can't get IVVisDLL interface from %s\n", pDLLName );
- Sys_UnloadModule( pModule );
- return 3;
- }
-
- pDLL->main( argc, argv );
- Sys_UnloadModule( pModule );
-
- return 0;
-}
-
+//========= Copyright Valve Corporation, All rights reserved. ============// +// +// Purpose: +// +// $NoKeywords: $ +// +//=============================================================================// +// vvis_launcher.cpp : Defines the entry point for the console application. +// + +#include "stdafx.h" +#include <direct.h> +#include "tier1/strtools.h" +#include "tier0/icommandline.h" +#include "ilaunchabledll.h" + + + +char* GetLastErrorString() +{ + static char err[2048]; + + LPVOID lpMsgBuf; + FormatMessage( + FORMAT_MESSAGE_ALLOCATE_BUFFER | + FORMAT_MESSAGE_FROM_SYSTEM | + FORMAT_MESSAGE_IGNORE_INSERTS, + NULL, + GetLastError(), + MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), // Default language + (LPTSTR) &lpMsgBuf, + 0, + NULL + ); + + strncpy( err, (char*)lpMsgBuf, sizeof( err ) ); + LocalFree( lpMsgBuf ); + + err[ sizeof( err ) - 1 ] = 0; + + return err; +} + + +int main(int argc, char* argv[]) +{ + CommandLine()->CreateCmdLine( argc, argv ); + const char *pDLLName = "vvis_dll.dll"; + + CSysModule *pModule = Sys_LoadModule( pDLLName ); + if ( !pModule ) + { + printf( "vvis launcher error: can't load %s\n%s", pDLLName, GetLastErrorString() ); + return 1; + } + + CreateInterfaceFn fn = Sys_GetFactory( pModule ); + if( !fn ) + { + printf( "vvis launcher error: can't get factory from %s\n", pDLLName ); + Sys_UnloadModule( pModule ); + return 2; + } + + int retCode = 0; + ILaunchableDLL *pDLL = (ILaunchableDLL*)fn( LAUNCHABLE_DLL_INTERFACE_VERSION, &retCode ); + if( !pDLL ) + { + printf( "vvis launcher error: can't get IVVisDLL interface from %s\n", pDLLName ); + Sys_UnloadModule( pModule ); + return 3; + } + + pDLL->main( argc, argv ); + Sys_UnloadModule( pModule ); + + return 0; +} + |