Use File.Copy in InstanceDll instead of manipulating streams

This commit is contained in:
YoshiRulz 2020-01-23 08:40:39 +10:00
parent e7a1638e00
commit 5a3f4ab1b3
No known key found for this signature in database
GPG Key ID: C4DE31C245353FB7
1 changed files with 1 additions and 3 deletions

View File

@ -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,