#ifndef _WINSTA_H
NTSYSAPI
BOOLEAN
NTAPI
WinStationNameFromLogonIdW(
_In_opt_ HANDLE ServerHandle,
_In_ ULONG SessionId,
_Out_writes_(WINSTATIONNAME_LENGTH + 1) PWSTR WinStationName
);
View code on GitHubThis function is a wrapper over an RPC method documented in the [MS-TSTS] specification.