Changeset 1479 for trunk/dll/defview.c
- Timestamp:
- Nov 15, 2009, 11:40:25 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
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)) {
Note:
See TracChangeset
for help on using the changeset viewer.