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.

102 lines
3.2 KiB

  1. /***********************************************************************
  2. * *
  3. * Filename: fsminit.c *
  4. * Module: H245 Finite State Machine Subsystem *
  5. * *
  6. ***********************************************************************
  7. * INTEL Corporation Proprietary 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) 1996 Intel Corporation. All rights reserved. *
  14. ***********************************************************************
  15. * *
  16. * $Workfile: FSMINIT.C $
  17. * $Revision: 1.2 $
  18. * $Modtime: 09 Dec 1996 13:34:24 $
  19. * $Log: S:/STURGEON/SRC/H245/SRC/VCS/FSMINIT.C_v $
  20. *
  21. * Rev 1.2 09 Dec 1996 13:34:38 EHOWARDX
  22. * Updated copyright notice.
  23. *
  24. * Rev 1.1 29 May 1996 15:20:16 EHOWARDX
  25. * Change to use HRESULT.
  26. *
  27. * Rev 1.0 09 May 1996 21:06:16 EHOWARDX
  28. * Initial revision.
  29. *
  30. * Rev 1.11.1.3 09 May 1996 19:48:42 EHOWARDX
  31. * Change TimerExpiryF function arguements.
  32. *
  33. * Rev 1.11.1.2 15 Apr 1996 10:46:12 EHOWARDX
  34. * Update.
  35. *
  36. * Rev 1.11.1.1 10 Apr 1996 21:15:38 EHOWARDX
  37. * Check-in for safety in middle of re-design.
  38. *
  39. * Rev 1.11.1.0 05 Apr 1996 12:32:40 EHOWARDX
  40. * Branched.
  41. * *
  42. ***********************************************************************/
  43. #include "precomp.h"
  44. #include "h245api.h"
  45. #include "h245com.h"
  46. #include "h245fsm.h"
  47. /*
  48. * NAME
  49. * Fsm_init - allocate and initialize memory for FSM instance
  50. *
  51. *
  52. * PARAMETERS
  53. * INPUT dwInst current instance
  54. *
  55. * RETURN VALUE
  56. * H245_ERROR_OK function succeeded
  57. * H245_ERROR_ALREADY_INIT FSM instance exists for specified dwInst
  58. */
  59. HRESULT
  60. Fsm_init(struct InstanceStruct *pInstance)
  61. {
  62. pInstance->StateMachine.sv_STATUS = INDETERMINATE;
  63. return H245_ERROR_OK;
  64. }
  65. /*
  66. * NAME
  67. * Fsm_shutdown - cleanup FSM instance and deallocate instance memory
  68. *
  69. *
  70. * PARAMETERS
  71. * INPUT dwInst current instance
  72. *
  73. * RETURN VALUE
  74. * H245_ERROR_OK function succeeded
  75. * H245_ERROR_INVALID_INST on FSM instance exists for specified dwInst
  76. */
  77. HRESULT
  78. Fsm_shutdown(struct InstanceStruct *pInstance)
  79. {
  80. register int i;
  81. for (i = 0; i < NUM_ENTITYS; ++i)
  82. {
  83. while (pInstance->StateMachine.Object_tbl[i])
  84. {
  85. H245TRACE(pInstance->dwInst, 2, "Fsm_shutdown: deallocating state entity %d", i);
  86. ObjectDestroy(pInstance->StateMachine.Object_tbl[i]);
  87. }
  88. }
  89. return H245_ERROR_OK;
  90. } // Fsm_shutdown()