Function Reference


_Security__GetLengthSid

Returns the length, in bytes, of a valid SID

#include <Security.au3>
_Security__GetLengthSid ( $pSID )

Parameters

$pSID Pointer to a SID

Return Value

Success: the length of SID.
Failure: 0.

Related

_Security__IsValidSid

See Also

Search GetLengthSid in MSDN Library.

Example

#include <Security.au3>

Local $tSID = _Security__GetAccountSid(@UserName)
If Not @error Then
        ; $tSID is structure filled with SID data for spesified account
        ; Check its length:
        Local $iLength = _Security__GetLengthSid($tSID)
        ConsoleWrite("The length of SID is: " & $iLength & " bytes" & @CRLF)

        ; ... The rest of the script here...
EndIf