Skip to content

Commit 2390be4

Browse files
committed
Ignore all DLL unblock failure to avoid crashes
1 parent 4bc7e28 commit 2390be4

File tree

1 file changed

+12
-6
lines changed

1 file changed

+12
-6
lines changed

FlexDMDUI/MainWindow.xaml.cs

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -317,15 +317,21 @@ private bool CheckRegisteredVersion(string clsid, string version)
317317

318318
private bool IsDLLBlocked(string path)
319319
{
320-
FileInfo file = new FileInfo(path);
321-
if (file.AlternateDataStreamExists("Zone.Identifier"))
320+
try
322321
{
323-
AlternateDataStreamInfo s = file.GetAlternateDataStream("Zone.Identifier", FileMode.Open);
324-
using (TextReader reader = s.OpenText())
322+
FileInfo file = new FileInfo(path);
323+
if (file.AlternateDataStreamExists("Zone.Identifier"))
325324
{
326-
var zoneId = reader.ReadToEnd().ToUpperInvariant();
327-
return zoneId.Contains("ZONEID=3") || zoneId.Contains("ZONEID=4");
325+
AlternateDataStreamInfo s = file.GetAlternateDataStream("Zone.Identifier", FileMode.Open);
326+
using (TextReader reader = s.OpenText())
327+
{
328+
var zoneId = reader.ReadToEnd().ToUpperInvariant();
329+
return zoneId.Contains("ZONEID=3") || zoneId.Contains("ZONEID=4");
330+
}
328331
}
332+
} catch (Exception)
333+
{
334+
// FIXME this is an horrible exception swallowing when DLL blocking check fails. This should be properly reported (at leats in a log file)
329335
}
330336
return false;
331337
}

0 commit comments

Comments
 (0)