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.

66 lines
2.0 KiB

  1. //+---------------------------------------------------------------------------
  2. //
  3. // Microsoft Windows
  4. // Copyright (C) Microsoft Corporation, 1992 - 1993.
  5. //
  6. // File: props.hxx
  7. //
  8. // Contents: Shared property code header
  9. //
  10. // Functions: ValidatePropType
  11. //
  12. // History: 14-Jun-93 DrewB Created
  13. //
  14. //----------------------------------------------------------------------------
  15. #ifndef __PROPS_HXX__
  16. #define __PROPS_HXX__
  17. typedef VARIANT DFPROPVAL;
  18. #ifdef OLDPROP
  19. // Property types that don't go in the property value itself
  20. #define VT_NOT_IN_VALUE(vt) \
  21. (((vt) & VT_VECTOR) || \
  22. (vt) == VT_BSTR || (vt) == VT_WBSTR || \
  23. (vt) == VT_LPSTR || (vt) == VT_LPWSTR || \
  24. (vt) == VT_BLOB_OBJECT || (vt) == VT_BLOB || \
  25. (vt) == VT_VARIANT || (vt) == VT_CF || (vt) == VT_UUID)
  26. #else
  27. // Property types that don't go in the property value itself
  28. #define VT_NOT_IN_VALUE(vt) \
  29. (((vt) & VT_VECTOR) || \
  30. (vt) == VT_BSTR || \
  31. (vt) == VT_LPSTR || (vt) == VT_LPWSTR || \
  32. (vt) == VT_BLOB_OBJECT || (vt) == VT_BLOB || \
  33. (vt) == VT_VARIANT || (vt) == VT_CF || (vt) == VT_UUID)
  34. #endif
  35. #define ValidatePropSpecKind(psk) \
  36. (((psk) == PRSPEC_LPWSTR || (psk) == PRSPEC_DISPID || \
  37. (psk) == PRSPEC_PROPID) ? S_OK : STG_E_INVALIDPARAMETER)
  38. SCODE ValidatePropType(DFPROPTYPE dpt);
  39. SCODE ValidatePropVt(DFPROPVAL *pdpv);
  40. #ifdef OLDPROPS
  41. #define BSTR_LLEN sizeof(UINT)
  42. #define BSTR_PTR(b) ((BYTE *)(b)-BSTR_LLEN)
  43. #define BSTR_SLEN(b) ((*(UINT *)BSTR_PTR(b)))
  44. #define BSTR_BLEN(b) (BSTR_SLEN(b)+1)
  45. #define BSTR_TLEN(b) (BSTR_BLEN(b)+BSTR_LLEN)
  46. #define WBSTR_LLEN sizeof(UINT)
  47. #define WBSTR_PTR(b) ((BYTE *)(b)-WBSTR_LLEN)
  48. #define WBSTR_SLEN(b) ((*(UINT *)WBSTR_PTR(b)))
  49. #define WBSTR_BLEN(b) (WBSTR_SLEN(b)+sizeof(WCHAR))
  50. #define WBSTR_TLEN(b) (WBSTR_BLEN(b)+WBSTR_LLEN)
  51. #else
  52. #define BSTR_LLEN sizeof(UINT)
  53. #define BSTR_PTR(b) ((BYTE *)(b)-BSTR_LLEN)
  54. #define BSTR_SLEN(b) ((*(UINT *)BSTR_PTR(b)))
  55. #define BSTR_BLEN(b) (BSTR_SLEN(b)+sizeof(WCHAR))
  56. #define BSTR_TLEN(b) (BSTR_BLEN(b)+BSTR_LLEN)
  57. #endif
  58. #endif // #ifndef __PROPS_HXX__