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.

34 lines
533 B

  1. // File: refcount.h
  2. #ifndef _REFCOUNT_H_
  3. #define _REFCOUNT_H_
  4. //////////////////////////////////////////////////////////////////////////
  5. class RefCount
  6. {
  7. protected:
  8. ULONG m_ulcRef;
  9. #ifdef DEBUG
  10. BOOL m_fTrack;
  11. #endif
  12. public:
  13. RefCount(void);
  14. // Virtual destructor defers to destructor of derived class.
  15. virtual ~RefCount(void);
  16. // IUnknown
  17. ULONG STDMETHODCALLTYPE AddRef(void);
  18. ULONG STDMETHODCALLTYPE Release(void);
  19. #ifdef DEBUG
  20. VOID SetTrack(BOOL fTrack) {m_fTrack = fTrack;}
  21. #endif
  22. };
  23. #endif /* _REFCOUNT_H_ */