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.

204 lines
7.7 KiB

  1. // Copyright (c) 2000-2001 Microsoft Corporation, All Rights Reserved
  2. // JobObjectProv.h
  3. #pragma once
  4. #define JOB_OBJECT_PROVIDER L"NamedJobObjectProv"
  5. _COM_SMARTPTR_TYPEDEF(IWbemServices, __uuidof(IWbemServices));
  6. _COM_SMARTPTR_TYPEDEF(IWbemObjectSink, __uuidof(IWbemObjectSink));
  7. _COM_SMARTPTR_TYPEDEF(IWbemClassObject, __uuidof(IWbemClassObject));
  8. /*****************************************************************************/
  9. // Component
  10. /*****************************************************************************/
  11. class CJobObjectProv;
  12. class CJobObjectProv : public CUnknown,
  13. public IWbemServices,
  14. public IWbemProviderInit
  15. {
  16. public:
  17. // IDispatch declaration and implementation
  18. DECLARE_IUNKNOWN
  19. // Constructor
  20. CJobObjectProv();
  21. // Destructor
  22. virtual ~CJobObjectProv();
  23. // Creation
  24. static HRESULT CreateInstance(CUnknown** ppNewComponent);
  25. // Interface IWbemProviderInit
  26. STDMETHOD(Initialize)(
  27. /* [in] */ LPWSTR pszUser,
  28. /* [in] */ LONG lFlags,
  29. /* [in] */ LPWSTR pszNamespace,
  30. /* [in] */ LPWSTR pszLocale,
  31. /* [in] */ IWbemServices *pNamespace,
  32. /* [in] */ IWbemContext *pCtx,
  33. /* [in] */ IWbemProviderInitSink *pInitSink);
  34. SCODE GetByPath( BSTR Path, IWbemClassObject FAR* FAR* pObj, IWbemContext *pCtx);
  35. // Interface IWbemServices
  36. STDMETHOD(OpenNamespace)(
  37. /* [in] */ const BSTR Namespace,
  38. /* [in] */ long lFlags,
  39. /* [in] */ IWbemContext __RPC_FAR *pCtx,
  40. /* [unique][in][out] */ IWbemServices __RPC_FAR *__RPC_FAR *ppWorkingNamespace,
  41. /* [unique][in][out] */ IWbemCallResult __RPC_FAR *__RPC_FAR *ppResult) {return WBEM_E_NOT_SUPPORTED;}
  42. STDMETHOD(CancelAsyncCall)(
  43. /* [in] */ IWbemObjectSink __RPC_FAR *pSink) {return WBEM_E_NOT_SUPPORTED;}
  44. HRESULT STDMETHODCALLTYPE QueryObjectSink(
  45. /* [in] */ long lFlags,
  46. /* [out] */ IWbemObjectSink __RPC_FAR *__RPC_FAR *ppResponseHandler) {return WBEM_E_NOT_SUPPORTED;}
  47. STDMETHOD(GetObject)(
  48. /* [in] */ const BSTR ObjectPath,
  49. /* [in] */ long lFlags,
  50. /* [in] */ IWbemContext __RPC_FAR *pCtx,
  51. /* [unique][in][out] */ IWbemClassObject __RPC_FAR *__RPC_FAR *ppObject,
  52. /* [unique][in][out] */ IWbemCallResult __RPC_FAR *__RPC_FAR *ppCallResult) {return WBEM_E_NOT_SUPPORTED;}
  53. STDMETHOD(GetObjectAsync)(
  54. /* [in] */ const BSTR ObjectPath,
  55. /* [in] */ long lFlags,
  56. /* [in] */ IWbemContext __RPC_FAR *pCtx,
  57. /* [in] */ IWbemObjectSink __RPC_FAR *pResponseHandler);
  58. STDMETHOD(PutClass)(
  59. /* [in] */ IWbemClassObject __RPC_FAR *pObject,
  60. /* [in] */ long lFlags,
  61. /* [in] */ IWbemContext __RPC_FAR *pCtx,
  62. /* [unique][in][out] */ IWbemCallResult __RPC_FAR *__RPC_FAR *ppCallResult) {return WBEM_E_NOT_SUPPORTED;}
  63. STDMETHOD(PutClassAsync)(
  64. /* [in] */ IWbemClassObject __RPC_FAR *pObject,
  65. /* [in] */ long lFlags,
  66. /* [in] */ IWbemContext __RPC_FAR *pCtx,
  67. /* [in] */ IWbemObjectSink __RPC_FAR *pResponseHandler) {return WBEM_E_NOT_SUPPORTED;}
  68. STDMETHOD(DeleteClass)(
  69. /* [in] */ const BSTR Class,
  70. /* [in] */ long lFlags,
  71. /* [in] */ IWbemContext __RPC_FAR *pCtx,
  72. /* [unique][in][out] */ IWbemCallResult __RPC_FAR *__RPC_FAR *ppCallResult) {return WBEM_E_NOT_SUPPORTED;}
  73. STDMETHOD(DeleteClassAsync)(
  74. /* [in] */ const BSTR Class,
  75. /* [in] */ long lFlags,
  76. /* [in] */ IWbemContext __RPC_FAR *pCtx,
  77. /* [in] */ IWbemObjectSink __RPC_FAR *pResponseHandler) {return WBEM_E_NOT_SUPPORTED;}
  78. STDMETHOD(CreateClassEnum)(
  79. /* [in] */ const BSTR Superclass,
  80. /* [in] */ long lFlags,
  81. /* [in] */ IWbemContext __RPC_FAR *pCtx,
  82. /* [out] */ IEnumWbemClassObject __RPC_FAR *__RPC_FAR *ppEnum) {return WBEM_E_NOT_SUPPORTED;}
  83. STDMETHOD(CreateClassEnumAsync)(
  84. /* [in] */ const BSTR Superclass,
  85. /* [in] */ long lFlags,
  86. /* [in] */ IWbemContext __RPC_FAR *pCtx,
  87. /* [in] */ IWbemObjectSink __RPC_FAR *pResponseHandler) {return WBEM_E_NOT_SUPPORTED;}
  88. STDMETHOD(PutInstance)(
  89. /* [in] */ IWbemClassObject __RPC_FAR *pInst,
  90. /* [in] */ long lFlags,
  91. /* [in] */ IWbemContext __RPC_FAR *pCtx,
  92. /* [unique][in][out] */ IWbemCallResult __RPC_FAR *__RPC_FAR *ppCallResult) {return WBEM_E_NOT_SUPPORTED;}
  93. STDMETHOD(PutInstanceAsync)(
  94. /* [in] */ IWbemClassObject __RPC_FAR *pInst,
  95. /* [in] */ long lFlags,
  96. /* [in] */ IWbemContext __RPC_FAR *pCtx,
  97. /* [in] */ IWbemObjectSink __RPC_FAR *pResponseHandler) {return WBEM_E_NOT_SUPPORTED;}
  98. STDMETHOD(DeleteInstance)(
  99. /* [in] */ const BSTR ObjectPath,
  100. /* [in] */ long lFlags,
  101. /* [in] */ IWbemContext __RPC_FAR *pCtx,
  102. /* [unique][in][out] */ IWbemCallResult __RPC_FAR *__RPC_FAR *ppCallResult) {return WBEM_E_NOT_SUPPORTED;}
  103. STDMETHOD(DeleteInstanceAsync)(
  104. /* [in] */ const BSTR ObjectPath,
  105. /* [in] */ long lFlags,
  106. /* [in] */ IWbemContext __RPC_FAR *pCtx,
  107. /* [in] */ IWbemObjectSink __RPC_FAR *pResponseHandler) {return WBEM_E_NOT_SUPPORTED;}
  108. STDMETHOD(CreateInstanceEnum)(
  109. /* [in] */ const BSTR Class,
  110. /* [in] */ long lFlags,
  111. /* [in] */ IWbemContext __RPC_FAR *pCtx,
  112. /* [out] */ IEnumWbemClassObject __RPC_FAR *__RPC_FAR *ppEnum) {return WBEM_E_NOT_SUPPORTED;}
  113. STDMETHOD(CreateInstanceEnumAsync)(
  114. /* [in] */ const BSTR Class,
  115. /* [in] */ long lFlags,
  116. /* [in] */ IWbemContext __RPC_FAR *pCtx,
  117. /* [in] */ IWbemObjectSink __RPC_FAR *pResponseHandler);
  118. STDMETHOD(ExecQuery)(
  119. /* [in] */ const BSTR QueryLanguage,
  120. /* [in] */ const BSTR Query,
  121. /* [in] */ long lFlags,
  122. /* [in] */ IWbemContext __RPC_FAR *pCtx,
  123. /* [out] */ IEnumWbemClassObject __RPC_FAR *__RPC_FAR *ppEnum) {return WBEM_E_NOT_SUPPORTED;}
  124. STDMETHOD(ExecQueryAsync)(
  125. /* [in] */ const BSTR QueryLanguage,
  126. /* [in] */ const BSTR Query,
  127. /* [in] */ long lFlags,
  128. /* [in] */ IWbemContext __RPC_FAR *pCtx,
  129. /* [in] */ IWbemObjectSink __RPC_FAR *pResponseHandler);
  130. STDMETHOD(ExecNotificationQuery)(
  131. /* [in] */ const BSTR QueryLanguage,
  132. /* [in] */ const BSTR Query,
  133. /* [in] */ long lFlags,
  134. /* [in] */ IWbemContext __RPC_FAR *pCtx,
  135. /* [out] */ IEnumWbemClassObject __RPC_FAR *__RPC_FAR *ppEnum) {return WBEM_E_NOT_SUPPORTED;}
  136. STDMETHOD(ExecNotificationQueryAsync)(
  137. /* [in] */ const BSTR QueryLanguage,
  138. /* [in] */ const BSTR Query,
  139. /* [in] */ long lFlags,
  140. /* [in] */ IWbemContext __RPC_FAR *pCtx,
  141. /* [in] */ IWbemObjectSink __RPC_FAR *pResponseHandler) {return WBEM_E_NOT_SUPPORTED;}
  142. STDMETHOD(ExecMethod)( const BSTR, const BSTR, long, IWbemContext*,
  143. IWbemClassObject*, IWbemClassObject**, IWbemCallResult**) {return WBEM_E_NOT_SUPPORTED;}
  144. STDMETHOD(ExecMethodAsync)( const BSTR, const BSTR, long,
  145. IWbemContext*, IWbemClassObject*, IWbemObjectSink*) {return WBEM_E_NOT_SUPPORTED;}
  146. private:
  147. HRESULT Enumerate(
  148. IWbemContext __RPC_FAR *pCtx,
  149. IWbemObjectSink __RPC_FAR *pResponseHandler,
  150. std::vector<_bstr_t>& rgNamedJOs,
  151. CJobObjProps& cjop,
  152. IWbemClassObject** ppStatusObject);
  153. IWbemServicesPtr m_pNamespace;
  154. CHString m_chstrNamespace;
  155. };