github.com/bshelton229/agent@v3.5.4+incompatible/system/version_dump_windows.go (about)

     1  package system
     2  
     3  import (
     4  	"fmt"
     5  	"syscall"
     6  )
     7  
     8  func VersionDump() (string, error) {
     9  	dll := syscall.MustLoadDLL("kernel32.dll")
    10  	p := dll.MustFindProc("GetVersion")
    11  	v, _, _ := p.Call()
    12  
    13  	return fmt.Sprintf("Windows version %d.%d (Build %d)\n", byte(v), uint8(v>>8), uint16(v>>16)), nil
    14  }