Leaked source code of windows server 2003
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.

34 lines
716 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. // NTRAID#NTBUG9 - 571792 - jonwis - 2002/04/25 - Dead code removal
  13. #ifdef FUSION_USE_OLD_XML_PARSER_SOURCE
  14. if (pref) ((Object *)pref)->AddRef();
  15. (*ppref) = (Object *)pref;
  16. #else // fusion xml parser
  17. if (pref) pref->AddRef();
  18. (*ppref) = pref;
  19. #endif
  20. if (punkRef) punkRef->Release();
  21. }
  22. void _release(IUnknown ** ppref)
  23. {
  24. if (*ppref)
  25. {
  26. (*ppref)->Release();
  27. *ppref = NULL;
  28. }
  29. }