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.

114 lines
5.1 KiB

  1. /****************************************************************************/
  2. // asmdata.c
  3. //
  4. // SM constant global data
  5. //
  6. // Copyright (C) 1997-2000 Microsoft Corporation
  7. /****************************************************************************/
  8. #include <precomp.h>
  9. #pragma hdrstop
  10. #ifndef DC_INCLUDE_DATA
  11. #include <adcg.h>
  12. #endif
  13. #include <ndcgdata.h>
  14. #ifdef __cplusplus
  15. extern "C" {
  16. #endif /* __cplusplus */
  17. #include <asmint.h>
  18. /****************************************************************************/
  19. /* SM State table */
  20. /****************************************************************************/
  21. DC_CONST_DATA_2D_ARRAY(BYTE, smStateTable, SM_NUM_EVENTS, SM_NUM_STATES,
  22. DC_STRUCT12(
  23. /****************************************************************************/
  24. /* This state table simply shows which events are valid in which states. */
  25. /* */
  26. /* Values mean */
  27. /* */
  28. /* - 0 event OK in this state. */
  29. /* */
  30. /* - 1 warning - event should not occur in this state, but does in */
  31. /* some race conditions - ignore it. */
  32. /* */
  33. /* - 2 error - event should not occur in ths state at all. */
  34. /* */
  35. /* These values are hard-coded here in ordeer to make the table readable. */
  36. /* They correspond to the constants SM_TABLE_OK, SM_TABLE_WARN & */
  37. /* SM_TABLE_ERROR. */
  38. /****************************************************************************/
  39. /* The events and states are defined in asmint.h. The events are */
  40. /* prefixed with SM_EVT and the states are prefixed with SM_STATE */
  41. /* */
  42. /* Started */
  43. /* | Initialized */
  44. /* | | NM_Connecting */
  45. /* | | | SM_Connecting */
  46. /* | | | | Licensing */
  47. /* | | | | | Connected */
  48. /* | | | | | | SC_Registered */
  49. /* | | | | | | | Disconnecting */
  50. /* | | | | | | | | */
  51. /* 0 1 2 3 4 5 6 7 */
  52. /****************************************************************************/
  53. DC_STRUCT8( 0, 2, 2, 2, 2, 2, 2, 2 ), /* Init */
  54. DC_STRUCT8( 1, 0, 0, 0, 0, 0, 0, 0 ), /* Term */
  55. DC_STRUCT8( 2, 2, 2, 2, 2, 0, 0, 2 ), /* Register */
  56. DC_STRUCT8( 2, 0, 2, 2, 2, 2, 2, 2 ), /* Connect */
  57. DC_STRUCT8( 2, 2, 2, 0, 0, 0, 0, 2 ), /* Disconnect */
  58. DC_STRUCT8( 2, 2, 0, 2, 2, 2, 2, 2 ), /* Connected */
  59. DC_STRUCT8( 1, 1, 0, 0, 0, 0, 0, 0 ), /* Disconnected */
  60. DC_STRUCT8( 1, 1, 1, 1, 1, 1, 0, 1 ), /* Data Packet */
  61. DC_STRUCT8( 1, 1, 1, 0, 0, 1, 0, 1 ), /* Send Data */
  62. DC_STRUCT8( 2, 2, 2, 0, 2, 2, 2, 1 ), /* Security Packet */
  63. DC_STRUCT8( 2, 2, 2, 2, 0, 1, 1, 1 ), /* Licensing Packet */
  64. DC_STRUCT8( 2, 2, 2, 2, 2, 2, 0, 0 ) /* Alive */
  65. ));
  66. #ifdef DC_DEBUG
  67. /****************************************************************************/
  68. /* State and event descriptions (debug build only) */
  69. /****************************************************************************/
  70. DC_CONST_DATA_2D_ARRAY(char, smStateName, SM_NUM_STATES, 25,
  71. DC_STRUCT8(
  72. "SM_STATE_STARTED",
  73. "SM_STATE_INITIALIZED",
  74. "SM_STATE_NM_CONNECTING",
  75. "SM_STATE_SM_CONNECTING",
  76. "SM_STATE_SM_LICENSING",
  77. "SM_STATE_CONNECTED",
  78. "SM_STATE_SC_REGISTERED",
  79. "SM_STATE_DISCONNECTING"
  80. ) );
  81. DC_CONST_DATA_2D_ARRAY(char, smEventName, SM_NUM_EVENTS, 35,
  82. DC_STRUCT12(
  83. "SM_EVT_INIT",
  84. "SM_EVT_TERM",
  85. "SM_EVT_REGISTER",
  86. "SM_EVT_CONNECT",
  87. "SM_EVT_DISCONNECT",
  88. "SM_EVT_CONNECTED",
  89. "SM_EVT_DISCONNECTED",
  90. "SM_EVT_DATA_PACKET",
  91. "SM_EVT_ALLOC/FREE/SEND",
  92. "SM_EVT_SEC_PACKET",
  93. "SM_EVT_LIC_PACKET",
  94. "SM_EVT_ALIVE"
  95. ) );
  96. #endif /* DC_DEBUG */
  97. #ifdef __cplusplus
  98. }
  99. #endif /* __cplusplus */