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.

69 lines
2.5 KiB

  1. //***************************************************************************
  2. //
  3. // (c) 1999-2001 by Microsoft Corp. All Rights Reserved.
  4. //
  5. // reputils.h
  6. //
  7. // cvadai 6-May-1999 created.
  8. // sanjes 20-Apr-2000 Bumped Current DB Version to 2.
  9. //
  10. //***************************************************************************
  11. #ifndef _REPUTILS_H_
  12. #define _REPUTILS_H_
  13. typedef __int64 SQL_ID;
  14. #define CURRENT_DB_VERSION 5
  15. #define WMIDB_STORAGE_STRING 1
  16. #define WMIDB_STORAGE_NUMERIC 2
  17. #define WMIDB_STORAGE_REAL 3
  18. #define WMIDB_STORAGE_REFERENCE 4
  19. #define WMIDB_STORAGE_IMAGE 5
  20. #define WMIDB_STORAGE_COMPACT 6
  21. #define REPDRVR_FLAG_ARRAY 0x1
  22. #define REPDRVR_FLAG_QUALIFIER 0x2
  23. #define REPDRVR_FLAG_KEY 0x4
  24. #define REPDRVR_FLAG_INDEXED 0x8
  25. #define REPDRVR_FLAG_NOT_NULL 0x10
  26. #define REPDRVR_FLAG_METHOD 0x20
  27. #define REPDRVR_FLAG_IN_PARAM 0x40
  28. #define REPDRVR_FLAG_OUT_PARAM 0x80
  29. #define REPDRVR_FLAG_KEYHOLE 0x100
  30. #define REPDRVR_FLAG_ABSTRACT 0x200
  31. #define REPDRVR_FLAG_UNKEYED 0x400
  32. #define REPDRVR_FLAG_SINGLETON 0x800
  33. #define REPDRVR_FLAG_HIDDEN 0x1000
  34. #define REPDRVR_FLAG_SYSTEM 0x2000
  35. #define REPDRVR_FLAG_IMAGE 0x4000
  36. #define REPDRVR_FLAG_CLASSREFS 0x8000
  37. #define REPDRVR_MAX_LONG_STRING_SIZE 255
  38. void SetBoolQualifier(IWbemQualifierSet *pQS, LPCWSTR lpQName, long lFlavor=0x3);
  39. LPWSTR StripEscapes (LPWSTR lpIn);
  40. LPWSTR GetStr (DWORD dwValue);
  41. LPWSTR GetStr(double dValue);
  42. LPWSTR GetStr (SQL_ID dValue);
  43. LPWSTR GetStr (float dValue);
  44. LPWSTR GetStr (VARIANT &vValue);
  45. LPWSTR GetPropertyVal (LPWSTR lpProp, IWbemClassObject *pObj);
  46. DWORD GetQualifierFlag (LPWSTR lpQfrName, IWbemQualifierSet *pQS);
  47. DWORD GetStorageType (CIMTYPE cimtype, bool bArray = false);
  48. HRESULT GetVariantFromArray (SAFEARRAY *psaArray, long iPos, long vt, VARIANT &vTemp);
  49. void GetByteBuffer (VARIANT *pValue, BYTE **ppInBuff, DWORD &dwLen);
  50. LPWSTR StripQuotes(LPWSTR lpText, WCHAR t = '\'');
  51. DWORD GetMaxBytes(DWORD One, DWORD Two);
  52. DWORD GetMaxByte(DWORD One, DWORD Two);
  53. LPWSTR GetOperator (DWORD dwOp);
  54. LPWSTR TruncateLongText(const wchar_t *pszData, long lMaxLen, bool &bChg,
  55. int iTruncLen = REPDRVR_MAX_LONG_STRING_SIZE, BOOL bAppend = TRUE);
  56. BOOL IsTruncated(LPCWSTR lpData, int iCompLen = REPDRVR_MAX_LONG_STRING_SIZE);
  57. HRESULT PutVariantInArray (SAFEARRAY **ppsaArray, long iPos, VARIANT *vTemp);
  58. char * GetAnsiString (wchar_t *pStr);
  59. #endif // _REPUTILS_H_