github.com/hspan/go-ole@v0.0.0/ienumvariant_windows.go (about)

     1  // +build windows
     2  
     3  package ole
     4  
     5  import (
     6  	"syscall"
     7  	"unsafe"
     8  )
     9  
    10  func (enum *IEnumVARIANT) Clone() (cloned *IEnumVARIANT, err error) {
    11  	hr, _, _ := syscall.Syscall(
    12  		enum.VTable().Clone,
    13  		2,
    14  		uintptr(unsafe.Pointer(enum)),
    15  		uintptr(unsafe.Pointer(&cloned)),
    16  		0)
    17  	if hr != 0 {
    18  		err = NewError(hr)
    19  	}
    20  	return
    21  }
    22  
    23  func (enum *IEnumVARIANT) Reset() (err error) {
    24  	hr, _, _ := syscall.Syscall(
    25  		enum.VTable().Reset,
    26  		1,
    27  		uintptr(unsafe.Pointer(enum)),
    28  		0,
    29  		0)
    30  	if hr != 0 {
    31  		err = NewError(hr)
    32  	}
    33  	return
    34  }
    35  
    36  func (enum *IEnumVARIANT) Skip(celt uint) (err error) {
    37  	hr, _, _ := syscall.Syscall(
    38  		enum.VTable().Skip,
    39  		2,
    40  		uintptr(unsafe.Pointer(enum)),
    41  		uintptr(celt),
    42  		0)
    43  	if hr != 0 {
    44  		err = NewError(hr)
    45  	}
    46  	return
    47  }
    48  
    49  func (enum *IEnumVARIANT) Next(celt uint) (array VARIANT, length uint, err error) {
    50  	hr, _, _ := syscall.Syscall6(
    51  		enum.VTable().Next,
    52  		4,
    53  		uintptr(unsafe.Pointer(enum)),
    54  		uintptr(celt),
    55  		uintptr(unsafe.Pointer(&array)),
    56  		uintptr(unsafe.Pointer(&length)),
    57  		0,
    58  		0)
    59  	if hr != 0 {
    60  		err = NewError(hr)
    61  	}
    62  	return
    63  }