Location: Symbol Reference > Files > JwsclToken.pas
JWSCL Documentation
ContentsIndexHome
PreviousUpNext
JwsclToken.pas

Project JEDI Windows Security Code Library (JWSCL) 

Provides access to security token objects

The Original Code is JwsclToken.pas. 

The Initial Developer of the Original Code is Christian Wimmer. Portions created by Christian Wimmer are Copyright (C) Christian Wimmer. All rights reserved. 

See Jwscl.inc for Vista related stuff!

Christian Wimmer

 
Name 
Description 
 
TJwPrivilege contains information about a token privilege 
 
TJwPrivilegeSet is a set of Privileges (defined by TJwPrivilege) There are two types of instances of TJwPrivilegeSet.
  1. TJwPrivilegeSet with an assigned token
  2. TJwPrivilegeSet without an assigned token.
It is not possible to change from one to the other case.
  1. If the token is assigned, you can enable or disable privileges. However
you cannot change privileges arbitrarily.
  1. If the privleges set is not assigned to a token, you can add or remove privileges arbitrarily.
However you cannot enable or disable privileges.
The description of these function shows what happens in one of these cases. 
 
TJwSecurityToken administers a token (impersonated or primary) All token information are retrieved dynamically. The token handle is closed on instance destroying if Shared is set to false.
A token is a security card that gives the logged on user the right to do things (like start processes a.s.o). Without a token the user would have to prove his/her security state to the system every time.
The system creates a process token for the process that it can use to get its security constraints. A process token is also called primary token. The process can create threads and decrement their security... more 
 
TJwSecurityTokenStatistics is a class that holds information about a token. For a detailed description see msdn : http://msdn2.microsoft.com/en-us/library/aa379632.aspx 
Name 
Description 
JwsclStrings, must be at the end of uses list!!! 
 
Name 
Description 
 
This is record TJwPrivilegeQueryType. 
 
This is record TJwPrivilegeSetType. 
 
Name 
Description 
 
JwCheckAdministratorAccess checks if the user has administrative rights.
 
 
JwCreateRestrictedToken creates a restricted token from the current process.
Remark: The function adapts the token security permission to allow the user access to its resources created with the restricted token (by setting a different token default dacl). This is necessary if you intend to strip away the Administrators group.
The function also sets the integrity level for Vista or above.
If the current process token does not have the Administrators group the function just returns a copy of the current process token. 
 
JwEnablePrivilege en- or disables a given privilege.  
 
JwGetPrivilegesText returns a string filled with privilege names (of current token) and their states seperated by #13#10. SE_XXXXX [enabled SE_XXXXX [disabled 
 
JwGetPrivilegesText returns a string filled with privilege names (of current token) and their states seperated by #13#10. SE_XXXXX [enabled] SE_XXXXX [disabled] This function returns the status of the given privileges in parameter DisplayPrivileges.  
 
JwGetProcessLogonSession returns the logon session ID of the given process. By default the current process is used  
 
JwIsMemberOfAdministratorsGroup checks if the user is a direct member of the Administrators group and this group is enabled for access checking. Therefore if this group has the flag use-for-deny-only the returned value is false. This usually happens if the user is an Administrator in Windows Vista with activated UAC.
 
 
JwIsPrivilegeSet checks whether a given privilege is available or enabled in the current process or thread.  
 
JwIsSystem returns true if the current process is running in the system context. It does not matter whether the process is in fact a service or not. 
 
JwIsUACEnabled checks whether the current Windows has UAC enabled.
 
 
Name 
Description 
 
This is record TJwSaferComputeTokenResult. 
Name 
Description 
This is type TWtsGetActiveConsoleSessionID. 
Name 
Description 
This is variable _WtsGetActiveConsoleSessionID. 
JwProcessHeap contains an handle to the process' heap. It is used to allocate memory on the heap. On unit initialization it is automatically set using GetProcessHeap (see http://msdn2.microsoft.com/en-us/library/aa366569.aspx). There is no need to change this value. Be aware that in future release this variable can become obsolete because the used memory functions are adapted or even replaced. 
License

The contents of this file are subject to the Mozilla Public License Version 1.1 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.mozilla.org/MPL/ 

Software distributed under the License is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for the specific language governing rights and limitations under the License. 

Alternatively, the contents of this file may be used under the terms of the GNU Lesser General Public License (the "LGPL License"), in which case the provisions of the LGPL License are applicable instead of those above. If you wish to allow use of your version of this file only under the terms of the LGPL License and not to allow others to use your version of this file under the MPL, indicate your decision by deleting the provisions above and replace them with the notice and other provisions required by the LGPL License. If you do not delete the provisions above, a recipient may use your version of this file under either the MPL or the LGPL License. 

For more information about the LGPL: http://www.gnu.org/copyleft/lesser.html

Copyright (c) 2010. All rights reserved.
This help was created by Doc-O-Matic sponsored by toolsfactory software inc.
What do you think about this topic? Send feedback!