Home | History | Annotate | Download | only in windows
      1 // MACHINE GENERATED BY 'go generate' COMMAND; DO NOT EDIT
      2 
      3 package windows
      4 
      5 import "unsafe"
      6 import "syscall"
      7 
      8 var _ unsafe.Pointer
      9 
     10 var (
     11 	modiphlpapi = syscall.NewLazyDLL("iphlpapi.dll")
     12 	modkernel32 = syscall.NewLazyDLL("kernel32.dll")
     13 
     14 	procGetAdaptersAddresses = modiphlpapi.NewProc("GetAdaptersAddresses")
     15 	procGetComputerNameExW   = modkernel32.NewProc("GetComputerNameExW")
     16 	procMoveFileExW          = modkernel32.NewProc("MoveFileExW")
     17 )
     18 
     19 func GetAdaptersAddresses(family uint32, flags uint32, reserved uintptr, adapterAddresses *IpAdapterAddresses, sizeOfPointer *uint32) (errcode error) {
     20 	r0, _, _ := syscall.Syscall6(procGetAdaptersAddresses.Addr(), 5, uintptr(family), uintptr(flags), uintptr(reserved), uintptr(unsafe.Pointer(adapterAddresses)), uintptr(unsafe.Pointer(sizeOfPointer)), 0)
     21 	if r0 != 0 {
     22 		errcode = syscall.Errno(r0)
     23 	}
     24 	return
     25 }
     26 
     27 func GetComputerNameEx(nameformat uint32, buf *uint16, n *uint32) (err error) {
     28 	r1, _, e1 := syscall.Syscall(procGetComputerNameExW.Addr(), 3, uintptr(nameformat), uintptr(unsafe.Pointer(buf)), uintptr(unsafe.Pointer(n)))
     29 	if r1 == 0 {
     30 		if e1 != 0 {
     31 			err = error(e1)
     32 		} else {
     33 			err = syscall.EINVAL
     34 		}
     35 	}
     36 	return
     37 }
     38 
     39 func MoveFileEx(from *uint16, to *uint16, flags uint32) (err error) {
     40 	r1, _, e1 := syscall.Syscall(procMoveFileExW.Addr(), 3, uintptr(unsafe.Pointer(from)), uintptr(unsafe.Pointer(to)), uintptr(flags))
     41 	if r1 == 0 {
     42 		if e1 != 0 {
     43 			err = error(e1)
     44 		} else {
     45 			err = syscall.EINVAL
     46 		}
     47 	}
     48 	return
     49 }
     50