MCPcopy Create free account
hub / github.com/TorqueGameEngines/Torque3D / getExecutableInfo

Function getExecutableInfo

Engine/source/platformWin32/winFileio.cpp:844–883  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

842
843#ifdef UNICODE
844static void getExecutableInfo( StringTableEntry* path, StringTableEntry* exe )
845{
846 static StringTableEntry pathEntry = NULL;
847 static StringTableEntry exeEntry = NULL;
848
849 if( !pathEntry )
850 {
851 if (!Platform::getWebDeployment())
852 {
853 WCHAR cen_buf[ 2048 ];
854 GetModuleFileNameW( NULL, cen_buf, sizeof( cen_buf ) / sizeof( cen_buf[ 0 ] ) );
855 forwardslash( cen_buf );
856
857 WCHAR* delimiter = dStrrchr( cen_buf, '/' );
858 if( delimiter )
859 *delimiter = '\0';
860
861 char* pathBuf = createUTF8string( cen_buf );
862 char* exeBuf = createUTF8string( delimiter + 1 );
863
864 pathEntry = StringTable->insert( pathBuf );
865 exeEntry = StringTable->insert( exeBuf );
866
867 SAFE_DELETE_ARRAY( pathBuf );
868 SAFE_DELETE_ARRAY( exeBuf );
869 }
870 else
871 {
872 char cdir[4096];
873 GetCurrentDirectoryA(4096, cdir);
874 pathEntry = StringTable->insert(cdir);
875 exeEntry = StringTable->insert("WebGameCtrl.exe");
876 }
877 }
878
879 if( path )
880 *path = pathEntry;
881 if( exe )
882 *exe = exeEntry;
883}
884#endif
885
886StringTableEntry Platform::getExecutableName()

Callers 2

getExecutableNameMethod · 0.85
getExecutablePathMethod · 0.85

Calls 4

createUTF8stringFunction · 0.85
forwardslashFunction · 0.70
dStrrchrFunction · 0.50
insertMethod · 0.45

Tested by

no test coverage detected