mapicode.h 7.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148
  1. /*
  2. * Copyright 2005 - 2016 Zarafa and its licensors
  3. *
  4. * This program is free software: you can redistribute it and/or modify
  5. * it under the terms of the GNU Affero General Public License, version 3,
  6. * as published by the Free Software Foundation.
  7. *
  8. * This program is distributed in the hope that it will be useful,
  9. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  11. * GNU Affero General Public License for more details.
  12. *
  13. * You should have received a copy of the GNU Affero General Public License
  14. * along with this program. If not, see <http://www.gnu.org/licenses/>.
  15. *
  16. */
  17. #ifndef __M4L_MAPICODE_H_
  18. #define __M4L_MAPICODE_H_
  19. #define MAPICODE_H
  20. #include <kopano/platform.h>
  21. #define MAKE_MAPI_SCODE(sev,fac,code) \
  22. ((SCODE) (((ULONG)(sev)<<31) | ((ULONG)(fac)<<16) | ((ULONG)(code))) )
  23. #define MAKE_MAPI_E( err ) (MAKE_MAPI_SCODE( 1, FACILITY_ITF, err ))
  24. #define MAKE_MAPI_S( warn ) (MAKE_MAPI_SCODE( 0, FACILITY_ITF, warn ))
  25. /* General errors (used by more than one MAPI object) */
  26. #define MAPI_E_CALL_FAILED E_FAIL
  27. #define MAPI_E_NOT_ENOUGH_MEMORY E_OUTOFMEMORY
  28. #define MAPI_E_INVALID_PARAMETER E_INVALIDARG
  29. #define MAPI_E_INTERFACE_NOT_SUPPORTED E_NOINTERFACE
  30. #define MAPI_E_NO_ACCESS E_ACCESSDENIED
  31. #define MAPI_E_NO_SUPPORT MAKE_MAPI_E( 0x102 )
  32. #define MAPI_E_BAD_CHARWIDTH MAKE_MAPI_E( 0x103 )
  33. #define MAPI_E_STRING_TOO_LONG MAKE_MAPI_E( 0x105 )
  34. #define MAPI_E_UNKNOWN_FLAGS MAKE_MAPI_E( 0x106 )
  35. #define MAPI_E_INVALID_ENTRYID MAKE_MAPI_E( 0x107 )
  36. #define MAPI_E_INVALID_OBJECT MAKE_MAPI_E( 0x108 )
  37. #define MAPI_E_OBJECT_CHANGED MAKE_MAPI_E( 0x109 )
  38. #define MAPI_E_OBJECT_DELETED MAKE_MAPI_E( 0x10A )
  39. #define MAPI_E_BUSY MAKE_MAPI_E( 0x10B )
  40. #define MAPI_E_NOT_ENOUGH_DISK MAKE_MAPI_E( 0x10D )
  41. #define MAPI_E_NOT_ENOUGH_RESOURCES MAKE_MAPI_E( 0x10E )
  42. #define MAPI_E_NOT_FOUND MAKE_MAPI_E( 0x10F )
  43. #define MAPI_E_VERSION MAKE_MAPI_E( 0x110 )
  44. #define MAPI_E_LOGON_FAILED MAKE_MAPI_E( 0x111 )
  45. #define MAPI_E_SESSION_LIMIT MAKE_MAPI_E( 0x112 )
  46. #define MAPI_E_USER_CANCEL MAKE_MAPI_E( 0x113 )
  47. #define MAPI_E_UNABLE_TO_ABORT MAKE_MAPI_E( 0x114 )
  48. #define MAPI_E_NETWORK_ERROR MAKE_MAPI_E( 0x115 )
  49. #define MAPI_E_DISK_ERROR MAKE_MAPI_E( 0x116 )
  50. #define MAPI_E_TOO_COMPLEX MAKE_MAPI_E( 0x117 )
  51. #define MAPI_E_BAD_COLUMN MAKE_MAPI_E( 0x118 )
  52. #define MAPI_E_EXTENDED_ERROR MAKE_MAPI_E( 0x119 )
  53. #define MAPI_E_COMPUTED MAKE_MAPI_E( 0x11A )
  54. #define MAPI_E_CORRUPT_DATA MAKE_MAPI_E( 0x11B )
  55. #define MAPI_E_UNCONFIGURED MAKE_MAPI_E( 0x11C )
  56. #define MAPI_E_FAILONEPROVIDER MAKE_MAPI_E( 0x11D )
  57. #define MAPI_E_UNKNOWN_CPID MAKE_MAPI_E( 0x11E )
  58. #define MAPI_E_UNKNOWN_LCID MAKE_MAPI_E( 0x11F )
  59. /* Flavors of E_ACCESSDENIED, used at logon */
  60. #define MAPI_E_PASSWORD_CHANGE_REQUIRED MAKE_MAPI_E( 0x120 )
  61. #define MAPI_E_PASSWORD_EXPIRED MAKE_MAPI_E( 0x121 )
  62. #define MAPI_E_INVALID_WORKSTATION_ACCOUNT MAKE_MAPI_E( 0x122 )
  63. #define MAPI_E_INVALID_ACCESS_TIME MAKE_MAPI_E( 0x123 )
  64. #define MAPI_E_ACCOUNT_DISABLED MAKE_MAPI_E( 0x124 )
  65. /* MAPI base function and status object specific errors and warnings */
  66. #define MAPI_E_END_OF_SESSION MAKE_MAPI_E( 0x200 )
  67. #define MAPI_E_UNKNOWN_ENTRYID MAKE_MAPI_E( 0x201 )
  68. #define MAPI_E_MISSING_REQUIRED_COLUMN MAKE_MAPI_E( 0x202 )
  69. #define MAPI_W_NO_SERVICE MAKE_MAPI_S( 0x203 )
  70. /* Property specific errors and warnings */
  71. #define MAPI_E_BAD_VALUE MAKE_MAPI_E( 0x301 )
  72. #define MAPI_E_INVALID_TYPE MAKE_MAPI_E( 0x302 )
  73. #define MAPI_E_TYPE_NO_SUPPORT MAKE_MAPI_E( 0x303 )
  74. #define MAPI_E_UNEXPECTED_TYPE MAKE_MAPI_E( 0x304 )
  75. #define MAPI_E_TOO_BIG MAKE_MAPI_E( 0x305 )
  76. #define MAPI_E_DECLINE_COPY MAKE_MAPI_E( 0x306 )
  77. #define MAPI_E_UNEXPECTED_ID MAKE_MAPI_E( 0x307 )
  78. #define MAPI_W_ERRORS_RETURNED MAKE_MAPI_S( 0x380 )
  79. /* Table specific errors and warnings */
  80. #define MAPI_E_UNABLE_TO_COMPLETE MAKE_MAPI_E( 0x400 )
  81. #define MAPI_E_TIMEOUT MAKE_MAPI_E( 0x401 )
  82. #define MAPI_E_TABLE_EMPTY MAKE_MAPI_E( 0x402 )
  83. #define MAPI_E_TABLE_TOO_BIG MAKE_MAPI_E( 0x403 )
  84. #define MAPI_E_INVALID_BOOKMARK MAKE_MAPI_E( 0x405 )
  85. #define MAPI_W_POSITION_CHANGED MAKE_MAPI_S( 0x481 )
  86. #define MAPI_W_APPROX_COUNT MAKE_MAPI_S( 0x482 )
  87. /* Transport specific errors and warnings */
  88. #define MAPI_E_WAIT MAKE_MAPI_E( 0x500 )
  89. #define MAPI_E_CANCEL MAKE_MAPI_E( 0x501 )
  90. #define MAPI_E_NOT_ME MAKE_MAPI_E( 0x502 )
  91. #define MAPI_W_CANCEL_MESSAGE MAKE_MAPI_S( 0x580 )
  92. /* Message Store, Folder, and Message specific errors and warnings */
  93. #define MAPI_E_CORRUPT_STORE MAKE_MAPI_E( 0x600 )
  94. #define MAPI_E_NOT_IN_QUEUE MAKE_MAPI_E( 0x601 )
  95. #define MAPI_E_NO_SUPPRESS MAKE_MAPI_E( 0x602 )
  96. #define MAPI_E_COLLISION MAKE_MAPI_E( 0x604 )
  97. #define MAPI_E_NOT_INITIALIZED MAKE_MAPI_E( 0x605 )
  98. #define MAPI_E_NON_STANDARD MAKE_MAPI_E( 0x606 )
  99. #define MAPI_E_NO_RECIPIENTS MAKE_MAPI_E( 0x607 )
  100. #define MAPI_E_SUBMITTED MAKE_MAPI_E( 0x608 )
  101. #define MAPI_E_HAS_FOLDERS MAKE_MAPI_E( 0x609 )
  102. #define MAPI_E_HAS_MESSAGES MAKE_MAPI_E( 0x60A )
  103. #define MAPI_E_FOLDER_CYCLE MAKE_MAPI_E( 0x60B )
  104. #define MAPI_W_PARTIAL_COMPLETION MAKE_MAPI_S( 0x680 )
  105. /* Address Book specific errors and warnings */
  106. #define MAPI_E_AMBIGUOUS_RECIP MAKE_MAPI_E( 0x700 )
  107. /* The range 0x0800 to 0x08FF is reserved */
  108. /* We expect these to eventually be defined by OLE, but for now,
  109. * here they are. When OLE defines them they can be much more
  110. * efficient than these, but these are "proper" and don't make
  111. * use of any hidden tricks.
  112. */
  113. #ifndef HR_SUCCEEDED
  114. #define HR_SUCCEEDED(_hr) SUCCEEDED((SCODE)(_hr))
  115. #define HR_FAILED(_hr) FAILED((SCODE)(_hr))
  116. #endif
  117. #endif /* MAPICODE_H */