code: func sysFromCredential(cred *Credential) (result *sysCREDENTIAL) {
  	if cred == nil {
  		return nil
  	}
  	result = new(sysCREDENTIAL)
  	result.Flags = 0
  	result.Type = 0
  	result.TargetName, _ = syscall.UTF16PtrFromString(cred.TargetName)
  	result.Comment, _ = syscall.UTF16PtrFromString(cred.Comment)
  	result.LastWritten = syscall.NsecToFiletime(cred.LastWritten.UnixNano())
  	result.CredentialBlobSize = uint32(len(cred.CredentialBlob))
  	if len(cred.CredentialBlob) > 0 {
  		result.CredentialBlob = uintptr(unsafe.Pointer(&cred.CredentialBlob[0]))
  	} else {
  		result.CredentialBlob = 0
  	}
  	result.Persist = uint32(cred.Persist)
  	result.AttributeCount = uint32(len(cred.Attributes))
  	attributes := make([]sysCREDENTIAL_ATTRIBUTE, len(cred.Attributes))
  	if len(attributes) > 0 {
  		result.Attributes = uintptr(unsafe.Pointer(&attributes[0]))
  	} else {
  		result.Attributes = 0
  	}
  	for i := range cred.Attributes {
  		inAttr := &cred.Attributes[i]
  		outAttr := &attributes[i]
  		outAttr.Keyword, _ = syscall.UTF16PtrFromString(inAttr.Keyword)
  		outAttr.Flags = 0
  		outAttr.ValueSize = uint32(len(inAttr.Value))
  		if len(inAttr.Value) > 0 {
  			outAttr.Value = uintptr(unsafe.Pointer(&inAttr.Value[0]))
  		} else {
  			outAttr.Value = 0
  		}
  	}
  	result.TargetAlias, _ = syscall.UTF16PtrFromString(cred.TargetAlias)
  	result.UserName, _ = syscall.UTF16PtrFromString(cred.UserName)
  
  	return
  }
docs: // Convert the given Credential object back to a CREDENTIAL struct, which can be used for calling the
  // Windows APIs