Skip to content

Commit bcc72fe

Browse files
committed
Sync with current ReClass.NET project.
1 parent dd5ebe0 commit bcc72fe

File tree

3 files changed

+22
-31
lines changed

3 files changed

+22
-31
lines changed

Diff for: LoadBinaryPlugin.csproj

+10-10
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
<DebugType>full</DebugType>
1919
<Optimize>false</Optimize>
2020
<OutputPath>bin\Debug\x86\</OutputPath>
21-
<DefineConstants>TRACE;DEBUG;WIN32</DefineConstants>
21+
<DefineConstants>TRACE;DEBUG;RECLASSNET32</DefineConstants>
2222
<ErrorReport>prompt</ErrorReport>
2323
<WarningLevel>4</WarningLevel>
2424
<AllowUnsafeBlocks>false</AllowUnsafeBlocks>
@@ -28,7 +28,7 @@
2828
<DebugType>pdbonly</DebugType>
2929
<Optimize>true</Optimize>
3030
<OutputPath>..\bin\Release\x86\</OutputPath>
31-
<DefineConstants>TRACE;WIN32;RELEASE</DefineConstants>
31+
<DefineConstants>TRACE;RECLASSNET32;RELEASE</DefineConstants>
3232
<ErrorReport>prompt</ErrorReport>
3333
<WarningLevel>4</WarningLevel>
3434
</PropertyGroup>
@@ -38,7 +38,7 @@
3838
<DebugType>full</DebugType>
3939
<Optimize>false</Optimize>
4040
<OutputPath>bin\Debug\x64\</OutputPath>
41-
<DefineConstants>TRACE;DEBUG;WIN64</DefineConstants>
41+
<DefineConstants>TRACE;DEBUG;RECLASSNET64</DefineConstants>
4242
<ErrorReport>prompt</ErrorReport>
4343
<WarningLevel>4</WarningLevel>
4444
<AllowUnsafeBlocks>false</AllowUnsafeBlocks>
@@ -48,7 +48,7 @@
4848
<DebugType>pdbonly</DebugType>
4949
<Optimize>true</Optimize>
5050
<OutputPath>..\bin\Release\x64\</OutputPath>
51-
<DefineConstants>TRACE;WIN64;RELEASE</DefineConstants>
51+
<DefineConstants>TRACE;RECLASSNET64;RELEASE</DefineConstants>
5252
<ErrorReport>prompt</ErrorReport>
5353
<WarningLevel>4</WarningLevel>
5454
</PropertyGroup>
@@ -76,12 +76,6 @@
7676
<DependentUpon>Resources.resx</DependentUpon>
7777
</Compile>
7878
</ItemGroup>
79-
<ItemGroup>
80-
<ProjectReference Include="..\ReClass.NET\ReClass.NET.csproj">
81-
<Project>{BFB8917D-E9B4-463F-A6E8-612C35728C78}</Project>
82-
<Name>ReClass.NET</Name>
83-
</ProjectReference>
84-
</ItemGroup>
8579
<ItemGroup>
8680
<EmbeddedResource Include="Properties\Resources.resx">
8781
<Generator>ResXFileCodeGenerator</Generator>
@@ -92,6 +86,12 @@
9286
<ItemGroup>
9387
<None Include="Resources\icon.png" />
9488
</ItemGroup>
89+
<ItemGroup>
90+
<ProjectReference Include="..\ReClass.NET\ReClass.NET\ReClass.NET.csproj">
91+
<Project>{bfb8917d-e9b4-463f-a6e8-612c35728c78}</Project>
92+
<Name>ReClass.NET</Name>
93+
</ProjectReference>
94+
</ItemGroup>
9595
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
9696
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
9797
Other similar extension points exist, see Microsoft.Common.targets.

Diff for: LoadBinaryPlugin.sln

+6-3
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11

22
Microsoft Visual Studio Solution File, Format Version 12.00
3-
# Visual Studio 14
4-
VisualStudioVersion = 14.0.25420.1
3+
# Visual Studio 15
4+
VisualStudioVersion = 15.0.27004.2002
55
MinimumVisualStudioVersion = 10.0.40219.1
66
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LoadBinaryPlugin", "LoadBinaryPlugin.csproj", "{CA79BA0B-0D80-476A-B793-FC7EF7DCEAD8}"
77
EndProject
8-
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ReClass.NET", "..\ReClass.NET\ReClass.NET.csproj", "{BFB8917D-E9B4-463F-A6E8-612C35728C78}"
8+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ReClass.NET", "..\ReClass.NET\ReClass.NET\ReClass.NET.csproj", "{BFB8917D-E9B4-463F-A6E8-612C35728C78}"
99
EndProject
1010
Global
1111
GlobalSection(SolutionConfigurationPlatforms) = preSolution
@@ -35,4 +35,7 @@ Global
3535
GlobalSection(SolutionProperties) = preSolution
3636
HideSolutionNode = FALSE
3737
EndGlobalSection
38+
GlobalSection(ExtensibilityGlobals) = postSolution
39+
SolutionGuid = {C9677E15-D4EA-4082-B65D-27B208118986}
40+
EndGlobalSection
3841
EndGlobal

Diff for: LoadBinaryPluginExt.cs

+6-18
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,13 @@
66
using System.Windows.Forms;
77
using ReClassNET.Core;
88
using ReClassNET.Debugger;
9-
using ReClassNET.Memory;
109
using ReClassNET.Plugins;
1110

1211
namespace LoadBinaryPlugin
1312
{
1413
public class LoadBinaryPluginExt : Plugin, ICoreProcessFunctions
1514
{
16-
private object sync = new object();
15+
private readonly object sync = new object();
1716

1817
private IPluginHost host;
1918

@@ -26,15 +25,7 @@ public class LoadBinaryPluginExt : Plugin, ICoreProcessFunctions
2625
public override bool Initialize(IPluginHost host)
2726
{
2827
Contract.Requires(host != null);
29-
30-
//System.Diagnostics.Debugger.Launch();
31-
32-
if (host == null)
33-
{
34-
throw new ArgumentNullException(nameof(host));
35-
}
36-
37-
this.host = host;
28+
this.host = host ?? throw new ArgumentNullException(nameof(host));
3829

3930
host.Process.CoreFunctions.RegisterFunctions("Load Binary", this);
4031

@@ -59,8 +50,7 @@ public override void Terminate()
5950
/// <returns>The file or null if the identifier doesn't exist.</returns>
6051
private MemoryMappedFile GetMappedFileById(IntPtr id)
6152
{
62-
MemoryMappedFile file;
63-
openFiles.TryGetValue(id, out file);
53+
openFiles.TryGetValue(id, out var file);
6454
return file;
6555
}
6656

@@ -71,8 +61,7 @@ private void LogErrorAndRemoveFile(IntPtr id, Exception ex)
7161
{
7262
Contract.Requires(ex != null);
7363

74-
MemoryMappedFile file;
75-
if (openFiles.TryGetValue(id, out file))
64+
if (openFiles.TryGetValue(id, out var file))
7665
{
7766
file.Dispose();
7867
}
@@ -94,7 +83,7 @@ public bool IsProcessValid(IntPtr process)
9483
}
9584

9685
/// <summary>Opens the file.</summary>
97-
/// <param name="pid">The file id.</param>
86+
/// <param name="id">The file id.</param>
9887
/// <param name="desiredAccess">The desired access. (ignored)</param>
9988
/// <returns>A plugin internal handle to the file.</returns>
10089
public IntPtr OpenRemoteProcess(IntPtr id, ProcessAccess desiredAccess)
@@ -129,8 +118,7 @@ public void CloseRemoteProcess(IntPtr process)
129118
{
130119
lock (sync)
131120
{
132-
MemoryMappedFile file;
133-
if (openFiles.TryGetValue(process, out file))
121+
if (openFiles.TryGetValue(process, out var file))
134122
{
135123
openFiles.Remove(process);
136124

0 commit comments

Comments
 (0)