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.

75 lines
2.4 KiB

  1. /////////////////////////////////////////////////////////////////////////////////
  2. /////////////////////////////////////////////////////////////////////////////////
  3. //
  4. // File: propvar.h
  5. //
  6. // Purpose: Prototypes, constants, and macros relating to
  7. // PropVariants in the Office code.
  8. //
  9. /////////////////////////////////////////////////////////////////////////////////
  10. /////////////////////////////////////////////////////////////////////////////////
  11. #ifndef _PROPVAR_H_
  12. #define _PROPVAR_H_
  13. // ----------
  14. // Prototypes
  15. // ----------
  16. BOOL FPropVarLoad (LPPROPVARIANT lppropvar, VARTYPE vt, LPVOID const lpv );
  17. void VPropVarMove (LPPROPVARIANT lppropvarDest, LPPROPVARIANT const lppropvarSource);
  18. BOOL FCoStrToWStr (LPWSTR * lplpwstr, const LPSTR lpstr, UINT uCodePage);
  19. BOOL FCoWStrToStr (LPSTR * lplpstr, const LPWSTR lpwstr, UINT uCodePage);
  20. BOOL FPropVarConvertString (LPPROPVARIANT lppropvarDest, const LPPROPVARIANT lppropvarSource, UINT uCodePage);
  21. // ---------
  22. // Constants
  23. // ---------
  24. // Default size of PropVariant/PropSpec arrays.
  25. #define DEFAULT_IPROPERTY_COUNT 10
  26. // ------
  27. // Macros
  28. // ------
  29. // Macro to see if a PropVariant is some kind of string.
  30. #define IS_PROPVAR_STRING( lppropvar ) \
  31. ( ( (lppropvar)->vt & ~VT_VECTOR ) == VT_LPSTR \
  32. || \
  33. ( (lppropvar)->vt & ~VT_VECTOR ) == VT_LPWSTR ) \
  34. // Macro to see if a VT is valid in the context
  35. // of the User-Defined property set.
  36. #define ISUDTYPE(vt) \
  37. ( vt == VT_LPSTR \
  38. || \
  39. vt == VT_LPWSTR \
  40. || \
  41. vt == VT_I4 \
  42. || \
  43. vt == VT_R8 \
  44. || \
  45. vt == VT_FILETIME \
  46. || \
  47. vt == VT_BOOL )
  48. // Macro to determine if a string is represented
  49. // differently (in terms of the code-page)
  50. // in memory than it is in the Property
  51. // set. The codepage parameter is that of the
  52. // property set.
  53. #define PROPVAR_STRING_CONVERSION_REQUIRED(lppropvar,codepage) \
  54. ( IS_PROPVAR_STRING( lppropvar ) \
  55. && \
  56. ((codepage) != CP_WINUNICODE) \
  57. )
  58. #endif _PROPVAR_H_