From 5a3f4ab1b373efcf5976fe23a1f2443e7c508dfc Mon Sep 17 00:00:00 2001 From: YoshiRulz Date: Thu, 23 Jan 2020 08:40:39 +1000 Subject: [PATCH] Use File.Copy in InstanceDll instead of manipulating streams --- BizHawk.Common/IImportResolver.cs | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/BizHawk.Common/IImportResolver.cs b/BizHawk.Common/IImportResolver.cs index 1e5ad2992a..d23da7dcbf 100644 --- a/BizHawk.Common/IImportResolver.cs +++ b/BizHawk.Common/IImportResolver.cs @@ -64,9 +64,7 @@ namespace BizHawk.Common { // copy the dll to a temp directory var path = TempFileManager.GetTempFilename(Path.GetFileNameWithoutExtension(dllPath), ".dll", false); - using var stream = new FileStream(path, FileMode.Create, FileSystemRights.FullControl, FileShare.ReadWrite | FileShare.Delete, 4 * 1024, FileOptions.None); - using var sdll = File.OpenRead(dllPath); - sdll.CopyTo(stream); + File.Copy(dllPath, path, true); // try to locate dlls in the current directory (for libretro cores) // this isn't foolproof but it's a little better than nothing // setting PWD temporarily doesn't work. that'd be ideal since it supposedly gets searched early on,