Einzelnen Beitrag anzeigen

Dezipaitor

Registriert seit: 14. Apr 2003
Ort: Stuttgart
1.701 Beiträge
 
Delphi 7 Professional
 
#29

Re: JEDI Windows Security Code Library

  Alt 13. Dez 2007, 09:30
JwsclToken exportiert eine Reihe von Funktionen.

Delphi-Quellcode:
{@Name checks if the user has administrative access to secured object.
This function checks if an access to a secured object, which only
users of the administration group have access, succeeds or fails.
The advantage of this function is that it also can be used with restricted
tokens, which are quite common since Windows XP and especially Vista.

@return Returns true if the user has administrative access; otherwise false.
}

function JwCheckAdministratorAccess : Boolean;
Wenn du weißt, welches Privileg du benötigst, kannst du das auch überprüfen:
Delphi-Quellcode:
{@Name checks whether a given privilege is available or enabled in the actual process or thread.
@param Index gets the privilege name
@param query defines whether the given privilege should be checked for availability or is enable
@return Returns true if the privilege is available and enabled. If the privilege is not available or disabled the result is false.
}

function JwIsPrivilegeSet(const Index: string;
  const Query: TJwPrivilegeQueryType = pqt_Available): boolean;
Eine Liste von verfügbaren Privilegien findest du damit
Delphi-Quellcode:
{@Name returns a string filled with privilege names (of current token) and their states seperated by #13#10.
SE_XXXXX [enabled]
SE_XXXXX [disabled]
}

function JwGetPrivilegesText: TJwString;
Christian
Windows, Tokens, Access Control List, Dateisicherheit, Desktop, Vista Elevation?
Goto: JEDI API LIB & Windows Security Code Library (JWSCL)
  Mit Zitat antworten Zitat