[Jedi-apilib+wscl-svn] SF.net SVN: jedi-apilib:[992] jwscl/branches/0.9.3/source
Brought to you by:
dezipaitor,
rweijnen
From: <dez...@us...> - 2010-07-28 15:18:32
|
Revision: 992 http://jedi-apilib.svn.sourceforge.net/jedi-apilib/?rev=992&view=rev Author: dezipaitor Date: 2010-07-28 15:18:26 +0000 (Wed, 28 Jul 2010) Log Message: ----------- #updated docs #fixed a bug with CheckTokenMembership Modified Paths: -------------- jwscl/branches/0.9.3/source/JwsclProcess.pas jwscl/branches/0.9.3/source/JwsclToken.pas Modified: jwscl/branches/0.9.3/source/JwsclProcess.pas =================================================================== --- jwscl/branches/0.9.3/source/JwsclProcess.pas 2010-07-28 15:09:22 UTC (rev 991) +++ jwscl/branches/0.9.3/source/JwsclProcess.pas 2010-07-28 15:18:26 UTC (rev 992) @@ -709,12 +709,19 @@ same name} StartupInfo : {$IFDEF UNICODE}TStartupInfoW{$ELSE}TStartupInfoA{$ENDIF}; - AdditionalGroups : TJwSecurityIdList; //zus\xE4tzliche Groups f\xFCrs Token + {Additional groups for the resulting token. May be nil. + The resulting token will have the groups of Administrator, the given groups here + and some more. + Logon SIDs are never added. + } + AdditionalGroups : TJwSecurityIdList; - {<B>SourceName</B> defines the source name which is stored in the token} + {<B>SourceName</B> defines the source name which is stored in the token. Your name of choice + that identifies the source of this token} SourceName : AnsiString; - {<B>OriginName</B> defines the initiator name of the token} + {<B>OriginName</B> defines the initiator name of the token. Your name of choice + that identifies the origin of this token} OriginName : AnsiString; {<B>SessionID</B> defines the target session ID of the new process @@ -738,10 +745,10 @@ {<B>LogonSID</B> can be the logon sid to be used for the new token. May be nil. In this case (and LogonToken = nil) the logon sid of the token with the given SessionID is used.} - LogonSID : TJwSecurityID; //optionales logon SID f\xFCr Tokengroups - eigenes Token + LogonSID : TJwSecurityID; {<B>Parameters</B> contains parameters for CreateProcessAsUser} - Parameters : TJwCreateProcessParameters; //Parameter f\xFCr CP + Parameters : TJwCreateProcessParameters; {<b>MaximumTryCount</b> defines the maximum try count for CreateProcessAsUser. The call is only repeated if CPAU returns ERROR_PIPE_BUSY which is a known Modified: jwscl/branches/0.9.3/source/JwsclToken.pas =================================================================== --- jwscl/branches/0.9.3/source/JwsclToken.pas 2010-07-28 15:09:22 UTC (rev 991) +++ jwscl/branches/0.9.3/source/JwsclToken.pas 2010-07-28 15:18:26 UTC (rev 992) @@ -855,7 +855,11 @@ {<B>CheckTokenMembership</B> checks whether a given SID is member of the token. It returns true if the SID could be found in the list ignoring - whether the SID is enabled or not; otherwise it returns false.} + whether the SID is enabled or not; otherwise it returns false. + + Exceptions + EJwsclWinCallFailedException This exception is thrown if winapi call CheckTokenMembership failed. + } function CheckTokenMembership(aSidToCheck: TJwSecurityId): boolean; {<B>IsEqual</B> compares the token instance with a second one. @@ -4734,7 +4738,12 @@ CheckTokenHandle('CheckTokenMembership'); bRes := True; - jwaWindows.CheckTokenMembership(Self.TokenHandle, @aSidToCheck.SID, bRes); + if not jwaWindows.CheckTokenMembership(Self.TokenHandle, aSidToCheck.SID, + bRes) then + raise EJwsclWinCallFailedException.CreateFmtEx( + RsWinCallFailed, 'CheckTokenMembership', + ClassName, RsUNToken, 0, True, ['CheckTokenMembership']); + Result := bRes; end; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |