Skip to content

Commit 81fee8f

Browse files
committed
Sync with ReClass.NET changes.
1 parent 1f82042 commit 81fee8f

File tree

1 file changed

+21
-11
lines changed

1 file changed

+21
-11
lines changed

Diff for: LoadBinaryPluginExt.cs

+21-11
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
using System.IO.MemoryMappedFiles;
66
using System.Runtime.InteropServices;
77
using System.Windows.Forms;
8+
using ReClassNET.Memory;
89
using ReClassNET.Plugins;
910
using RGiesecke.DllExport;
1011
using static ReClassNET.Memory.NativeHelper;
@@ -97,23 +98,26 @@ public static bool IsProcessValid(IntPtr process)
9798
/// <param name="desiredAccess">The desired access. (ignored)</param>
9899
/// <returns>A plugin internal handle to the file.</returns>
99100
[DllExport(CallingConvention = CallingConvention.StdCall)]
100-
private static IntPtr OpenRemoteProcess(int pid, int desiredAccess)
101+
private static IntPtr OpenRemoteProcess(IntPtr id, ProcessAccess desiredAccess)
101102
{
102103
lock (sync)
103104
{
104-
try
105+
if (currentFile.GetHashCode() == id.ToInt32())
105106
{
106-
var file = MemoryMappedFile.CreateFromFile(currentFile);
107+
try
108+
{
109+
var file = MemoryMappedFile.CreateFromFile(currentFile);
107110

108-
var handle = file.SafeMemoryMappedFileHandle.DangerousGetHandle();
111+
var handle = file.SafeMemoryMappedFileHandle.DangerousGetHandle();
109112

110-
openFiles.Add(handle, file);
113+
openFiles.Add(handle, file);
111114

112-
return handle;
113-
}
114-
catch (Exception ex)
115-
{
116-
host.Logger.Log(ex);
115+
return handle;
116+
}
117+
catch (Exception ex)
118+
{
119+
host.Logger.Log(ex);
120+
}
117121
}
118122
}
119123

@@ -209,7 +213,13 @@ private static void EnumerateProcesses(EnumerateProcessCallback callbackProcess)
209213
{
210214
currentFile = ofd.FileName;
211215

212-
callbackProcess(currentFile.GetHashCode(), currentFile);
216+
var data = new EnumerateProcessData
217+
{
218+
Id = (IntPtr)currentFile.GetHashCode(),
219+
Path = currentFile
220+
};
221+
222+
callbackProcess(ref data);
213223
}
214224
}
215225
}

0 commit comments

Comments
 (0)