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.

170 lines
3.1 KiB

  1. /*++
  2. Copyright (C) 1996-2001 Microsoft Corporation
  3. Module Name:
  4. ProvFact.h
  5. Abstract:
  6. History:
  7. --*/
  8. #ifndef _Server_ProviderRegistrar_H
  9. #define _Server_ProviderRegistrar_H
  10. #include "Globals.h"
  11. /******************************************************************************
  12. *
  13. * Name:
  14. *
  15. *
  16. * Description:
  17. *
  18. *
  19. *****************************************************************************/
  20. class CInterceptor_DecoupledClient ;
  21. class CServerObject_ProviderRegistrar_Base : public IWbemDecoupledRegistrar
  22. {
  23. protected:
  24. WmiAllocator &m_Allocator ;
  25. HANDLE m_registrationEvent;
  26. GUID m_Identity ;
  27. BSTR m_Clsid ;
  28. BSTR m_User ;
  29. BSTR m_Locale ;
  30. BSTR m_Scope ;
  31. BSTR m_Registration ;
  32. BOOL m_Registered ;
  33. BYTE *m_MarshaledProxy ;
  34. DWORD m_MarshaledProxyLength ;
  35. CInterceptor_DecoupledClient *m_Provider ;
  36. HRESULT CreateInterceptor (
  37. IWbemContext *a_Context ,
  38. IUnknown *a_Unknown ,
  39. BYTE *&a_MarshaledProxy ,
  40. DWORD &a_MarshaledProxyLength ,
  41. IUnknown *&a_MarshaledUnknown
  42. ) ;
  43. HRESULT DirectUnRegister (
  44. long a_Flags ,
  45. IWbemContext *a_Context ,
  46. LPCWSTR a_User ,
  47. LPCWSTR a_Locale ,
  48. LPCWSTR a_Registration ,
  49. LPCWSTR a_Scope ,
  50. GUID &a_Identity
  51. ) ;
  52. HRESULT DirectRegister (
  53. GUID &a_Identity ,
  54. long a_Flags ,
  55. IWbemContext *a_Context ,
  56. LPCWSTR a_User ,
  57. LPCWSTR a_Locale ,
  58. LPCWSTR a_Registration ,
  59. LPCWSTR a_Scope ,
  60. IUnknown *a_Unknown ,
  61. BYTE *a_MarshaledProxy ,
  62. DWORD a_MarshaledProxyLength
  63. ) ;
  64. HRESULT SaveToRegistry (
  65. long a_Flags ,
  66. IWbemContext *a_Context ,
  67. LPCWSTR a_User ,
  68. LPCWSTR a_Locale ,
  69. LPCWSTR a_Registration ,
  70. LPCWSTR a_Scope ,
  71. IUnknown *a_Unknown ,
  72. BYTE *a_MarshaledProxy ,
  73. DWORD a_MarshaledProxyLength
  74. ) ;
  75. protected:
  76. public: /* Internal */
  77. public: /* External */
  78. CServerObject_ProviderRegistrar_Base ( WmiAllocator &a_Allocator ) ;
  79. ~CServerObject_ProviderRegistrar_Base () ;
  80. HRESULT STDMETHODCALLTYPE Register (
  81. long a_Flags ,
  82. IWbemContext *a_Context ,
  83. LPCWSTR a_User ,
  84. LPCWSTR a_Locale ,
  85. LPCWSTR a_Scope ,
  86. LPCWSTR a_Registration ,
  87. IUnknown *a_Unknown
  88. ) ;
  89. HRESULT STDMETHODCALLTYPE UnRegister () ;
  90. HRESULT Initialize () ;
  91. HRESULT AcquireLock(void);
  92. void ReleaseLock(void);
  93. };
  94. inline
  95. void CServerObject_ProviderRegistrar_Base::ReleaseLock(void)
  96. {
  97. ReleaseMutex( m_registrationEvent );
  98. }
  99. /******************************************************************************
  100. *
  101. * Name:
  102. *
  103. *
  104. * Description:
  105. *
  106. *
  107. *****************************************************************************/
  108. class CServerObject_ProviderRegistrar : public CServerObject_ProviderRegistrar_Base
  109. {
  110. private:
  111. long m_ReferenceCount ;
  112. protected:
  113. public: /* Internal */
  114. public: /* External */
  115. CServerObject_ProviderRegistrar ( WmiAllocator &a_Allocator ) ;
  116. ~CServerObject_ProviderRegistrar () ;
  117. //IUnknown members
  118. STDMETHODIMP QueryInterface ( REFIID , LPVOID FAR * ) ;
  119. STDMETHODIMP_( ULONG ) AddRef () ;
  120. STDMETHODIMP_( ULONG ) Release () ;
  121. };
  122. #endif // _Server_ProviderRegistrar_H