The ones you found probably does something like this, so I guess that's oldish too :
// -----------------------------------------------------------------------------
//
// RunningAsAdmin
//
// -----------------------------------------------------------------------------
// Detect if we're running at an elevated security level.
// -----------------------------------------------------------------------------
function RunningAsAdmin: boolean;
var
hToken, hProcess: THandle;
pTokenInformation: pointer;
ReturnLength: DWord;
TokenInformation: TTokenElevation;
begin
Result := False;
hProcess := GetCurrentProcess;
try
if OpenProcessToken(hProcess, TOKEN_QUERY, hToken) then
try
FillChar(TokenInformation, SizeOf(TokenInformation), 0);
pTokenInformation := @TokenInformation;
GetTokenInformation(hToken, TokenElevation, pTokenInformation, SizeOf(TokenInformation), ReturnLength);
Result := (TokenInformation.TokenIsElevated <> 0);
finally
CloseHandle(hToken);
end;
except
// Ignore error - although none of the above should throw an exception...
end;
end;