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.

53 lines
3.3 KiB

  1. //***************************************************************************
  2. //
  3. // WMIHELPER.H
  4. //
  5. // Module: HEALTHMON SERVER AGENT
  6. //
  7. // Purpose: Helper functions and wrappers around WMI
  8. //
  9. // Copyright (c)1999 Microsoft Corporation, All Rights Reserved
  10. //
  11. //***************************************************************************
  12. #if !defined( __WMIHELPER_H )
  13. #define __WMIHELPER_H
  14. //#include <wbemcli.h>
  15. //#include <wbemprov.h>
  16. #include <wbemidl.h>
  17. //#include <wbemprov.h>
  18. HRESULT GetStrProperty(IWbemClassObject *pDataPoint, LPTSTR pszProp, LPTSTR *pszString);
  19. HRESULT GetAsStrProperty(IWbemClassObject *pDataPoint, LPTSTR pszProp, LPTSTR *pszString);
  20. HRESULT GetReal32Property(IWbemClassObject *pDataPoint, LPTSTR pszProp, float *pFloat);
  21. HRESULT GetUint8Property(IWbemClassObject *pDataPoint, LPTSTR pszProp, int *pInt);
  22. HRESULT GetUint32Property(IWbemClassObject *pDataPoint, LPTSTR pszProp, long *pLong);
  23. HRESULT GetUint64Property(IWbemClassObject *pDataPoint, LPTSTR pszProp, unsigned __int64 *pInt64);
  24. HRESULT GetBoolProperty(IWbemClassObject *pDataPoint, LPTSTR pszProp, BOOL *pBool);
  25. // HRESULT GetObjectProperty(IWbemClassObject *pObj, LPTSTR pszProp, IWbemClassObject **pObject);
  26. HRESULT PutSAProperty(IWbemClassObject *pClassObject, LPTSTR szProp, SAFEARRAY* psa);
  27. HRESULT PutStrProperty(IWbemClassObject *pClassObject, LPTSTR szProp, LPTSTR szString);
  28. HRESULT PutUint32Property(IWbemClassObject *pClassObject, LPTSTR szProp, long lValue);
  29. HRESULT PutUUint32Property(IWbemClassObject *pClassObject, LPTSTR szProp, unsigned long lValue);
  30. HRESULT PutReal32Property(IWbemClassObject *pClassObject, LPTSTR szProp, float fValue);
  31. HRESULT PutBoolProperty(IWbemClassObject *pClassObject, LPTSTR szProp, BOOL bValue);
  32. HRESULT GetWbemObjectInst(IWbemServices** ppSvc, LPCTSTR szName, IWbemContext *pContext, IWbemClassObject **pOutObj);
  33. // HRESULT GetWbemObjectInstAmended(IWbemServices** ppSvc, LPCTSTR szName, IWbemContext *pContext, BOOL bErrorOK, IWbemClassObject **pOutObj);
  34. HRESULT GetWbemObjectInstSemiSync(IWbemServices** ppSvc, LPCTSTR szName, IWbemContext *pContext, IWbemCallResult **pOutObj);
  35. // HRESULT GetUint32Qualifier(IWbemClassObject *pObj, LPTSTR pszProp, LPTSTR pszQual, long *pLong);
  36. // HRESULT PutUint32Qualifier(IWbemClassObject *pObj, LPTSTR pszProp, LPTSTR pszQual, long pLong);
  37. // HRESULT GetInstModificationEvent(IWbemClassObject*& pInst, IWbemClassObject*& pPrevInst, IWbemClassObject **pOutObj);
  38. // HRESULT GetInstCreationEvent(IWbemClassObject*& pInst, IWbemClassObject **pOutObj);
  39. // HRESULT SendInstModificationEvent(IWbemObjectSink* pEventSink, IWbemClassObject*& pInstance, IWbemClassObject*& pPrevInstance);
  40. // HRESULT SendInstCreationEvent(IWbemObjectSink* pEventSink, IWbemClassObject*& pInstance);
  41. HRESULT SendEvents(IWbemObjectSink* pEventSink, IWbemClassObject** pInstances, int iSize);
  42. HRESULT GetWbemClassObject(IWbemClassObject** ppObj, VARIANT* v);
  43. BOOL GetLatestWMIError(int code, HRESULT hResIn, LPTSTR pszString);
  44. BOOL GetLatestAgentError(int code, LPTSTR pszString);
  45. // BOOL SwapLocalizedStringsIn(void);
  46. // BOOL DoClass(LPTSTR pszClass, BOOL bDoMessage);
  47. // BOOL GetSafeArray(LPTSTR pszClass, LPTSTR pszPropertyName, VARIANT &psaValueMap, VARIANT &psaValues);
  48. // BOOL FindValue(SAFEARRAY *psaValueMap, SAFEARRAY *psaValues, LPTSTR pszString, LPTSTR *pszOutValue);
  49. #endif // __WMIHELPER_H