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.

134 lines
3.9 KiB

  1. //////////////////////////////////////////////////////////////////////////////
  2. //
  3. // Copyright (c) 1999-2000 Microsoft Corporation
  4. //
  5. // Module Name:
  6. // InstanceProv.h
  7. //
  8. // Implementation File:
  9. // InstanceProv.cpp
  10. //
  11. // Description:
  12. // Definition of the CInstanceProv class.
  13. //
  14. // Author:
  15. // Henry Wang (HenryWa) 24-AUG-1999
  16. // MSP Prabu (mprabu) 06-Jan-2001
  17. // Jim Benton (jbenton) 15-Oct-2001
  18. //
  19. // Notes:
  20. //
  21. //////////////////////////////////////////////////////////////////////////////
  22. #pragma once
  23. //////////////////////////////////////////////////////////////////////////////
  24. // Forward Declarations
  25. //////////////////////////////////////////////////////////////////////////////
  26. class CInstanceProv;
  27. class CWbemClassObject;
  28. class CProvException;
  29. //////////////////////////////////////////////////////////////////////////////
  30. //++
  31. //
  32. // class CInstanceProv
  33. //
  34. // Description:
  35. // Implement the Instance and method provider entry point class. WMI
  36. // holds a pointer to this object, and invoking its member functions
  37. // based client request
  38. //
  39. //--
  40. //////////////////////////////////////////////////////////////////////////////
  41. class CInstanceProv : public CImpersonatedProvider
  42. {
  43. protected:
  44. HRESULT SetExtendedStatus(
  45. CProvException & rpe ,
  46. IWbemObjectSink ** ppHandler
  47. );
  48. public:
  49. CInstanceProv(
  50. IN BSTR bstrObjectPath = NULL,
  51. IN BSTR bstrUser = NULL,
  52. IN BSTR bstrPassword = NULL,
  53. IN IWbemContext * pCtx = NULL
  54. )
  55. {
  56. InterlockedIncrement( &g_cObj );
  57. m_fInitialized = FALSE;
  58. }
  59. virtual ~CInstanceProv( void );
  60. HRESULT STDMETHODCALLTYPE DoGetObjectAsync(
  61. IN BSTR bstrObjectPath,
  62. IN long lFlags,
  63. IN IWbemContext * pCtx,
  64. IN IWbemObjectSink * pHandler
  65. );
  66. HRESULT STDMETHODCALLTYPE DoPutInstanceAsync(
  67. IN IWbemClassObject * pInst,
  68. IN long lFlags,
  69. IN IWbemContext * pCtx,
  70. IN IWbemObjectSink * pHandler
  71. ) ;
  72. HRESULT STDMETHODCALLTYPE DoDeleteInstanceAsync(
  73. IN BSTR bstrObjectPath,
  74. IN long lFlags,
  75. IN IWbemContext * pCtx,
  76. IN IWbemObjectSink * pHandler
  77. ) ;
  78. HRESULT STDMETHODCALLTYPE DoCreateInstanceEnumAsync(
  79. IN BSTR bstrRefStr,
  80. IN long lFlags,
  81. IN IWbemContext * pCtx,
  82. IN IWbemObjectSink * pHandler
  83. );
  84. HRESULT STDMETHODCALLTYPE DoExecQueryAsync(
  85. IN BSTR bstrQueryLanguage,
  86. IN BSTR bstrQuery,
  87. IN long lFlags,
  88. IN IWbemContext * pCtx,
  89. IN IWbemObjectSink * pHandler
  90. )
  91. {
  92. return WBEM_E_NOT_SUPPORTED;
  93. }
  94. HRESULT STDMETHODCALLTYPE DoExecMethodAsync(
  95. IN BSTR bstrObjectPath,
  96. IN BSTR bstrMethodName,
  97. IN long lFlags,
  98. IN IWbemContext * pCtx,
  99. IN IWbemClassObject * pInParams,
  100. IN IWbemObjectSink * pHandler
  101. );
  102. STDMETHODIMP Initialize(
  103. IN LPWSTR pszUser,
  104. IN LONG lFlags,
  105. IN LPWSTR pszNamespace,
  106. IN LPWSTR pszLocale,
  107. IN IWbemServices * pNamespace,
  108. IN IWbemContext * pCtx,
  109. IN IWbemProviderInitSink * pInitSink
  110. );
  111. static HRESULT S_HrCreateThis(
  112. IN IUnknown * pUnknownOuter,
  113. OUT VOID ** ppv
  114. );
  115. private:
  116. BOOL m_fInitialized;
  117. }; //*** CInstanceProv