BOOLEAN CheckIfGameCdromIsInCDromDrive() { CHAR8 zVolumeNameBuffer[512]; UINT32 uiVolumeSerialNumber=0; UINT32 uiMaxComponentLength=0; UINT32 uiFileSystemFlags=0; CHAR8 zFileSystemNameBuffer[512]; CHAR8 zCdLocation[ SGPFILENAME_LEN ]; CHAR8 zCdFile[ SGPFILENAME_LEN ]; CHAR8 zCdromRootDrive[512]; BOOLEAN fFailed = FALSE; UINT32 uiVolumeReturnValue; UINT32 uiLastError = ERROR_SUCCESS; if( !GetCdromLocationFromIniFile( zCdromRootDrive ) ) return( FALSE ); uiVolumeReturnValue = GetVolumeInformation( zCdromRootDrive, zVolumeNameBuffer, 512, &uiVolumeSerialNumber, &uiMaxComponentLength, &uiFileSystemFlags, zFileSystemNameBuffer, 512 ); if( !uiVolumeReturnValue ) { uiLastError = GetLastError(); } // OK, build filename sprintf( zCdFile, "%s%s", zCdLocation, gCheckFilenames[ Random( 2 ) ] ); //If the cdrom drive is no longer in the drive if( uiLastError == ERROR_NOT_READY || ( !FileExists( zCdFile ) ) ) { CHAR8 sString[512]; //if a game has been started, add the msg about saving the game to a different entry if( gTacticalStatus.fHasAGameBeenStarted ) { sprintf( sString, "%S %S", pMessageStrings[ MSG_INTEGRITY_WARNING ], pMessageStrings[ MSG_CDROM_SAVE_GAME ] ); SaveGame( SAVE__ERROR_NUM, pMessageStrings[ MSG_CDROM_SAVE ] ); } else { sprintf( sString, "%S", pMessageStrings[ MSG_INTEGRITY_WARNING ] ); } // ATE: These are ness. due to reference counting // in showcursor(). I'm not about to go digging in low level stuff at this // point in the game development, so keep these here, as this works... ShowCursor(TRUE); ShowCursor(TRUE); ShutdownWithErrorBox( sString ); //DoTester( ); //MessageBox(NULL, sString, "Error", MB_OK | MB_ICONERROR ); return( FALSE ); } return( TRUE ); }
void HandleLaserLockResult( BOOLEAN fSuccess ) { if( !fSuccess ) { CHAR8 zString[512]; sprintf( zString, "%S", gzLateLocalizedString[56] ); ShowCursor(TRUE); ShowCursor(TRUE); ShutdownWithErrorBox( zString ); } }