home *** CD-ROM | disk | FTP | other *** search
/ Tricks of the Windows Gam…ming Gurus (2nd Edition) / Disc2.iso / msdn_vcb / samples / vc98 / sdk / dbmsg / mapi / common / _scode.h next >
Encoding:
C/C++ Source or Header  |  1996-04-11  |  5.8 KB  |  220 lines

  1. /*
  2.  *  _ S C O D E . H
  3.  *
  4.  *  Status Codes returned by MAPI routines
  5.  *
  6.  *  Copyright 1993-1995 Microsoft Corporation. All Rights Reserved.
  7.  */
  8.  
  9. #ifndef _SCODE_H
  10. #define _SCODE_H
  11.  
  12. /* Define S_OK and ITF_* */
  13.  
  14. #ifdef _WIN32
  15. #include <winerror.h>
  16. #endif
  17.  
  18. /*
  19.  *  MAPI Status codes follow the style of OLE 2.0 sCodes as defined in the
  20.  *  OLE 2.0 Programmer's Reference and header file scode.h (Windows 3.x)
  21.  *  or winerror.h (Windows NT and Windows 95).
  22.  *
  23.  */
  24.  
  25. /*  On Windows 3.x, status codes have 32-bit values as follows:
  26.  *
  27.  *   3 3 2 2 2 2 2 2 2 2 2 2 1 1 1 1 1 1 1 1 1 1
  28.  *   1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0
  29.  *  +-+---------------------+-------+-------------------------------+
  30.  *  |S|       Context       | Facil |               Code            |
  31.  *  +-+---------------------+-------+-------------------------------+
  32.  *
  33.  *  where
  34.  *
  35.  *      S - is the severity code
  36.  *
  37.  *          0 - SEVERITY_SUCCESS
  38.  *          1 - SEVERITY_ERROR
  39.  *
  40.  *      Context - context info
  41.  *
  42.  *      Facility - is the facility code
  43.  *
  44.  *          0x0 - FACILITY_NULL     generally useful errors ([SE]_*)
  45.  *          0x1 - FACILITY_RPC      remote procedure call errors (RPC_E_*)
  46.  *          0x2 - FACILITY_DISPATCH late binding dispatch errors
  47.  *          0x3 - FACILITY_STORAGE  storage errors (STG_E_*)
  48.  *          0x4 - FACILITY_ITF      interface-specific errors
  49.  *
  50.  *      Code - is the facility's status code
  51.  *
  52.  *
  53.  */
  54.  
  55. /*
  56.  *  On Windows NT 3.5 and Windows 95, scodes are 32-bit values
  57.  *  laid out as follows:
  58.  *  
  59.  *    3 3 2 2 2 2 2 2 2 2 2 2 1 1 1 1 1 1 1 1 1 1
  60.  *    1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0
  61.  *   +-+-+-+-+-+---------------------+-------------------------------+
  62.  *   |S|R|C|N|r|    Facility         |               Code            |
  63.  *   +-+-+-+-+-+---------------------+-------------------------------+
  64.  *  
  65.  *   where
  66.  *  
  67.  *      S - Severity - indicates success/fail
  68.  *  
  69.  *          0 - Success
  70.  *          1 - Fail (COERROR)
  71.  *  
  72.  *      R - reserved portion of the facility code, corresponds to NT's
  73.  *          second severity bit.
  74.  *  
  75.  *      C - reserved portion of the facility code, corresponds to NT's
  76.  *          C field.
  77.  *  
  78.  *      N - reserved portion of the facility code. Used to indicate a
  79.  *          mapped NT status value.
  80.  *  
  81.  *      r - reserved portion of the facility code. Reserved for internal
  82.  *          use. Used to indicate HRESULT values that are not status
  83.  *          values, but are instead message ids for display strings.
  84.  *  
  85.  *      Facility - is the facility code
  86.  *          FACILITY_NULL                    0x0
  87.  *          FACILITY_RPC                     0x1
  88.  *          FACILITY_DISPATCH                0x2
  89.  *          FACILITY_STORAGE                 0x3
  90.  *          FACILITY_ITF                     0x4
  91.  *          FACILITY_WIN32                   0x7
  92.  *          FACILITY_WINDOWS                 0x8
  93.  *  
  94.  *      Code - is the facility's status code
  95.  *  
  96.  */
  97.  
  98.  
  99.  
  100.  
  101. /*
  102.  *  We can't use OLE 2.0 macros to build sCodes because the definition has
  103.  *  changed and we wish to conform to the new definition.
  104.  */
  105.  
  106. /* The following two macros are used to build OLE 2.0 style sCodes */
  107.  
  108.  
  109. #ifdef  SUCCESS_SUCCESS
  110. #undef  SUCCESS_SUCCESS
  111. #endif
  112. #define SUCCESS_SUCCESS     0L
  113.  
  114. /* General errors (used by more than one MAPI object) */
  115.  
  116.  
  117. Sc(MAPI_E_NO_SUPPORT),
  118. Sc(MAPI_E_BAD_CHARWIDTH),
  119. Sc(MAPI_E_STRING_TOO_LONG),
  120. Sc(MAPI_E_UNKNOWN_FLAGS),
  121. Sc(MAPI_E_INVALID_ENTRYID),
  122. Sc(MAPI_E_INVALID_OBJECT),
  123. Sc(MAPI_E_OBJECT_CHANGED),
  124. Sc(MAPI_E_OBJECT_DELETED),
  125. Sc(MAPI_E_BUSY),
  126. Sc(MAPI_E_NOT_ENOUGH_DISK),
  127. Sc(MAPI_E_NOT_ENOUGH_RESOURCES),
  128. Sc(MAPI_E_NOT_FOUND),
  129. Sc(MAPI_E_VERSION),
  130. Sc(MAPI_E_LOGON_FAILED),
  131. Sc(MAPI_E_SESSION_LIMIT),
  132. Sc(MAPI_E_USER_CANCEL),
  133. Sc(MAPI_E_UNABLE_TO_ABORT),
  134. Sc(MAPI_E_NETWORK_ERROR),
  135. Sc(MAPI_E_DISK_ERROR),
  136. Sc(MAPI_E_TOO_COMPLEX),
  137. Sc(MAPI_E_BAD_COLUMN),
  138. Sc(MAPI_E_EXTENDED_ERROR),
  139. Sc(MAPI_E_COMPUTED),
  140. Sc(MAPI_E_CORRUPT_DATA),
  141. Sc(MAPI_E_UNCONFIGURED),
  142. Sc(MAPI_E_FAILONEPROVIDER),
  143. Sc(MAPI_E_UNKNOWN_CPID),
  144. Sc(MAPI_E_UNKNOWN_LCID),
  145.  
  146. /* MAPI base function and status object specific errors and warnings */
  147.  
  148. Sc(MAPI_E_END_OF_SESSION),
  149. Sc(MAPI_E_UNKNOWN_ENTRYID),
  150. Sc(MAPI_E_MISSING_REQUIRED_COLUMN),
  151. Sc(MAPI_W_NO_SERVICE),
  152.  
  153. /* Property specific errors and warnings */
  154.  
  155. Sc(MAPI_E_BAD_VALUE),
  156. Sc(MAPI_E_INVALID_TYPE),
  157. Sc(MAPI_E_TYPE_NO_SUPPORT),
  158. Sc(MAPI_E_UNEXPECTED_TYPE),
  159. Sc(MAPI_E_TOO_BIG),
  160. Sc(MAPI_E_DECLINE_COPY),
  161. Sc(MAPI_E_UNEXPECTED_ID),
  162.  
  163. Sc(MAPI_W_ERRORS_RETURNED),
  164.  
  165. /* Table specific errors and warnings */
  166.  
  167. Sc(MAPI_E_UNABLE_TO_COMPLETE),
  168. Sc(MAPI_E_TIMEOUT),
  169. Sc(MAPI_E_TABLE_EMPTY),
  170. Sc(MAPI_E_TABLE_TOO_BIG),
  171.  
  172. Sc(MAPI_E_INVALID_BOOKMARK),
  173.  
  174. Sc(MAPI_W_POSITION_CHANGED),
  175. Sc(MAPI_W_APPROX_COUNT),
  176.  
  177. /* Transport specific errors and warnings */
  178.  
  179. Sc(MAPI_E_WAIT),
  180. Sc(MAPI_E_CANCEL),
  181. Sc(MAPI_E_NOT_ME),
  182.  
  183. Sc(MAPI_W_CANCEL_MESSAGE),
  184.  
  185. /* Message Store, Folder, and Message specific errors and warnings */
  186.  
  187. Sc(MAPI_E_CORRUPT_STORE),
  188. Sc(MAPI_E_NOT_IN_QUEUE),
  189. Sc(MAPI_E_NO_SUPPRESS),
  190. Sc(MAPI_E_COLLISION),
  191. Sc(MAPI_E_NOT_INITIALIZED),
  192. Sc(MAPI_E_NON_STANDARD),
  193. Sc(MAPI_E_NO_RECIPIENTS),
  194. Sc(MAPI_E_SUBMITTED),
  195. Sc(MAPI_E_HAS_FOLDERS),
  196. Sc(MAPI_E_HAS_MESSAGES),
  197. Sc(MAPI_E_FOLDER_CYCLE),
  198.  
  199. Sc(MAPI_W_PARTIAL_COMPLETION),
  200.  
  201. /* Address Book specific errors and warnings */
  202.  
  203. Sc(MAPI_E_AMBIGUOUS_RECIP),
  204.  
  205. /* The range 0x0800 to 0x08FF is reserved */
  206.  
  207. /* Obsolete typing shortcut that will go away eventually. */
  208. #ifndef MakeResult
  209. #endif
  210.  
  211. /* We expect these to eventually be defined by OLE, but for now,
  212.  * here they are.  When OLE defines them they can be much more
  213.  * efficient than these, but these are "proper" and don't make
  214.  * use of any hidden tricks.
  215.  */
  216. #ifndef HR_SUCCEEDED
  217. #endif
  218.  
  219. #endif  /* _SCODE_H */
  220.