Source code of Windows XP (NT5)
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.

220 lines
9.3 KiB

  1. // WhqlObj.h : Declaration of the CWhqlObj
  2. #ifndef __WHQLOBJ_H_
  3. #define __WHQLOBJ_H_
  4. #include "resource.h" // main symbols
  5. #include "WbemProv.h"
  6. /////////////////////////////////////////////////////////////////////////////
  7. // CWhqlObj
  8. enum Classes_Provided
  9. {
  10. Class_Win32_PnPSignedDriver ,
  11. Class_Win32_PnPSignedDriverCIMDataFile ,
  12. Class_Win32_PnPSignedDriverWin32PnPEntity
  13. };
  14. class ATL_NO_VTABLE CWhqlObj :
  15. public CComObjectRootEx<CComMultiThreadModel>,
  16. public CComCoClass<CWhqlObj, &CLSID_WhqlObj>,
  17. public IDispatchImpl<IWhqlObj, &IID_IWhqlObj, &LIBID_WHQLPROLib>,
  18. public IWbemProviderInit,
  19. public IWbemServices
  20. {
  21. public:
  22. CWhqlObj()
  23. {
  24. }
  25. DECLARE_REGISTRY_RESOURCEID(IDR_WHQLOBJ)
  26. DECLARE_PROTECT_FINAL_CONSTRUCT()
  27. BEGIN_COM_MAP(CWhqlObj)
  28. COM_INTERFACE_ENTRY(IWhqlObj)
  29. COM_INTERFACE_ENTRY(IDispatch)
  30. COM_INTERFACE_ENTRY(IWbemProviderInit)
  31. COM_INTERFACE_ENTRY(IWbemServices)
  32. END_COM_MAP()
  33. // IWhqlObj
  34. public:
  35. //IWbemProviderInit
  36. STDMETHOD(Initialize)(
  37. /* [in] */ LPWSTR pszUser,
  38. /* [in] */ LONG lFlags,
  39. /* [in] */ LPWSTR pszNamespace,
  40. /* [in] */ LPWSTR pszLocale,
  41. /* [in] */ IWbemServices *pNamespace,
  42. /* [in] */ IWbemContext *pCtx,
  43. /* [in] */ IWbemProviderInitSink *pInitSink);
  44. STDMETHOD(GetByPath)(BSTR Path, IWbemClassObject FAR* FAR* pObj, IWbemContext *pCtx) {return WBEM_E_NOT_SUPPORTED;};
  45. //IWbemServices
  46. HRESULT STDMETHODCALLTYPE OpenNamespace(
  47. /* [in] */ const BSTR strNamespace,
  48. /* [in] */ long lFlags,
  49. /* [in] */ IWbemContext __RPC_FAR *pCtx,
  50. /* [unique][in][out] */ IWbemServices __RPC_FAR *__RPC_FAR *ppWorkingNamespace,
  51. /* [unique][in][out] */ IWbemCallResult __RPC_FAR *__RPC_FAR *ppResult){return WBEM_E_NOT_SUPPORTED;};
  52. HRESULT STDMETHODCALLTYPE CancelAsyncCall(
  53. /* [in] */ IWbemObjectSink __RPC_FAR *pSink){return WBEM_E_NOT_SUPPORTED;};
  54. HRESULT STDMETHODCALLTYPE QueryObjectSink(
  55. /* [in] */ long lFlags,
  56. /* [out] */ IWbemObjectSink __RPC_FAR *__RPC_FAR *ppResponseHandler){return WBEM_E_NOT_SUPPORTED;};
  57. HRESULT STDMETHODCALLTYPE GetObject(
  58. /* [in] */ const BSTR strObjectPath,
  59. /* [in] */ long lFlags,
  60. /* [in] */ IWbemContext __RPC_FAR *pCtx,
  61. /* [unique][in][out] */ IWbemClassObject __RPC_FAR *__RPC_FAR *ppObject,
  62. /* [unique][in][out] */ IWbemCallResult __RPC_FAR *__RPC_FAR *ppCallResult){return WBEM_E_NOT_SUPPORTED;};
  63. HRESULT STDMETHODCALLTYPE GetObjectAsync(
  64. /* [in] */ const BSTR strObjectPath,
  65. /* [in] */ long lFlags,
  66. /* [in] */ IWbemContext __RPC_FAR *pCtx,
  67. /* [in] */ IWbemObjectSink __RPC_FAR *pResponseHandler){return WBEM_E_NOT_SUPPORTED;};
  68. HRESULT STDMETHODCALLTYPE PutClass(
  69. /* [in] */ IWbemClassObject __RPC_FAR *pObject,
  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. HRESULT STDMETHODCALLTYPE PutClassAsync(
  74. /* [in] */ IWbemClassObject __RPC_FAR *pObject,
  75. /* [in] */ long lFlags,
  76. /* [in] */ IWbemContext __RPC_FAR *pCtx,
  77. /* [in] */ IWbemObjectSink __RPC_FAR *pResponseHandler){return WBEM_E_NOT_SUPPORTED;};
  78. HRESULT STDMETHODCALLTYPE DeleteClass(
  79. /* [in] */ const BSTR strClass,
  80. /* [in] */ long lFlags,
  81. /* [in] */ IWbemContext __RPC_FAR *pCtx,
  82. /* [unique][in][out] */ IWbemCallResult __RPC_FAR *__RPC_FAR *ppCallResult){return WBEM_E_NOT_SUPPORTED;};
  83. HRESULT STDMETHODCALLTYPE DeleteClassAsync(
  84. /* [in] */ const BSTR strClass,
  85. /* [in] */ long lFlags,
  86. /* [in] */ IWbemContext __RPC_FAR *pCtx,
  87. /* [in] */ IWbemObjectSink __RPC_FAR *pResponseHandler){return WBEM_E_NOT_SUPPORTED;};
  88. HRESULT STDMETHODCALLTYPE CreateClassEnum(
  89. /* [in] */ const BSTR strSuperclass,
  90. /* [in] */ long lFlags,
  91. /* [in] */ IWbemContext __RPC_FAR *pCtx,
  92. /* [out] */ IEnumWbemClassObject __RPC_FAR *__RPC_FAR *ppEnum){return WBEM_E_NOT_SUPPORTED;};
  93. HRESULT STDMETHODCALLTYPE CreateClassEnumAsync(
  94. /* [in] */ const BSTR strSuperclass,
  95. /* [in] */ long lFlags,
  96. /* [in] */ IWbemContext __RPC_FAR *pCtx,
  97. /* [in] */ IWbemObjectSink __RPC_FAR *pResponseHandler){return WBEM_E_NOT_SUPPORTED;};
  98. HRESULT STDMETHODCALLTYPE PutInstance(
  99. /* [in] */ IWbemClassObject __RPC_FAR *pInst,
  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. HRESULT STDMETHODCALLTYPE PutInstanceAsync(
  104. /* [in] */ IWbemClassObject __RPC_FAR *pInst,
  105. /* [in] */ long lFlags,
  106. /* [in] */ IWbemContext __RPC_FAR *pCtx,
  107. /* [in] */ IWbemObjectSink __RPC_FAR *pResponseHandler){return WBEM_E_NOT_SUPPORTED;};
  108. HRESULT STDMETHODCALLTYPE DeleteInstance(
  109. /* [in] */ const BSTR strObjectPath,
  110. /* [in] */ long lFlags,
  111. /* [in] */ IWbemContext __RPC_FAR *pCtx,
  112. /* [unique][in][out] */ IWbemCallResult __RPC_FAR *__RPC_FAR *ppCallResult){return WBEM_E_NOT_SUPPORTED;};
  113. HRESULT STDMETHODCALLTYPE DeleteInstanceAsync(
  114. /* [in] */ const BSTR strObjectPath,
  115. /* [in] */ long lFlags,
  116. /* [in] */ IWbemContext __RPC_FAR *pCtx,
  117. /* [in] */ IWbemObjectSink __RPC_FAR *pResponseHandler){return WBEM_E_NOT_SUPPORTED;};
  118. HRESULT STDMETHODCALLTYPE CreateInstanceEnum(
  119. /* [in] */ const BSTR strClass,
  120. /* [in] */ long lFlags,
  121. /* [in] */ IWbemContext __RPC_FAR *pCtx,
  122. /* [out] */ IEnumWbemClassObject __RPC_FAR *__RPC_FAR *ppEnum){return WBEM_E_NOT_SUPPORTED;};
  123. HRESULT STDMETHODCALLTYPE CreateInstanceEnumAsync(
  124. /* [in] */ const BSTR strClass,
  125. /* [in] */ long lFlags,
  126. /* [in] */ IWbemContext __RPC_FAR *pCtx,
  127. /* [in] */ IWbemObjectSink __RPC_FAR *pResponseHandler);
  128. HRESULT STDMETHODCALLTYPE ExecQuery(
  129. /* [in] */ const BSTR strQueryLanguage,
  130. /* [in] */ const BSTR strQuery,
  131. /* [in] */ long lFlags,
  132. /* [in] */ IWbemContext __RPC_FAR *pCtx,
  133. /* [out] */ IEnumWbemClassObject __RPC_FAR *__RPC_FAR *ppEnum){return WBEM_E_NOT_SUPPORTED;};
  134. HRESULT STDMETHODCALLTYPE ExecQueryAsync(
  135. /* [in] */ const BSTR strQueryLanguage,
  136. /* [in] */ const BSTR strQuery,
  137. /* [in] */ long lFlags,
  138. /* [in] */ IWbemContext __RPC_FAR *pCtx,
  139. /* [in] */ IWbemObjectSink __RPC_FAR *pResponseHandler){return WBEM_E_NOT_SUPPORTED;};
  140. HRESULT STDMETHODCALLTYPE ExecNotificationQuery(
  141. /* [in] */ const BSTR strQueryLanguage,
  142. /* [in] */ const BSTR strQuery,
  143. /* [in] */ long lFlags,
  144. /* [in] */ IWbemContext __RPC_FAR *pCtx,
  145. /* [out] */ IEnumWbemClassObject __RPC_FAR *__RPC_FAR *ppEnum){return WBEM_E_NOT_SUPPORTED;};
  146. HRESULT STDMETHODCALLTYPE ExecNotificationQueryAsync(
  147. /* [in] */ const BSTR strQueryLanguage,
  148. /* [in] */ const BSTR strQuery,
  149. /* [in] */ long lFlags,
  150. /* [in] */ IWbemContext __RPC_FAR *pCtx,
  151. /* [in] */ IWbemObjectSink __RPC_FAR *pResponseHandler){return WBEM_E_NOT_SUPPORTED;};
  152. HRESULT STDMETHODCALLTYPE ExecMethod(
  153. /* [in] */ const BSTR strObjectPath,
  154. /* [in] */ const BSTR strMethodName,
  155. /* [in] */ long lFlags,
  156. /* [in] */ IWbemContext __RPC_FAR *pCtx,
  157. /* [in] */ IWbemClassObject __RPC_FAR *pInParams,
  158. /* [unique][in][out] */ IWbemClassObject __RPC_FAR *__RPC_FAR *ppOutParams,
  159. /* [unique][in][out] */ IWbemCallResult __RPC_FAR *__RPC_FAR *ppCallResult){return WBEM_E_NOT_SUPPORTED;};
  160. HRESULT STDMETHODCALLTYPE ExecMethodAsync(
  161. /* [in] */ const BSTR strObjectPath,
  162. /* [in] */ const BSTR strMethodName,
  163. /* [in] */ long lFlags,
  164. /* [in] */ IWbemContext __RPC_FAR *pCtx,
  165. /* [in] */ IWbemClassObject __RPC_FAR *pInParams,
  166. /* [in] */ IWbemObjectSink __RPC_FAR *pResponseHandler){return WBEM_E_NOT_SUPPORTED;};
  167. protected:
  168. IWbemServices* m_pNamespace;
  169. IWbemClassObject* m_pClass;
  170. CString m_csPathStr ;
  171. CString m_csAntecedent ;
  172. CString m_csCurPnPID ;
  173. CPtrArray m_ptrArr;
  174. protected://Helper
  175. int GetInfFileCount();
  176. SCODE PutData(IWbemContext *pCtx , Classes_Provided eClasses);
  177. SCODE GetInfData(LPTSTR lpszInfFile , LPTSTR lpszInfSection , LPTSTR szDeviceID , IWbemContext *pCtx , IWbemClassObject *pInstance);
  178. SCODE EnumRegKeys(HKEY hSubKey , IWbemClassObject* pInstance, LPTSTR szDeviceDesc, LPTSTR szDeviceID , IWbemContext *pCtx , Classes_Provided eClasses);
  179. SCODE GetService(LPTSTR szDeviceID , LPTSTR szName , ULONG* plen );
  180. SCODE CreateAssoc( IWbemContext *pCtx );
  181. };
  182. #endif //__WHQLOBJ_H_