code: func getCurrentVersionVal(key string) (string, error) {
  	var h windows.Handle
  	if err := windows.RegOpenKeyEx(windows.HKEY_LOCAL_MACHINE,
  		windows.StringToUTF16Ptr(`SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\`),
  		0,
  		windows.KEY_READ,
  		&h); err != nil {
  		return "", err
  	}
  	defer windows.RegCloseKey(h)
  
  	var buf [128]uint16
  	var typ uint32
  	n := uint32(len(buf) * int(unsafe.Sizeof(buf[0]))) // api expects array of bytes, not uint16
  	if err := windows.RegQueryValueEx(h,
  		windows.StringToUTF16Ptr(key),
  		nil,
  		&typ,
  		(*byte)(unsafe.Pointer(&buf[0])),
  		&n); err != nil {
  		return "", err
  	}
  
  	return windows.UTF16ToString(buf[:]), nil
  }
docs: // getCurrentVersionVal gets value of specified key from registry.