code style

This commit is contained in:
qhy040404
2024-06-02 09:15:39 +08:00
parent 1d4409aa43
commit 7d6a9691a2
3 changed files with 3 additions and 7 deletions

View File

@@ -6,9 +6,9 @@ namespace Snap.Hutao.Core.LifeCycle.InterProcess;
internal enum PipePacketCommand : byte
{
None = 0,
Connect = 1,
RedirectActivation = 10,
RequestElevatedStatus = 11,
Exit = 30,
}

View File

@@ -23,7 +23,7 @@ internal sealed partial class PrivateNamedPipeClient : IDisposable
PipePacketHeader connectPacket = default;
connectPacket.Version = 1;
connectPacket.Type = PipePacketType.Request;
connectPacket.Command = PipePacketCommand.Connect;
connectPacket.Command = PipePacketCommand.RequestElevatedStatus;
clientStream.Write(new(&connectPacket, sizeof(PipePacketHeader)));
}

View File

@@ -12,8 +12,6 @@ internal sealed partial class PrivateNamedPipeServer : IDisposable
{
private readonly PrivateNamedPipeMessageDispatcher messageDispatcher;
private readonly RuntimeOptions runtimeOptions;
private readonly ITaskContext taskContext;
private readonly App app;
private readonly CancellationTokenSource serverTokenSource = new();
private readonly SemaphoreSlim serverSemaphore = new(1);
@@ -24,8 +22,6 @@ internal sealed partial class PrivateNamedPipeServer : IDisposable
{
messageDispatcher = serviceProvider.GetRequiredService<PrivateNamedPipeMessageDispatcher>();
runtimeOptions = serviceProvider.GetRequiredService<RuntimeOptions>();
taskContext = serviceProvider.GetRequiredService<ITaskContext>();
app = serviceProvider.GetRequiredService<App>();
PipeSecurity? pipeSecurity = default;
@@ -89,7 +85,7 @@ internal sealed partial class PrivateNamedPipeServer : IDisposable
switch ((header->Type, header->Command, header->ContentType))
{
case (PipePacketType.Request, PipePacketCommand.Connect, _):
case (PipePacketType.Request, PipePacketCommand.RequestElevatedStatus, _):
PipePacketHeader elevatedPacket = default;
elevatedPacket.Version = 1;
elevatedPacket.Type = PipePacketType.Response;