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.

45 lines
555 B

  1. /*++
  2. Copyright (C) 1999-2001 Microsoft Corporation
  3. Module Name:
  4. ADAPELEM.CPP
  5. Abstract:
  6. Implementation File
  7. History:
  8. --*/
  9. #include "precomp.h"
  10. #include <stdio.h>
  11. #include "adapelem.h"
  12. CAdapElement::CAdapElement( void )
  13. : m_lRefCount(1)
  14. {
  15. }
  16. CAdapElement::~CAdapElement( void )
  17. {
  18. }
  19. long CAdapElement::AddRef( void )
  20. {
  21. return InterlockedIncrement( &m_lRefCount );
  22. }
  23. long CAdapElement::Release( void )
  24. {
  25. long lRef = InterlockedDecrement( &m_lRefCount );
  26. if ( 0 == lRef )
  27. {
  28. delete this;
  29. }
  30. return lRef;
  31. }