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.

182 lines
7.6 KiB

  1. /****************************************************************************/
  2. // ascdata.c
  3. //
  4. // Share Controller data.
  5. //
  6. // Copyright (C) 1997-2000 Microsoft Corporation
  7. /****************************************************************************/
  8. #include <ndcgdata.h>
  9. // The current state.
  10. DC_DATA(unsigned, scState, SCS_STARTED);
  11. // Array of information about the parties in the share, indexed by localID.
  12. DC_DATA_ARRAY_NULL(SC_PARTY_INFO, scPartyArray, SC_DEF_MAX_PARTIES, NULL);
  13. // The number of parties in the current share, including the local party.
  14. DC_DATA(unsigned, scNumberInShare, 0);
  15. // Fastpath input/output for SC_NetworkIDToLocalID().
  16. DC_DATA(NETPERSONID, scLastNetID, 0);
  17. DC_DATA(LOCALPERSONID, scLastLocID, 0);
  18. // User ID, Share ID & Share generation number.
  19. DC_DATA(UINT32, scUserID, 0);
  20. DC_DATA(UINT32, scShareID, 0);
  21. DC_DATA(UINT32, scGeneration, 0);
  22. // SM Handle.
  23. DC_DATA(PVOID, scPSMHandle, NULL);
  24. // Local SC data that indicates if client supports no BC header or not.
  25. DC_DATA(UINT16, scNoBitmapCompressionHdr, TS_EXTRA_NO_BITMAP_COMPRESSION_HDR);
  26. // Whether all clients and server support fast-path output.
  27. DC_DATA(BOOLEAN, scUseFastPathOutput, FALSE);
  28. // Whether compression will be used during shadow
  29. DC_DATA(BOOLEAN, scUseShadowCompression, FALSE);
  30. // Whether Clients support long credentials (Username, domain and password)
  31. DC_DATA(BOOLEAN, scUseLongCredentials, FALSE);
  32. // Whether we should send periodic autoreconnect cookie updates (only when
  33. // other data is being sent)
  34. DC_DATA(BOOLEAN, scEnablePeriodicArcUpdate, FALSE);
  35. // Whether autoreconnect is enabled (Iff capabilities and policy say it's ok)
  36. DC_DATA(BOOLEAN, scUseAutoReconnect, FALSE);
  37. // Compression-used flag value and size of the compression flags field
  38. // (0 or 1) that will be used when creating fast-path output update PDUs.
  39. DC_DATA(BYTE, scCompressionUsedValue, TS_OUTPUT_FASTPATH_COMPRESSION_USED);
  40. // Size for update order packaging code to reserve for headers -- different
  41. // based on whether we're using fast-path output and whther compression is
  42. // in use.
  43. DC_DATA(unsigned, scUpdatePDUHeaderSpace, 0);
  44. // MPPC compressor compression ratio tallies.
  45. DC_DATA(unsigned, scMPPCCompTotal, 0);
  46. DC_DATA(unsigned, scMPPCUncompTotal, 0);
  47. // Default OutBuf allocation sizes and usable space.
  48. DC_DATA(unsigned, sc8KOutBufUsableSpace, 0);
  49. DC_DATA(unsigned, sc16KOutBufUsableSpace, 0);
  50. // The SC state table.
  51. DC_CONST_DATA_2D_ARRAY(BYTE, scStateTable, SC_NUM_EVENTS, SC_NUM_STATES,
  52. DC_STRUCT17(
  53. /****************************************************************************/
  54. /* This state table simply shows which events are valid in which states. */
  55. /* */
  56. /* Values mean */
  57. /* */
  58. /* - 0 event OK in this state. */
  59. /* */
  60. /* - 1 warning - event should not occur in this state, but does in */
  61. /* some race conditions - ignore it. */
  62. /* */
  63. /* - 2 error - event should not occur in ths state at all. */
  64. /* */
  65. /* These values are hard-coded here in ordeer to make the table readable. */
  66. /* They correspond to the constants SC_TABLE_OK, SC_TABLE_WARN & */
  67. /* SC_TABLE_ERROR. */
  68. /****************************************************************************/
  69. /* The events and states are defined in ascint.h. The events are */
  70. /* prefixed with SCE and the states are prefixed with SCS */
  71. /* */
  72. /* Started */
  73. /* | Initialized */
  74. /* | | ShareStarting */
  75. /* | | | InShare */
  76. /* | | | | */
  77. /* 0 1 2 3 */
  78. /****************************************************************************/
  79. DC_STRUCT4( 0, 2, 2, 2 ), /* INIT */
  80. DC_STRUCT4( 2, 0, 0, 0 ), /* TERM */
  81. DC_STRUCT4( 1, 0, 1, 1 ), /* CREATE_SHARE */
  82. DC_STRUCT4( 2, 1, 0, 0 ), /* END_SHARE */
  83. DC_STRUCT4( 2, 2, 0, 0 ), /* CONFIRM_ACTIVE */
  84. DC_STRUCT4( 1, 1, 1, 0 ), /* DETACH_USER */
  85. DC_STRUCT4( 2, 2, 2, 0 ), /* INITIATESYNC */
  86. DC_STRUCT4( 2, 1, 0, 0 ), /* CONTROLPACKET */
  87. DC_STRUCT4( 2, 1, 1, 0 ), /* DATAPACKET */
  88. DC_STRUCT4( 2, 2, 0, 0 ), /* GETMYNETWORKPERSONID */
  89. DC_STRUCT4( 2, 1, 1, 0 ), /* GETREMOTEPERSONDETAILS */
  90. DC_STRUCT4( 2, 1, 1, 0 ), /* GETLOCALPERSONDETAILS */
  91. DC_STRUCT4( 2, 1, 1, 0 ), /* PERIODIC */
  92. DC_STRUCT4( 2, 2, 0, 0 ), /* LOCALIDTONETWORKID */
  93. DC_STRUCT4( 2, 2, 0, 0 ), /* NETWORKIDTOLOCALID */
  94. DC_STRUCT4( 2, 1, 0, 0 ), /* ISLOCALPERSONID */
  95. DC_STRUCT4( 2, 1, 0, 0 ) /* ISNETWORKPERSONID */
  96. ));
  97. #ifdef DC_DEBUG
  98. // State and event descriptions (debug build only).
  99. DC_CONST_DATA_2D_ARRAY(char, scStateName, SC_NUM_STATES, 25,
  100. DC_STRUCT4(
  101. "SCS_STARTED",
  102. "SCS_INITED",
  103. "SCS_SHARE_STARTING",
  104. "SCS_IN_SHARE") );
  105. DC_CONST_DATA_2D_ARRAY(char, scEventName, SC_NUM_EVENTS, 35,
  106. DC_STRUCT17(
  107. "SCE_INIT",
  108. "SCE_TERM",
  109. "SCE_CREATE_SHARE",
  110. "SCE_END_SHARE",
  111. "SCE_CONFIRM_ACTIVE",
  112. "SCE_DETACH_USER",
  113. "SCE_INITIATESYNC",
  114. "SCE_CONTROLPACKET",
  115. "SCE_DATAPACKET",
  116. "SCE_GETMYNETWORKPERSONID",
  117. "SCE_GETREMOTEPERSONDETAILS",
  118. "SCE_GETLOCALPERSONDETAILS",
  119. "SCE_PERIODIC",
  120. "SCE_LOCALIDTONETWORKID",
  121. "SCE_NETWORKIDTOLOCALID",
  122. "SCE_ISLOCALPERSONID",
  123. "SCE_ISNETWORKPERSONID") );
  124. // Packet descriptions (debug only).
  125. DC_CONST_DATA_2D_ARRAY(char, scPktName, 26, 42,
  126. DC_STRUCT26(
  127. "Unknown",
  128. "TS_PDUTYPE2_UPDATE",
  129. "TS_PDUTYPE2_FONT",
  130. "TS_PDUTYPE2_CONTROL",
  131. "TS_PDUTYPE2_WINDOWACTIVATION",
  132. "TS_PDUTYPE2_WINDOWLISTUPDATE",
  133. "TS_PDUTYPE2_APPLICATION",
  134. "TS_PDUTYPE2_DESKTOP_SCROLL",
  135. "TS_PDUTYPE2_MEDIATEDCONTROL",
  136. "TS_PDUTYPE2_INPUT",
  137. "TS_PDUTYPE2_MEDIATEDCONTROL",
  138. "TS_PDUTYPE2_REMOTESHARE",
  139. "TS_PDUTYPE2_SYNCHRONIZE",
  140. "TS_PDUTYPE2_UPDATECAPABILITY",
  141. "TS_PDUTYPE2_REFRESH_RECT",
  142. "TS_PDUTYPE2_PLAY_BEEP",
  143. "TS_PDUTYPE2_SUPPRESS_OUTPUT",
  144. "TS_PDUTYPE2_SHUTDOWN_REQUEST",
  145. "TS_PDUTYPE2_SHUTDOWN_DENIED",
  146. "TS_PDUTYPE2_SAVE_SESSION_INFO",
  147. "TS_PDUTYPE2_FONTLIST",
  148. "TS_PDUTYPE2_FONTMAP",
  149. "TS_PDUTYPE2_SET_KEYBOARD_INDICATORS",
  150. "TS_PDUTYPE2_CLIP",
  151. "TS_PDUTYPE2_BITMAPCACHE_PERSISTENT_LIST",
  152. "TS_PDUTYPE2_BITMAPCACHE_ERROR_PDU"
  153. ));
  154. #endif /* DC_DEBUG */