Source code of Windows XP (NT5)
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.

274 lines
6.7 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. //
  30. // Change compression type (bunch of bit flags)
  31. // 0x0000 (CT_NONE) is no compression
  32. // 0x0001 (CT_PKZIP) is non-persistent dictionary PKZIP
  33. // 0x0002 (CT_PERSIST_PKZIP) is persistent dictionary PKZIP
  34. //
  35. // Default value is 0x0003 (pkzip + persist pkzip)
  36. //
  37. #define GDC_INI_COMPRESSION "GDCCompression"
  38. //
  39. // Change 2nd level order encoding (bunch of bitflags)
  40. // 0x0001 (CAPS_ENCODING_BASE_OE)
  41. // 0x0002 (CAPS_ENCODING_OE2_NEGOTIABLE)
  42. // 0x0004 (CAPS_ENCODING_OE2_DISABLED)
  43. // 0x0008 (CAPS_ENCODING_ALIGNED_OE)
  44. //
  45. // Default value is 0x0002
  46. // To turn off 2nd level encoding, use 0x0006 (negotiable + disabled)
  47. //
  48. #define OE2_INI_2NDORDERENCODING "2ndLevelOrderEncoding"
  49. //
  50. // Speedy link constant
  51. //
  52. #define DCS_FAST_THRESHOLD 50000
  53. //
  54. // We will not compress packets smaller than this, whatever the link speed
  55. //
  56. #define DCS_MIN_COMPRESSABLE_PACKET 256
  57. //
  58. // We will not compress packets smaller than this on a fast link
  59. // NOTE that is is the largest single T.120 preallocated packet size.
  60. //
  61. #define DCS_MIN_FAST_COMPRESSABLE_PACKET 8192
  62. //
  63. // We will not try to persistently compress packets larger than this
  64. //
  65. #define DCS_MAX_PDC_COMPRESSABLE_PACKET 4096
  66. //
  67. // Frequency (ms) with which the core performs timer tasks
  68. //
  69. // VOLUME_SAMPLE is the time beyond which we will take another sample of
  70. // the bounds accumulation data. If the screendata accumulated in this
  71. // time is less than BOUNDS_ACCUM then we will try and send it immediately
  72. // otherwise we wait until the orders have slowed down.
  73. //
  74. // UPDATE_PERIOD is the absolute maximum time between attempts to send data
  75. //
  76. // ANIMATION_SLOWDOWN id how many times we attempt to send mem-scrn blits
  77. // over a PSTN connection.
  78. //
  79. // ANIMATION_DETECTION the interval, in mS, below which we determine the
  80. // app is performing animation. Must be low otherwise we slowdown during
  81. // rapid typing. The algorithm simply looks for repeated memblts to the
  82. // same area
  83. //
  84. // DCS_ORDERS_TURNOFF_FREQUENCY
  85. // The frequency of orders above which we start time slicing order
  86. // transmission in order to give the host system a chance to draw the
  87. // orders without having to send them in individual network packets.
  88. //
  89. // DCS_BOUNDS_TURNOFF_RATE
  90. // Very important for performance of typing in Word that this value is not
  91. // too low, since Word can generate 50K per keystroke. On the other hand,
  92. // it is important not to allow the capture of screendata until after an
  93. // app that does a lot of blitting to the screen has finished.
  94. //
  95. // DCS_BOUNDS_IMMEDIATE_RATE
  96. // To avoid sending excessive amounts of screendata we only send at the
  97. // most ten times per second. However, if the volumes are small then we
  98. // override this to reduce latency
  99. //
  100. //
  101. // The other rates control individual timer functions - see adcsapi.c for
  102. // further details
  103. // Note that the IM period is less than the likely rate of this function
  104. // being scheduled. This is set low so that we will, in general, call IM
  105. // periodic every time to keep mouse moves flowing, but it will not be
  106. // called repeatedly if there are several wakeups pending within a single
  107. // scheduling cycle.
  108. //
  109. //
  110. #define DCS_VOLUME_SAMPLE 500
  111. #define DCS_BOUNDS_TURNOFF_RATE 400000
  112. #define DCS_BOUNDS_IMMEDIATE_RATE 100000
  113. #define DCS_ORDERS_TURNOFF_FREQUENCY 100
  114. #define DCS_SD_UPDATE_SHORT_PERIOD 100
  115. #define DCS_SD_UPDATE_LONG_PERIOD 5000
  116. #define DCS_ORDER_UPDATE_PERIOD 100
  117. #define DCS_FAST_MISC_PERIOD 200
  118. #define DCS_IM_PERIOD 80
  119. //
  120. // Special Messages to synchronize APIs etc.
  121. //
  122. #if defined(DLL_CORE) || defined(DLL_HOOK)
  123. #define DCS_FIRST_MSG WM_APP
  124. enum
  125. {
  126. DCS_FINISH_INIT_MSG = DCS_FIRST_MSG,
  127. DCS_PERIODIC_SCHEDULE_MSG,
  128. DCS_KILLSHARE_MSG,
  129. DCS_SHAREDESKTOP_MSG,
  130. DCS_UNSHAREDESKTOP_MSG,
  131. DCS_TAKECONTROL_MSG,
  132. DCS_CANCELTAKECONTROL_MSG,
  133. DCS_RELEASECONTROL_MSG,
  134. DCS_PASSCONTROL_MSG,
  135. DCS_ALLOWCONTROL_MSG,
  136. DCS_GIVECONTROL_MSG,
  137. DCS_CANCELGIVECONTROL_MSG,
  138. DCS_REVOKECONTROL_MSG
  139. };
  140. #endif // DLL_CORE or DLL_HOOK
  141. //
  142. //
  143. // PROTOTYPES
  144. //
  145. //
  146. BOOL DCS_Init(void);
  147. void DCS_FinishInit(void);
  148. void DCS_Term(void);
  149. //
  150. // DCS_NotifyUI()
  151. //
  152. // DESCRIPTION:
  153. // Called by app sharing to notify the front end of various changes and
  154. // actions.
  155. //
  156. void DCS_NotifyUI(UINT event, UINT parm1, UINT parm2);
  157. void DCSLocalDesktopSizeChanged( UINT width, UINT height );
  158. #define DCS_MAIN_WINDOW_CLASS "Salem_MainWindow"
  159. LRESULT CALLBACK DCSMainWndProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam);
  160. #define SHP_SETTING_TRUECOLOR 0x0001
  161. //
  162. // EVENTS
  163. //
  164. enum
  165. {
  166. SH_EVT_APPSHARE_READY = SPI_BASE_EVENT,
  167. SH_EVT_SHARE_STARTED,
  168. SH_EVT_SHARING_STARTED,
  169. SH_EVT_SHARE_ENDED,
  170. SH_EVT_PERSON_JOINED,
  171. SH_EVT_PERSON_LEFT,
  172. SH_EVT_CONTROLLABLE,
  173. SH_EVT_STARTCONTROLLED,
  174. SH_EVT_STOPCONTROLLED,
  175. SH_EVT_STARTINCONTROL,
  176. SH_EVT_STOPINCONTROL,
  177. };
  178. //
  179. // Function PROTOTYPES
  180. //
  181. #if defined(DLL_CORE)
  182. #include <ias.h>
  183. HRESULT SHP_GetPersonStatus(UINT dwID, IAS_PERSON_STATUS * pStatus);
  184. BOOL SHP_ShareDesktop(void);
  185. HRESULT SHP_UnshareDesktop(void);
  186. //
  187. // COLLABORATION
  188. //
  189. HRESULT SHP_TakeControl(IAS_GCC_ID PersonOf);
  190. HRESULT SHP_CancelTakeControl(IAS_GCC_ID PersonOf);
  191. HRESULT SHP_ReleaseControl(IAS_GCC_ID PersonOf);
  192. HRESULT SHP_PassControl(IAS_GCC_ID PersonOf, UINT PersonTo);
  193. HRESULT SHP_AllowControl(BOOL fAllow);
  194. HRESULT SHP_GiveControl(IAS_GCC_ID PersonTo);
  195. HRESULT SHP_CancelGiveControl(IAS_GCC_ID PersonTo);
  196. HRESULT SHP_RevokeControl(IAS_GCC_ID PersonTo);
  197. void DCS_ShareDesktop(void);
  198. void DCS_UnshareDesktop(void);
  199. #endif // DLL_CORE
  200. #endif // _H_DCS