Skip to content

Commit 612c7bd

Browse files
committed
cleanup
1 parent 588eb6a commit 612c7bd

File tree

2 files changed

+7
-8
lines changed

2 files changed

+7
-8
lines changed

src/DiffEngine/GlobalUsings.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
global using System.Text;

src/DiffEngine/Process/WindowsProcess.cs

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
using System.Text;
2-
31
static partial class WindowsProcess
42
{
53
#if NET7_0_OR_GREATER
@@ -284,7 +282,7 @@ static int FindDotSeparatedPath(CharSpan span)
284282
var commandLineOffset = 0x70; // UNICODE_STRING CommandLine in RTL_USER_PROCESS_PARAMETERS
285283

286284
var buffer = new byte[8];
287-
if (!ReadProcessMemory(handle, pebAddress + processParametersOffset, buffer, new IntPtr(8), out _))
285+
if (!ReadProcessMemory(handle, pebAddress + processParametersOffset, buffer, new(8), out _))
288286
{
289287
return null;
290288
}
@@ -297,7 +295,7 @@ static int FindDotSeparatedPath(CharSpan span)
297295

298296
// Read UNICODE_STRING structure (Length: 2, MaxLength: 2, padding: 4, Buffer: 8)
299297
buffer = new byte[16];
300-
if (!ReadProcessMemory(handle, processParameters + commandLineOffset, buffer, new IntPtr(16), out _))
298+
if (!ReadProcessMemory(handle, processParameters + commandLineOffset, buffer, new(16), out _))
301299
{
302300
return null;
303301
}
@@ -311,7 +309,7 @@ static int FindDotSeparatedPath(CharSpan span)
311309
}
312310

313311
var cmdLineBuffer = new byte[length];
314-
if (!ReadProcessMemory(handle, cmdLinePtr, cmdLineBuffer, new IntPtr(length), out _))
312+
if (!ReadProcessMemory(handle, cmdLinePtr, cmdLineBuffer, new(length), out _))
315313
{
316314
return null;
317315
}
@@ -326,7 +324,7 @@ static int FindDotSeparatedPath(CharSpan span)
326324
var commandLineOffset = 0x40; // UNICODE_STRING CommandLine in RTL_USER_PROCESS_PARAMETERS
327325

328326
var buffer = new byte[4];
329-
if (!ReadProcessMemory(handle, pebAddress + processParametersOffset, buffer, new IntPtr(4), out _))
327+
if (!ReadProcessMemory(handle, pebAddress + processParametersOffset, buffer, new(4), out _))
330328
{
331329
return null;
332330
}
@@ -339,7 +337,7 @@ static int FindDotSeparatedPath(CharSpan span)
339337

340338
// Read UNICODE_STRING structure (Length: 2, MaxLength: 2, Buffer: 4)
341339
buffer = new byte[8];
342-
if (!ReadProcessMemory(handle, processParameters + commandLineOffset, buffer, new IntPtr(8), out _))
340+
if (!ReadProcessMemory(handle, processParameters + commandLineOffset, buffer, new(8), out _))
343341
{
344342
return null;
345343
}
@@ -353,7 +351,7 @@ static int FindDotSeparatedPath(CharSpan span)
353351
}
354352

355353
var cmdLineBuffer = new byte[length];
356-
if (!ReadProcessMemory(handle, cmdLinePtr, cmdLineBuffer, new IntPtr(length), out _))
354+
if (!ReadProcessMemory(handle, cmdLinePtr, cmdLineBuffer, new(length), out _))
357355
{
358356
return null;
359357
}

0 commit comments

Comments
 (0)