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.

108 lines
2.5 KiB

  1. //***************************************************************************
  2. //
  3. // NTEVTPROV.H
  4. //
  5. // Module: WBEM NT EVENT PROVIDER
  6. //
  7. // Copyright (c) 1996-2001 Microsoft Corporation, All Rights Reserved
  8. //
  9. //***************************************************************************
  10. #ifndef _NT_EVT_PROV_NTEVTPROV_H
  11. #define _NT_EVT_PROV_NTEVTPROV_H
  12. class CEventProviderManager;
  13. class CNTEventProvider : public IWbemEventProvider, public IWbemProviderInit, public IWbemEventProviderSecurity
  14. {
  15. private:
  16. IWbemServices* m_pNamespace;
  17. IWbemObjectSink* m_pEventSink;
  18. CEventProviderManager* m_Mgr;
  19. LONG m_ref;
  20. //copy constuctor not defined so not allowed!
  21. CNTEventProvider(CNTEventProvider&);
  22. void operator=(const CNTEventProvider&);
  23. public:
  24. CNTEventProvider(CEventProviderManager* mgr);
  25. IWbemServices* GetNamespace();
  26. IWbemObjectSink* GetEventSink();
  27. void AddRefAll();
  28. void ReleaseAll();
  29. ~CNTEventProvider();
  30. //globals
  31. //=======
  32. static ProvDebugLog* g_NTEvtDebugLog;
  33. static CMutex* g_secMutex;
  34. static PSID s_NetworkServiceSid;
  35. static PSID s_LocalServiceSid;
  36. static PSID s_AliasBackupOpsSid;
  37. static PSID s_AliasSystemOpsSid;
  38. static PSID s_AliasGuestsSid;
  39. static PSID s_LocalSystemSid;
  40. static PSID s_AliasAdminsSid;
  41. static PSID s_AnonymousLogonSid;
  42. static PSID s_WorldSid;
  43. static void AllocateGlobalSIDs();
  44. static void FreeGlobalSIDs();
  45. static BOOL GlobalSIDsOK();
  46. //interface methods
  47. //==================
  48. STDMETHODIMP ProvideEvents(
  49. IWbemObjectSink* pSink,
  50. LONG lFlags
  51. );
  52. STDMETHODIMP QueryInterface(REFIID riid, PVOID* ppv);
  53. STDMETHODIMP_(ULONG) AddRef();
  54. STDMETHODIMP_(ULONG) Release();
  55. /* IWbemProviderInit methods */
  56. STDMETHODIMP Initialize (
  57. LPWSTR pszUser,
  58. LONG lFlags,
  59. LPWSTR pszNamespace,
  60. LPWSTR pszLocale,
  61. IWbemServices *pCIMOM, // For anybody
  62. IWbemContext *pCtx,
  63. IWbemProviderInitSink *pInitSink // For init signals
  64. );
  65. /* IWbemEventProviderSecurity methods */
  66. STDMETHODIMP AccessCheck(
  67. LPCWSTR wszQueryLanguage,
  68. LPCWSTR wszQuery,
  69. LONG lSidLength,
  70. const BYTE __RPC_FAR *pSid);
  71. };
  72. #define DebugOut(a) { \
  73. \
  74. if ( (NULL != CNTEventProvider::g_NTEvtDebugLog) && CNTEventProvider::g_NTEvtDebugLog->GetLogging () && ( CNTEventProvider::g_NTEvtDebugLog->GetLevel () > 0 ) ) \
  75. { \
  76. {a ; } \
  77. } \
  78. }
  79. #endif //_NT_EVT_PROV_NTEVTPROV_H