long LogOpenQuiet( char *filename, __int64 *filelen ) { char rawfileName[256]; long hnd = 0; DateFixFilename( filename, rawfileName ); // Check if we trying to open a shortcut if ( IsShortCut( rawfileName ) ){ char linkpath[256]; mystrcpy( linkpath, rawfileName ); #if DEF_WINDOWS GetShortCut( linkpath, rawfileName ); #endif } // Now see if the we want to open a short cut to a URL if ( IsURLShortCut( rawfileName ) ){ char linkpath[256]; mystrcpy( linkpath, rawfileName ); #if DEF_WINDOWS GetURLShortCut( linkpath, rawfileName ); #endif } // Check for a just a plain URL if ( IsURL( rawfileName ) ){ StatusSetID( IDS_REMOTELOG , strrchr( rawfileName,'/' ) ); hnd = (long)INetOpen( rawfileName, filelen ); return hnd; } // Check other types char format[100]; // determine if its PKZIP file and if so... dont open it, YET if ( IsFileInvalid( rawfileName, format ) ) return 0; #ifndef DEF_MAC if ( IsPKZIP( rawfileName ) ) hnd = (long)UnzipOpen( rawfileName, NULL ); else #ifdef _BZLIB_H if ( aIsBzFile( rawfileName ) ) // PLEASE DO THIS SOON FOR MAC.... at least for manual completeness, hey OSX people will love it. hnd = (long)BZ2_bzopen( rawfileName, "rb" ); else #endif #endif { hnd = (long)gzopen( rawfileName, "rb" ); } if ( filelen && hnd ) *filelen = GetFileLength( rawfileName ); return hnd; }
BOOL CPlayerSubresyncBar::PreTranslateMessage(MSG* pMsg) { if (IsWindow(pMsg->hwnd) && IsVisible() && pMsg->message >= WM_KEYFIRST && pMsg->message <= WM_KEYLAST) { if (pMsg->message == WM_KEYDOWN && pMsg->wParam == VK_ESCAPE) { GetParentFrame()->ShowControlBar(this, FALSE, TRUE); return TRUE; } if (IsShortCut(pMsg) || IsDialogMessage(pMsg)) { return TRUE; } } return __super::PreTranslateMessage(pMsg); }
static gzFile DBIO_OpenFile( const char *filename ) { char rawfileName[256]; strcpy( rawfileName, filename ); DateFixFilename( rawfileName, 0 ); if ( IsShortCut( rawfileName ) ){ char linkpath[256]; mystrcpy( linkpath, rawfileName ); #if DEF_WINDOWS GetShortCut( linkpath, rawfileName ); #endif } gzFile fh=0; if ( !IsURL( rawfileName ) ) { char format[256]; // determine if its PKZIP file and if so... dont open it, YET if ( IsFileInvalid( rawfileName, format ) ) { OutDebugs( "Cannot open %s because it is a %s file.", rawfileName, format ); return 0; } else { if ( IsBzFile( rawfileName ) ) ; // fh=bzopen( rawfileName, "rb" ); removed for compat build RHF else fh=gzopen( rawfileName, "rb" ); } } return fh; }
DualErr CPGPdiskApp::CanonicalizeAppCommandInfo(PAppCommandInfo pACI) { DualErr derr; try { AppOp op; CString path; PGPdisk *pPGD; PGPUInt8 drive; pgpAssertAddrValid(pACI, AppCommandInfo); op = pACI->op; path = pACI->path; drive = pACI->drive; // Only some commands need pre-processing. switch (op) { case kAppOp_Mount: // Resolve any shortcut. if (IsShortCut(path)) derr = ResolveShortcut(path, &path); if (derr.IsntError()) { // Resolve 'root' forms to the corresponding PGPdisk. if (IsPlainLocalRoot(path)) { pPGD = mPGPdisks.FindPGPdisk(DriveFromPath(path)); if (NULL!=(int)(pPGD)) path = pPGD->GetPath(); } // Pretty the path. derr = VerifyAndCanonicalizePath(path, &path); } break; case kAppOp_AddPassphrase: case kAppOp_ChangePassphrase: case kAppOp_RemovePassphrase: case kAppOp_RemoveAlternates: case kAppOp_AddRemovePublicKeys: case kAppOp_WipePassesThisDisk: // Resolve any shortcut. if (IsShortCut(path)) derr = ResolveShortcut(path, &path); if (derr.IsntError()) { // Pretty the path. derr = VerifyAndCanonicalizePath(path, &path); } break; case kAppOp_Unmount: // If we don't have a drive, check for path. if (!IsLegalDriveNumber(drive)) { pgpAssert(!path.IsEmpty()); // Resolve any shortcut. if (IsShortCut(path)) derr = ResolveShortcut(path, &path); // Extract the drive letter. if (derr.IsntError()) { if (IsPlainLocalRoot(path)) { // We have a root to a PGPdisk volume. drive = DriveLetToNum(path[0]); } else { // We have a path to a PGPdisk file. derr = VerifyAndCanonicalizePath(path, &path); if (derr.IsntError()) { pPGD = mPGPdisks.FindPGPdisk(path); if (NULL!=(int)(pPGD)) drive = pPGD->GetDrive(); } } } } break; } // Update the ACI with the modified values. if (derr.IsntError()) { strcpy(pACI->path, path); pACI->drive = drive; } } catch (CMemoryException *ex) { derr = DualErr(kPGDMinorError_OutOfMemory); ex->Delete(); } return derr; }