Exemple #1
1
func copyVariant(p *syscall.Proc, source *types.Variant) (destination *types.Variant, err error) {
	err = errors.HResultToError(p.Call(
		uintptr(unsafe.Pointer(&destination)),
		uintptr(unsafe.Pointer(source))))
	return
}
Exemple #2
0
func PutElement(array *types.COMArray, index int64, element interface{}) (err error) {
	err = errors.HResultToError(procSafeArrayPutElement.Call(
		uintptr(unsafe.Pointer(array)),
		uintptr(index),
		uintptr(unsafe.Pointer(&element))))
	return
}
Exemple #3
0
func GetPointerOfIndex(array *types.COMArray, index int64) (ref uintptr, err error) {
	err = errors.HResultToError(procSafeArrayPtrOfIndex.Call(
		uintptr(unsafe.Pointer(array)),
		uintptr(index),
		uintptr(unsafe.Pointer(&ref))))
	return
}
Exemple #4
0
// AllocateArrayDescriptorEx allocates SafeArray.
//
// AKA: SafeArrayAllocDescriptorEx in Windows API.
func AllocateArrayDescriptorEx(variantType types.VariantType, dimensions uint32) (array *types.COMArray, err error) {
	err = errors.HResultToError(procSafeArrayAllocDescriptorEx.Call(
		uintptr(variantType),
		uintptr(dimensions),
		uintptr(unsafe.Pointer(&array))))
	return
}
Exemple #5
0
func GetUpperBound(array *types.COMArray, dimension uint32) (upperBound int64, err error) {
	err = errors.HResultToError(procSafeArrayGetUBound.Call(
		uintptr(unsafe.Pointer(array)),
		uintptr(dimension),
		uintptr(unsafe.Pointer(&upperBound))))
	return
}
Exemple #6
0
func GetVariantType(array *types.COMArray) (varType types.VariantType, err error) {
	var vt uint16
	err = errors.HResultToError(procSafeArrayGetVartype.Call(
		uintptr(unsafe.Pointer(array)),
		uintptr(unsafe.Pointer(&vt))))
	varType = com.VariantType(vt)
	return
}
Exemple #7
0
func VariantChangeType(source *types.Variant, flags uint16, vt types.VariantType) (destination *types.Variant, err error) {
	err = errors.HResultToError(procVariantChangeType.Call(
		uintptr(unsafe.Pointer(&destination)),
		uintptr(unsafe.Pointer(source)),
		uintptr(flags),
		uintptr(vt)))
	return
}
Exemple #8
0
func VariantClear(v *types.Variant) error {
	return errors.HResultToError(procVariantClear.Call(uintptr(unsafe.Pointer(v))))
}
Exemple #9
0
// Duplicate returns copy of SafeArray.
//
// AKA: SafeArrayCopy in Windows API.
func Duplicate(original *types.COMArray) (array *types.COMArray, err error) {
	err = errors.HResultToError(procSafeArrayCopy.Call(
		uintptr(unsafe.Pointer(original)),
		uintptr(unsafe.Pointer(&array))))
	return
}
Exemple #10
0
// AllocateArrayData allocates SafeArray.
//
// AKA: SafeArrayAllocData in Windows API.
func AllocateArrayData(array *types.COMArray) (err error) {
	err = errors.HResultToError(procSafeArrayAllocData.Call(uintptr(unsafe.Pointer(array))))
	return
}
Exemple #11
0
// UnaccessData releases raw array.
//
// AKA: SafeArrayUnaccessData in Windows API.
func UnaccessData(array *types.COMArray) (err error) {
	err = errors.HResultToError(procSafeArrayUnaccessData.Call(uintptr(unsafe.Pointer(array))))
	return
}
Exemple #12
0
// AccessData returns raw array.
//
// AKA: SafeArrayAccessData in Windows API.
func AccessData(array *types.COMArray) (element uintptr, err error) {
	err = errors.HResultToError(procSafeArrayAccessData.Call(
		uintptr(unsafe.Pointer(array)),
		uintptr(unsafe.Pointer(&element))))
	return
}
Exemple #13
0
func DestroyDescriptor(array *types.COMArray) error {
	return errors.HResultToError(procSafeArrayDestroyDescriptor.Call(uintptr(unsafe.Pointer(array))))
}
Exemple #14
0
func ResetDimensions(array *types.COMArray, bounds *types.Bounds) error {
	err = errors.HResultToError(procSafeArrayRedim.Call(
		uintptr(unsafe.Pointer(array)),
		uintptr(unsafe.Pointer(bounds))))
	return
}
Exemple #15
0
func SetInterfaceID(array *types.COMArray, interfaceID *types.GUID) (err error) {
	err = errors.HResultToError(procSafeArraySetIID.Call(
		uintptr(unsafe.Pointer(array)),
		uintptr(unsafe.Pointer(interfaceID))))
	return
}
Exemple #16
0
func Lock(array *types.COMArray) (err error) {
	err = errors.HResultToError(procSafeArrayLock.Call(uintptr(unsafe.Pointer(array))))
	return
}
Exemple #17
0
func SetRecordInfo(array *types.COMArray, recordInfo interface{}) (err error) {
	err = errors.HResultToError(procSafeArraySetRecordInfo.Call(
		uintptr(unsafe.Pointer(array)),
		uintptr(unsafe.Pointer(recordInfo))))
	return
}
Exemple #18
0
// DuplicateData duplicates SafeArray into another SafeArray object.
//
// AKA: SafeArrayCopyData in Windows API.
func DuplicateData(original, duplicate *types.COMArray) (err error) {
	err = errors.HResultToError(procSafeArrayCopyData.Call(
		uintptr(unsafe.Pointer(original)),
		uintptr(unsafe.Pointer(&duplicate))))
	return
}
Exemple #19
0
func GetInterfaceID(array *types.COMArray) (guid *types.GUID, err error) {
	err = errors.HResultToError(procSafeArrayGetIID.Call(
		uintptr(unsafe.Pointer(array)),
		uintptr(unsafe.Pointer(&guid))))
	return
}