A
Al
I am using the techinque to get the TokenElevationType using the API
GetTokenInformation on Vista to determine if a user is an admin. It seems to
work fine on Vista Business/Ultimate etc. However, it fails on Vista Home.
Does anyone have any clues?
The code is along the following lines:
TOKEN_ELEVATION_TYPE elevationType;
DWORD dwSize;
GetTokenInformation(hUserToken, TokenElevationType, &elevationType,
sizeof(elevationType), &dwSize);
switch (elevationType)
{
case TokenElevationTypeDefault:
TRACE(_T("TokenElevationTypeDefault - User is not using a split token\n"));
m_bAdmin = FALSE;
break;
case TokenElevationTypeFull:
TRACE(_T("TokenElevationTypeFull - User has a split token, and the
process is running elevated\n"));
m_bAdmin = TRUE;
break;
case TokenElevationTypeLimited:
TRACE(_T("TokenElevationTypeLimited - User has a split token, but the
process is not running elevated\n"));
m_bAdmin = TRUE;
break;
}
Thanks.
GetTokenInformation on Vista to determine if a user is an admin. It seems to
work fine on Vista Business/Ultimate etc. However, it fails on Vista Home.
Does anyone have any clues?
The code is along the following lines:
TOKEN_ELEVATION_TYPE elevationType;
DWORD dwSize;
GetTokenInformation(hUserToken, TokenElevationType, &elevationType,
sizeof(elevationType), &dwSize);
switch (elevationType)
{
case TokenElevationTypeDefault:
TRACE(_T("TokenElevationTypeDefault - User is not using a split token\n"));
m_bAdmin = FALSE;
break;
case TokenElevationTypeFull:
TRACE(_T("TokenElevationTypeFull - User has a split token, and the
process is running elevated\n"));
m_bAdmin = TRUE;
break;
case TokenElevationTypeLimited:
TRACE(_T("TokenElevationTypeLimited - User has a split token, but the
process is not running elevated\n"));
m_bAdmin = TRUE;
break;
}
Thanks.