Skip to content

Commit

Permalink
Ignore all DLL unblock failure to avoid crashes
Browse files Browse the repository at this point in the history
  • Loading branch information
vbousquet committed Feb 23, 2021
1 parent 4bc7e28 commit 2390be4
Showing 1 changed file with 12 additions and 6 deletions.
18 changes: 12 additions & 6 deletions FlexDMDUI/MainWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -317,15 +317,21 @@ private bool CheckRegisteredVersion(string clsid, string version)

private bool IsDLLBlocked(string path)
{
FileInfo file = new FileInfo(path);
if (file.AlternateDataStreamExists("Zone.Identifier"))
try
{
AlternateDataStreamInfo s = file.GetAlternateDataStream("Zone.Identifier", FileMode.Open);
using (TextReader reader = s.OpenText())
FileInfo file = new FileInfo(path);
if (file.AlternateDataStreamExists("Zone.Identifier"))
{
var zoneId = reader.ReadToEnd().ToUpperInvariant();
return zoneId.Contains("ZONEID=3") || zoneId.Contains("ZONEID=4");
AlternateDataStreamInfo s = file.GetAlternateDataStream("Zone.Identifier", FileMode.Open);
using (TextReader reader = s.OpenText())
{
var zoneId = reader.ReadToEnd().ToUpperInvariant();
return zoneId.Contains("ZONEID=3") || zoneId.Contains("ZONEID=4");
}
}
} catch (Exception)
{
// FIXME this is an horrible exception swallowing when DLL blocking check fails. This should be properly reported (at leats in a log file)
}
return false;
}
Expand Down

0 comments on commit 2390be4

Please sign in to comment.