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
1.8 KiB

  1. //***************************************************************************
  2. //
  3. // Copyright (c) 1997-2001 Microsoft Corporation, All Rights Reserved
  4. //
  5. //***************************************************************************
  6. #ifndef _WMIMAP_HEADER
  7. #define _WMIMAP_HEADER
  8. #define WRITE_IT 0
  9. #define READ_IT 1
  10. ///////////////////////////////////////////////////////////////////////
  11. class CWMIDataTypeMap
  12. {
  13. public:
  14. CWMIDataTypeMap()
  15. { m_pWMIBlockInfo = NULL; m_pdwAccumulativeSizeOfBlock = NULL; }
  16. CWMIDataTypeMap(CWMIDataBlock * pBlock, DWORD * pdw)
  17. { m_pWMIBlockInfo = pBlock; m_pdwAccumulativeSizeOfBlock = pdw; }
  18. ~CWMIDataTypeMap(){}
  19. int GetWMISize(long lType);
  20. long GetVariantType(WCHAR * wcsType);
  21. long ConvertType(long lType );
  22. void GetSizeAndType( WCHAR * wcsType, IDOrder * p, long & lType, int & nWMISize );
  23. DWORD ArraySize(long lType,CVARIANT & var);
  24. HRESULT GetDataFromDataBlock(CVARIANT & v,long lType, int nSize );
  25. HRESULT GetDataFromDataBlock(IWbemObjectAccess * p, long lHandle, long lType, int nSize);
  26. HRESULT PutInArray(SAFEARRAY * & psa,long * pi, long & lType, VARIANT * var);
  27. WCHAR * SetVariantType(long lType);
  28. BOOL SetDataInDataBlock(CSAFEARRAY * pSafe,int i,CVARIANT & v, long lType, int nSize);
  29. BOOL NaturallyAlignData( int nSize, BOOL fRead);
  30. BOOL MissingQualifierValueMatches( CSAFEARRAY * pSafe, long index, CVARIANT & v, long lType, CVARIANT & vToCompare );
  31. BOOL SetDefaultMissingQualifierValue( CVARIANT & v, long lType, CVARIANT & vToSet );
  32. private:
  33. BOOL ConvertDWORDToWMIDataTypeAndWriteItToBlock(DWORD dwLong,int nSize);
  34. DWORD ConvertWMIDataTypeToDWORD(int nSize);
  35. CWMIDataBlock * m_pWMIBlockInfo;
  36. DWORD * m_pdwAccumulativeSizeOfBlock;
  37. };
  38. #endif