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