Fix loading roms from archive when using recent roms menu

This commit is contained in:
adelikat 2017-04-01 16:14:04 -05:00
parent c58d2929f8
commit e767e1b673
1 changed files with 9 additions and 1 deletions

View File

@ -168,8 +168,16 @@ namespace BizHawk.Common
//http://stackoverflow.com/questions/139010/how-to-resolve-a-lnk-in-c-sharp //http://stackoverflow.com/questions/139010/how-to-resolve-a-lnk-in-c-sharp
public static string ResolveShortcut(string filename) public static string ResolveShortcut(string filename)
{ {
if (Path.GetExtension(filename).ToLowerInvariant() != ".lnk") // archive internal files are never shortcuts (and choke when analyzing any further)
if (filename.Contains("|"))
{
return filename; return filename;
}
if (Path.GetExtension(filename).ToLowerInvariant() != ".lnk")
{
return filename;
}
PInvokes.ShellLink link = new PInvokes.ShellLink(); PInvokes.ShellLink link = new PInvokes.ShellLink();
((PInvokes.IPersistFile)link).Load(filename, PInvokes.STGM_READ); ((PInvokes.IPersistFile)link).Load(filename, PInvokes.STGM_READ);