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.

142 lines
4.0 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. {
  61. InterlockedDecrement( &g_cObj );
  62. //#ifdef _DEBUG
  63. #ifdef _DEBUG_NEVER
  64. _CrtDumpMemoryLeaks();
  65. #endif
  66. }
  67. HRESULT STDMETHODCALLTYPE DoGetObjectAsync(
  68. IN BSTR bstrObjectPath,
  69. IN long lFlags,
  70. IN IWbemContext * pCtx,
  71. IN IWbemObjectSink * pHandler
  72. );
  73. HRESULT STDMETHODCALLTYPE DoPutInstanceAsync(
  74. IN IWbemClassObject * pInst,
  75. IN long lFlags,
  76. IN IWbemContext * pCtx,
  77. IN IWbemObjectSink * pHandler
  78. ) ;
  79. HRESULT STDMETHODCALLTYPE DoDeleteInstanceAsync(
  80. IN BSTR bstrObjectPath,
  81. IN long lFlags,
  82. IN IWbemContext * pCtx,
  83. IN IWbemObjectSink * pHandler
  84. ) ;
  85. HRESULT STDMETHODCALLTYPE DoCreateInstanceEnumAsync(
  86. IN BSTR bstrRefStr,
  87. IN long lFlags,
  88. IN IWbemContext * pCtx,
  89. IN IWbemObjectSink * pHandler
  90. );
  91. HRESULT STDMETHODCALLTYPE DoExecQueryAsync(
  92. IN BSTR bstrQueryLanguage,
  93. IN BSTR bstrQuery,
  94. IN long lFlags,
  95. IN IWbemContext * pCtx,
  96. IN IWbemObjectSink * pHandler
  97. )
  98. {
  99. return WBEM_E_NOT_SUPPORTED;
  100. }
  101. HRESULT STDMETHODCALLTYPE DoExecMethodAsync(
  102. IN BSTR bstrObjectPath,
  103. IN BSTR bstrMethodName,
  104. IN long lFlags,
  105. IN IWbemContext * pCtx,
  106. IN IWbemClassObject * pInParams,
  107. IN IWbemObjectSink * pHandler
  108. );
  109. STDMETHODIMP Initialize(
  110. IN LPWSTR pszUser,
  111. IN LONG lFlags,
  112. IN LPWSTR pszNamespace,
  113. IN LPWSTR pszLocale,
  114. IN IWbemServices * pNamespace,
  115. IN IWbemContext * pCtx,
  116. IN IWbemProviderInitSink * pInitSink
  117. );
  118. static HRESULT S_HrCreateThis(
  119. IN IUnknown * pUnknownOuter,
  120. OUT VOID ** ppv
  121. );
  122. private:
  123. BOOL m_fInitialized;
  124. }; //*** CInstanceProv