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.

302 lines
8.0 KiB

  1. //
  2. // DC-Share Stuff
  3. //
  4. #ifndef _H_DCS
  5. #define _H_DCS
  6. //
  7. // RESOURCES
  8. //
  9. #include <resource.h>
  10. //
  11. // We piggyback some extra flags into the ExtTextOut options. We must
  12. // ensure that we dont clash with the Windows defined ones.
  13. //
  14. #define ETO_WINDOWS (0x0001 | ETO_OPAQUE | ETO_CLIPPED)
  15. #define ETO_LPDX 0x8000U
  16. //
  17. // Debugging Options (also in retail)
  18. //
  19. // NOTE: THESE MUST STAY IN SYNC WITH WHAT'S in \ui\conf\dbgmenu.*
  20. //
  21. // View one's own shared stuff in a frame to see what others are getting
  22. #define VIEW_INI_VIEWSELF "ViewOwnSharedStuff"
  23. // Hatch the areas sent as screen data from the host when viewing them
  24. #define USR_INI_HATCHSCREENDATA "HatchScreenData"
  25. // Hatch the areas sent as bitmap orders from the host when viewing them
  26. #define USR_INI_HATCHBMPORDERS "HatchBitmapOrders"
  27. // Turn off flow control
  28. #define S20_INI_NOFLOWCONTROL "NoFlowControl"
  29. // Turn off OM compression
  30. #define OM_INI_NOCOMPRESSION "NoOMCompression"
  31. //
  32. // Change compression type (bunch of bit flags)
  33. // 0x0000 (CT_NONE) is no compression
  34. // 0x0001 (CT_PKZIP) is non-persistent dictionary PKZIP
  35. // 0x0002 (CT_PERSIST_PKZIP) is persistent dictionary PKZIP
  36. //
  37. // Default value is 0x0003 (pkzip + persist pkzip)
  38. //
  39. #define GDC_INI_COMPRESSION "GDCCompression"
  40. //
  41. // Change 2nd level order encoding (bunch of bitflags)
  42. // 0x0001 (CAPS_ENCODING_BASE_OE)
  43. // 0x0002 (CAPS_ENCODING_OE2_NEGOTIABLE)
  44. // 0x0004 (CAPS_ENCODING_OE2_DISABLED)
  45. // 0x0008 (CAPS_ENCODING_ALIGNED_OE)
  46. //
  47. // Default value is 0x0002
  48. // To turn off 2nd level encoding, use 0x0006 (negotiable + disabled)
  49. //
  50. #define OE2_INI_2NDORDERENCODING "2ndLevelOrderEncoding"
  51. //
  52. // Speedy link constant
  53. //
  54. #define DCS_FAST_THRESHOLD 50000
  55. //
  56. // We will not compress packets smaller than this, whatever the link speed
  57. //
  58. #define DCS_MIN_COMPRESSABLE_PACKET 256
  59. //
  60. // We will not compress packets smaller than this on a fast link
  61. // NOTE that is is the largest single T.120 preallocated packet size.
  62. //
  63. #define DCS_MIN_FAST_COMPRESSABLE_PACKET 8192
  64. //
  65. // We will not try to persistently compress packets larger than this
  66. //
  67. #define DCS_MAX_PDC_COMPRESSABLE_PACKET 4096
  68. //
  69. // Frequency (ms) with which the core performs timer tasks
  70. //
  71. // VOLUME_SAMPLE is the time beyond which we will take another sample of
  72. // the bounds accumulation data. If the screendata accumulated in this
  73. // time is less than BOUNDS_ACCUM then we will try and send it immediately
  74. // otherwise we wait until the orders have slowed down.
  75. //
  76. // UPDATE_PERIOD is the absolute maximum time between attempts to send data
  77. //
  78. // ANIMATION_SLOWDOWN id how many times we attempt to send mem-scrn blits
  79. // over a PSTN connection.
  80. //
  81. // ANIMATION_DETECTION the interval, in mS, below which we determine the
  82. // app is performing animation. Must be low otherwise we slowdown during
  83. // rapid typing. The algorithm simply looks for repeated memblts to the
  84. // same area
  85. //
  86. // DCS_ORDERS_TURNOFF_FREQUENCY
  87. // The frequency of orders above which we start time slicing order
  88. // transmission in order to give the host system a chance to draw the
  89. // orders without having to send them in individual network packets.
  90. //
  91. // DCS_BOUNDS_TURNOFF_RATE
  92. // Very important for performance of typing in Word that this value is not
  93. // too low, since Word can generate 50K per keystroke. On the other hand,
  94. // it is important not to allow the capture of screendata until after an
  95. // app that does a lot of blitting to the screen has finished.
  96. //
  97. // DCS_BOUNDS_IMMEDIATE_RATE
  98. // To avoid sending excessive amounts of screendata we only send at the
  99. // most ten times per second. However, if the volumes are small then we
  100. // override this to reduce latency
  101. //
  102. //
  103. // The other rates control individual timer functions - see adcsapi.c for
  104. // further details
  105. // Note that the IM period is less than the likely rate of this function
  106. // being scheduled. This is set low so that we will, in general, call IM
  107. // periodic every time to keep mouse moves flowing, but it will not be
  108. // called repeatedly if there are several wakeups pending within a single
  109. // scheduling cycle.
  110. //
  111. //
  112. #define DCS_VOLUME_SAMPLE 500
  113. #define DCS_BOUNDS_TURNOFF_RATE 400000
  114. #define DCS_BOUNDS_IMMEDIATE_RATE 100000
  115. #define DCS_ORDERS_TURNOFF_FREQUENCY 100
  116. #define DCS_SD_UPDATE_SHORT_PERIOD 100
  117. #define DCS_SD_UPDATE_LONG_PERIOD 5000
  118. #define DCS_ORDER_UPDATE_PERIOD 100
  119. #define DCS_FAST_MISC_PERIOD 200
  120. #define DCS_IM_PERIOD 80
  121. //
  122. // Special Messages to synchronize APIs etc.
  123. //
  124. #if defined(DLL_CORE) || defined(DLL_HOOK)
  125. #define DCS_FIRST_MSG WM_APP
  126. enum
  127. {
  128. DCS_FINISH_INIT_MSG = DCS_FIRST_MSG,
  129. DCS_PERIODIC_SCHEDULE_MSG,
  130. DCS_KILLSHARE_MSG,
  131. DCS_SHARE_MSG,
  132. DCS_UNSHARE_MSG,
  133. DCS_NEWTOPLEVEL_MSG,
  134. DCS_RECOUNTTOPLEVEL_MSG,
  135. DCS_TAKECONTROL_MSG,
  136. DCS_CANCELTAKECONTROL_MSG,
  137. DCS_RELEASECONTROL_MSG,
  138. DCS_PASSCONTROL_MSG,
  139. DCS_ALLOWCONTROL_MSG,
  140. DCS_GIVECONTROL_MSG,
  141. DCS_CANCELGIVECONTROL_MSG,
  142. DCS_REVOKECONTROL_MSG,
  143. DCS_PAUSECONTROL_MSG
  144. };
  145. #endif // DLL_CORE or DLL_HOOK
  146. //
  147. //
  148. // PROTOTYPES
  149. //
  150. //
  151. BOOL DCS_Init(void);
  152. void DCS_FinishInit(void);
  153. void DCS_Term(void);
  154. //
  155. // DCS_NotifyUI()
  156. //
  157. // DESCRIPTION:
  158. // Called by app sharing to notify the front end of various changes and
  159. // actions.
  160. //
  161. void DCS_NotifyUI(UINT event, UINT parm1, UINT parm2);
  162. void DCSLocalDesktopSizeChanged( UINT width, UINT height );
  163. #define DCS_MAIN_WINDOW_CLASS "AS_MainWindow"
  164. LRESULT CALLBACK DCSMainWndProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam);
  165. #define SHP_POLICY_NOAPPSHARING 0x0001
  166. #define SHP_POLICY_NOSHARING 0x0002
  167. #define SHP_POLICY_NODOSBOXSHARE 0x0004
  168. #define SHP_POLICY_NOEXPLORERSHARE 0x0008
  169. #define SHP_POLICY_SHAREMASK (SHP_POLICY_NODOSBOXSHARE | SHP_POLICY_NOEXPLORERSHARE)
  170. #define SHP_POLICY_NODESKTOPSHARE 0x0010
  171. #define SHP_POLICY_NOTRUECOLOR 0x0020
  172. #define SHP_POLICY_NOCONTROL 0x2000
  173. #define SHP_POLICY_NOOLDWHITEBOARD 0x8000
  174. #define SHP_SETTING_TRUECOLOR 0x0001
  175. //
  176. // EVENTS
  177. //
  178. enum
  179. {
  180. SH_EVT_APPSHARE_READY = SPI_BASE_EVENT,
  181. SH_EVT_SHARE_STARTED,
  182. SH_EVT_SHARING_STARTED,
  183. SH_EVT_SHARE_ENDED,
  184. SH_EVT_PERSON_JOINED,
  185. SH_EVT_PERSON_LEFT,
  186. SH_EVT_CONTROLLABLE,
  187. SH_EVT_STARTCONTROLLED,
  188. SH_EVT_STOPCONTROLLED,
  189. SH_EVT_PAUSEDCONTROLLED,
  190. SH_EVT_UNPAUSEDCONTROLLED,
  191. SH_EVT_STARTINCONTROL,
  192. SH_EVT_STOPINCONTROL,
  193. SH_EVT_PAUSEDINCONTROL,
  194. SH_EVT_UNPAUSEDINCONTROL
  195. };
  196. //
  197. // Function PROTOTYPES
  198. //
  199. #if defined(DLL_CORE)
  200. #include <ias.h>
  201. HRESULT SHP_GetPersonStatus(UINT dwID, IAS_PERSON_STATUS * pStatus);
  202. #define SHP_DESKTOP_PROCESS 0xFFFFFFFF
  203. HRESULT SHP_LaunchHostUI(void);
  204. BOOL SHP_Share(HWND hwnd, IAS_SHARE_TYPE uType);
  205. HRESULT SHP_Unshare(HWND hwnd);
  206. //
  207. // COLLABORATION
  208. //
  209. HRESULT SHP_TakeControl(IAS_GCC_ID PersonOf);
  210. HRESULT SHP_CancelTakeControl(IAS_GCC_ID PersonOf);
  211. HRESULT SHP_ReleaseControl(IAS_GCC_ID PersonOf);
  212. HRESULT SHP_PassControl(IAS_GCC_ID PersonOf, UINT PersonTo);
  213. HRESULT SHP_AllowControl(BOOL fAllow);
  214. HRESULT SHP_GiveControl(IAS_GCC_ID PersonTo);
  215. HRESULT SHP_CancelGiveControl(IAS_GCC_ID PersonTo);
  216. HRESULT SHP_RevokeControl(IAS_GCC_ID PersonTo);
  217. HRESULT SHP_PauseControl(IAS_GCC_ID PersonControlledBy, BOOL fPaused);
  218. void DCS_Share(HWND hwnd, IAS_SHARE_TYPE uType);
  219. void DCS_Unshare(HWND hwnd);
  220. #endif // DLL_CORE
  221. #endif // _H_DCS