mirror of
https://jihulab.com/DGP-Studio/Snap.Hutao.git
synced 2025-11-19 21:02:53 +08:00
code style
This commit is contained in:
@@ -6,9 +6,9 @@ namespace Snap.Hutao.Core.LifeCycle.InterProcess;
|
||||
internal enum PipePacketCommand : byte
|
||||
{
|
||||
None = 0,
|
||||
Connect = 1,
|
||||
|
||||
RedirectActivation = 10,
|
||||
RequestElevatedStatus = 11,
|
||||
|
||||
Exit = 30,
|
||||
}
|
||||
@@ -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)));
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user