示例#1
1
文件: windows.go 项目: jmptrader/com
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
文件: windows.go 项目: jmptrader/com
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
}