Source code of Windows XP (NT5)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

33 lines
610 B

  1. /*
  2. * @(#)_reference.cxx 1.0 6/3/97
  3. *
  4. * Copyright (c) 1997 - 1999 Microsoft Corporation. All rights reserved. *
  5. */
  6. #include "stdinc.h"
  7. #include "core.hxx"
  8. #pragma hdrstop
  9. void _assign(IUnknown ** ppref, IUnknown * pref)
  10. {
  11. IUnknown *punkRef = *ppref;
  12. #ifdef FUSION_USE_OLD_XML_PARSER_SOURCE
  13. if (pref) ((Object *)pref)->AddRef();
  14. (*ppref) = (Object *)pref;
  15. #else // fusion xml parser
  16. if (pref) pref->AddRef();
  17. (*ppref) = pref;
  18. #endif
  19. if (punkRef) punkRef->Release();
  20. }
  21. void _release(IUnknown ** ppref)
  22. {
  23. if (*ppref)
  24. {
  25. (*ppref)->Release();
  26. *ppref = NULL;
  27. }
  28. }