| 888 | } |
| 889 | |
| 890 | bool GetSessionIdFromToken(HANDLE handle, DWORD &sessionid) |
| 891 | { |
| 892 | DWORD returnLength; |
| 893 | |
| 894 | if (GetTokenInformation(handle, TokenSessionId, &sessionid, sizeof(sessionid), &returnLength) && |
| 895 | returnLength == sizeof(sessionid)) { |
| 896 | DbgPrint(L"SessionId = %u\n", sessionid); |
| 897 | return true; |
| 898 | } else { |
| 899 | DWORD lastErr = GetLastError(); |
| 900 | DbgPrint(L"failed to get SessionId, LastErr = %u\n", lastErr); |
| 901 | return false; |
| 902 | } |
| 903 | } |
| 904 | |
| 905 | bool CanGetSessionIdOk() |
| 906 | { |
no test coverage detected