iunknown.go 585 B

1234567891011121314151617181920212223242526272829
  1. // Copyright 2010-2012 The W32 Authors. All rights reserved.
  2. // Use of this source code is governed by a BSD-style
  3. // license that can be found in the LICENSE file.
  4. // +build windows
  5. package w32
  6. type pIUnknownVtbl struct {
  7. pQueryInterface uintptr
  8. pAddRef uintptr
  9. pRelease uintptr
  10. }
  11. type IUnknown struct {
  12. lpVtbl *pIUnknownVtbl
  13. }
  14. func (this *IUnknown) QueryInterface(id *GUID) *IDispatch {
  15. return ComQueryInterface(this, id)
  16. }
  17. func (this *IUnknown) AddRef() int32 {
  18. return ComAddRef(this)
  19. }
  20. func (this *IUnknown) Release() int32 {
  21. return ComRelease(this)
  22. }