mirror of
https://github.com/goatcorp/Dalamud.git
synced 2026-02-15 12:27:43 +01:00
gameProcess stuff
This commit is contained in:
parent
79fb6c5104
commit
ac80895f43
2 changed files with 33 additions and 22 deletions
|
|
@ -5,9 +5,19 @@ using Microsoft.Win32.SafeHandles;
|
|||
|
||||
namespace Dalamud.Bootstrap
|
||||
{
|
||||
internal sealed class GameProcess : Process
|
||||
internal sealed class GameProcess : IDisposable
|
||||
{
|
||||
public GameProcess(SafeProcessHandle handle) : base(handle) { }
|
||||
private Process m_process;
|
||||
public GameProcess(Process process)
|
||||
{
|
||||
m_process = process;
|
||||
}
|
||||
|
||||
public void Dispose()
|
||||
{
|
||||
m_process?.Dispose();
|
||||
m_process = null!;
|
||||
}
|
||||
|
||||
public static GameProcess Open(uint pid)
|
||||
{
|
||||
|
|
@ -21,9 +31,9 @@ namespace Dalamud.Bootstrap
|
|||
|
||||
// TODO: unfuck VM_WRITE
|
||||
|
||||
var handle = Process.OpenHandle(pid, access);
|
||||
var process = Process.Open(pid, access);
|
||||
|
||||
return new GameProcess(handle);
|
||||
return new GameProcess(process);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue