Browse Source

Fix some issues with console initialization

pull/65/head
Meivyn 1 year ago
parent
commit
840e25a11b
No known key found for this signature in database GPG Key ID: 8BDD3E48158B2F71
2 changed files with 5 additions and 4 deletions
  1. +2
    -4
      IPA.Loader/Logging/ConsoleWindow.cs
  2. +3
    -0
      docs/articles/command-line.md

+ 2
- 4
IPA.Loader/Logging/ConsoleWindow.cs View File

@ -24,10 +24,8 @@ namespace IPA.Logging
public static void Initialize(int processId, bool alwaysCreateNewConsole = false)
{
bool consoleAttached = true;
if (alwaysCreateNewConsole
|| (!AttachConsole(processId)
&& Marshal.GetLastWin32Error() != ErrorAccessDenied))
bool consoleAttached;
if (alwaysCreateNewConsole || !(consoleAttached = AttachConsole(processId)))
{
consoleAttached = AllocConsole();
}


+ 3
- 0
docs/articles/command-line.md View File

@ -40,6 +40,9 @@ Here's a quick list of what they are and what they do.
> ```powershell
> powershell -c ".\steam -applaunch 620980 --verbose (Get-CimInstance Win32_Process -Filter ProcessId=$PID).ParentProcessId"
> ```
>
> Do note that this isn't going to work from an elevated terminal.
- `--debug`


Loading…
Cancel
Save