Source code of Windows XP (NT5)
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.

266 lines
9.1 KiB

  1. #ifndef _ISDMAPI_H_
  2. #define _ISDMAPI_H_
  3. /****************************************************************************
  4. *
  5. * $Archive: S:/STURGEON/SRC/INCLUDE/VCS/isdmapi.h_v $
  6. *
  7. * INTEL Corporation Prorietary Information
  8. *
  9. * This listing is supplied under the terms of a license agreement
  10. * with INTEL Corporation and may not be copied nor disclosed except
  11. * in accordance with the terms of that agreement.
  12. *
  13. * Copyright (c) 1993-1994 Intel Corporation.
  14. *
  15. * $Revision: 1.12 $
  16. * $Date: Aug 15 1996 14:23:36 $
  17. * $Author: dmgorlic $
  18. *
  19. * Deliverable:
  20. *
  21. * Abstract:
  22. *
  23. * Notes:
  24. *
  25. ***************************************************************************/
  26. #include "apierror.h"
  27. #ifdef __cplusplus
  28. extern "C" { // Assume C declarations for C++.
  29. #endif // __cplusplus
  30. #ifndef DllExport
  31. #define DllExport __declspec( dllexport )
  32. #endif // DllExport
  33. typedef DWORD HSTATSESSION, *LPHSTATSESSION;
  34. #define MAX_SESSNAME_LENGTH 25
  35. #define MAX_MODNAME_LENGTH 20
  36. #define MAX_SESSIDENT_LENGTH 256 //consistant with max cName length
  37. #define MAX_STATNAME_LENGTH 256
  38. //stat item string name
  39. typedef char STATNAME[MAX_STATNAME_LENGTH], *LPSTATNAME;
  40. //session string name
  41. typedef char SESSIONNAME[MAX_SESSNAME_LENGTH], *LPSESSIONNAME;
  42. //module name
  43. typedef char MODULENAME[MAX_MODNAME_LENGTH], *LPMODULENAME;
  44. //identifier length
  45. typedef char SESSIONIDENT[MAX_SESSIDENT_LENGTH], *LPSESSIONIDENT;
  46. typedef struct STATSTRUCT
  47. {
  48. DWORD dwStructSize; // size of the structure
  49. STATNAME szStatName; // string name of the stat item
  50. DWORD dwToken; // session unique id of the stat item
  51. DWORD dwValue; // value(data) of the stat item
  52. DWORD dwLow; // low value for range of value
  53. DWORD dwHigh; // hi value for range of value
  54. DWORD dwLastUpdate; // time stamp of last update
  55. } STAT, *LPSTAT;
  56. // Typedefs for ISDM application entry points to ensure stricter checking
  57. // when functions are called via pointers
  58. //
  59. typedef HRESULT (*ISD_REGISTER_SESSION) (LPMODULENAME, LPSESSIONNAME, LPSESSIONIDENT, LPHSTATSESSION);
  60. typedef HRESULT (*ISD_CREATESTAT) (HSTATSESSION, LPSTAT, WORD);
  61. typedef HRESULT (*ISD_UNREGISTERSESSION) (HSTATSESSION);
  62. typedef HRESULT (*ISD_DELETESTAT) (HSTATSESSION, LPSTAT, WORD);
  63. typedef HRESULT (*ISD_UPDATESTAT) (HSTATSESSION, LPSTAT, WORD);
  64. typedef HRESULT (*ISD_GETFIRSTSESSION) (LPMODULENAME, LPSESSIONNAME, LPSESSIONIDENT, LPHSTATSESSION);
  65. typedef HRESULT (*ISD_GETNEXTSESSION) (HSTATSESSION, LPMODULENAME, LPSESSIONNAME, LPSESSIONIDENT, LPHSTATSESSION);
  66. typedef HRESULT (*ISD_GETNUMSESSIONS) (WORD *);
  67. typedef HRESULT (*ISD_GETFIRSTSTAT) (HSTATSESSION, LPSTAT);
  68. typedef HRESULT (*ISD_GETNEXTSTAT) (HSTATSESSION, LPSTAT, LPSTAT);
  69. typedef HRESULT (*ISD_GETNUMSTATS) (HSTATSESSION, WORD *);
  70. typedef HRESULT (*ISD_GETSESSIONSTATS) (HSTATSESSION, LPSTAT, WORD);
  71. typedef struct _ISDMAPI
  72. {
  73. ISD_REGISTER_SESSION ISD_RegisterSession;
  74. ISD_CREATESTAT ISD_CreateStat;
  75. ISD_UNREGISTERSESSION ISD_UnregisterSession;
  76. ISD_DELETESTAT ISD_DeleteStat;
  77. ISD_UPDATESTAT ISD_UpdateStat;
  78. ISD_GETFIRSTSESSION ISD_GetFirstSession;
  79. ISD_GETNEXTSESSION ISD_GetNextSession;
  80. ISD_GETNUMSESSIONS ISD_GetNumSessions;
  81. ISD_GETFIRSTSTAT ISD_GetFirstStat;
  82. ISD_GETNEXTSTAT ISD_GetNextStat;
  83. ISD_GETNUMSTATS ISD_GetNumStats;
  84. ISD_GETSESSIONSTATS ISD_GetSessionStats;
  85. }
  86. ISDMAPI, *LPISDMAPI;
  87. //HRESULT error defines
  88. #define ISDM_ERROR_BASE ERROR_LOCAL_BASE_ID
  89. #define ERROR_HIT_MAX_SESSIONS ISDM_ERROR_BASE + 1
  90. #define ERROR_HIT_MAX_STATS ISDM_ERROR_BASE + 2
  91. #define ERROR_ACCESSING_SESSION ISDM_ERROR_BASE + 3
  92. #define ERROR_SESSION_EXISTS ISDM_ERROR_BASE + 4
  93. #define ERROR_INVALID_SESS_HANDLE ISDM_ERROR_BASE + 5
  94. #define ERROR_INVALID_STAT_HANDLE ISDM_ERROR_BASE + 6
  95. #define ERROR_NO_SESSIONS ISDM_ERROR_BASE + 7
  96. #define ERROR_NO_STATS ISDM_ERROR_BASE + 8
  97. #define ERROR_SESSION_NOT_FOUND ISDM_ERROR_BASE + 9
  98. #define ERROR_MUTEX_WAIT_FAIL ISDM_ERROR_BASE + 10
  99. #define ERROR_TOKEN_NOT_UNIQUE ISDM_ERROR_BASE + 11
  100. #define ERROR_NO_FREE_SESSIONS ISDM_ERROR_BASE + 12
  101. #define ERROR_SESSION_GET_FAIL ISDM_ERROR_BASE + 13
  102. #define ERROR_BAD_STAT_ARRAY ISDM_ERROR_BASE + 14
  103. #define ERROR_BAD_STAT_TOKEN ISDM_ERROR_BASE + 15
  104. #define ERROR_BAD_SESSION_NAME ISDM_ERROR_BASE + 16
  105. #define ERROR_NO_FREE_STATS ISDM_ERROR_BASE + 17
  106. #define ERROR_BAD_MODULE_NAME ISDM_ERROR_BASE + 18
  107. //token defines
  108. //RRCM
  109. #define RRCM_LOCAL_STREAM 1
  110. #define RRCM_REMOTE_STREAM 2
  111. #define ISDM_TOKEN_BASE 0x0000
  112. #define ISDM_CC_CODEC ISDM_TOKEN_BASE + 1
  113. #define ISDM_CC_REMOTE ISDM_TOKEN_BASE + 2
  114. #define ISDM_CC_LOCAL ISDM_TOKEN_BASE + 3
  115. #define ISDM_RRCM_BASE 0x1000
  116. #define ISDM_SSRC ISDM_RRCM_BASE + 1
  117. #define ISDM_NUM_PCKT_SENT ISDM_RRCM_BASE + 2
  118. #define ISDM_NUM_BYTES_SENT ISDM_RRCM_BASE + 3
  119. #define ISDM_FRACTION_LOST ISDM_RRCM_BASE + 4
  120. #define ISDM_CUM_NUM_PCKT_LOST ISDM_RRCM_BASE + 5
  121. #define ISDM_XTEND_HIGHEST_SEQ_NUM ISDM_RRCM_BASE + 6
  122. #define ISDM_INTERARRIVAL_JITTER ISDM_RRCM_BASE + 7
  123. #define ISDM_LAST_SR ISDM_RRCM_BASE + 8
  124. #define ISDM_DLSR ISDM_RRCM_BASE + 9
  125. #define ISDM_NUM_BYTES_RCVD ISDM_RRCM_BASE + 10
  126. #define ISDM_NUM_PCKT_RCVD ISDM_RRCM_BASE + 11
  127. #define ISDM_NTP_FRAC ISDM_RRCM_BASE + 12
  128. #define ISDM_NTP_SEC ISDM_RRCM_BASE + 13
  129. #define ISDM_WHO_AM_I ISDM_RRCM_BASE + 14
  130. #define ISDM_FDBK_FRACTION_LOST ISDM_RRCM_BASE + 15
  131. #define ISDM_FDBK_CUM_NUM_PCKT_LOST ISDM_RRCM_BASE + 16
  132. #define ISDM_FDBK_LAST_SR ISDM_RRCM_BASE + 17
  133. #define ISDM_FDBK_DLSR ISDM_RRCM_BASE + 18
  134. #define ISDM_FDBK_INTERARRIVAL_JITTER ISDM_RRCM_BASE + 19
  135. //
  136. //Supplier calls
  137. //
  138. //registration call
  139. //This call is made whenever a new session is desired. The session name passed in must be unique
  140. //across all sessions.
  141. extern DllExport HRESULT ISD_RegisterSession
  142. (
  143. LPMODULENAME pszModuleName, // module who owns session
  144. LPSESSIONNAME pszSessionName, // string name of new session to register
  145. LPSESSIONIDENT pszSessionIdent, // further level identifier for session
  146. LPHSTATSESSION phSession // return; handle to new session
  147. );
  148. //stat creation call
  149. //add 1+ stat item(s) to a session.
  150. extern DllExport HRESULT ISD_CreateStat
  151. (
  152. HSTATSESSION hSession, // handle to session
  153. LPSTAT pStatArray, // array of structs holding new stats to create
  154. WORD wNumItems // size of array(number of new stats)
  155. );
  156. //unregistration call
  157. //deletes a session and all associated stat structs
  158. extern DllExport HRESULT ISD_UnregisterSession
  159. (
  160. HSTATSESSION hSession // handle of session to remove
  161. );
  162. //stat deletion call
  163. //delete 1+ stat item(s) from a session
  164. extern DllExport HRESULT ISD_DeleteStat
  165. (
  166. HSTATSESSION hSession, // handle to session
  167. LPSTAT pStatArray, // array of structs
  168. WORD wNumItems // size of array(number of stats to remove)
  169. );
  170. //set stat data call
  171. extern DllExport HRESULT ISD_UpdateStat
  172. (
  173. HSTATSESSION hSession, // handle of session with stat item(s)
  174. LPSTAT pStatArray, // array of structs holding items to update
  175. WORD wNumItems // size of array(number of stats to update)
  176. );
  177. //
  178. //Consumer calls
  179. //
  180. //query calls
  181. //session query
  182. extern DllExport HRESULT ISD_GetFirstSession
  183. (
  184. LPMODULENAME pszModuleName, // module who owns session
  185. LPSESSIONNAME pszSessionName, // string name of new session to register
  186. LPSESSIONIDENT pszSessionIdent, // further level identifier for session
  187. LPHSTATSESSION phSession // return; the session handle or null if empty list
  188. );
  189. //GetNext uses hCurSession to determine the next item..returned in phNextSession
  190. extern DllExport HRESULT ISD_GetNextSession
  191. (
  192. HSTATSESSION hCurSession, // the current session handle
  193. LPMODULENAME pszModuleName, // module who owns session
  194. LPSESSIONNAME pszSessionName, // string name of new session to register
  195. LPSESSIONIDENT pszSessionIdent, // further level identifier for session
  196. LPHSTATSESSION phNextSession // return; the session handle or null if at the end
  197. );
  198. extern DllExport HRESULT ISD_GetNumSessions
  199. (
  200. WORD *wNumSessions // return; number of sessions
  201. );
  202. //stat query..retreive structs for the first time(get unique ids..initial values..etc)
  203. extern DllExport HRESULT ISD_GetFirstStat
  204. (
  205. HSTATSESSION hSession, // handle to session containing stat
  206. LPSTAT pStat // return; filled struct for first stat item
  207. );
  208. //pCurrentStat and pNextStat can be identical for saving memory.
  209. extern DllExport HRESULT ISD_GetNextStat
  210. (
  211. HSTATSESSION hSession, // handle to session containing stat
  212. LPSTAT pCurrentStat, // pointer to current stat item(for determining next)
  213. LPSTAT pNextStat // return; filled struct for next stat item
  214. );
  215. extern DllExport HRESULT ISD_GetNumStats
  216. (
  217. HSTATSESSION hSession, // what session we are interested in
  218. WORD *wNumStats // return; number of stats in session
  219. );
  220. //stat retreival
  221. extern DllExport HRESULT ISD_GetSessionStats
  222. (
  223. HSTATSESSION hSession, // what session we are interested in
  224. LPSTAT pStatArray, // return; array of structs holding items
  225. WORD wNumStats // return; number of items in session
  226. );
  227. //void StorePartofStat(LPSTAT pStat,LPCSTR szName,LPBYTE pValue,DWORD dwType);
  228. #ifdef __cplusplus
  229. } // End of extern "C" {
  230. #endif // __cplusplus
  231. #endif // ISDTAT.H