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.

71 lines
2.2 KiB

  1. //
  2. // computil.h
  3. //
  4. #ifndef COMPUTIL_H
  5. #define COMPUTIL_H
  6. #include "private.h"
  7. #include "strary.h"
  8. #include "immxutil.h"
  9. HRESULT GetCompartment(IUnknown *punk, REFGUID rguidComp, ITfCompartment **ppComp, BOOL fGlobal);
  10. HRESULT SetCompartmentDWORD(TfClientId tid, IUnknown *punk, REFGUID rguidComp, DWORD dw, BOOL fGlobal);
  11. HRESULT GetCompartmentDWORD(IUnknown *punk, REFGUID rguidComp, DWORD *pdw, BOOL fGlobal);
  12. HRESULT ToggleCompartmentDWORD(TfClientId tid, IUnknown *punk, REFGUID rguidComp, BOOL fGlobal);
  13. HRESULT SetCompartmentGUIDATOM(TfClientId tid, IUnknown *punk, REFGUID rguidComp, TfClientId ga, BOOL fGlobal);
  14. HRESULT GetCompartmentGUIDATOM(IUnknown *punk, REFGUID rguidComp, TfClientId *pga, BOOL fGlobal);
  15. HRESULT SetCompartmentGUID(LIBTHREAD *plt, TfClientId tid, IUnknown *punk, REFGUID rguidComp, REFGUID rguid, BOOL fGlobal);
  16. HRESULT GetCompartmentGUID(LIBTHREAD *plt, IUnknown *punk, REFGUID rguidComp, GUID *pguid, BOOL fGlobal);
  17. HRESULT SetCompartmentUnknown(TfClientId tid, IUnknown *punk, REFGUID rguidComp, IUnknown *punkPriv);
  18. HRESULT GetCompartmentUnknown(IUnknown *punk, REFGUID rguidComp, IUnknown **ppunkPriv);
  19. HRESULT ClearCompartment(TfClientId tid, IUnknown *punk, REFGUID rguidComp, BOOL fGlobal);
  20. typedef struct tag_CESMAP {
  21. ITfCompartment *pComp;
  22. DWORD dwCookie;
  23. } CESMAP;
  24. #define CES_INVALID_COOKIE ((DWORD)(-1))
  25. typedef HRESULT (*CESCALLBACK)(void *pv, REFGUID rguid);
  26. class CCompartmentEventSink : public ITfCompartmentEventSink
  27. {
  28. public:
  29. CCompartmentEventSink(CESCALLBACK pfnCallback, void *pv);
  30. virtual ~CCompartmentEventSink() {};
  31. //
  32. // IUnknown methods
  33. //
  34. STDMETHODIMP QueryInterface(REFIID riid, void **ppvObj);
  35. STDMETHODIMP_(ULONG) AddRef(void);
  36. STDMETHODIMP_(ULONG) Release(void);
  37. //
  38. // ITfCompartmentEventSink
  39. //
  40. STDMETHODIMP OnChange(REFGUID rguid);
  41. HRESULT _Advise(IUnknown *punk, REFGUID rguidComp, BOOL fGlobal);
  42. HRESULT _Unadvise();
  43. protected:
  44. void SetCallbackPV(void* pv)
  45. {
  46. if (_pv == NULL)
  47. _pv = pv;
  48. };
  49. private:
  50. CStructArray<CESMAP> _rgcesmap;
  51. long _cRef;
  52. CESCALLBACK _pfnCallback;
  53. void *_pv;
  54. };
  55. #endif //COMPUTIL_H