RtlGetConsoleSessionForegroundProcessId - NtDoc

Native API online documentation, based on the System Informer (formerly Process Hacker) phnt headers
#ifndef _NTRTL_H
#ifdef PHNT_INLINE_TYPEDEFS
#if (PHNT_VERSION >= PHNT_REDSTONE)

// private
FORCEINLINE
LONGLONG
NTAPI
RtlGetConsoleSessionForegroundProcessId(
    VOID
    )
{
    if (NtCurrentPeb()->SharedData && NtCurrentPeb()->SharedData->ServiceSessionId)
        return NtCurrentPeb()->SharedData->ConsoleSessionForegroundProcessId;
    else
        return USER_SHARED_DATA->ConsoleSessionForegroundProcessId;
}

#endif
#endif
#endif

View code on GitHub
#ifndef _NTRTL_H
#ifdef PHNT_INLINE_TYPEDEFS
// ...
#else
#if (PHNT_VERSION >= PHNT_REDSTONE)

// private
NTSYSAPI
LONGLONG
NTAPI
RtlGetConsoleSessionForegroundProcessId(
    VOID
    );

#endif
#endif
#endif

View code on GitHub

No description available.