Changeset 1479
Legend:
- Unmodified
- Added
- Removed
-
trunk/dll/assoc.c
r1398 r1479 20 20 19 Jul 08 GKY Replace save_dir2(dir) with pFM2SaveDirectory and use BldFullPathName 21 21 24 Aug 08 GKY Warn full drive on save of .DAT file; prevent loss of existing file 22 15 Nov 09 GKY Add check for attempt to open zero byte file (avoids MMPM trying to play them) 22 23 23 24 **************************************************************************************/ … … 393 394 INT ExecAssociation(HWND hwnd, CHAR * datafile) 394 395 { 395 CHAR *file, sig[CCHMAXPATH], sigl[CCHMAXPATH], mask[CCHMAXPATH], *p; 396 CHAR *file; 397 CHAR sig[CCHMAXPATH]; 398 CHAR sigl[CCHMAXPATH]; 399 CHAR mask[CCHMAXPATH], *p; 396 400 FILE *fp; 397 BOOL didmatch, exclude; 401 BOOL didmatch; 402 BOOL exclude; 403 BOOL checked = FALSE; 398 404 ULONG offset; 399 405 LINKASSOC *info; … … 426 432 strchr(p, ':')) ? datafile : file, p, FALSE); 427 433 if (exclude && didmatch) 428 didmatch = FALSE; 429 if (didmatch) { 430 if (info->sig && *info->sig) { 431 strcpy(sigl, info->sig); 432 literal(sigl); 433 fp = _fsopen(datafile, "rb", SH_DENYNO); 434 if (fp) { 435 if (info->offset < 0L) { 436 fseek(fp, 0L, SEEK_END); 437 offset = ftell(fp) + info->offset; 438 } 439 else 440 offset = info->offset; 441 fseek(fp, offset, SEEK_SET); 442 if (fread(sig, 443 1, 444 strlen(sigl), 445 fp) != strlen(sigl) || strncmp(sigl, sig, strlen(sigl))) 446 didmatch = FALSE; 447 fclose(fp); 448 } 449 } 434 didmatch = FALSE; 435 fp = _fsopen(datafile, "rb", SH_DENYNO); 436 if (fp) { 437 if (!checked) { 438 APIRET temp; 439 440 temp = fread(sig, 1, 2, fp); 441 if (temp != 2) { 442 temp = saymsg(MB_YESNO, hwnd, NullStr, GetPString(IDS_ZEROBYTETEXT)); 443 if (temp == MBID_YES) { 444 DefaultView(hwnd, (HWND) 0, hwndMain, NULL, 8, datafile); 445 } 446 fclose(fp); 447 return 0; 448 } 449 else 450 checked = TRUE; 451 } 452 if (didmatch) { 453 if (info->sig && *info->sig) { 454 strcpy(sigl, info->sig); 455 literal(sigl); 456 457 if (info->offset < 0L) { 458 fseek(fp, 0L, SEEK_END); 459 offset = ftell(fp) + info->offset; 460 } 461 else 462 offset = info->offset; 463 fseek(fp, offset, SEEK_SET); 464 if (fread(sig, 465 1, 466 strlen(sigl), 467 fp) != strlen(sigl) || strncmp(sigl, sig, strlen(sigl))) 468 didmatch = FALSE; 469 470 } 471 } 472 fclose(fp); 450 473 } 451 474 if (didmatch) { /* got a match; do it... */ -
trunk/dll/defview.c
r1402 r1479 22 22 05 Jan 09 GKY Use TestBinary so that text veiwer isn't used for hex files by default 23 23 08 Mar 09 GKY Additional strings move to PCSZs 24 15 Nov 09 GKY Add check for attempt to open zero byte file and reorder file type checks 25 to place exes before MMPM check (avoids MMPM trying to play them) 26 15 Nov 09 GKY Work around MMIO's falure to identify MPG files as media 24 27 25 28 ***********************************************************************/ … … 72 75 HMODULE MMIOModHandle = NULLHANDLE; 73 76 PMMIOIDENTIFYFILE pMMIOIdentifyFile = NULL; 74 PMMIOGETINFO pMMIOGetInfo = NULL;75 PMMIOCLOSE pMMIOClose = NULL;76 PMMIOOPEN pMMIOOpen = NULL;77 MMIOINFO mmioinfo;78 HMMIO hmmio;77 //PMMIOGETINFO pMMIOGetInfo = NULL; 78 //PMMIOCLOSE pMMIOClose = NULL; 79 //PMMIOOPEN pMMIOOpen = NULL; 80 //MMIOINFO mmioinfo; 81 //HMMIO hmmio; 79 82 FOURCC fccStorageSystem = 0; 80 83 MMFORMATINFO mmFormatInfo; 81 APIRET rc ,rc1;84 APIRET rc; // rc1; 82 85 HWND hwnd = HWND_DESKTOP; 83 86 char *p; … … 101 104 return played; 102 105 } 103 if (DosQueryProcAddr(MMIOModHandle, 106 /* This code seems to serve no purpose GKY 11-15-09 107 if (DosQueryProcAddr(MMIOModHandle, 104 108 0, 105 109 "mmioGetInfo", (PFN *) & pMMIOGetInfo)) { … … 121 125 no_mmos2 = TRUE; 122 126 return played; 123 } 127 }*/ 124 128 } 125 129 126 130 /* attempt to identify the file using MMPM/2 */ 127 memset( &mmioinfo, '\0', sizeof(MMIOINFO) );131 //memset( &mmioinfo, '\0', sizeof(MMIOINFO) ); 128 132 /*Eliminate non multimedia files*/ 129 hmmio = pMMIOOpen(filename,133 /*hmmio = pMMIOOpen(filename, 130 134 &mmioinfo, 131 135 MMIO_READ); … … 153 157 return played; 154 158 } 155 rc1 = pMMIOGetInfo(hmmio, &mmioinfo, 0L); 159 rc1 = pMMIOGetInfo(hmmio, &mmioinfo, 0L);*/ 156 160 memset(&mmFormatInfo, 0, sizeof(MMFORMATINFO)); 157 161 mmFormatInfo.ulStructLen = sizeof(MMFORMATINFO); 158 162 rc = pMMIOIdentifyFile(filename, 159 &mmioinfo,163 0L, //&mmioinfo, 160 164 &mmFormatInfo, 161 165 &fccStorageSystem, 0L, 162 166 MMIO_FORCE_IDENTIFY_FF); 163 167 /* free module handle */ 164 rc1 = pMMIOClose(hmmio, 0L);168 //rc1 = pMMIOClose(hmmio, 0L); 165 169 DosFreeModule(MMIOModHandle); 166 170 167 171 /* if identified and not FOURCC_DOS */ 168 if (!rc && mmFormatInfo.fccIOProc != FOURCC_DOS) { 172 p = strrchr(filename, '.'); //Added to save mp3, ogg & flac which fail above test 173 if (!p) 174 p = "."; 175 if (!rc && (mmFormatInfo.fccIOProc != FOURCC_DOS || !stricmp(p, PCSZ_DOTMPG) || 176 !stricmp(p, PCSZ_DOTMPEG))) { // MPG are identified as FOURCC_DOS 169 177 if (mmFormatInfo.ulMediaType == MMIO_MEDIATYPE_IMAGE && 170 178 (mmFormatInfo.ulFlags & MMIO_CANREADTRANSLATED)) { … … 175 183 OpenObject(filename, Default, hwnd); //Image fails to display these 176 184 else // is an image that can be translated 177 RunFM2Util( "IMAGE.EXE", filename);185 RunFM2Util(PCSZ_IMAGEEXE, filename); 178 186 played = TRUE; 179 187 } … … 311 319 hwndParent, hwndFrame, filename, 4, NULL); 312 320 if (!hwndArc) { 313 if (! fCheckMM || !ShowMultimedia(filename)) {314 if (!IsExecutable(filename) || !ExecFile(hwnd, filename)) { 315 p = strrchr(filename, '.'); 316 if (!p) 317 p = "."; 318 if (stricmp(p, ".INI") || !StartIniEditor(hwndParent, filename, 4)) {319 if (stricmp(p, PCSZ_DOTHLP) || !ViewHelp(filename)) {321 if (!IsExecutable(filename) || !ExecFile(hwnd, filename)) { 322 p = strrchr(filename, '.'); 323 if (!p) 324 p = "."; 325 if (stricmp(p, ".INI") || !StartIniEditor(hwndParent, filename, 4)) { 326 if (stricmp(p, PCSZ_DOTHLP) || !ViewHelp(filename)) { 327 if (!fCheckMM || !stricmp(p, ".DLL") || !ShowMultimedia(filename)) { 320 328 ViewIt: 321 329 if (TestBinary(filename)) { -
trunk/dll/fm3res.rc
r1473 r1479 46 46 15 Sep 09 SHL Add rescan progress messages 47 47 27 Sep 09 SHL Add more items to COMP_MENU 48 15 Nov 09 GKY Add ZEROBYTETEXT 48 49 49 50 ***********************************************************************/ … … 2418 2419 IDS_INIFAILURETEXT "Check INI header failed will attempt to replace with backup if backup fails or not found will open with new ini" 2419 2420 IDS_HELPCMDTEXT "/HELP" 2421 IDS_ZEROBYTETEXT "Zero byte file do you wish to open it in an editor (No cancels)" 2420 2422 IDS_DETACHREQUESTTEXT "Detach Request" 2421 2423 IDS_DIRCNRTOTALHELP "This window tells you how many objects\rand how many bytes are in the container.\rYou can drag me (this dir), or drag onto\rme (into this dir)." -
trunk/dll/fm3str.h
r1469 r1479 37 37 inappropriate menu context choices 38 38 15 Sep 09 SHL Add ids for rescan progress messages 39 15 Nov 09 GKY Add ZEROBYTETEXT (58) 39 40 40 41 ***********************************************************************/ … … 98 99 #define IDS_INIFAILURETEXT 51 99 100 #define IDS_HELPCMDTEXT 56 101 #define IDS_ZEROBYTETEXT 58 100 102 #define IDS_DETACHREQUESTTEXT 59 101 103 #define IDS_DIRCNRTOTALHELP 60 -
trunk/dll/init.c
r1475 r1479 87 87 command.com. Prevents hang (at least until a Dos program is started) on a system 88 88 that has a broken MDOS install. 89 15 Nov 09 GKY Add more PCSZs 89 90 90 91 ***********************************************************************/ … … 237 238 PCSZ PCSZ_USERDIRSDAT = "USERDIRS.DAT"; 238 239 PCSZ PCSZ_FM2PLAYEXE = "FM2PLAY.EXE"; 240 PCSZ PCSZ_IMAGEEXE = "IMAGE.EXE"; 239 241 PCSZ PCSZ_FM2PLAYTEMP = "$FM2PLAY.$$$"; 240 242 PCSZ PCSZ_LVMGUICMD = "LVMGUI.CMD"; … … 308 310 PCSZ PCSZ_DOTINF = ".INF"; 309 311 PCSZ PCSZ_DOTMP3 = ".MP3"; 312 PCSZ PCSZ_DOTMPG = ".MPG"; 313 PCSZ PCSZ_DOTMPEG = ".MPEG"; 310 314 PCSZ PCSZ_DOTOGG = ".OGG"; 311 315 PCSZ PCSZ_DOTFLAC = ".FLAC"; … … 1100 1104 if (DosCreateMutexSem(NULL, &hmtFillingTreeCnr, 0L, FALSE)) 1101 1105 Dos_Error(MB_CANCEL, rc, HWND_DESKTOP, pszSrcFile, __LINE__, 1102 1106 PCSZ_DOSCREATEMUTEXSEM); 1103 1107 if (DosCreateEventSem(NULL, &hevInitialCnrScanComplete, 0L, FALSE)) 1104 1108 Dos_Error(MB_CANCEL, rc, HWND_DESKTOP, pszSrcFile, __LINE__, -
trunk/dll/init.h
r1451 r1479 22 22 and rescans drive in tree container depending on container focus, greyed out 23 23 inappropriate menu context choices 24 15 Nov 09 GKY Add more PCSZs 24 25 25 26 ***********************************************************************/ … … 50 51 extern PCSZ PCSZ_MINILVMEXE; 51 52 extern PCSZ PCSZ_FDISKPMEXE; 53 extern PCSZ PCSZ_IMAGEEXE; 52 54 extern PCSZ PCSZ_LVMEXE; 53 55 extern PCSZ PCSZ_ARCCNR; … … 128 130 extern PCSZ PCSZ_DOTINF; 129 131 extern PCSZ PCSZ_DOTMP3; 132 extern PCSZ PCSZ_DOTMPG; 133 extern PCSZ PCSZ_DOTMPEG; 130 134 extern PCSZ PCSZ_DOTOGG; 131 135 extern PCSZ PCSZ_DOTFLAC;
Note:
See TracChangeset
for help on using the changeset viewer.