istream.go 688 B

123456789101112131415161718192021222324252627282930313233
  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. import (
  7. "unsafe"
  8. )
  9. type pIStreamVtbl struct {
  10. pQueryInterface uintptr
  11. pAddRef uintptr
  12. pRelease uintptr
  13. }
  14. type IStream struct {
  15. lpVtbl *pIStreamVtbl
  16. }
  17. func (this *IStream) QueryInterface(id *GUID) *IDispatch {
  18. return ComQueryInterface((*IUnknown)(unsafe.Pointer(this)), id)
  19. }
  20. func (this *IStream) AddRef() int32 {
  21. return ComAddRef((*IUnknown)(unsafe.Pointer(this)))
  22. }
  23. func (this *IStream) Release() int32 {
  24. return ComRelease((*IUnknown)(unsafe.Pointer(this)))
  25. }