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: termenv_windows.go
    path of file: ./repos/scan4all/vendor/github.com/muesli/termenv
    
    the code of the file until where you have to start completion: //go:build windows
// +build windows

package termenv

import (
	"fmt"
	"strconv"

	"golang.org/x/sys/windows"
)

func (o *Output) ColorProfile() Profile {
	if !o.isTTY() {
		return Ascii
	}

	if o.environ.Getenv("ConEmuANSI") == "ON" {
		return TrueColor
	}

	winVersion, _, buildNumber := windows.RtlGetNtVersionNumbers()
	if buildNumber < 10586 || winVersion < 10 {
		// No ANSI support before Windows 10 build 10586.
		if o.environ.Getenv("ANSICON") != "" {
			conVersion := o.environ.Getenv("ANSICON_VER")
			cv, err := strconv
    
func EnableVirtualTerminalProcessing(o *Output) (restoreFunc func() error, err error) {
	// There is nothing to restore until we set the console mode.
	restoreFunc = func() error {
		return nil
	}

	// If o is not a tty, then there is nothing to do.
	tty := o.TTY()
	if tty == nil {
		return
	}

	// Get the current console mode. If there is an error, assume that o is not
	// a terminal, discard the error, and return.
	var mode uint32
	if err2 := windows.GetConsoleMode(windows.Handle(tty.Fd()), &mode); err2 != nil {
		return
	}

	// If virtual terminal processing is already set, then there is nothing to
	// do and nothing to restore.
	if mode&windows.ENABLE_VIRTUAL_TERMINAL_PROCESSING == windows.ENABLE_VIRTUAL_TERMINAL_PROCESSING {
		return
	}

	// Enable virtual terminal processing. See
	// https://docs.microsoft.com/en-us/windows/console/console-virtual-terminal-sequences
	if err2 := windows.SetConsoleMode(windows.Handle(tty.Fd()), mode|windows.ENABLE_VIRTUAL_TERMINAL_PROCESSING); err2 != nil {
		err = fmt.Errorf("windows.SetConsoleMode: %w", err2)
		return
	}

	// Set the restore function. We maintain a reference to the tty in the
	// closure (rather than just its handle) to ensure that the tty is not
	// closed by a finalizer.
	restoreFunc = func() error {
		return windows.SetConsoleMode(windows.Handle(tty.Fd()), mode)
	}

	return
}