<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[welche rechte habe ich?]]></title><description><![CDATA[<p>hallo, kann mir mal jemand sagen, wie ich in windows (xp) mittels irgendwelcher apis rausbekomme, welche rechte ich momentan besitzte? ich will eigentlich nur wissen, ob ich ein normaler user bin oder amdinistrator.<br />
ein code schnippel wäre super.</p>
<p>gruß<br />
mc_ginley</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/117669/welche-rechte-habe-ich</link><generator>RSS for Node</generator><lastBuildDate>Fri, 03 Jul 2026 14:38:55 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/117669.rss" rel="self" type="application/rss+xml"/><pubDate>Wed, 10 Aug 2005 07:59:08 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to welche rechte habe ich? on Wed, 10 Aug 2005 07:59:08 GMT]]></title><description><![CDATA[<p>hallo, kann mir mal jemand sagen, wie ich in windows (xp) mittels irgendwelcher apis rausbekomme, welche rechte ich momentan besitzte? ich will eigentlich nur wissen, ob ich ein normaler user bin oder amdinistrator.<br />
ein code schnippel wäre super.</p>
<p>gruß<br />
mc_ginley</p>
]]></description><link>https://www.c-plusplus.net/forum/post/849126</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/849126</guid><dc:creator><![CDATA[mc_ginley]]></dc:creator><pubDate>Wed, 10 Aug 2005 07:59:08 GMT</pubDate></item><item><title><![CDATA[Reply to welche rechte habe ich? on Wed, 10 Aug 2005 10:03:07 GMT]]></title><description><![CDATA[<p>Also ich weis zwar keine Code-Schnipsel für dich aber soweit ichw eis, gibts für Wartungsarbeiten einen Admin zugangd er Admin heist, den erreicht man aber nur wenn man die Modusauswahl hat, ansonsten is jeder User ein Admin bis man es umstellt, gilt vor allem für den ersten User der is immer Admin.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/849218</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/849218</guid><dc:creator><![CDATA[Raven2]]></dc:creator><pubDate>Wed, 10 Aug 2005 10:03:07 GMT</pubDate></item><item><title><![CDATA[Reply to welche rechte habe ich? on Wed, 10 Aug 2005 12:22:33 GMT]]></title><description><![CDATA[<p>Ich habe hier leider nur etwas Delphi Code, aber die APIs sind ja die gleichen:</p>
<pre><code>function GetAdminSid: PSID;
const
  // bekannte SIDs ... (WinNT.h)
  SECURITY_NT_AUTHORITY  : TSIDIdentifierAuthority = (Value: (0, 0, 0, 0, 0, 5));
  // bekannte RIDs ... (WinNT.h)
  SECURITY_BUILTIN_DOMAIN_RID: DWORD = $00000020;
  DOMAIN_ALIAS_RID_ADMINS: DWORD = $00000220;
begin
  Result := nil;
  AllocateAndInitializeSid(SECURITY_NT_AUTHORITY, 2,
    SECURITY_BUILTIN_DOMAIN_RID, DOMAIN_ALIAS_RID_ADMINS,
    0, 0, 0, 0, 0, 0, Result);
end;

////////////////////////////////////////////////////////////////////////////////
//
//  IsAdmin
//    Autor: Nico Bendlin

function IsAdmin: LongBool;
var
  TokenHandle            : THandle;
  ReturnLength           : DWORD;
  TokenInformation       : PTokenGroups;
  AdminSid               : PSID;
  Loop                   : Integer;
begin
  Result := False;
  TokenHandle := 0;
  if OpenProcessToken(GetCurrentProcess, TOKEN_QUERY, TokenHandle) then
  try
    ReturnLength := 0;
    GetTokenInformation(TokenHandle, TokenGroups, nil, 0, ReturnLength);
    TokenInformation := GetMemory(ReturnLength);
    if Assigned(TokenInformation) then
    try
      if GetTokenInformation(TokenHandle, TokenGroups, TokenInformation,
        ReturnLength, ReturnLength) then
      begin
        AdminSid := GetAdminSid;
        for Loop := 0 to TokenInformation^.GroupCount - 1 do
        begin
          if EqualSid(TokenInformation^.Groups[Loop].Sid, AdminSid) then
          begin
            Result := True;
            Break;
          end;
        end;
        FreeSid(AdminSid);
      end;
    finally
      FreeMemory(TokenInformation);
    end;
  finally
    CloseHandle(TokenHandle);
  end;
end;
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/849356</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/849356</guid><dc:creator><![CDATA[[[global:former_user]]]]></dc:creator><pubDate>Wed, 10 Aug 2005 12:22:33 GMT</pubDate></item></channel></rss>