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.
 
 
 
 
 
 

148 lines
6.0 KiB

//***************************************************************************
//
// Copyright (c) 1997-2002 Microsoft Corporation, All Rights Reserved
//
//***************************************************************************
#ifndef _WDMSHELL_HEADER
#define _WDMSHELL_HEADER
#include "wmicom.h"
////////////////////////////////////////////////////////////////////////////////////////////////////////////////
class CWMIStandardShell
{
private:
CWMIProcessClass * m_pClass;
CProcessStandardDataBlock * m_pWDM;
BOOL m_fInit;
public:
CWMIStandardShell();
~CWMIStandardShell();
HRESULT Initialize (
WCHAR * wcsClass,
BOOL fInternalEvent,
CHandleMap * pList,
BOOL fUpdateNamespace,
ULONG uDesiredAccess,
IWbemServices __RPC_FAR * pServices,
IWbemServices __RPC_FAR * pRepository,
IWbemObjectSink __RPC_FAR * pHandler,
IWbemContext __RPC_FAR *pCtx
);
inline BOOL HasMofChanged() { return m_pWDM->HasMofChanged(); }
//=============================================
// Process All and Single WMI Instances
//=============================================
HRESULT ProcessAllInstances();
HRESULT ProcessSingleInstance( WCHAR * wcsInstanceName);
//==========================================================
// The put instance group
//==========================================================
HRESULT FillInAndSubmitWMIDataBlob( IWbemClassObject * pIClass, int nTypeOfPut, CVARIANT & vList);
//=============================================
// Event functions
//=============================================
HRESULT ProcessEvent(WORD wBinaryMofType, PWNODE_HEADER WnodeHeader);
inline HRESULT RegisterWMIEvent( WCHAR * wcsGuid, ULONG_PTR uContext, CLSID & Guid, BOOL fRegistered)
{ return m_pWDM->RegisterWMIEvent(wcsGuid,uContext,Guid,fRegistered);}
//=============================================
// method functions
//=============================================
HRESULT ExecuteMethod( WCHAR * wcsInstance,
WCHAR * MethodInstanceName,
IWbemClassObject * pParentClass,
IWbemClassObject * pInClassData,
IWbemClassObject * pInClass,
IWbemClassObject * pOutClass ) ;
//=============================================
// data processing functions
//=============================================
HRESULT GetGuid(WCHAR * pwcsGuid);
HRESULT SetGuidForEvent( WORD wType,WCHAR * wcsGuid, int cchSize );
HRESULT RegisterForWMIEvents( ULONG uContext, WCHAR * wcsGuid, BOOL fRegistered,CLSID & Guid );
inline BOOL CancelWMIEventRegistration( GUID gGuid , ULONG_PTR uContext ) { return m_pClass->WMI()->CancelWMIEventRegistration(gGuid,uContext);}
//=============================================
// The binary mof groupg
//=============================================
HRESULT ProcessBinaryGuidsViaEvent( PWNODE_HEADER WnodeHeader,WORD wType );
HRESULT QueryAndProcessAllBinaryGuidInstances(CNamespaceManagement & Namespace, BOOL & fMofHasChanged, KeyList * pArrDriversInRegistry);
//=============================================
// Misc
//=============================================
inline CLSID * GuidPtr() { return m_pClass->GuidPtr();}
inline HRESULT SetErrorMessage(HRESULT hr){ return m_pClass->WMI()->SetErrorMessage(hr,m_pClass->GetClassName(),m_pWDM->GetMessage());}
};
//************************************************************************************************************
//============================================================================================================
//
// The Hi Performance Shell
//
//============================================================================================================
//************************************************************************************************************
class CWMIHiPerfShell
{
private:
CHiPerfHandleMap * m_pHiPerfMap;
CProcessHiPerfDataBlock * m_pWDM;
CWMIProcessClass * m_pClass;
BOOL m_fAutoCleanup;
BOOL m_fInit;
HRESULT QueryAllInstances(HANDLE WMIHandle,IWbemHiPerfEnum* pHiPerfEnum);
HRESULT QuerySingleInstance(HANDLE WMIHandle);
public:
CWMIHiPerfShell(BOOL fAuto);
~CWMIHiPerfShell();
HRESULT Initialize (
BOOL fUpdate,
ULONG uDesiredAccess,
CHandleMap * pList,
WCHAR * wcs,
IWbemServices __RPC_FAR * pServices,
IWbemServices __RPC_FAR * pRepository,
IWbemObjectSink __RPC_FAR * pHandler,
IWbemContext __RPC_FAR *pCtx
) ;
inline void SetHiPerfHandleMap(CHiPerfHandleMap * p) { m_pHiPerfMap = p; }
inline CCriticalSection * GetCriticalSection() { return m_pHiPerfMap->GetCriticalSection();}
inline CHiPerfHandleMap * HiPerfHandleMap() { return m_pHiPerfMap;}
HRESULT QueryAllHiPerfData();
HRESULT HiPerfQuerySingleInstance(WCHAR * wcsInstance);
HRESULT AddAccessObjectToRefresher(IWbemObjectAccess *pAccess, IWbemObjectAccess ** ppRefreshable, ULONG_PTR * plId);
HRESULT AddEnumeratorObjectToRefresher(IWbemHiPerfEnum* pHiPerfEnum, ULONG_PTR * plId);
HRESULT RemoveObjectFromHandleMap(ULONG_PTR lHiPerfId);
HRESULT RefreshCompleteList();
inline HRESULT SetErrorMessage(HRESULT hr){ return m_pClass->WMI()->SetErrorMessage(hr,m_pClass->GetClassName(),m_pWDM->GetMessage());}
};
#endif