You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: hcnroute.go
    path of file: ./repos/buildkit/vendor/github.com/Microsoft/hcsshim/hcn
    
    the code of the file until where you have to start completion: //go:build windows

package hcn

import (
	"encoding/json"
	"errors"

	"github.com/Microsoft/go-winio/pkg/guid"
	"github.com/Microsoft/hcsshim/internal/interop"
	"github.com/sirupsen/logrus"
)

// HostComputeRoute represents SDN routes.
type HostComputeRoute struct {
	ID                   string                  `json:"ID,omitempty"`
	HostComputeEndp
    
func createRoute(settings string) (*HostComputeRoute, error) {
	// Create new route.
	var (
		routeHandle      hcnRoute
		resultBuffer     *uint16
		propertiesBuffer *uint16
	)
	routeGUID := guid.GUID{}
	hr := hcnCreateRoute(&routeGUID, settings, &routeHandle, &resultBuffer)
	if err := checkForErrors("hcnCreateRoute", hr, resultBuffer); err != nil {
		return nil, err
	}
	// Query route.
	hcnQuery := defaultQuery()
	query, err := json.Marshal(hcnQuery)
	if err != nil {
		return nil, err
	}
	hr = hcnQueryRouteProperties(routeHandle, string(query), &propertiesBuffer, &resultBuffer)
	if err := checkForErrors("hcnQueryRouteProperties", hr, resultBuffer); err != nil {
		return nil, err
	}
	properties := interop.ConvertAndFreeCoTaskMemString(propertiesBuffer)
	// Close Route.
	hr = hcnCloseRoute(routeHandle)
	if err := checkForErrors("hcnCloseRoute", hr, nil); err != nil {
		return nil, err
	}
	// Convert output to HostComputeRoute
	var outputRoute HostComputeRoute
	if err := json.Unmarshal([]byte(properties), &outputRoute); err != nil {
		return nil, err
	}
	return &outputRoute, nil
}