mirror of
https://github.com/gwdevhub/Daybreak.git
synced 2026-07-15 15:19:57 +00:00
0a0ec5cefc
Co-authored-by: Alexandru Macocian <amacocian@microsoft.com>
19 lines
906 B
C#
19 lines
906 B
C#
namespace Daybreak.Shared.Services.Api;
|
|
|
|
/// <summary>
|
|
/// Platform-specific provider for converting process IDs.
|
|
/// On Windows, this is a pass-through. On Linux, this maps Wine PIDs to Linux system PIDs.
|
|
/// </summary>
|
|
public interface IPidProvider
|
|
{
|
|
/// <summary>
|
|
/// Converts a reported process ID (e.g., from the Daybreak API health endpoint)
|
|
/// to the actual system process ID.
|
|
/// </summary>
|
|
/// <param name="reportedPid">The process ID reported by the API (may be a Wine PID on Linux).</param>
|
|
/// <param name="executableName">The executable name to search for (e.g., "Gw.exe").</param>
|
|
/// <param name="port">The local TCP port owned by the process, when available.</param>
|
|
/// <returns>The system process ID, or the original PID if conversion fails or is not needed.</returns>
|
|
int ResolveSystemPid(int reportedPid, string executableName, int? port = null);
|
|
}
|