code: func createStoreContext(leaf *Certificate, opts *VerifyOptions) (*syscall.CertContext, error) {
  	var storeCtx *syscall.CertContext
  
  	leafCtx, err := syscall.CertCreateCertificateContext(syscall.X509_ASN_ENCODING|syscall.PKCS_7_ASN_ENCODING, &leaf.Raw[0], uint32(len(leaf.Raw)))
  	if err != nil {
  		return nil, err
  	}
  	defer syscall.CertFreeCertificateContext(leafCtx)
  
  	handle, err := syscall.CertOpenStore(syscall.CERT_STORE_PROV_MEMORY, 0, 0, syscall.CERT_STORE_DEFER_CLOSE_UNTIL_LAST_FREE_FLAG, 0)
  	if err != nil {
  		return nil, err
  	}
  	defer syscall.CertCloseStore(handle, 0)
  
  	err = syscall.CertAddCertificateContextToStore(handle, leafCtx, syscall.CERT_STORE_ADD_ALWAYS, &storeCtx)
  	if err != nil {
  		return nil, err
  	}
  
  	if opts.Intermediates != nil {
  		for _, intermediate := range opts.Intermediates.certs {
  			ctx, err := syscall.CertCreateCertificateContext(syscall.X509_ASN_ENCODING|syscall.PKCS_7_ASN_ENCODING, &intermediate.Raw[0], uint32(len(intermediate.Raw)))
  			if err != nil {
  				return nil, err
  			}
  
  			err = syscall.CertAddCertificateContextToStore(handle, ctx, syscall.CERT_STORE_ADD_ALWAYS, nil)
  			syscall.CertFreeCertificateContext(ctx)
  			if err != nil {
  				return nil, err
  			}
  		}
  	}
  
  	return storeCtx, nil
  }
docs: // Creates a new *syscall.CertContext representing the leaf certificate in an in-memory
  // certificate store containing itself and all of the intermediate certificates specified
  // in the opts.Intermediates CertPool.
  //
  // A pointer to the in-memory store is available in the returned CertContext's Store field.
  // The store is automatically freed when the CertContext is freed using
  // syscall.CertFreeCertificateContext.