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.

191 lines
5.8 KiB

  1. /******************************************************************************
  2. *
  3. * INTEL Corporation Proprietary Information
  4. * Copyright (c) 1994, 1995, 1996 Intel Corporation.
  5. *
  6. * This listing is supplied under the terms of a license agreement
  7. * with INTEL Corporation and may not be used, copied, nor disclosed
  8. * except in accordance with the terms of that agreement.
  9. *
  10. *****************************************************************************/
  11. /******************************************************************************
  12. *
  13. * $Workfile: h245com.h $
  14. * $Revision: 1.6 $
  15. * $Modtime: Mar 04 1997 17:38:42 $
  16. * $Log: S:/STURGEON/SRC/H245/INCLUDE/VCS/h245com.h_v $
  17. *
  18. * Rev 1.6 Mar 04 1997 17:53:24 tomitowx
  19. * process detach fix
  20. *
  21. * Rev 1.5 12 Dec 1996 15:53:48 EHOWARDX
  22. *
  23. * Master Slave Determination kludge.
  24. *
  25. * Rev 1.4 10 Jun 1996 16:51:20 EHOWARDX
  26. * Added Configuration parameter to InstanceCreate().
  27. *
  28. * Rev 1.3 04 Jun 1996 13:24:38 EHOWARDX
  29. * Fixed warnings in Release build.
  30. *
  31. * Rev 1.2 29 May 1996 15:21:30 EHOWARDX
  32. * No change.
  33. *
  34. * Rev 1.1 28 May 1996 14:10:00 EHOWARDX
  35. * Tel Aviv update.
  36. *
  37. * Rev 1.0 09 May 1996 21:04:48 EHOWARDX
  38. * Initial revision.
  39. *
  40. * Rev 1.17 09 May 1996 19:38:10 EHOWARDX
  41. * Redesigned locking logic and added new functionality.
  42. *
  43. * Rev 1.16 04 Apr 1996 18:06:30 cjutzi
  44. * - added shutdown lock
  45. *
  46. * Rev 1.15 26 Mar 1996 13:39:56 cjutzi
  47. * - fixed ASSERT warning message
  48. *
  49. * Rev 1.14 26 Mar 1996 13:24:26 cjutzi
  50. *
  51. * - added pragma for release code.. to disable warning messages
  52. * from H245TRACE
  53. *
  54. * Rev 1.13 26 Mar 1996 09:49:34 cjutzi
  55. *
  56. * - ok.. Added Enter&Leave&Init&Delete Critical Sections for Ring 0
  57. *
  58. * Rev 1.12 26 Mar 1996 08:40:44 cjutzi
  59. *
  60. *
  61. * Rev 1.11 25 Mar 1996 17:54:44 cjutzi
  62. *
  63. * - broke build.. backstep
  64. *
  65. * Rev 1.10 25 Mar 1996 17:21:32 cjutzi
  66. *
  67. * - added h245sys.x to the global includes for the enter critical
  68. * section stuff
  69. *
  70. * Rev 1.9 18 Mar 1996 09:14:10 cjutzi
  71. *
  72. * - sorry.. removed timer lock.. not needed.
  73. *
  74. * Rev 1.8 18 Mar 1996 08:48:38 cjutzi
  75. * - added timer lock
  76. *
  77. * Rev 1.7 13 Mar 1996 14:08:20 cjutzi
  78. * - removed ASSERT when NDEBUG is defined
  79. *
  80. *
  81. * Rev 1.6 13 Mar 1996 09:50:16 dabrown1
  82. * added winspox.h for CRITICAL_SECTION definition
  83. *
  84. * Rev 1.5 12 Mar 1996 15:48:24 cjutzi
  85. *
  86. * - added instance table lock
  87. *
  88. * Rev 1.4 28 Feb 1996 09:36:22 cjutzi
  89. *
  90. * - added ossGlobal p_ossWorld for debug PDU tracing and PDU verification
  91. *
  92. * Rev 1.3 21 Feb 1996 12:18:52 EHOWARDX
  93. * Added parenthesis around n in H245ASSERT() macro.
  94. * Note: Logical not (!) has higher operator precedence than equal/not equal
  95. * (== or !=). Therefore, in many places this ASSERT was not acting as the
  96. * author intended. It is always a good idea to fully parenthesize expressions
  97. * in macros!
  98. *
  99. * Rev 1.2 09 Feb 1996 16:19:52 cjutzi
  100. *
  101. * - Added export InstanceTbl to module.. from h245init.x
  102. * - added trace
  103. * - added Assert define's
  104. * $Ident$
  105. *
  106. *****************************************************************************/
  107. #ifndef _H245COM_H_
  108. #define _H245COM_H_
  109. #include "h245api.h"
  110. #include "h245sys.x" /* critical section stuff */
  111. #include "api.h" /* api includes */
  112. #include "sendrcv.x"
  113. #include "h245fsm.h"
  114. #ifndef OIL
  115. # define RESULT unsigned long
  116. #endif
  117. void H245Panic (LPSTR, int);
  118. #ifndef NDEBUG
  119. #define H245PANIC() { H245Panic(__FILE__,__LINE__); }
  120. #else
  121. #define H245PANIC()
  122. #endif
  123. /*
  124. * Trace Level Definitions:
  125. *
  126. * 0 - no trace on at all
  127. * 1 - only errors
  128. * 2 - PDU tracking
  129. * 3 - PDU and SendReceive packet tracing
  130. * 4 - Main API Module level tracing
  131. * 5 - Inter Module level tacing #1
  132. * 6 - Inter Module level tacing #2
  133. * 7 - <Undefined>
  134. * 8 - <Undefined>
  135. * 9 - <Undefined>
  136. * 10- and above.. free for all
  137. */
  138. #ifndef NDEBUG
  139. void H245TRACE (H245_INST_T inst, DWORD level, LPSTR format, ...);
  140. #else
  141. /* disable H245TRACE warning message too may parameters for macro */
  142. #pragma warning (disable:4002)
  143. #define H245TRACE()
  144. #endif
  145. #define MAXINST 16
  146. extern DWORD TraceLevel;
  147. typedef struct TimerList
  148. {
  149. struct TimerList * pNext;
  150. void * pContext;
  151. H245TIMERCALLBACK pfnCallBack;
  152. DWORD dwAlarm;
  153. } TimerList_T;
  154. typedef struct InstanceStruct
  155. {
  156. DWORD dwPhysId; // Physical Identifier
  157. DWORD dwInst; // H.245 client instance Identifier
  158. H245_CONFIG_T Configuration; // Client type
  159. ASN1_CODER_INFO *pWorld; // Context for ASN.1 encode/decode
  160. /* context for subsystems */
  161. API_STRUCT_T API; // API subsystem substructure
  162. hSRINSTANCE SendReceive; // Send/Receive subsystem substructure
  163. Fsm_Struct_t StateMachine; // State Machine subsystem substructure
  164. TimerList_T *pTimerList; // Linked list of running timeout timers
  165. char fDelete; // TRUE to delete instance
  166. char LockCount; // Nested critical section count
  167. char bMasterSlaveKludge; // TRUE if remote is same version
  168. char bReserved;
  169. };
  170. struct InstanceStruct * InstanceCreate(DWORD dwPhysId, H245_CONFIG_T Configuration);
  171. struct InstanceStruct * InstanceLock(H245_INST_T dwInst);
  172. int InstanceUnlock(struct InstanceStruct *pInstance);
  173. int InstanceDelete(struct InstanceStruct *pInstance);
  174. int InstanceUnlock_ProcessDetach(struct InstanceStruct *pInstance, BOOL fProcessDetach);
  175. BOOL H245SysInit();
  176. VOID H245SysDeInit();
  177. #endif /* _H245COM_H_ */