func BytePtrFromString(s string) (*byte, error) {
	a, err := ByteSliceFromString(s)
	if err != nil {
		return nil, err
	}
	return &a[0], nil
}
BytePtrFromString returns a pointer to a NUL-terminated array of
bytes containing the text of s. If s contains a NUL byte at any
location, it returns (nil, syscall.EINVAL).
package windows  
import (
	"bytes"
	"strings"
	"syscall"
	"unsafe"
	"golang.org/x/sys/internal/unsafeheader"
)
func ByteSliceFromString(s string) ([]byte, error) {
	if strings.IndexByte(s, 0) != -1 {
		return nil, syscall.EINVAL
	}
	a := make([]byte, len(s)+1)
	copy(a, s)
	return a, nil
}