Пример #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
}
Пример #2
0
func setStdHandle(ph *syscall.Proc, stdhandle int32, handle syscall.Handle) error {
	r0, _, e1 := syscall.Syscall(ph.Addr(), 2, uintptr(stdhandle), uintptr(handle), 0)
	if r0 == 0 {
		if e1 != 0 {
			return error(e1)
		}
		return syscall.EINVAL
	}
	return nil
}
Пример #3
-1
func classIDFromProgramIDHelper(p *syscall.Proc, programID string) (classID *GUID, err error) {
	ptrProgramID, err := windows.UTF16PtrFromString(programID)
	if err != nil {
		return
	}

	err = HResultToError(p.Call(
		uintptr(unsafe.Pointer(ptrProgramID)),
		uintptr(unsafe.Pointer(&classID))))
	return
}