mirror of
https://github.com/microsoft/PowerToys.git
synced 2024-12-12 02:09:24 +08:00
Fix crash
This commit is contained in:
parent
a3be4cb6d6
commit
48811ecb4d
@ -95,9 +95,12 @@ namespace FileLocksmith::Interop
|
||||
}
|
||||
|
||||
static array<System::String ^>^ ReadPathsFromPipe(System::String^ pipeName)
|
||||
{
|
||||
HANDLE hStdin = INVALID_HANDLE_VALUE;
|
||||
|
||||
if (!pipeName->Empty)
|
||||
{
|
||||
std::wstring pipe = from_system_string(pipeName);
|
||||
HANDLE hStdin;
|
||||
|
||||
if (pipe.size() > 0)
|
||||
{
|
||||
@ -129,6 +132,7 @@ namespace FileLocksmith::Interop
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
hStdin = GetStdHandle(STD_INPUT_HANDLE);
|
||||
|
@ -82,11 +82,6 @@ namespace PowerToys.FileLocksmithUI.ViewModels
|
||||
var args = Environment.GetCommandLineArgs();
|
||||
var pipeName = args.Where(s => s.Contains("\\\\.\\pipe\\")).FirstOrDefault();
|
||||
|
||||
foreach (var s in args)
|
||||
{
|
||||
MessageBox.Show(s);
|
||||
}
|
||||
|
||||
paths = NativeMethods.ReadPathsFromPipe(pipeName);
|
||||
Logger.LogInfo($"Starting FileLocksmith with {paths.Length} files selected.");
|
||||
LoadProcessesCommand = new AsyncRelayCommand(LoadProcessesAsync);
|
||||
|
Loading…
Reference in New Issue
Block a user