Leaked source code of windows server 2003
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.

355 lines
12 KiB

  1. /****************************************************************************
  2. *
  3. * $Archive: S:/STURGEON/SRC/INCLUDE/VCS/apierror.h_v $
  4. *
  5. * INTEL Corporation Prorietary Information
  6. *
  7. * This listing is supplied under the tERROR of a license agreement
  8. * with INTEL Corporation and may not be copied nor disclosed except
  9. * in accordance with the terms of that agreement.
  10. *
  11. * Copyright (c) 1993-1994 Intel Corporation.
  12. *
  13. * $Revision: 1.28 $
  14. * $Date: Jan 22 1997 11:38:04 $
  15. * $Author: plantz $
  16. *
  17. * Deliverable:
  18. *
  19. * Abstract:
  20. * Media Service Manager "public" header file. This file contains
  21. * #defines, typedefs, struct definitions and prototypes used by
  22. * and in conjunction with MSM. Any EXE or DLL which interacts with
  23. * MSM will include this header file.
  24. *
  25. * Notes:
  26. *
  27. ***************************************************************************/
  28. #ifndef APIERROR_H
  29. #define APIERROR_H
  30. #include <objbase.h>
  31. #ifdef __cplusplus
  32. extern "C" { // Assume C declarations for C++.
  33. #endif // __cplusplus
  34. #ifndef DllExport
  35. #define DllExport __declspec( dllexport )
  36. #endif // DllExport
  37. // Prototype for function that converts HRESULT into a string. The function
  38. // and string resources are contained in NETMMERR.DLL.
  39. //
  40. typedef WORD (*NETMMERR_ERRORTOSTRING) (HRESULT, LPSTR, int);
  41. extern DllExport BOOL GetResultUserString(HRESULT hResult, LPSTR lpBuffer, int iBufferSize);
  42. extern DllExport BOOL GetResultSubStrings(HRESULT hResult, LPSTR lpBuffer, int iBufferSize);
  43. // This description was extracted from winerror.h. It appears here only for
  44. // the purpose of convenience.
  45. //
  46. // OLE error definitions and values
  47. //
  48. // The return value of OLE APIs and methods is an HRESULT.
  49. // This is not a handle to anything, but is merely a 32-bit value
  50. // with several fields encoded in the value. The parts of an
  51. // HRESULT are shown below.
  52. //
  53. // Many of the macros and functions below were orginally defined to
  54. // operate on SCODEs. SCODEs are no longer used. The macros are
  55. // still present for compatibility and easy porting of Win16 code.
  56. // Newly written code should use the HRESULT macros and functions.
  57. //
  58. //
  59. // HRESULTs are 32 bit values layed out as follows:
  60. //
  61. // 3 3 2 2 2 2 2 2 2 2 2 2 1 1 1 1 1 1 1 1 1 1
  62. // 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
  63. // +-+-+-+-+-+---------------------+-------------------------------+
  64. // |S|R|C|N|r| Facility | Code |
  65. // +-+-+-+-+-+---------------------+-------------------------------+
  66. //
  67. // where
  68. //
  69. // S - Severity - indicates success/fail
  70. //
  71. // 0 - Success
  72. // 1 - Fail (COERROR)
  73. //
  74. // R - reserved portion of the facility code, corresponds to NT's
  75. // second severity bit.
  76. //
  77. // C - reserved portion of the facility code, corresponds to NT's
  78. // C field.
  79. //
  80. // N - reserved portion of the facility code. Used to indicate a
  81. // mapped NT status value.
  82. //
  83. // r - reserved portion of the facility code. Reserved for internal
  84. // use. Used to indicate HRESULT values that are not status
  85. // values, but are instead message ids for display strings.
  86. //
  87. // Facility - is the facility code
  88. //
  89. // Code - is the facility's status code
  90. //
  91. // Macro to create a custom HRESULT
  92. //
  93. #define MAKE_CUSTOM_HRESULT(sev,cus,fac,code) \
  94. ((HRESULT) (((unsigned long)(sev)<<31) | ((unsigned long)(cus)<<29) | ((unsigned long)(fac)<<16) | ((unsigned long)(code))) )
  95. // Macro to test for custom HRESULT
  96. //
  97. #define HRESULT_CUSTOM(hr) (((hr) >> 29) & 0x1)
  98. // Macro to get custom facility and code
  99. //
  100. #define CUSTOM_FACILITY_MASK 0x07FF0000
  101. #define CUSTOM_FACILITY(hr) ((hr & CUSTOM_FACILITY_MASK) >> 16)
  102. #define CUSTOM_FACILITY_CODE(hr) (hr & 0x00000FFF)
  103. // Custom facility codes
  104. //
  105. #define FACILITY_BASE 0x080
  106. #define FACILITY_MSM (FACILITY_BASE + 1)
  107. #define FACILITY_AUDIOMSP (FACILITY_BASE + 2)
  108. #define FACILITY_VIDEOMSP (FACILITY_BASE + 3)
  109. #define FACILITY_FILEIOMSP (FACILITY_BASE + 4)
  110. #define FACILITY_CALLCONTROL (FACILITY_BASE + 5)
  111. #define FACILITY_SESSIONMANAGER (FACILITY_BASE + 6)
  112. #define FACILITY_RTPCHANMAN (FACILITY_BASE + 7)
  113. #define FACILITY_RTPMSP (FACILITY_BASE + 8)
  114. #define FACILITY_RTPRTCPCONTROL (FACILITY_BASE + 9)
  115. #define FACILITY_WINSOCK (FACILITY_BASE + 10)
  116. #define FACILITY_TESTMSP (FACILITY_BASE + 11)
  117. #define FACILITY_MSM_SESSION_CLASSES (FACILITY_BASE + 12)
  118. #define FACILITY_SCRIPTING (FACILITY_BASE + 13)
  119. #define FACILITY_Q931 (FACILITY_BASE + 14)
  120. #define FACILITY_WSCB (FACILITY_BASE + 15)
  121. #define FACILITY_DRWS (FACILITY_BASE + 16)
  122. #define FACILITY_ISDM (FACILITY_BASE + 17)
  123. #define FACILITY_AUTOREG (FACILITY_BASE + 18)
  124. #define FACILITY_CAPREG (FACILITY_BASE + 19)
  125. #define FACILITY_H245WS (FACILITY_BASE + 20)
  126. #define FACILITY_H245 (FACILITY_BASE + 21)
  127. #define FACILITY_ARSCLIENT (FACILITY_BASE + 22)
  128. #define FACILITY_PPM (FACILITY_BASE + 23)
  129. #define FACILITY_STRMSP (FACILITY_BASE + 24)
  130. #define FACILITY_STRMAN (FACILITY_BASE + 25)
  131. #define FACILITY_MIXERMSP (FACILITY_BASE + 26)
  132. #define FACILITY_GKI (FACILITY_BASE + 27)
  133. #define FACILITY_GKIREGISTRATION (FACILITY_BASE + 28)
  134. #define FACILITY_GKIADMISSION (FACILITY_BASE + 29)
  135. #define FACILITY_CALLINCOMPLETE (FACILITY_BASE + 30)
  136. #define FACILITY_CALLSUMMARY (FACILITY_BASE + 31)
  137. #define FACILITY_GKIUNREGREQ (FACILITY_BASE + 32)
  138. #define FACILITY_WINSOCK2 FACILITY_WINSOCK
  139. // Macros to support custom error reporting
  140. //
  141. #define MAKE_MSM_ERROR(error) MAKE_CUSTOM_HRESULT(SEVERITY_ERROR, TRUE, FACILITY_MSM, (error))
  142. #define MAKE_AUDIOMSP_ERROR(error) MAKE_CUSTOM_HRESULT(SEVERITY_ERROR, TRUE, FACILITY_AUDIOMSP, (error))
  143. #define MAKE_AUDIOMSP_ERROR(error) MAKE_CUSTOM_HRESULT(SEVERITY_ERROR, TRUE, FACILITY_AUDIOMSP, (error))
  144. #define MAKE_VIDEOMSP_ERROR(error) MAKE_CUSTOM_HRESULT(SEVERITY_ERROR, TRUE, FACILITY_VIDEOMSP, (error))
  145. #define MAKE_FILEIOMSP_ERROR(error) MAKE_CUSTOM_HRESULT(SEVERITY_ERROR, TRUE, FACILITY_FILEIOMSP,(error))
  146. #define MAKE_RTPCHANMAN_ERROR(error) MAKE_CUSTOM_HRESULT(SEVERITY_ERROR, TRUE, FACILITY_RTPCHANNELMANAGER, (error))
  147. #define MAKE_RTPMSP_ERROR(error) MAKE_CUSTOM_HRESULT(SEVERITY_ERROR, TRUE, FACILITY_RTPMSP, (error))
  148. #define MAKE_WINSOCK_ERROR(error) MAKE_CUSTOM_HRESULT(SEVERITY_ERROR, TRUE, FACILITY_WINSOCK, (error))
  149. #define MAKE_TESTMSP_ERROR(error) MAKE_CUSTOM_HRESULT(SEVERITY_ERROR, TRUE, FACILITY_TESTMSP, (error))
  150. #define MAKE_MSM_SESSION_CLASSES_ERROR(error) MAKE_CUSTOM_HRESULT(SEVERITY_ERROR, TRUE, FACILITY_MSM_SESSION_CLASSES, (error))
  151. #define MAKE_SCRIPTING_ERROR(error) MAKE_CUSTOM_HRESULT(SEVERITY_ERROR, TRUE, FACILITY_SCRIPTING,(error))
  152. #define MAKE_Q931_ERROR(error) MAKE_CUSTOM_HRESULT(SEVERITY_ERROR, TRUE, FACILITY_Q931, (error))
  153. #define MAKE_WSCB_ERROR(error) MAKE_CUSTOM_HRESULT(SEVERITY_ERROR, TRUE, FACILITY_WSCB, (error))
  154. #define MAKE_DRWS_ERROR(error) MAKE_CUSTOM_HRESULT(SEVERITY_ERROR, TRUE, FACILITY_DRWS, (error))
  155. #define MAKE_ISDM_ERROR(error) MAKE_CUSTOM_HRESULT(SEVERITY_ERROR, TRUE, FACILITY_ISDM, (error))
  156. #define MAKE_AUTOREG_ERROR(error) MAKE_CUSTOM_HRESULT(SEVERITY_ERROR, TRUE, FACILITY_AUTOREG, (error))
  157. #define MAKE_CAPREG_ERROR(error) MAKE_CUSTOM_HRESULT(SEVERITY_ERROR, TRUE, FACILITY_CAPREG, (error))
  158. #define MAKE_H245WS_ERROR(error) MAKE_CUSTOM_HRESULT(SEVERITY_ERROR, TRUE, FACILITY_H245WS, (error))
  159. #define MAKE_H245_ERROR(error) MAKE_CUSTOM_HRESULT(SEVERITY_ERROR, TRUE, FACILITY_H245, (error))
  160. #define MAKE_ARSCLIENT_ERROR(error) MAKE_CUSTOM_HRESULT(SEVERITY_ERROR, TRUE, FACILITY_ARSCLIENT, (error))
  161. #define MAKE_PPM_ERROR(error) MAKE_CUSTOM_HRESULT(SEVERITY_ERROR, TRUE, FACILITY_PPM, (error))
  162. #define MAKE_STRMSP_ERROR(error) MAKE_CUSTOM_HRESULT(SEVERITY_ERROR, TRUE, FACILITY_STRMSP, (error))
  163. #define MAKE_STRMAN_ERROR(error) MAKE_CUSTOM_HRESULT(SEVERITY_ERROR, TRUE, FACILITY_STRMAN, (error))
  164. #define MAKE_MIXERMSP_ERROR(error) MAKE_CUSTOM_HRESULT(SEVERITY_ERROR, TRUE, FACILITY_MIXERMSP, (error))
  165. // Error defines for MSM
  166. //
  167. //
  168. #define ERROR_BASE_ID 0x8000
  169. #define ERROR_LOCAL_BASE_ID 0xA000
  170. //
  171. // MessageId: ERROR_UNKNOWN
  172. //
  173. // MessageText:
  174. //
  175. // An unkown error has occured in the system
  176. //
  177. #define ERROR_UNKNOWN (ERROR_BASE_ID + 0)
  178. //
  179. // MessageId: ERROR_INVALID_BUFFER
  180. //
  181. // MessageText:
  182. //
  183. // An invalid buffer handle was encountered.
  184. //
  185. #define ERROR_INVALID_BUFFER (ERROR_BASE_ID + 1)
  186. //
  187. // MessageId: ERROR_INVALID_BUFFER_SIZE
  188. //
  189. // MessageText:
  190. //
  191. // An invalid buffer size was encountered.
  192. //
  193. #define ERROR_INVALID_BUFFER_SIZE (ERROR_BASE_ID + 2)
  194. //
  195. // MessageId: ERROR_INVALID_CALL_ORDER
  196. //
  197. // MessageText:
  198. //
  199. // A bad call sequence was encountered.
  200. //
  201. #define ERROR_INVALID_CALL_ORDER (ERROR_BASE_ID + 3)
  202. //
  203. // MessageId: ERROR_INVALID_CONFIG_SETTING
  204. //
  205. // MessageText:
  206. //
  207. // A specified configuration parameter was invalid
  208. //
  209. #define ERROR_INVALID_CONFIG_SETTING (ERROR_BASE_ID + 4)
  210. //
  211. // MessageId: ERROR_INVALID_LINK
  212. //
  213. // MessageText:
  214. //
  215. // An invalid link handle was encountered.
  216. //
  217. #define ERROR_INVALID_LINK (ERROR_BASE_ID + 5)
  218. //
  219. // MessageId: ERROR_INVALID_PORT
  220. //
  221. // MessageText:
  222. //
  223. // An invalid port handle was encountered.
  224. //
  225. #define ERROR_INVALID_PORT (ERROR_BASE_ID + 6)
  226. //
  227. // MessageId: ERROR_INVALID_SERVICE
  228. //
  229. // MessageText:
  230. //
  231. // An invalid service handle was encountered.
  232. //
  233. #define ERROR_INVALID_SERVICE (ERROR_BASE_ID + 7)
  234. //
  235. // MessageId: ERROR_INVALID_SERVICE_DLL
  236. //
  237. // MessageText:
  238. //
  239. // The specified service DLL does not support required interface
  240. //
  241. #define ERROR_INVALID_SERVICE_DLL (ERROR_BASE_ID + 8)
  242. //
  243. // MessageId: ERROR_INVALID_SERIVCE_ID
  244. //
  245. // MessageText:
  246. //
  247. // The specified service was not located in the registry
  248. //
  249. #define ERROR_INVALID_SERVICE_ID (ERROR_BASE_ID + 9)
  250. //
  251. // MessageId: ERROR_INVALID_SESSION
  252. //
  253. // MessageText:
  254. //
  255. // An invalid session handle was encountered.
  256. //
  257. #define ERROR_INVALID_SESSION (ERROR_BASE_ID + 10)
  258. //
  259. // MessageId: ERROR_INVALID_SYNC
  260. //
  261. // MessageText:
  262. //
  263. // An invalid sync handle was encountered.
  264. //
  265. #define ERROR_INVALID_SYNC (ERROR_BASE_ID + 11)
  266. //
  267. // MessageId: ERROR_INVALID_VERSION
  268. //
  269. // MessageText:
  270. //
  271. // An invalid version of an object or structure was detected.
  272. //
  273. #define ERROR_INVALID_VERSION (ERROR_BASE_ID + 12)
  274. //
  275. // MessageId: ERROR_BUFFER_LIMIT
  276. //
  277. // MessageText:
  278. //
  279. // No buffers are available for performing this operation.
  280. //
  281. #define ERROR_BUFFER_LIMIT (ERROR_BASE_ID + 13)
  282. //
  283. // MessageId: ERROR_INVALID_SKEY
  284. //
  285. // MessageText:
  286. //
  287. // An invalid status key was encountered.
  288. //
  289. #define ERROR_INVALID_SKEY (ERROR_BASE_ID + 14)
  290. //
  291. // MessageId: ERROR_INVALID_SVALUE
  292. //
  293. // MessageText:
  294. //
  295. // An invalid status value was encountered.
  296. //
  297. #define ERROR_INVALID_SVALUE (ERROR_BASE_ID + 15)
  298. #ifdef __cplusplus
  299. } // End of extern "C" {
  300. #endif // __cplusplus
  301. #endif // APIMSM_H