Add vendor go.uber.org/zap

This commit is contained in:
Daniele Rondina
2020-01-03 15:20:02 +01:00
parent 20654d5dbb
commit 4433fc72ac
367 changed files with 96853 additions and 36906 deletions

View File

@@ -229,15 +229,13 @@ func LookupSID(system, account string) (sid *SID, domain string, accType uint32,
// String converts SID to a string format suitable for display, storage, or transmission.
func (sid *SID) String() string {
// From https://docs.microsoft.com/en-us/windows/win32/secbiomet/general-constants
const SecurityMaxSidSize = 68
var s *uint16
e := ConvertSidToStringSid(sid, &s)
if e != nil {
return ""
}
defer LocalFree((Handle)(unsafe.Pointer(s)))
return UTF16ToString((*[SecurityMaxSidSize]uint16)(unsafe.Pointer(s))[:])
return UTF16ToString((*[256]uint16)(unsafe.Pointer(s))[:])
}
// Len returns the length, in bytes, of a valid security identifier SID.