AppRefCount.h 684 B

1234567891011121314151617181920212223242526272829303132333435
  1. #pragma once
  2. #ifdef __cplusplus
  3. #include <unknwn.h>
  4. class ThreadRefCount : public IUnknown
  5. {
  6. public:
  7. ThreadRefCount();
  8. STDMETHOD(QueryInterface)(REFIID riid, PVOID *ppvObject);
  9. STDMETHOD_(ULONG, AddRef)(void);
  10. STDMETHOD_(ULONG, Release)(void);
  11. LONG refCount;
  12. };
  13. class AppRefCount : public IUnknown
  14. {
  15. public:
  16. AppRefCount();
  17. STDMETHOD(QueryInterface)(REFIID riid, PVOID *ppvObject);
  18. STDMETHOD_(ULONG, AddRef)(void);
  19. STDMETHOD_(ULONG, Release)(void);
  20. LONG refCount;
  21. DWORD m_dwThread;
  22. };
  23. extern "C" {
  24. #endif
  25. void *InitAppRefCounterObject(DWORD threadId);
  26. void *GetAppRefCounterObject();
  27. void AppRefCount_Release();
  28. int AppRefCount_CanQuit();
  29. #ifdef __cplusplus
  30. }
  31. #endif