221 lines
9.3 KiB
C
221 lines
9.3 KiB
C
|
// WhqlObj.h : Declaration of the CWhqlObj
|
||
|
|
||
|
#ifndef __WHQLOBJ_H_
|
||
|
#define __WHQLOBJ_H_
|
||
|
|
||
|
#include "resource.h" // main symbols
|
||
|
#include "WbemProv.h"
|
||
|
|
||
|
/////////////////////////////////////////////////////////////////////////////
|
||
|
// CWhqlObj
|
||
|
|
||
|
enum Classes_Provided
|
||
|
{
|
||
|
Class_Win32_PnPSignedDriver ,
|
||
|
Class_Win32_PnPSignedDriverCIMDataFile ,
|
||
|
Class_Win32_PnPSignedDriverWin32PnPEntity
|
||
|
};
|
||
|
|
||
|
class ATL_NO_VTABLE CWhqlObj :
|
||
|
public CComObjectRootEx<CComMultiThreadModel>,
|
||
|
public CComCoClass<CWhqlObj, &CLSID_WhqlObj>,
|
||
|
public IDispatchImpl<IWhqlObj, &IID_IWhqlObj, &LIBID_WHQLPROLib>,
|
||
|
public IWbemProviderInit,
|
||
|
public IWbemServices
|
||
|
{
|
||
|
public:
|
||
|
CWhqlObj()
|
||
|
{
|
||
|
}
|
||
|
|
||
|
DECLARE_REGISTRY_RESOURCEID(IDR_WHQLOBJ)
|
||
|
|
||
|
DECLARE_PROTECT_FINAL_CONSTRUCT()
|
||
|
|
||
|
BEGIN_COM_MAP(CWhqlObj)
|
||
|
COM_INTERFACE_ENTRY(IWhqlObj)
|
||
|
COM_INTERFACE_ENTRY(IDispatch)
|
||
|
COM_INTERFACE_ENTRY(IWbemProviderInit)
|
||
|
COM_INTERFACE_ENTRY(IWbemServices)
|
||
|
END_COM_MAP()
|
||
|
|
||
|
// IWhqlObj
|
||
|
public:
|
||
|
|
||
|
//IWbemProviderInit
|
||
|
STDMETHOD(Initialize)(
|
||
|
/* [in] */ LPWSTR pszUser,
|
||
|
/* [in] */ LONG lFlags,
|
||
|
/* [in] */ LPWSTR pszNamespace,
|
||
|
/* [in] */ LPWSTR pszLocale,
|
||
|
/* [in] */ IWbemServices *pNamespace,
|
||
|
/* [in] */ IWbemContext *pCtx,
|
||
|
/* [in] */ IWbemProviderInitSink *pInitSink);
|
||
|
|
||
|
STDMETHOD(GetByPath)(BSTR Path, IWbemClassObject FAR* FAR* pObj, IWbemContext *pCtx) {return WBEM_E_NOT_SUPPORTED;};
|
||
|
|
||
|
//IWbemServices
|
||
|
HRESULT STDMETHODCALLTYPE OpenNamespace(
|
||
|
/* [in] */ const BSTR strNamespace,
|
||
|
/* [in] */ long lFlags,
|
||
|
/* [in] */ IWbemContext __RPC_FAR *pCtx,
|
||
|
/* [unique][in][out] */ IWbemServices __RPC_FAR *__RPC_FAR *ppWorkingNamespace,
|
||
|
/* [unique][in][out] */ IWbemCallResult __RPC_FAR *__RPC_FAR *ppResult){return WBEM_E_NOT_SUPPORTED;};
|
||
|
|
||
|
HRESULT STDMETHODCALLTYPE CancelAsyncCall(
|
||
|
/* [in] */ IWbemObjectSink __RPC_FAR *pSink){return WBEM_E_NOT_SUPPORTED;};
|
||
|
|
||
|
HRESULT STDMETHODCALLTYPE QueryObjectSink(
|
||
|
/* [in] */ long lFlags,
|
||
|
/* [out] */ IWbemObjectSink __RPC_FAR *__RPC_FAR *ppResponseHandler){return WBEM_E_NOT_SUPPORTED;};
|
||
|
|
||
|
HRESULT STDMETHODCALLTYPE GetObject(
|
||
|
/* [in] */ const BSTR strObjectPath,
|
||
|
/* [in] */ long lFlags,
|
||
|
/* [in] */ IWbemContext __RPC_FAR *pCtx,
|
||
|
/* [unique][in][out] */ IWbemClassObject __RPC_FAR *__RPC_FAR *ppObject,
|
||
|
/* [unique][in][out] */ IWbemCallResult __RPC_FAR *__RPC_FAR *ppCallResult){return WBEM_E_NOT_SUPPORTED;};
|
||
|
|
||
|
HRESULT STDMETHODCALLTYPE GetObjectAsync(
|
||
|
/* [in] */ const BSTR strObjectPath,
|
||
|
/* [in] */ long lFlags,
|
||
|
/* [in] */ IWbemContext __RPC_FAR *pCtx,
|
||
|
/* [in] */ IWbemObjectSink __RPC_FAR *pResponseHandler){return WBEM_E_NOT_SUPPORTED;};
|
||
|
|
||
|
HRESULT STDMETHODCALLTYPE PutClass(
|
||
|
/* [in] */ IWbemClassObject __RPC_FAR *pObject,
|
||
|
/* [in] */ long lFlags,
|
||
|
/* [in] */ IWbemContext __RPC_FAR *pCtx,
|
||
|
/* [unique][in][out] */ IWbemCallResult __RPC_FAR *__RPC_FAR *ppCallResult){return WBEM_E_NOT_SUPPORTED;};
|
||
|
|
||
|
HRESULT STDMETHODCALLTYPE PutClassAsync(
|
||
|
/* [in] */ IWbemClassObject __RPC_FAR *pObject,
|
||
|
/* [in] */ long lFlags,
|
||
|
/* [in] */ IWbemContext __RPC_FAR *pCtx,
|
||
|
/* [in] */ IWbemObjectSink __RPC_FAR *pResponseHandler){return WBEM_E_NOT_SUPPORTED;};
|
||
|
|
||
|
HRESULT STDMETHODCALLTYPE DeleteClass(
|
||
|
/* [in] */ const BSTR strClass,
|
||
|
/* [in] */ long lFlags,
|
||
|
/* [in] */ IWbemContext __RPC_FAR *pCtx,
|
||
|
/* [unique][in][out] */ IWbemCallResult __RPC_FAR *__RPC_FAR *ppCallResult){return WBEM_E_NOT_SUPPORTED;};
|
||
|
|
||
|
HRESULT STDMETHODCALLTYPE DeleteClassAsync(
|
||
|
/* [in] */ const BSTR strClass,
|
||
|
/* [in] */ long lFlags,
|
||
|
/* [in] */ IWbemContext __RPC_FAR *pCtx,
|
||
|
/* [in] */ IWbemObjectSink __RPC_FAR *pResponseHandler){return WBEM_E_NOT_SUPPORTED;};
|
||
|
|
||
|
HRESULT STDMETHODCALLTYPE CreateClassEnum(
|
||
|
/* [in] */ const BSTR strSuperclass,
|
||
|
/* [in] */ long lFlags,
|
||
|
/* [in] */ IWbemContext __RPC_FAR *pCtx,
|
||
|
/* [out] */ IEnumWbemClassObject __RPC_FAR *__RPC_FAR *ppEnum){return WBEM_E_NOT_SUPPORTED;};
|
||
|
|
||
|
HRESULT STDMETHODCALLTYPE CreateClassEnumAsync(
|
||
|
/* [in] */ const BSTR strSuperclass,
|
||
|
/* [in] */ long lFlags,
|
||
|
/* [in] */ IWbemContext __RPC_FAR *pCtx,
|
||
|
/* [in] */ IWbemObjectSink __RPC_FAR *pResponseHandler){return WBEM_E_NOT_SUPPORTED;};
|
||
|
|
||
|
HRESULT STDMETHODCALLTYPE PutInstance(
|
||
|
/* [in] */ IWbemClassObject __RPC_FAR *pInst,
|
||
|
/* [in] */ long lFlags,
|
||
|
/* [in] */ IWbemContext __RPC_FAR *pCtx,
|
||
|
/* [unique][in][out] */ IWbemCallResult __RPC_FAR *__RPC_FAR *ppCallResult){return WBEM_E_NOT_SUPPORTED;};
|
||
|
|
||
|
HRESULT STDMETHODCALLTYPE PutInstanceAsync(
|
||
|
/* [in] */ IWbemClassObject __RPC_FAR *pInst,
|
||
|
/* [in] */ long lFlags,
|
||
|
/* [in] */ IWbemContext __RPC_FAR *pCtx,
|
||
|
/* [in] */ IWbemObjectSink __RPC_FAR *pResponseHandler){return WBEM_E_NOT_SUPPORTED;};
|
||
|
|
||
|
HRESULT STDMETHODCALLTYPE DeleteInstance(
|
||
|
/* [in] */ const BSTR strObjectPath,
|
||
|
/* [in] */ long lFlags,
|
||
|
/* [in] */ IWbemContext __RPC_FAR *pCtx,
|
||
|
/* [unique][in][out] */ IWbemCallResult __RPC_FAR *__RPC_FAR *ppCallResult){return WBEM_E_NOT_SUPPORTED;};
|
||
|
|
||
|
HRESULT STDMETHODCALLTYPE DeleteInstanceAsync(
|
||
|
/* [in] */ const BSTR strObjectPath,
|
||
|
/* [in] */ long lFlags,
|
||
|
/* [in] */ IWbemContext __RPC_FAR *pCtx,
|
||
|
/* [in] */ IWbemObjectSink __RPC_FAR *pResponseHandler){return WBEM_E_NOT_SUPPORTED;};
|
||
|
|
||
|
HRESULT STDMETHODCALLTYPE CreateInstanceEnum(
|
||
|
/* [in] */ const BSTR strClass,
|
||
|
/* [in] */ long lFlags,
|
||
|
/* [in] */ IWbemContext __RPC_FAR *pCtx,
|
||
|
/* [out] */ IEnumWbemClassObject __RPC_FAR *__RPC_FAR *ppEnum){return WBEM_E_NOT_SUPPORTED;};
|
||
|
|
||
|
HRESULT STDMETHODCALLTYPE CreateInstanceEnumAsync(
|
||
|
/* [in] */ const BSTR strClass,
|
||
|
/* [in] */ long lFlags,
|
||
|
/* [in] */ IWbemContext __RPC_FAR *pCtx,
|
||
|
/* [in] */ IWbemObjectSink __RPC_FAR *pResponseHandler);
|
||
|
|
||
|
HRESULT STDMETHODCALLTYPE ExecQuery(
|
||
|
/* [in] */ const BSTR strQueryLanguage,
|
||
|
/* [in] */ const BSTR strQuery,
|
||
|
/* [in] */ long lFlags,
|
||
|
/* [in] */ IWbemContext __RPC_FAR *pCtx,
|
||
|
/* [out] */ IEnumWbemClassObject __RPC_FAR *__RPC_FAR *ppEnum){return WBEM_E_NOT_SUPPORTED;};
|
||
|
|
||
|
HRESULT STDMETHODCALLTYPE ExecQueryAsync(
|
||
|
/* [in] */ const BSTR strQueryLanguage,
|
||
|
/* [in] */ const BSTR strQuery,
|
||
|
/* [in] */ long lFlags,
|
||
|
/* [in] */ IWbemContext __RPC_FAR *pCtx,
|
||
|
/* [in] */ IWbemObjectSink __RPC_FAR *pResponseHandler){return WBEM_E_NOT_SUPPORTED;};
|
||
|
|
||
|
HRESULT STDMETHODCALLTYPE ExecNotificationQuery(
|
||
|
/* [in] */ const BSTR strQueryLanguage,
|
||
|
/* [in] */ const BSTR strQuery,
|
||
|
/* [in] */ long lFlags,
|
||
|
/* [in] */ IWbemContext __RPC_FAR *pCtx,
|
||
|
/* [out] */ IEnumWbemClassObject __RPC_FAR *__RPC_FAR *ppEnum){return WBEM_E_NOT_SUPPORTED;};
|
||
|
|
||
|
HRESULT STDMETHODCALLTYPE ExecNotificationQueryAsync(
|
||
|
/* [in] */ const BSTR strQueryLanguage,
|
||
|
/* [in] */ const BSTR strQuery,
|
||
|
/* [in] */ long lFlags,
|
||
|
/* [in] */ IWbemContext __RPC_FAR *pCtx,
|
||
|
/* [in] */ IWbemObjectSink __RPC_FAR *pResponseHandler){return WBEM_E_NOT_SUPPORTED;};
|
||
|
|
||
|
HRESULT STDMETHODCALLTYPE ExecMethod(
|
||
|
/* [in] */ const BSTR strObjectPath,
|
||
|
/* [in] */ const BSTR strMethodName,
|
||
|
/* [in] */ long lFlags,
|
||
|
/* [in] */ IWbemContext __RPC_FAR *pCtx,
|
||
|
/* [in] */ IWbemClassObject __RPC_FAR *pInParams,
|
||
|
/* [unique][in][out] */ IWbemClassObject __RPC_FAR *__RPC_FAR *ppOutParams,
|
||
|
/* [unique][in][out] */ IWbemCallResult __RPC_FAR *__RPC_FAR *ppCallResult){return WBEM_E_NOT_SUPPORTED;};
|
||
|
|
||
|
HRESULT STDMETHODCALLTYPE ExecMethodAsync(
|
||
|
/* [in] */ const BSTR strObjectPath,
|
||
|
/* [in] */ const BSTR strMethodName,
|
||
|
/* [in] */ long lFlags,
|
||
|
/* [in] */ IWbemContext __RPC_FAR *pCtx,
|
||
|
/* [in] */ IWbemClassObject __RPC_FAR *pInParams,
|
||
|
/* [in] */ IWbemObjectSink __RPC_FAR *pResponseHandler){return WBEM_E_NOT_SUPPORTED;};
|
||
|
|
||
|
protected:
|
||
|
IWbemServices* m_pNamespace;
|
||
|
IWbemClassObject* m_pClass;
|
||
|
CString m_csPathStr ;
|
||
|
CString m_csAntecedent ;
|
||
|
CString m_csCurPnPID ;
|
||
|
CPtrArray m_ptrArr;
|
||
|
|
||
|
protected://Helper
|
||
|
int GetInfFileCount();
|
||
|
SCODE PutData(IWbemContext *pCtx , Classes_Provided eClasses);
|
||
|
SCODE GetInfData(LPTSTR lpszInfFile , LPTSTR lpszInfSection , LPTSTR szDeviceID , IWbemContext *pCtx , IWbemClassObject *pInstance);
|
||
|
SCODE EnumRegKeys(HKEY hSubKey , IWbemClassObject* pInstance, LPTSTR szDeviceDesc, LPTSTR szDeviceID , IWbemContext *pCtx , Classes_Provided eClasses);
|
||
|
SCODE GetService(LPTSTR szDeviceID , LPTSTR szName , ULONG* plen );
|
||
|
SCODE CreateAssoc( IWbemContext *pCtx );
|
||
|
|
||
|
};
|
||
|
|
||
|
#endif //__WHQLOBJ_H_
|