package com
import "github.com/zzl/go-com/com"
Index ¶
- Constants
- Variables
- func AddImpl(impl win32.IUnknownInterface) int32
- func AddToScope(value interface{}, scope ...*Scope)
- func EnsureThreadCoInitialized()
- func Failed(hr win32.HRESULT, logFail ...bool) bool
- func HresultFromWin32(err win32.WIN32_ERROR) win32.HRESULT
- func InitializeContext()
- func Malloc(size uintptr) unsafe.Pointer
- func MessageLoop()
- func NewComObj[T any, PT ComObjConstraint[T]](impl win32.IUnknownInterface) *T
- func NewErrorOrNil(hr win32.HRESULT) error
- func PrintHr(hr win32.HRESULT)
- func QueryInterface[T QueryInterfaceResultType](pObj win32.IUnknownObject, scoped bool) T
- func SetLastError(err Error)
- func Succeeded(hr win32.HRESULT, logFail ...bool) bool
- func Uninitialize()
- func UninitializeContext()
- func WithScope(action func())
- type BStr
- func NewBStr(bs win32.BSTR) *BStr
- func NewBStringFromStr(str string) *BStr
- func (this *BStr) Addr() uintptr
- func (this *BStr) BSTR() win32.BSTR
- func (this *BStr) Free()
- func (this *BStr) PBSTR() *win32.BSTR
- func (this *BStr) String() string
- func (this *BStr) ToStringAndFree() string
- type Bstrs
- type ComObjConstraint
- type ComObjInterface
- type ComObjLifecycleAware
- type Context
- func GetContext() *Context
- func (this *Context) GetCurrentScope() *Scope
- func (this *Context) SetCurrentScope(s *Scope)
- type Disposable
- type Error
- func NewError(hr win32.HRESULT) Error
- func (me Error) Error() string
- func (me Error) FAILED() bool
- func (me Error) HRESULT() win32.HRESULT
- type ErrorInfo
- type Finalizable
- type IIDProvider
- type IUnknownComObj
- func (this *IUnknownComObj) AddRef() uintptr
- func (this *IUnknownComObj) AssignPpvObject(ppvObject unsafe.Pointer)
- func (this *IUnknownComObj) BuildVtbl(lock bool) *win32.IUnknownVtbl
- func (this *IUnknownComObj) GetIUnknown() *win32.IUnknown
- func (this *IUnknownComObj) GetIUnknownComObj() *IUnknownComObj
- func (this *IUnknownComObj) GetSubComObjs() []ComObjInterface
- func (this *IUnknownComObj) GetVtbl() *win32.IUnknownVtbl
- func (this *IUnknownComObj) IID() *syscall.GUID
- func (this *IUnknownComObj) IUnknown() *win32.IUnknown
- func (this *IUnknownComObj) Impl() win32.IUnknownInterface
- func (this *IUnknownComObj) QueryInterface(riid *syscall.GUID, ppvObject unsafe.Pointer) uintptr
- func (this *IUnknownComObj) Release() uintptr
- func (this *IUnknownComObj) SetVtbl(vtbl *win32.IUnknownVtbl)
- type IUnknownImpl
- func (this *IUnknownImpl) AddRef() uint32
- func (this *IUnknownImpl) AssignPpvObject(ppvObject unsafe.Pointer, iid ...*syscall.GUID) bool
- func (this *IUnknownImpl) GetComObj() ComObjInterface
- func (this *IUnknownImpl) OnComObjCreate()
- func (this *IUnknownImpl) OnComObjFree()
- func (this *IUnknownImpl) QueryInterface(riid *syscall.GUID, ppvObject unsafe.Pointer) win32.HRESULT
- func (this *IUnknownImpl) Release() uint32
- func (this *IUnknownImpl) SetComObj(obj ComObjInterface)
- type Initializable
- type Initialized
- type QueryInterfaceResultType
- type RealObjectAware
- type Scope
- func NewScope() *Scope
- func (this *Scope) Add(pUnknown unsafe.Pointer)
- func (this *Scope) AddArray(psa *win32.SAFEARRAY)
- func (this *Scope) AddBstr(bstr win32.BSTR)
- func (this *Scope) AddComPtr(iunknownObj win32.IUnknownObject, addRef ...bool)
- func (this *Scope) AddVar(pVar *win32.VARIANT)
- func (this *Scope) AddVarIfNeeded(pVar *win32.VARIANT)
- func (this *Scope) Clear()
- func (this *Scope) Leave()
- type UnknownClass
- func NewUnknownClass(pUnk *win32.IUnknown, scoped bool) *UnknownClass
- func (this *UnknownClass) Dispose()
- type VariantCompatible
Constants ¶
Variables ¶
Functions ¶
func AddImpl ¶
func AddImpl(impl win32.IUnknownInterface) int32
func AddToScope ¶
func AddToScope(value interface{}, scope ...*Scope)
func EnsureThreadCoInitialized ¶
func EnsureThreadCoInitialized()
func Failed ¶
func HresultFromWin32 ¶
func HresultFromWin32(err win32.WIN32_ERROR) win32.HRESULT
func InitializeContext ¶
func InitializeContext()
func Malloc ¶
func MessageLoop ¶
func MessageLoop()
func NewComObj ¶
func NewComObj[T any, PT ComObjConstraint[T]](impl win32.IUnknownInterface) *T
func NewErrorOrNil ¶
func PrintHr ¶
func QueryInterface ¶
func QueryInterface[T QueryInterfaceResultType](pObj win32.IUnknownObject, scoped bool) T
func SetLastError ¶
func SetLastError(err Error)
func Succeeded ¶
func Uninitialize ¶
func Uninitialize()
func UninitializeContext ¶
func UninitializeContext()
func WithScope ¶
func WithScope(action func())
Types ¶
type BStr ¶
type BStr struct {
// contains filtered or unexported fields
}
func NewBStr ¶
func NewBStringFromStr ¶
func (*BStr) Addr ¶
func (*BStr) BSTR ¶
func (*BStr) Free ¶
func (this *BStr) Free()
func (*BStr) PBSTR ¶
func (*BStr) String ¶
func (*BStr) ToStringAndFree ¶
type Bstrs ¶
type Bstrs struct {
// contains filtered or unexported fields
}
func NewBStrs ¶
func NewBStrs() *Bstrs
func (*Bstrs) Add ¶
func (*Bstrs) Dispose ¶
func (this *Bstrs) Dispose()
type ComObjConstraint ¶
type ComObjConstraint[T any] interface { ComObjInterface *T }
type ComObjInterface ¶
type ComObjInterface interface { AddRef() uintptr Release() uintptr GetVtbl() *win32.IUnknownVtbl GetIUnknownComObj() *IUnknownComObj GetSubComObjs() []ComObjInterface IID() *syscall.GUID AssignPpvObject(ppvObject unsafe.Pointer) }
type ComObjLifecycleAware ¶
type ComObjLifecycleAware interface { OnComObjCreate() OnComObjFree() }
type Context ¶
type Context struct { ID int32 //could be reused TID uint32 LastError *ErrorInfo // contains filtered or unexported fields }
func GetContext ¶
func GetContext() *Context
func (*Context) GetCurrentScope ¶
func (*Context) SetCurrentScope ¶
type Disposable ¶
type Disposable interface {
Dispose()
}
type Error ¶
func NewError ¶
func (Error) Error ¶
func (Error) FAILED ¶
func (Error) HRESULT ¶
type ErrorInfo ¶
func GetLastErrorInfo ¶
func GetLastErrorInfo() *ErrorInfo
func (*ErrorInfo) String ¶
type Finalizable ¶
type Finalizable interface {
Finalize()
}
type IIDProvider ¶
type IUnknownComObj ¶
type IUnknownComObj struct { LpVtbl *win32.IUnknownVtbl Parent *IUnknownComObj // contains filtered or unexported fields }
func (*IUnknownComObj) AddRef ¶
func (this *IUnknownComObj) AddRef() uintptr
func (*IUnknownComObj) AssignPpvObject ¶
func (this *IUnknownComObj) AssignPpvObject(ppvObject unsafe.Pointer)
func (*IUnknownComObj) BuildVtbl ¶
func (this *IUnknownComObj) BuildVtbl(lock bool) *win32.IUnknownVtbl
func (*IUnknownComObj) GetIUnknown ¶
func (this *IUnknownComObj) GetIUnknown() *win32.IUnknown
func (*IUnknownComObj) GetIUnknownComObj ¶
func (this *IUnknownComObj) GetIUnknownComObj() *IUnknownComObj
func (*IUnknownComObj) GetSubComObjs ¶
func (this *IUnknownComObj) GetSubComObjs() []ComObjInterface
func (*IUnknownComObj) GetVtbl ¶
func (this *IUnknownComObj) GetVtbl() *win32.IUnknownVtbl
func (*IUnknownComObj) IID ¶
func (this *IUnknownComObj) IID() *syscall.GUID
func (*IUnknownComObj) IUnknown ¶
func (this *IUnknownComObj) IUnknown() *win32.IUnknown
func (*IUnknownComObj) Impl ¶
func (this *IUnknownComObj) Impl() win32.IUnknownInterface
func (*IUnknownComObj) QueryInterface ¶
func (*IUnknownComObj) Release ¶
func (this *IUnknownComObj) Release() uintptr
func (*IUnknownComObj) SetVtbl ¶
func (this *IUnknownComObj) SetVtbl(vtbl *win32.IUnknownVtbl)
type IUnknownImpl ¶
type IUnknownImpl struct { ComObj ComObjInterface }
func (*IUnknownImpl) AddRef ¶
func (this *IUnknownImpl) AddRef() uint32
func (*IUnknownImpl) AssignPpvObject ¶
func (*IUnknownImpl) GetComObj ¶
func (this *IUnknownImpl) GetComObj() ComObjInterface
func (*IUnknownImpl) OnComObjCreate ¶
func (this *IUnknownImpl) OnComObjCreate()
func (*IUnknownImpl) OnComObjFree ¶
func (this *IUnknownImpl) OnComObjFree()
func (*IUnknownImpl) QueryInterface ¶
func (this *IUnknownImpl) QueryInterface(riid *syscall.GUID, ppvObject unsafe.Pointer) win32.HRESULT
func (*IUnknownImpl) Release ¶
func (this *IUnknownImpl) Release() uint32
func (*IUnknownImpl) SetComObj ¶
func (this *IUnknownImpl) SetComObj(obj ComObjInterface)
type Initializable ¶
type Initializable interface {
Initialize()
}
type Initialized ¶
type Initialized struct { }
func Initialize ¶
func Initialize() Initialized
func InitializeMt ¶
func InitializeMt() Initialized
func (Initialized) Uninitialize ¶
func (me Initialized) Uninitialize()
type QueryInterfaceResultType ¶
type QueryInterfaceResultType interface { IIDProvider win32.IUnknownObject }
type RealObjectAware ¶
type RealObjectAware interface {
SetRealObject(obj interface{})
}
type Scope ¶
type Scope struct { ParentScope *Scope // contains filtered or unexported fields }
func NewScope ¶
func NewScope() *Scope
func (*Scope) Add ¶
func (*Scope) AddArray ¶
func (*Scope) AddBstr ¶
func (*Scope) AddComPtr ¶
func (this *Scope) AddComPtr(iunknownObj win32.IUnknownObject, addRef ...bool)
func (*Scope) AddVar ¶
func (*Scope) AddVarIfNeeded ¶
func (*Scope) Clear ¶
func (this *Scope) Clear()
func (*Scope) Leave ¶
func (this *Scope) Leave()
type UnknownClass ¶
func NewUnknownClass ¶
func NewUnknownClass(pUnk *win32.IUnknown, scoped bool) *UnknownClass
func (*UnknownClass) Dispose ¶
func (this *UnknownClass) Dispose()
type VariantCompatible ¶
Source Files ¶
bstr.go context.go error.go impl.go scope.go types.go utils.go
Directories ¶
Path | Synopsis |
---|---|
com/comimpl |
- Version
- v1.5.0 (latest)
- Published
- Jan 29, 2023
- Platform
- linux/amd64
- Imports
- 8 packages
- Last checked
- 3 months ago –
Tools for package owners.