| 1 | package unix |
| 2 | |
| 3 | import ( |
| 4 | "syscall" |
| 5 | |
| 6 | "golang.org/x/sys/windows" |
| 7 | ) |
| 8 | |
| 9 | func BytePtrFromString(s string) (*byte, error) { |
| 10 | p, err := windows.BytePtrFromString(s) |
| 11 | if err == syscall.EINVAL { |
| 12 | err = EINVAL |
| 13 | } |
| 14 | return p, err |
| 15 | } |
| 16 | |
| 17 | func ByteSliceToString(s []byte) string { |
| 18 | return windows.ByteSliceToString(s) |
| 19 | } |
| 20 | |
| 21 | func ByteSliceFromString(s string) ([]byte, error) { |
| 22 | return windows.ByteSliceFromString(s) |
| 23 | } |