novitiate has asked for the wisdom of the Perl Monks concerning the following question:
'The SID is stored in a hexadecimal representation of the binary SID 'so we convert it and store it in a byte array tmp = Len(strSID) / 2 - 1 ReDim bByte(tmp) As Byte For i = 0 To tmp - 1 bByte(i) = CInt("&h" & Mid(strSID, (i * 2) + 1, 2)) Next 'Allocate space for the strings so the API won't GPF strName = Space(64) strDomain = Space(64) 'Get the NT Domain and UserName 'Note: This can't be done from VBScript directly 'because VBScript doesn't support making the 'LookupAccountSid API call ret = LookupAccountSid(vbNullString, bByte(0), strName, Len(strName) +, strDomain, Len(strDomain), iType
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: pack hex to bin
by I0 (Priest) on Aug 22, 2001 at 22:58 UTC | |
by novitiate (Scribe) on Aug 22, 2001 at 23:44 UTC | |
|
Re: pack hex to bin
by blakem (Monsignor) on Aug 22, 2001 at 23:07 UTC |