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.

450 lines
12 KiB

  1. /****************************************************************************/
  2. // uidata.h
  3. //
  4. // Data for the UI component.
  5. //
  6. // Copyright (C) 1997-2000 Microsoft Corporation
  7. /****************************************************************************/
  8. #ifndef _H_WUIDATA
  9. #define _H_WUIDATA
  10. #ifdef AXCORE
  11. #include <wuiids.h>
  12. #endif // AXCORE
  13. /****************************************************************************/
  14. /* Structure: UI_DATA */
  15. /* */
  16. /* Description: Component data in the User Interface */
  17. /****************************************************************************/
  18. #define UI_MAX_DOMAIN_LENGTH 512
  19. #define UI_MAX_USERNAME_LENGTH 512
  20. #define UI_MAX_PASSWORD_LENGTH 512
  21. #define UI_MAX_PASSWORD_LENGTH_OLD 32
  22. #define UI_FILENAME_MAX_LENGTH 15
  23. #define UI_MAX_WORKINGDIR_LENGTH MAX_PATH
  24. #define UI_MAX_ALTERNATESHELL_LENGTH MAX_PATH
  25. #define UI_MAX_TSCFILE_LENGTH 512
  26. #define UI_MAX_CLXCMDLINE_LENGTH 256
  27. //
  28. // From uierr.h
  29. //
  30. #include "auierr.h"
  31. //
  32. // Connection mode - start connection, listen, or use connected socket
  33. //
  34. typedef enum {
  35. CONNECTIONMODE_INITIATE, // Initiate connection
  36. CONNECTIONMODE_CONNECTEDENDPOINT, // Connect with connected socket.
  37. } CONNECTIONMODE;
  38. /****************************************************************************/
  39. /* Number of glyph caches. */
  40. /****************************************************************************/
  41. #define GLYPH_NUM_CACHES 10
  42. typedef struct tagUI_DATA
  43. {
  44. HINSTANCE hResDllInstance;
  45. //Comma separated list of virtual channel addin DLL's
  46. TCHAR *pszVChanAddinDlls;
  47. HINSTANCE hInstance;
  48. BOOL coreInitialized;
  49. UINT32 shareID;
  50. unsigned channelID; /* Broadcast channel to send on */
  51. unsigned osMinorType;
  52. SOCKET TDSocket;
  53. HWND hwndMain;
  54. HWND hwndUIContainer;
  55. HWND hwndUIMain;
  56. HWND hWndCntrl;
  57. #if defined(OS_WIN32) && !defined(OS_WINCE)
  58. DCTCHAR szIconFile[MAX_PATH];
  59. DCINT iconIndex;
  60. #endif
  61. HWND hwndContainer;
  62. HDC hdcBitmap;
  63. WINDOWPLACEMENT windowPlacement;
  64. DCSIZE controlSize;
  65. DCSIZE mainWindowClientSize;
  66. DCSIZE containerSize;
  67. DCSIZE maxMainWindowSize;
  68. DCPOINT scrollMax;
  69. DCPOINT scrollPos;
  70. TCHAR strAddress[UT_MAX_ADDRESS_LENGTH];
  71. char ansiAddress[UT_MAX_ADDRESS_LENGTH];
  72. BOOL acceleratorCheckState;
  73. //
  74. // User requested color depth identifier
  75. //
  76. unsigned colorDepthID;
  77. BOOL autoConnectEnabled;
  78. BOOL smoothScrolling;
  79. BOOL shadowBitmapEnabled;
  80. BOOL dedicatedTerminal;
  81. BOOL encryptionEnabled;
  82. UINT16 sasSequence;
  83. UINT16 transportType;
  84. UINT16 MCSPort;
  85. UINT16 clientMCSID;
  86. UINT16 serverMCSID;
  87. DCSIZE desktopSize;
  88. //
  89. // Actual color depth we connected at
  90. //
  91. int connectedColorDepth;
  92. UINT32 SessionId;
  93. BOOL fCompress;
  94. // Decompression context.
  95. RecvContext1 Context1;
  96. RecvContext2_64K* pRecvContext2;
  97. //
  98. // Internal props that are passed down
  99. // from the control
  100. //
  101. //Control settable properties for UH
  102. unsigned orderDrawThreshold;
  103. ULONG RegBitmapCacheSize;
  104. ULONG RegBitmapVirtualCache8BppSize;
  105. ULONG RegBitmapVirtualCache16BppSize;
  106. ULONG RegBitmapVirtualCache24BppSize;
  107. ULONG RegScaleBitmapCachesByBPP;
  108. USHORT RegNumBitmapCaches : 15;
  109. USHORT RegPersistenceActive : 1;
  110. UINT RegBCProportion[TS_BITMAPCACHE_MAX_CELL_CACHES];
  111. ULONG RegBCMaxEntries[TS_BITMAPCACHE_MAX_CELL_CACHES];
  112. TCHAR PersistCacheFileName[MAX_PATH];
  113. UINT32 bSendBitmapKeys[TS_BITMAPCACHE_MAX_CELL_CACHES];
  114. unsigned GlyphSupportLevel;
  115. UINT32 cbGlyphCacheEntrySize[GLYPH_NUM_CACHES];
  116. unsigned fragCellSize;
  117. unsigned brushSupportLevel;
  118. //Control settable properties for IH
  119. UINT32 minSendInterval; /* Min time between mousemove sends (ms)*/
  120. UINT32 eventsAtOnce; /* Max events to pull off in one go */
  121. UINT32 maxEventCount; /* Max number of events in InputPDU */
  122. UINT32 keepAliveInterval; /* keep-alive time (seconds) */
  123. BOOL allowBackgroundInput;
  124. #ifdef OS_WINCE
  125. //Flag set if user wants to override default
  126. //paletteIsFixed setting
  127. BOOL fOverrideDefaultPaletteIsFixed;
  128. unsigned paletteIsFixed;
  129. #endif
  130. #ifdef DC_DEBUG
  131. BOOL hatchBitmapPDUData;
  132. BOOL hatchIndexPDUData;
  133. BOOL hatchSSBOrderData;
  134. BOOL hatchMemBltOrderData;
  135. BOOL labelMemBltOrders;
  136. BOOL bitmapCacheMonitor;
  137. //
  138. // Random failure item passed to randomfailure dialog box
  139. //
  140. int randomFailureItem;
  141. #endif /* DC_DEBUG */
  142. //
  143. // Scroll bar visibility flags
  144. //
  145. BOOL fVerticalScrollBarVisible;
  146. BOOL fHorizontalScrollBarVisible;
  147. unsigned connectionStatus;
  148. TCHAR errorString[UI_ERR_MAX_STRLEN];
  149. UINT32 connectFlags;
  150. BOOL fMouse;
  151. BOOL fDisableCtrlAltDel;
  152. BOOL fEnableWindowsKey;
  153. BOOL fDoubleClickDetect;
  154. BOOL fAutoLogon;
  155. BOOL fMaximizeShell;
  156. BOOL fBitmapPersistence;
  157. //
  158. // These properties are always Unicode
  159. //
  160. WCHAR Domain[UI_MAX_DOMAIN_LENGTH];
  161. WCHAR UserName[UI_MAX_USERNAME_LENGTH];
  162. WCHAR AlternateShell[UI_MAX_ALTERNATESHELL_LENGTH];
  163. WCHAR WorkingDir[UI_MAX_WORKINGDIR_LENGTH];
  164. //
  165. // Load balance info -- two, one for redirection case, one for
  166. // non-redirection. If these are NULL they are not valid. A flag indicates
  167. // whether we are in the middle of a redirection.
  168. //
  169. BSTR bstrScriptedLBInfo;
  170. BSTR bstrRedirectionLBInfo;
  171. BOOL ClientIsRedirected;
  172. // Client load balancing redirection data.
  173. BOOL DoRedirection;
  174. UINT32 RedirectionSessionID;
  175. WCHAR RedirectionServerAddress[TS_MAX_SERVERADDRESS_LENGTH];
  176. WCHAR RedirectionUserName[UI_MAX_USERNAME_LENGTH];
  177. BOOL UseRedirectionUserName;
  178. // if client is using smartcard to logon
  179. BOOL fUseSmartcardLogon;
  180. //
  181. // Password/salt are binary buffers
  182. //
  183. BYTE Password[UI_MAX_PASSWORD_LENGTH];
  184. BYTE Salt[UT_SALT_LENGTH];
  185. TCHAR CLXCmdLine[UI_MAX_CLXCMDLINE_LENGTH];
  186. DCHOTKEY hotKey;
  187. CONNECTSTRUCT connectStruct;
  188. u_long hostAddress;
  189. HANDLE hGHBN;
  190. DCUINT addrIndex;
  191. DCUINT singleTimeout;
  192. DCUINT licensingTimeout;
  193. DCUINT disconnectReason;
  194. DCBOOL fOnCoreInitializeEventCalled;
  195. DCBOOL bConnect;
  196. HANDLE hEvent;
  197. INT_PTR shutdownTimer;
  198. DCUINT shutdownTimeout;
  199. //winCE does not have GetKeyBoardType API so these
  200. //values are properties on the control.
  201. #ifdef OS_WINCE
  202. DCUINT32 winceKeyboardType;
  203. DCUINT32 winceKeyboardSubType;
  204. DCUINT32 winceKeyboardFunctionKey;
  205. #endif
  206. //
  207. // Fullscreen title
  208. //
  209. DCTCHAR szFullScreenTitle[MAX_PATH];
  210. //
  211. // Overall connection timeout property
  212. //
  213. DCUINT connectionTimeOut;
  214. DCTCHAR szKeyBoardLayoutStr[UTREG_UI_KEYBOARD_LAYOUT_LEN];
  215. //
  216. // Flag set when the ActiveX control has 'left' it's container
  217. // and gone to real full screen mode.
  218. //
  219. DCBOOL fControlIsFullScreen;
  220. //
  221. // Flag set by property on control to indicate fullscreen is handled by container
  222. //
  223. DCBOOL fContainerHandlesFullScreenToggle;
  224. //
  225. //We are in container full screen mode
  226. //
  227. DCBOOL fContainerInFullScreen;
  228. //
  229. // Flag set by control to indicate a request
  230. // to startup in fullscreen mode
  231. //
  232. DCBOOL fStartFullScreen;
  233. //Instance pointer to the active x control
  234. //this is passed to the virtual channel Ex API's
  235. //so the addin can know which control instance to talk to
  236. IUnknown* pUnkAxControlInstance;
  237. //
  238. // Desktop size
  239. //
  240. DCUINT uiSizeTable[2];
  241. //
  242. // Keyboard hooking mode
  243. //
  244. DCUINT keyboardHookMode;
  245. //
  246. // Audio redirection options
  247. //
  248. DCUINT audioRedirectionMode;
  249. //
  250. // Device redirection
  251. //
  252. BOOL fEnableDriveRedirection;
  253. BOOL fEnablePrinterRedirection;
  254. BOOL fEnablePortRedirection;
  255. BOOL fEnableSCardRedirection;
  256. //
  257. // Connect to server console setting
  258. //
  259. BOOL fConnectToServerConsole;
  260. // Flag set to disable internal RDPDR (only works on initialisation).
  261. //
  262. DCBOOL fDisableInternalRdpDr;
  263. //
  264. // Smart sizing - Scale the client window
  265. //
  266. #ifdef SMART_SIZING
  267. BOOL fSmartSizing;
  268. #endif // SMART_SIZING
  269. //
  270. // Event that is signaled to notify the
  271. // core has completed initialization
  272. //
  273. HANDLE hEvtNotifyCoreInit;
  274. //
  275. // Set at init time, indicates if the client
  276. // is running on a PTS box
  277. //
  278. BOOL fRunningOnPTS;
  279. //
  280. // Minutes to idle timeout
  281. //
  282. LONG minsToIdleTimeout;
  283. HANDLE hIdleInputTimer;
  284. //
  285. // Last error info sent from (SET_ERROR_INFO_PDU)
  286. // this is used to present the user with meaningful
  287. // error messages about why the disconnection occurred
  288. //
  289. UINT lastServerErrorInfo;
  290. //
  291. // BBAR enabled
  292. //
  293. BOOL fBBarEnabled;
  294. BOOL fBBarPinned;
  295. BOOL fBBarShowMinimizeButton;
  296. BOOL fBBarShowRestoreButton;
  297. //
  298. // Grabs the focus on connection
  299. //
  300. BOOL fGrabFocusOnConnect;
  301. //
  302. // Disconnection timeout
  303. //
  304. HANDLE hDisconnectTimeout;
  305. //
  306. // List of server features to disable for perf reasons (e.g wallpaper)
  307. //
  308. DWORD dwPerformanceFlags;
  309. //
  310. // Flag to indicate connect with connected endpoint
  311. //
  312. CONNECTIONMODE ConnectMode;
  313. //
  314. // TRUE to fire OnReceivedTSPublicKey() FALSE otherwise.
  315. //
  316. BOOL fNotifyTSPublicKey;
  317. //
  318. // Enable the autoreconnect feature
  319. //
  320. BOOL fEnableAutoReconnect;
  321. //
  322. // Allow the use of the autoreconnect cookie
  323. //
  324. BOOL fUseAutoReconnectCookie;
  325. //
  326. // Max # of autoreconnection attempts
  327. //
  328. LONG MaxAutoReconnectionAttempts;
  329. //
  330. // Autoreconnect cookie (this is an Opaque blob)
  331. //
  332. PBYTE pAutoReconnectCookie;
  333. ULONG cbAutoReconnectCookieLen;
  334. //
  335. // Flag to detect re-entrant call to Connect()
  336. // e.g. from the OnDisconnected handler
  337. //
  338. BOOL fConnectCalledWatch;
  339. //
  340. // Flag to indicate if client requires FIPS
  341. //
  342. BOOL fUseFIPS;
  343. } UI_DATA;
  344. //
  345. // User defined messages to notify ActiveX layer
  346. //
  347. #define WM_INITTSC (WM_APP + 100)
  348. #define WM_TERMTSC (WM_INITTSC + 1)
  349. #define WM_TS_CONNECTING (WM_INITTSC + 2)
  350. #define WM_TS_CONNECTED (WM_INITTSC + 3)
  351. #define WM_TS_LOGINCOMPLETE (WM_INITTSC + 4)
  352. #define WM_TS_DISCONNECTED (WM_INITTSC + 5)
  353. #define WM_TS_GONEFULLSCREEN (WM_INITTSC + 6)
  354. #define WM_TS_LEFTFULLSCREEN (WM_INITTSC + 7)
  355. #define WM_TS_REQUESTFULLSCREEN (WM_INITTSC + 8)
  356. #define WM_TS_FATALERROR (WM_INITTSC + 9)
  357. #define WM_TS_WARNING (WM_INITTSC + 10)
  358. #define WM_TS_DESKTOPSIZECHANGE (WM_INITTSC + 11)
  359. #define WM_TS_IDLETIMEOUTNOTIFICATION (WM_INITTSC + 12)
  360. #define WM_TS_REQUESTMINIMIZE (WM_INITTSC + 13)
  361. #define WM_TS_ASKCONFIRMCLOSE (WM_INITTSC + 14)
  362. #define WM_TS_RECEIVEDPUBLICKEY (WM_INITTSC + 15)
  363. #define CO_MAX_COMMENT_LENGTH 64
  364. //-----------------------------------------------------------------------------
  365. //
  366. // Default licensing phase timeout: 300 seconds
  367. //
  368. //-----------------------------------------------------------------------------
  369. #define DEFAULT_LICENSING_TIMEOUT 300
  370. #endif /* _H_WUIDATA */