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.

89 lines
2.8 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. BOOL FPropVarCopyToBuf (LPPROPVARIANT const lppropvar, DWORD cbMax, LPVOID lpBuf);
  22. // ---------
  23. // Constants
  24. // ---------
  25. // Default size of PropVariant/PropSpec arrays.
  26. #define DEFAULT_IPROPERTY_COUNT 10
  27. // ------
  28. // Macros
  29. // ------
  30. // Macro to see if a PropVariant is some kind of string.
  31. #define IS_PROPVAR_STRING( lppropvar ) \
  32. ( ( (lppropvar)->vt & ~VT_VECTOR ) == VT_LPSTR \
  33. || \
  34. ( (lppropvar)->vt & ~VT_VECTOR ) == VT_LPWSTR ) \
  35. // Macro to see if a VT is valid in the context
  36. // of the User-Defined property set.
  37. #define ISUDTYPE(vt) \
  38. ( vt == VT_LPSTR \
  39. || \
  40. vt == VT_LPWSTR \
  41. || \
  42. vt == VT_I4 \
  43. || \
  44. vt == VT_R8 \
  45. || \
  46. vt == VT_FILETIME \
  47. || \
  48. vt == VT_BOOL )
  49. // Macro to determine if a string is represented
  50. // differently (in terms of the code-page)
  51. // in memory than it is in the Property
  52. // set. The codepage parameter is that of the
  53. // property set.
  54. #ifdef UNICODE
  55. #define PROPVAR_STRING_CONVERSION_REQUIRED(lppropvar,codepage) \
  56. ( IS_PROPVAR_STRING( lppropvar ) \
  57. && \
  58. ((codepage) != CP_WINUNICODE) \
  59. )
  60. #else // UNICODE
  61. #define PROPVAR_STRING_CONVERSION_REQUIRED(lppropvar,codepage) \
  62. ( IS_PROPVAR_STRING( lppropvar ) \
  63. && \
  64. ((codepage) == CP_WINUNICODE) \
  65. )
  66. #endif // UNICODE
  67. #endif _PROPVAR_H_