|
JWSCL Documentation
|
constructor CreateTokenByProcess(const aProcessHandle: TJwProcessHandle; const aDesiredAccess: TJwAccessMask; const Duplicate: Boolean = false); virtual;
|
Parameters |
Description |
|
const aProcessHandle: TJwProcessHandle |
Receives a process handle which is used to get the process token. The handle can be zero (0) to use the current process handle of the caller |
|
const aDesiredAccess: TJwAccessMask |
Receives the desired access for this token. The access types can be get from the following list. Access flags must be concatenated with or operator. Can be MAXIMUM_ALLOWED to get maximum access. |
|
const Duplicate: Boolean = false |
Defines whether the token of the Processhandle should be spawned into this process. If this parameter is true the token handle is opened and duplicated. The new handle may have more rights for the current process. This is especially useful if another process is defined in aProcessHandle because the handle to this process token may be restricted. If you want to use DuplicateToken or creating an impersonated token (by ConvertToImpersonatedToken) you must specific TOKEN_DUPLICATE. Access Rights for Access-Token Objects: from http://msdn2.microsoft.com/en-us/library/aa374905.aspx:
Standard Access Rights: from http://msdn2.microsoft.com/en-us/library/aa379607.aspx
The Windows API also defines the following combinations of the standard access rights constants.
) |
CreateTokenByProcess creates a new instances and opens a process token.
To open a token of another session rather than the current session the current process token must be the SYSTEM token. Only the access right TOKEN_READ can be used with an admin token.
If parameter aDesiredAccess is MAXIMUM_ALLOWED and the right READ_CONTROL is not granted the value of the property AccessMask is zero. Otherwise it contains all granted rights for the token.
If you do not specify TOKEN_DUPLICATE, you will get direct access to the target process' token. Therefore you can change the behaviour of the process by changing enabled privileges. This does not affect an impersonation of the token because for this action is has to be duplicated.
|
Exceptions |
Description |
|
If the token could not be opened |
|
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!
|