mirror of
https://github.com/goatcorp/Dalamud.git
synced 2026-02-09 09:24:35 +01:00
Recover the key from the time when the process was created
Thanks Wintermute!
This commit is contained in:
parent
cd45ecd377
commit
16d806a2bb
4 changed files with 63 additions and 197 deletions
|
|
@ -155,6 +155,24 @@ namespace Dalamud.Bootstrap
|
|||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns a time when the process was started.
|
||||
/// </summary>
|
||||
public DateTime GetCreationTime()
|
||||
{
|
||||
unsafe
|
||||
{
|
||||
FileTime creationTime, exitTime, kernelTime, userTime;
|
||||
|
||||
if (Win32.GetProcessTimes(m_handle, &creationTime, &exitTime, &kernelTime, &userTime))
|
||||
{
|
||||
ProcessException.ThrowLastOsError(GetPid());
|
||||
}
|
||||
|
||||
return (DateTime)creationTime;
|
||||
}
|
||||
}
|
||||
|
||||
private string[] ParseCommandLine(ReadOnlySpan<byte> commandLine)
|
||||
{
|
||||
unsafe
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue