Untitled

mail@pastecode.io avatar
unknown
plain_text
2 years ago
345 B
2
Indexable
HANDLE hToken;
    if (OpenProcessToken(GetCurrentProcess(), TOKEN_QUERY, &hToken)) {
        TOKEN_ELEVATION elevation;
        DWORD dwSize;
        if (GetTokenInformation(hToken, TokenElevation, &elevation, sizeof(elevation), &dwSize)) {
            isElevated = (elevation.TokenIsElevated != 0);
        }
        CloseHandle(hToken);
    }