Adding VHD library with simple function, updating mksyscall

Adds the basic structs for VHD function calls and includes one simple wrapper for VHDX creation.
This includes the updated version of mksyscall_windows.go, which previously assumed any api that doesn't end in "W" must not be unicode, and encodes the strings incorrectly. This hard-codes for unicode support and generates the syscalls from there.
This commit is contained in:
Stefan Wernli
2017-07-11 21:12:04 -07:00
parent 1bbb8c8d24
commit 24d09c6f4b
3 changed files with 150 additions and 3 deletions
+4 -3
View File
@@ -2,6 +2,8 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
// Hard-coding unicode mode for VHD library.
// +build ignore
/*
@@ -556,8 +558,7 @@ func (f *Fn) HelperCallParamList() string {
// IsUTF16 is true, if f is W (utf16) function. It is false
// for all A (ascii) functions.
func (f *Fn) IsUTF16() bool {
s := f.DLLFuncName()
return s[len(s)-1] == 'W'
return true
}
// StrconvFunc returns name of Go string to OS string function for f.
@@ -897,4 +898,4 @@ func {{.HelperName}}({{.HelperParamList}}) {{template "results" .}}{
{{define "printtrace"}}{{if .PrintTrace}} print("SYSCALL: {{.Name}}(", {{.ParamPrintList}}") (", {{.Rets.PrintList}}")\n")
{{end}}{{end}}
`
`