mirror of
https://github.com/fastfetch-cli/fastfetch.git
synced 2026-10-30 00:37:23 +01:00
Windows: defines NtCurrentProcess and uses it
This commit is contained in:
@@ -6,6 +6,7 @@
|
||||
#include "common/windows/registry.h"
|
||||
#include "common/windows/unicode.h"
|
||||
#include "common/windows/version.h"
|
||||
#include "common/windows/nt.h"
|
||||
#include "common/stringUtils.h"
|
||||
|
||||
#include <stdalign.h>
|
||||
@@ -223,7 +224,7 @@ static bool detectDefaultTerminal(FFTerminalResult* result)
|
||||
conhost:;
|
||||
ULONG_PTR conhostPid = 0;
|
||||
ULONG size;
|
||||
if(NT_SUCCESS(NtQueryInformationProcess(GetCurrentProcess(), ProcessConsoleHostProcess, &conhostPid, sizeof(conhostPid), &size)) && conhostPid != 0)
|
||||
if(NT_SUCCESS(NtQueryInformationProcess(NtCurrentProcess(), ProcessConsoleHostProcess, &conhostPid, sizeof(conhostPid), &size)) && conhostPid != 0)
|
||||
{
|
||||
// For Windows Terminal, it reports the PID of OpenConsole
|
||||
if(ffProcessGetInfoWindows((uint32_t) conhostPid, NULL, &result->processName, &result->exe, &result->exeName, &result->exePath, NULL))
|
||||
|
||||
Reference in New Issue
Block a user