Skip to content

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
diogotr7 committed Jan 3, 2024
1 parent 47b0ac1 commit 9eb4653
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -51,11 +51,14 @@ public LogitechWrapperPrerequisite(Plugin plugin)

public override bool IsMet()
{
using var key64 = Registry.LocalMachine.OpenSubKey(REGISTRY_PATH_64);
using var key32 = Registry.LocalMachine.OpenSubKey(REGISTRY_PATH_32);
var key64 = Registry.LocalMachine.OpenSubKey(REGISTRY_PATH_64);
var key32 = Registry.LocalMachine.OpenSubKey(REGISTRY_PATH_32);

var is64BitKeyPresent = key64?.GetValue(null)?.ToString() == _dllPath64;
var is32BitKeyPresent = key32?.GetValue(null)?.ToString() == _dllPath32;

key64?.Dispose();
key32?.Dispose();

return is64BitKeyPresent && is32BitKeyPresent;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,7 @@ public LogitechPipeListenerService(ILogger logger, Plugin plugin)
_excluded = new();

var id = WTSGetActiveConsoleSessionId();
var pipeName = "LGS_LED_SDK-" + id.ToString("x8");
_pipeListener = new(pipeName);
_pipeListener = new PipeListener($"LGS_LED_SDK-{id:x8}");
_pipeListener.ClientConnected += OnPipeListenerClientConnected;
_pipeListener.ClientDisconnected += OnPipeListenerClientDisconnected;
_pipeListener.CommandReceived += OnPipeListenerCommandReceived;
Expand Down

0 comments on commit 9eb4653

Please sign in to comment.