propkeydef.h 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. /*
  2. * Copyright (C) 2009 Maarten Lankhorst
  3. *
  4. * This library is free software; you can redistribute it and/or
  5. * modify it under the terms of the GNU Lesser General Public
  6. * License as published by the Free Software Foundation; either
  7. * version 2.1 of the License, or (at your option) any later version.
  8. *
  9. * This library is distributed in the hope that it will be useful,
  10. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  12. * Lesser General Public License for more details.
  13. *
  14. * You should have received a copy of the GNU Lesser General Public
  15. * License along with this library; if not, write to the Free Software
  16. * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
  17. */
  18. #ifndef PID_FIRST_USABLE
  19. #define PID_FIRST_USABLE 2
  20. #endif
  21. #ifndef REFPROPERTYKEY
  22. #ifdef __cplusplus
  23. #define REFPROPERTYKEY const PROPERTYKEY &
  24. #else /*!__cplusplus*/
  25. #define REFPROPERTYKEY const PROPERTYKEY * __MIDL_CONST
  26. #endif
  27. #endif
  28. #undef DEFINE_PROPERTYKEY
  29. #ifdef INITGUID
  30. #ifdef __cplusplus
  31. #define DEFINE_PROPERTYKEY(name, l, w1, w2, b1, b2, b3, b4, b5, b6, b7, b8, pid) \
  32. EXTERN_C const PROPERTYKEY DECLSPEC_SELECTANY name = \
  33. { { l, w1, w2, { b1, b2, b3, b4, b5, b6, b7, b8 } }, pid }
  34. #else
  35. #define DEFINE_PROPERTYKEY(name, l, w1, w2, b1, b2, b3, b4, b5, b6, b7, b8, pid) \
  36. const PROPERTYKEY DECLSPEC_SELECTANY name = \
  37. { { l, w1, w2, { b1, b2, b3, b4, b5, b6, b7, b8 } }, pid }
  38. #endif
  39. #else
  40. #define DEFINE_PROPERTYKEY(name, l, w1, w2, b1, b2, b3, b4, b5, b6, b7, b8, pid) \
  41. EXTERN_C const PROPERTYKEY name
  42. #endif
  43. #ifndef IsEqualPropertyKey
  44. #ifdef __cplusplus
  45. #define IsEqualPropertyKey(a,b) (((a).pid == (b).pid) && IsEqualIID((a).fmtid,(b).fmtid))
  46. #else
  47. #define IsEqualPropertyKey(a,b) (((a).pid == (b).pid) && IsEqualIID(&(a).fmtid,&(b).fmtid))
  48. #endif
  49. #endif
  50. #ifndef _PROPERTYKEY_EQUALITY_OPERATORS_
  51. #define _PROPERTYKEY_EQUALITY_OPERATORS_
  52. #ifdef __cplusplus
  53. extern "C++"
  54. {
  55. inline bool operator==(REFPROPERTYKEY guidOne, REFPROPERTYKEY guidOther)
  56. {
  57. return IsEqualPropertyKey(guidOne, guidOther);
  58. }
  59. inline bool operator!=(REFPROPERTYKEY guidOne, REFPROPERTYKEY guidOther)
  60. {
  61. return !(guidOne == guidOther);
  62. }
  63. }
  64. #endif
  65. #endif