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.

42 lines
831 B

  1. #pragma once
  2. #include <objbase.h>
  3. // ---------------------------------------------------------------------------
  4. // CUnknown
  5. // Base class for class instances provided by component server.
  6. // ---------------------------------------------------------------------------
  7. class CUnknown
  8. {
  9. public:
  10. // ctor
  11. CUnknown();
  12. // dtor
  13. virtual ~CUnknown() ;
  14. virtual HRESULT __stdcall QueryInterface(REFIID riid, void ** ppv) = 0;
  15. DWORD AddRef();
  16. DWORD Release();
  17. virtual HRESULT Init() = 0;
  18. static DWORD ActiveComponents();
  19. // Helper function
  20. HRESULT FinishQI(IUnknown* pI, void** ppv) ;
  21. private:
  22. // Reference count for this object
  23. DWORD m_cRef ;
  24. // Count of all active instances
  25. static long s_cActiveComponents ;
  26. } ;