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.

222 lines
9.6 KiB

  1. //*************************************************************
  2. //
  3. // Microsoft Confidential. Copyright (c) Microsoft Corporation 1999. All rights reserved
  4. //
  5. // File: diagProv.h
  6. //
  7. // Description: Diagnostic mode snapshot provider
  8. //
  9. // History: 8-20-99 leonardm Created
  10. //
  11. //*************************************************************
  12. #ifndef _SNAPPROV_H__CE49F9FF_5775_4575_9052_C76FBD20AD79__INCLUDED
  13. #define _SNAPPROV_H__CE49F9FF_5775_4575_9052_C76FBD20AD79__INCLUDED
  14. #include <wbemidl.h>
  15. #include "smartptr.h"
  16. #define DENY_RSOP_FROM_INTERACTIVE_USER L"DenyRsopToInteractiveUser"
  17. extern long g_cObj;
  18. extern long g_cLock;
  19. //*************************************************************
  20. //
  21. // Class: CNotImplSnapProv
  22. //
  23. // Description:
  24. //
  25. //*************************************************************
  26. class CNotImplSnapProv : public IWbemServices
  27. {
  28. public:
  29. virtual HRESULT STDMETHODCALLTYPE OpenNamespace(
  30. /* [in] */ const BSTR strNamespace,
  31. /* [in] */ long lFlags,
  32. /* [in] */ IWbemContext __RPC_FAR *pCtx,
  33. /* [unique][in][out] */ IWbemServices __RPC_FAR *__RPC_FAR *ppWorkingNamespace,
  34. /* [unique][in][out] */ IWbemCallResult __RPC_FAR *__RPC_FAR *ppResult) { return WBEM_E_NOT_SUPPORTED;}
  35. virtual HRESULT STDMETHODCALLTYPE CancelAsyncCall(
  36. /* [in] */ IWbemObjectSink __RPC_FAR *pSink) { return WBEM_E_NOT_SUPPORTED;}
  37. virtual HRESULT STDMETHODCALLTYPE QueryObjectSink(
  38. /* [in] */ long lFlags,
  39. /* [out] */ IWbemObjectSink __RPC_FAR *__RPC_FAR *ppResponseHandler) { return WBEM_E_NOT_SUPPORTED;}
  40. virtual HRESULT STDMETHODCALLTYPE GetObject(
  41. /* [in] */ const BSTR strObjectPath,
  42. /* [in] */ long lFlags,
  43. /* [in] */ IWbemContext __RPC_FAR *pCtx,
  44. /* [unique][in][out] */ IWbemClassObject __RPC_FAR *__RPC_FAR *ppObject,
  45. /* [unique][in][out] */ IWbemCallResult __RPC_FAR *__RPC_FAR *ppCallResult) { return WBEM_E_NOT_SUPPORTED;}
  46. virtual HRESULT STDMETHODCALLTYPE GetObjectAsync(
  47. /* [in] */ const BSTR strObjectPath,
  48. /* [in] */ long lFlags,
  49. /* [in] */ IWbemContext __RPC_FAR *pCtx,
  50. /* [in] */ IWbemObjectSink __RPC_FAR *pResponseHandler) { return WBEM_E_NOT_SUPPORTED;}
  51. virtual HRESULT STDMETHODCALLTYPE PutClass(
  52. /* [in] */ IWbemClassObject __RPC_FAR *pObject,
  53. /* [in] */ long lFlags,
  54. /* [in] */ IWbemContext __RPC_FAR *pCtx,
  55. /* [unique][in][out] */ IWbemCallResult __RPC_FAR *__RPC_FAR *ppCallResult) { return WBEM_E_NOT_SUPPORTED;}
  56. virtual HRESULT STDMETHODCALLTYPE PutClassAsync(
  57. /* [in] */ IWbemClassObject __RPC_FAR *pObject,
  58. /* [in] */ long lFlags,
  59. /* [in] */ IWbemContext __RPC_FAR *pCtx,
  60. /* [in] */ IWbemObjectSink __RPC_FAR *pResponseHandler) { return WBEM_E_NOT_SUPPORTED;}
  61. virtual HRESULT STDMETHODCALLTYPE DeleteClass(
  62. /* [in] */ const BSTR strClass,
  63. /* [in] */ long lFlags,
  64. /* [in] */ IWbemContext __RPC_FAR *pCtx,
  65. /* [unique][in][out] */ IWbemCallResult __RPC_FAR *__RPC_FAR *ppCallResult) { return WBEM_E_NOT_SUPPORTED;}
  66. virtual HRESULT STDMETHODCALLTYPE DeleteClassAsync(
  67. /* [in] */ const BSTR strClass,
  68. /* [in] */ long lFlags,
  69. /* [in] */ IWbemContext __RPC_FAR *pCtx,
  70. /* [in] */ IWbemObjectSink __RPC_FAR *pResponseHandler) { return WBEM_E_NOT_SUPPORTED;}
  71. virtual HRESULT STDMETHODCALLTYPE CreateClassEnum(
  72. /* [in] */ const BSTR strSuperclass,
  73. /* [in] */ long lFlags,
  74. /* [in] */ IWbemContext __RPC_FAR *pCtx,
  75. /* [out] */ IEnumWbemClassObject __RPC_FAR *__RPC_FAR *ppEnum) { return WBEM_E_NOT_SUPPORTED;}
  76. virtual HRESULT STDMETHODCALLTYPE CreateClassEnumAsync(
  77. /* [in] */ const BSTR strSuperclass,
  78. /* [in] */ long lFlags,
  79. /* [in] */ IWbemContext __RPC_FAR *pCtx,
  80. /* [in] */ IWbemObjectSink __RPC_FAR *pResponseHandler) { return WBEM_E_NOT_SUPPORTED;}
  81. virtual HRESULT STDMETHODCALLTYPE PutInstance(
  82. /* [in] */ IWbemClassObject __RPC_FAR *pInst,
  83. /* [in] */ long lFlags,
  84. /* [in] */ IWbemContext __RPC_FAR *pCtx,
  85. /* [unique][in][out] */ IWbemCallResult __RPC_FAR *__RPC_FAR *ppCallResult) { return WBEM_E_NOT_SUPPORTED;}
  86. virtual HRESULT STDMETHODCALLTYPE PutInstanceAsync(
  87. /* [in] */ IWbemClassObject __RPC_FAR *pInst,
  88. /* [in] */ long lFlags,
  89. /* [in] */ IWbemContext __RPC_FAR *pCtx,
  90. /* [in] */ IWbemObjectSink __RPC_FAR *pResponseHandler) { return WBEM_E_NOT_SUPPORTED;}
  91. virtual HRESULT STDMETHODCALLTYPE DeleteInstance(
  92. /* [in] */ const BSTR strObjectPath,
  93. /* [in] */ long lFlags,
  94. /* [in] */ IWbemContext __RPC_FAR *pCtx,
  95. /* [unique][in][out] */ IWbemCallResult __RPC_FAR *__RPC_FAR *ppCallResult) { return WBEM_E_NOT_SUPPORTED;}
  96. virtual HRESULT STDMETHODCALLTYPE DeleteInstanceAsync(
  97. /* [in] */ const BSTR strObjectPath,
  98. /* [in] */ long lFlags,
  99. /* [in] */ IWbemContext __RPC_FAR *pCtx,
  100. /* [in] */ IWbemObjectSink __RPC_FAR *pResponseHandler) { return WBEM_E_NOT_SUPPORTED;}
  101. virtual HRESULT STDMETHODCALLTYPE CreateInstanceEnum(
  102. /* [in] */ const BSTR strClass,
  103. /* [in] */ long lFlags,
  104. /* [in] */ IWbemContext __RPC_FAR *pCtx,
  105. /* [out] */ IEnumWbemClassObject __RPC_FAR *__RPC_FAR *ppEnum) { return WBEM_E_NOT_SUPPORTED;}
  106. virtual HRESULT STDMETHODCALLTYPE CreateInstanceEnumAsync(
  107. /* [in] */ const BSTR strClass,
  108. /* [in] */ long lFlags,
  109. /* [in] */ IWbemContext __RPC_FAR *pCtx,
  110. /* [in] */ IWbemObjectSink __RPC_FAR *pResponseHandler) { return WBEM_E_NOT_SUPPORTED;}
  111. virtual HRESULT STDMETHODCALLTYPE ExecQuery(
  112. /* [in] */ const BSTR strQueryLanguage,
  113. /* [in] */ const BSTR strQuery,
  114. /* [in] */ long lFlags,
  115. /* [in] */ IWbemContext __RPC_FAR *pCtx,
  116. /* [out] */ IEnumWbemClassObject __RPC_FAR *__RPC_FAR *ppEnum) { return WBEM_E_NOT_SUPPORTED;}
  117. virtual HRESULT STDMETHODCALLTYPE ExecQueryAsync(
  118. /* [in] */ const BSTR strQueryLanguage,
  119. /* [in] */ const BSTR strQuery,
  120. /* [in] */ long lFlags,
  121. /* [in] */ IWbemContext __RPC_FAR *pCtx,
  122. /* [in] */ IWbemObjectSink __RPC_FAR *pResponseHandler) { return WBEM_E_NOT_SUPPORTED;}
  123. virtual HRESULT STDMETHODCALLTYPE ExecNotificationQuery(
  124. /* [in] */ const BSTR strQueryLanguage,
  125. /* [in] */ const BSTR strQuery,
  126. /* [in] */ long lFlags,
  127. /* [in] */ IWbemContext __RPC_FAR *pCtx,
  128. /* [out] */ IEnumWbemClassObject __RPC_FAR *__RPC_FAR *ppEnum) { return WBEM_E_NOT_SUPPORTED;}
  129. virtual HRESULT STDMETHODCALLTYPE ExecNotificationQueryAsync(
  130. /* [in] */ const BSTR strQueryLanguage,
  131. /* [in] */ const BSTR strQuery,
  132. /* [in] */ long lFlags,
  133. /* [in] */ IWbemContext __RPC_FAR *pCtx,
  134. /* [in] */ IWbemObjectSink __RPC_FAR *pResponseHandler) { return WBEM_E_NOT_SUPPORTED;}
  135. virtual HRESULT STDMETHODCALLTYPE ExecMethod(
  136. /* [in] */ const BSTR strObjectPath,
  137. /* [in] */ const BSTR strMethodName,
  138. /* [in] */ long lFlags,
  139. /* [in] */ IWbemContext __RPC_FAR *pCtx,
  140. /* [in] */ IWbemClassObject __RPC_FAR *pInParams,
  141. /* [unique][in][out] */ IWbemClassObject __RPC_FAR *__RPC_FAR *ppOutParams,
  142. /* [unique][in][out] */ IWbemCallResult __RPC_FAR *__RPC_FAR *ppCallResult) { return WBEM_E_NOT_SUPPORTED;}
  143. };
  144. //*************************************************************
  145. //
  146. // Class: CSnapProv
  147. //
  148. // Description: Actual snapshot provider class
  149. //
  150. //*************************************************************
  151. class CSnapProv : public CNotImplSnapProv, public IWbemProviderInit
  152. {
  153. private:
  154. long m_cRef;
  155. bool m_bInitialized;
  156. IWbemServices* m_pNamespace;
  157. XBStr m_xbstrNameSpace;
  158. XBStr m_xbstrResult;
  159. XBStr m_xbstrExtendedInfo;
  160. XBStr m_xbstrClass;
  161. XBStr m_xbstrUserSid;
  162. XBStr m_xbstrUserSids;
  163. XBStr m_xbstrFlags;
  164. public:
  165. CSnapProv();
  166. ~CSnapProv();
  167. // From IUnknown
  168. STDMETHOD(QueryInterface)(REFIID riid, LPVOID* ppv);
  169. STDMETHOD_(ULONG, AddRef)();
  170. STDMETHOD_(ULONG, Release)();
  171. // From IWbemProviderInit
  172. STDMETHOD(Initialize)(LPWSTR pszUser,LONG lFlags,LPWSTR pszNamespace,LPWSTR pszLocale,IWbemServices __RPC_FAR *pNamespace,IWbemContext __RPC_FAR *pCtx,IWbemProviderInitSink __RPC_FAR *pInitSink);
  173. // From IWbemServices
  174. STDMETHOD(ExecMethodAsync)( const BSTR strObjectPath,
  175. const BSTR strMethodName,
  176. long lFlags,
  177. IWbemContext __RPC_FAR *pCtx,
  178. IWbemClassObject __RPC_FAR *pInParams,
  179. IWbemObjectSink __RPC_FAR *pResponseHandler);
  180. };
  181. #endif // _SNAPPROV_H__CE49F9FF_5775_4575_9052_C76FBD20AD79__INCLUDED