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.

65 lines
1.3 KiB

  1. //
  2. // gcomp.h
  3. //
  4. #ifndef GCOMP_H
  5. #define GCOMP_H
  6. #include "private.h"
  7. #include "strary.h"
  8. #include "immxutil.h"
  9. #include "computil.h"
  10. HRESULT SetGlobalCompartmentDWORD(REFGUID rguidComp, DWORD dw);
  11. HRESULT GetGlobalCompartmentDWORD(REFGUID rguidComp, DWORD *pdw);
  12. #if 0
  13. typedef struct {
  14. ITfCompartment *pComp;
  15. DWORD dwCookie;
  16. } CESMAP;
  17. #endif
  18. #define CES_INVALID_COOKIE ((DWORD)(-1))
  19. typedef HRESULT (*CESCALLBACK)(void *pv, REFGUID rguid);
  20. class CGlobalCompartmentEventSink : public ITfCompartmentEventSink
  21. {
  22. public:
  23. CGlobalCompartmentEventSink(CESCALLBACK pfnCallback, void *pv);
  24. virtual ~CGlobalCompartmentEventSink() {};
  25. //
  26. // IUnknown methods
  27. //
  28. STDMETHODIMP QueryInterface(REFIID riid, void **ppvObj);
  29. STDMETHODIMP_(ULONG) AddRef(void);
  30. STDMETHODIMP_(ULONG) Release(void);
  31. //
  32. // ITfCompartmentEventSink
  33. //
  34. STDMETHODIMP OnChange(REFGUID rguid);
  35. HRESULT _Advise(REFGUID rguidComp);
  36. HRESULT _Unadvise();
  37. protected:
  38. void SetCallbackPV(void* pv)
  39. {
  40. if (_pv == NULL)
  41. _pv = pv;
  42. };
  43. private:
  44. CStructArray<CESMAP> _rgcesmap;
  45. long _cRef;
  46. CESCALLBACK _pfnCallback;
  47. void *_pv;
  48. };
  49. #endif //GCOMP_H