Beispiel #1
0
func NewHString(s string) (hstring hstr.HString, err error) {
	u16 := windows.StringToUTF16Ptr(s)
	len := uint32(utf8.RuneCountInString(s))
	err = errors.MaybeError(procWindowsCreateString.Call(
		uintptr(unsafe.Pointer(u16)),
		uintptr(len),
		uintptr(unsafe.Pointer(&hstring))))
	return
}
Beispiel #2
0
func RoActivateInstance(classID string) (obj *iinspectable.Inspectable, err error) {
	hClassID, err := NewHString(classID)
	if err != nil {
		return nil, err
	}
	defer DeleteHString(hClassID)

	err = errors.MaybeError(procRoActivateInstance.Call(
		uintptr(unsafe.Pointer(hClassID)),
		uintptr(unsafe.Pointer(&obj))))
	return
}
Beispiel #3
0
func RoGetActivationFactory(classID string, interfaceID *types.GUID) (obj *iinspectable.Inspectable, err error) {
	hClassID, err := NewHString(classID)
	if err != nil {
		return nil, err
	}
	defer DeleteHString(hClassID)

	err = errors.MaybeError(procRoGetActivationFactory.Call(
		uintptr(unsafe.Pointer(hClassID)),
		uintptr(unsafe.Pointer(interfaceID)),
		uintptr(unsafe.Pointer(&obj))))
	return
}
Beispiel #4
0
func AllocateArrayDescriptorEx(variantType types.VariantType, dimensions uint32) (array *types.COMArray, err error) {
	err = errors.MaybeError(C.SafeArrayAllocDescriptorEx(uint16(variantType), dimensions, unsafe.Pointer(&array)))
	return
}
Beispiel #5
0
func AllocateArrayDescriptor(dimensions uint32) (array *types.COMArray, err error) {
	err = errors.MaybeError(C.SafeArrayAllocDescriptor(dimensions, unsafe.Pointer(&array)))
	return
}
Beispiel #6
0
func AllocateArrayData(array *types.COMArray) error {
	return errors.MaybeError(C.SafeArrayAllocData(array))
}
Beispiel #7
0
func GetUpperBound(array *types.COMArray, dimension uint32) (upperBound int64, err error) {
	err = errors.MaybeError(C.SafeArrayGetUBound(array, dimension, unsafe.Pointer(&upperBound)))
	return
}
Beispiel #8
0
func DestroyDescriptor(array *types.COMArray) error {
	return errors.MaybeError(C.SafeArrayDestroyDescriptor(array))
}
Beispiel #9
0
func PutElement(array *types.COMArray, index int64, element interface{}) error {
	return errors.MaybeError(C.SafeArrayPutElement(array, index, unsafe.Pointer(&element)))
}
Beispiel #10
0
func ResetDimensions(array *types.COMArray, bounds *types.Bounds) error {
	return errors.MaybeError(C.SafeArrayRedim(array, bounds))
}
Beispiel #11
0
func SetInterfaceID(array *types.COMArray, interfaceID *types.GUID) error {
	return errors.MaybeError(C.SafeArraySetIID(array, interfaceID))
}
Beispiel #12
0
func GetPointerOfIndex(array *types.COMArray, index int64) (ref uintptr, err error) {
	err = errors.MaybeError(C.SafeArrayPtrOfIndex(array, index, unsafe.Pointer(&ref)))
	return
}
Beispiel #13
0
func Unlock(array *types.COMArray) error {
	return errors.MaybeError(C.SafeArrayUnlock(array))
}
Beispiel #14
0
func GetVariantType(array *types.COMArray) (varType uint16, err error) {
	err = errors.MaybeError(C.SafeArrayGetVartype(array, unsafe.Pointer(&varType)))
	return
}
Beispiel #15
0
func Duplicate(original *types.COMArray) (array *types.COMArray, err error) {
	err = errors.MaybeError(C.SafeArrayCopy(original, unsafe.Pointer(&array)))
	return
}
Beispiel #16
0
func DuplicateData(original, duplicate *types.COMArray) error {
	return errors.MaybeError(C.SafeArrayCopyData(original, unsafe.Pointer(&duplicate)))
}
Beispiel #17
0
func GetRecordInfo(array *types.COMArray) (recordInfo interface{}, err error) {
	err = errors.MaybeError(C.SafeArrayGetRecordInfo(array, unsafe.Pointer(&recordInfo)))
	return
}
Beispiel #18
0
func RoInitialize(threadType uint32) error {
	return errors.MaybeError(procRoInitialize.Call(uintptr(threadType)))
}
Beispiel #19
0
func SetRecordInfo(array *types.COMArray, recordInfo interface{}) error {
	return errors.MaybeError(C.SafeArraySetRecordInfo(array, unsafe.Pointer(recordInfo)))
}
Beispiel #20
0
func AccessData(array *types.COMArray) (element uintptr, err error) {
	err = errors.MaybeError(C.SafeArrayAccessData(array, unsafe.Pointer(&element)))
	return
}
Beispiel #21
0
func UnaccessData(array *types.COMArray) error {
	return errors.MaybeError(C.SafeArrayUnaccessData(array))
}
Beispiel #22
0
func DeleteHString(hstring hstr.HString) error {
	return errors.MaybeError(procWindowsDeleteString.Call(uintptr(hstring)))
}
Beispiel #23
0
func GetInterfaceID(array *types.COMArray) (guid *types.GUID, err error) {
	err = errors.MaybeError(C.SafeArrayGetIID(array, unsafe.Pointer(&guid)))
	return
}