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.

347 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.30 $
  14. * $Date: 26 Feb 1997 15:35:04 $
  15. * $Author: CHULME $
  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) & 0xffff)) )
  95. // Macro to test for custom HRESULT
  96. //
  97. #define HRESULT_CUSTOM(hr) (((hr) >> 29) & 0x1)
  98. // Custom facility codes
  99. //
  100. #define FACILITY_BASE 0x080
  101. #define FACILITY_MSM (FACILITY_BASE + 1)
  102. #define FACILITY_AUDIOMSP (FACILITY_BASE + 2)
  103. #define FACILITY_VIDEOMSP (FACILITY_BASE + 3)
  104. #define FACILITY_FILEIOMSP (FACILITY_BASE + 4)
  105. #define FACILITY_CALLCONTROL (FACILITY_BASE + 5)
  106. #define FACILITY_SESSIONMANAGER (FACILITY_BASE + 6)
  107. #define FACILITY_RTPCHANMAN (FACILITY_BASE + 7)
  108. #define FACILITY_RTPMSP (FACILITY_BASE + 8)
  109. #define FACILITY_RTPRTCPCONTROL (FACILITY_BASE + 9)
  110. #define FACILITY_WINSOCK (FACILITY_BASE + 10)
  111. #define FACILITY_TESTMSP (FACILITY_BASE + 11)
  112. #define FACILITY_MSM_SESSION_CLASSES (FACILITY_BASE + 12)
  113. #define FACILITY_SCRIPTING (FACILITY_BASE + 13)
  114. #define FACILITY_Q931 (FACILITY_BASE + 14)
  115. #define FACILITY_WSCB (FACILITY_BASE + 15)
  116. #define FACILITY_DRWS (FACILITY_BASE + 16)
  117. #define FACILITY_ISDM (FACILITY_BASE + 17)
  118. #define FACILITY_AUTOREG (FACILITY_BASE + 18)
  119. #define FACILITY_CAPREG (FACILITY_BASE + 19)
  120. #define FACILITY_H245WS (FACILITY_BASE + 20)
  121. #define FACILITY_H245 (FACILITY_BASE + 21)
  122. #define FACILITY_ARSCLIENT (FACILITY_BASE + 22)
  123. #define FACILITY_PPM (FACILITY_BASE + 23)
  124. #define FACILITY_STRMSP (FACILITY_BASE + 24)
  125. #define FACILITY_STRMAN (FACILITY_BASE + 25)
  126. #define FACILITY_MIXERMSP (FACILITY_BASE + 26)
  127. #define FACILITY_GKI (FACILITY_BASE + 27)
  128. #define FACILITY_CCLOCK (FACILITY_BASE + 28)
  129. #define FACILITY_WINSOCK2 FACILITY_WINSOCK
  130. // Macros to support custom error reporting
  131. //
  132. #define MAKE_MSM_ERROR(error) MAKE_CUSTOM_HRESULT(SEVERITY_ERROR, TRUE, FACILITY_MSM, (error))
  133. #define MAKE_AUDIOMSP_ERROR(error) MAKE_CUSTOM_HRESULT(SEVERITY_ERROR, TRUE, FACILITY_AUDIOMSP, (error))
  134. #define MAKE_AUDIOMSP_ERROR(error) MAKE_CUSTOM_HRESULT(SEVERITY_ERROR, TRUE, FACILITY_AUDIOMSP, (error))
  135. #define MAKE_VIDEOMSP_ERROR(error) MAKE_CUSTOM_HRESULT(SEVERITY_ERROR, TRUE, FACILITY_VIDEOMSP, (error))
  136. #define MAKE_FILEIOMSP_ERROR(error) MAKE_CUSTOM_HRESULT(SEVERITY_ERROR, TRUE, FACILITY_FILEIOMSP,(error))
  137. #define MAKE_RTPCHANMAN_ERROR(error) MAKE_CUSTOM_HRESULT(SEVERITY_ERROR, TRUE, FACILITY_RTPCHANNELMANAGER, (error))
  138. #define MAKE_RTPMSP_ERROR(error) MAKE_CUSTOM_HRESULT(SEVERITY_ERROR, TRUE, FACILITY_RTPMSP, (error))
  139. #define MAKE_WINSOCK_ERROR(error) MAKE_CUSTOM_HRESULT(SEVERITY_ERROR, TRUE, FACILITY_WINSOCK, (error))
  140. #define MAKE_TESTMSP_ERROR(error) MAKE_CUSTOM_HRESULT(SEVERITY_ERROR, TRUE, FACILITY_TESTMSP, (error))
  141. #define MAKE_MSM_SESSION_CLASSES_ERROR(error) MAKE_CUSTOM_HRESULT(SEVERITY_ERROR, TRUE, FACILITY_MSM_SESSION_CLASSES, (error))
  142. #define MAKE_SCRIPTING_ERROR(error) MAKE_CUSTOM_HRESULT(SEVERITY_ERROR, TRUE, FACILITY_SCRIPTING,(error))
  143. #define MAKE_Q931_ERROR(error) MAKE_CUSTOM_HRESULT(SEVERITY_ERROR, TRUE, FACILITY_Q931, (error))
  144. #define MAKE_WSCB_ERROR(error) MAKE_CUSTOM_HRESULT(SEVERITY_ERROR, TRUE, FACILITY_WSCB, (error))
  145. #define MAKE_DRWS_ERROR(error) MAKE_CUSTOM_HRESULT(SEVERITY_ERROR, TRUE, FACILITY_DRWS, (error))
  146. #define MAKE_ISDM_ERROR(error) MAKE_CUSTOM_HRESULT(SEVERITY_ERROR, TRUE, FACILITY_ISDM, (error))
  147. #define MAKE_AUTOREG_ERROR(error) MAKE_CUSTOM_HRESULT(SEVERITY_ERROR, TRUE, FACILITY_AUTOREG, (error))
  148. #define MAKE_CAPREG_ERROR(error) MAKE_CUSTOM_HRESULT(SEVERITY_ERROR, TRUE, FACILITY_CAPREG, (error))
  149. #define MAKE_H245WS_ERROR(error) MAKE_CUSTOM_HRESULT(SEVERITY_ERROR, TRUE, FACILITY_H245WS, (error))
  150. #define MAKE_H245_ERROR(error) MAKE_CUSTOM_HRESULT(SEVERITY_ERROR, TRUE, FACILITY_H245, (error))
  151. #define MAKE_ARSCLIENT_ERROR(error) MAKE_CUSTOM_HRESULT(SEVERITY_ERROR, TRUE, FACILITY_ARSCLIENT, (error))
  152. #define MAKE_PPM_ERROR(error) MAKE_CUSTOM_HRESULT(SEVERITY_ERROR, TRUE, FACILITY_PPM, (error))
  153. #define MAKE_STRMSP_ERROR(error) MAKE_CUSTOM_HRESULT(SEVERITY_ERROR, TRUE, FACILITY_STRMSP, (error))
  154. #define MAKE_STRMAN_ERROR(error) MAKE_CUSTOM_HRESULT(SEVERITY_ERROR, TRUE, FACILITY_STRMAN, (error))
  155. #define MAKE_MIXERMSP_ERROR(error) MAKE_CUSTOM_HRESULT(SEVERITY_ERROR, TRUE, FACILITY_MIXERMSP, (error))
  156. // Error defines for MSM
  157. //
  158. //
  159. #define ERROR_BASE_ID 0x8000
  160. #define ERROR_LOCAL_BASE_ID 0xA000
  161. //
  162. // MessageId: ERROR_UNKNOWN
  163. //
  164. // MessageText:
  165. //
  166. // An unkown error has occured in the system
  167. //
  168. #define ERROR_UNKNOWN (ERROR_BASE_ID + 0)
  169. //
  170. // MessageId: ERROR_INVALID_BUFFER
  171. //
  172. // MessageText:
  173. //
  174. // An invalid buffer handle was encountered.
  175. //
  176. #define ERROR_INVALID_BUFFER (ERROR_BASE_ID + 1)
  177. //
  178. // MessageId: ERROR_INVALID_BUFFER_SIZE
  179. //
  180. // MessageText:
  181. //
  182. // An invalid buffer size was encountered.
  183. //
  184. #define ERROR_INVALID_BUFFER_SIZE (ERROR_BASE_ID + 2)
  185. //
  186. // MessageId: ERROR_INVALID_CALL_ORDER
  187. //
  188. // MessageText:
  189. //
  190. // A bad call sequence was encountered.
  191. //
  192. #define ERROR_INVALID_CALL_ORDER (ERROR_BASE_ID + 3)
  193. //
  194. // MessageId: ERROR_INVALID_CONFIG_SETTING
  195. //
  196. // MessageText:
  197. //
  198. // A specified configuration parameter was invalid
  199. //
  200. #define ERROR_INVALID_CONFIG_SETTING (ERROR_BASE_ID + 4)
  201. //
  202. // MessageId: ERROR_INVALID_LINK
  203. //
  204. // MessageText:
  205. //
  206. // An invalid link handle was encountered.
  207. //
  208. #define ERROR_INVALID_LINK (ERROR_BASE_ID + 5)
  209. //
  210. // MessageId: ERROR_INVALID_PORT
  211. //
  212. // MessageText:
  213. //
  214. // An invalid port handle was encountered.
  215. //
  216. #define ERROR_INVALID_PORT (ERROR_BASE_ID + 6)
  217. //
  218. // MessageId: ERROR_INVALID_SERVICE
  219. //
  220. // MessageText:
  221. //
  222. // An invalid service handle was encountered.
  223. //
  224. #define ERROR_INVALID_SERVICE (ERROR_BASE_ID + 7)
  225. //
  226. // MessageId: ERROR_INVALID_SERVICE_DLL
  227. //
  228. // MessageText:
  229. //
  230. // The specified service DLL does not support required interface
  231. //
  232. #define ERROR_INVALID_SERVICE_DLL (ERROR_BASE_ID + 8)
  233. //
  234. // MessageId: ERROR_INVALID_SERIVCE_ID
  235. //
  236. // MessageText:
  237. //
  238. // The specified service was not located in the registry
  239. //
  240. #define ERROR_INVALID_SERVICE_ID (ERROR_BASE_ID + 9)
  241. //
  242. // MessageId: ERROR_INVALID_SESSION
  243. //
  244. // MessageText:
  245. //
  246. // An invalid session handle was encountered.
  247. //
  248. #define ERROR_INVALID_SESSION (ERROR_BASE_ID + 10)
  249. //
  250. // MessageId: ERROR_INVALID_SYNC
  251. //
  252. // MessageText:
  253. //
  254. // An invalid sync handle was encountered.
  255. //
  256. #define ERROR_INVALID_SYNC (ERROR_BASE_ID + 11)
  257. //
  258. // MessageId: ERROR_INVALID_VERSION
  259. //
  260. // MessageText:
  261. //
  262. // An invalid version of an object or structure was detected.
  263. //
  264. #define ERROR_INVALID_VERSION (ERROR_BASE_ID + 12)
  265. //
  266. // MessageId: ERROR_BUFFER_LIMIT
  267. //
  268. // MessageText:
  269. //
  270. // No buffers are available for performing this operation.
  271. //
  272. #define ERROR_BUFFER_LIMIT (ERROR_BASE_ID + 13)
  273. //
  274. // MessageId: ERROR_INVALID_SKEY
  275. //
  276. // MessageText:
  277. //
  278. // An invalid status key was encountered.
  279. //
  280. #define ERROR_INVALID_SKEY (ERROR_BASE_ID + 14)
  281. //
  282. // MessageId: ERROR_INVALID_SVALUE
  283. //
  284. // MessageText:
  285. //
  286. // An invalid status value was encountered.
  287. //
  288. #define ERROR_INVALID_SVALUE (ERROR_BASE_ID + 15)
  289. #ifdef __cplusplus
  290. } // End of extern "C" {
  291. #endif // __cplusplus
  292. #endif // APIMSM_H