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.

64 lines
1.5 KiB

  1. /*++
  2. Copyright (C) 1995-2001 Microsoft Corporation
  3. Module Name:
  4. CVARIANT.H
  5. Abstract:
  6. Declares the CVariantClass
  7. History:
  8. a-davj 9-27-95 Created.
  9. --*/
  10. #ifndef _CVARIANT_H_
  11. #define _CVARIANT_H_
  12. #include "stdprov.h"
  13. //***************************************************************************
  14. //
  15. // CLASS NAME:
  16. //
  17. // CVariant
  18. //
  19. // DESCRIPTION:
  20. //
  21. // A wrapper around the VARIANT stucture.
  22. //
  23. //***************************************************************************
  24. class CVariant : public CObject {
  25. public:
  26. CVariant();
  27. CVariant(LPWSTR pwcStr);
  28. SCODE SetData(void * pData, VARTYPE vt, int iSize = -1);
  29. SCODE GetData(void ** pData, DWORD dwRegType, DWORD * pdwSize);
  30. SCODE DoPut(long lFlags,IWbemClassObject FAR *,BSTR PropName, CVariant * pVar);
  31. ~CVariant();
  32. void SetType(VARTYPE vtNew){var.vt = vtNew;};
  33. VARTYPE GetType(){return var.vt;};
  34. void * GetDataPtr(){return (void *)&var.lVal;};
  35. VARIANT * GetVarPtr(){return &var;};
  36. BSTR GetBstr(){return var.bstrVal;};
  37. BOOL bGetBOOL(){return var.boolVal;};
  38. DWORD GetNumElements(void);
  39. BOOL IsArray(void){return var.vt & VT_ARRAY;};
  40. SCODE ChangeType(VARTYPE vtNew);
  41. void Clear(void);
  42. private:
  43. VARIANT var;
  44. int CalcNumStrings(TCHAR *pTest);
  45. SCODE SetArrayData(void * pData,VARTYPE vtSimple, int iSize);
  46. SCODE GetArrayData(void ** pData, DWORD * pdwSize);
  47. };
  48. #endif