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.

1527 lines
41 KiB

  1. /****************************************************************************/
  2. // icadd.h
  3. //
  4. // TermSrv protocol stack defines.
  5. //
  6. // Copyright (C) 1997-2000 Microsoft Corporation
  7. /****************************************************************************/
  8. #ifndef _ICADDH_
  9. #define _ICADDH_
  10. /*
  11. * ICA Stack types -- TEMP until moved to winsta.h
  12. */
  13. typedef enum _STACKCLASS {
  14. Stack_Primary,
  15. Stack_Shadow,
  16. Stack_Passthru,
  17. Stack_Console
  18. } STACKCLASS;
  19. /*
  20. * ICA Channel types -- TEMP until moved to winsta.h
  21. *
  22. * NOTE: Channel_Virtual MUST be the last in the list.
  23. */
  24. typedef enum _CHANNELCLASS {
  25. Channel_Keyboard,
  26. Channel_Mouse,
  27. Channel_Video,
  28. Channel_Beep,
  29. Channel_Command,
  30. Channel_Virtual // WARNING: this must remain last in the list
  31. } CHANNELCLASS;
  32. #define CHANNEL_FIRST Channel_Keyboard
  33. #define CHANNEL_LAST Channel_Virtual
  34. #define CHANNEL_COUNT Channel_Virtual+1
  35. /*
  36. * Client module information
  37. */
  38. typedef struct _CLIENTMODULES {
  39. /*
  40. * Initialization data from client (client -> host)
  41. */
  42. PUCHAR pUiModule; // user interface module
  43. PUCHAR pUiExtModule[ MAX_UI_MODULES ]; // user interface extension modules
  44. PUCHAR pWdModule; // winstation driver module
  45. PUCHAR pVdModule[ VIRTUAL_MAXIMUM ]; // virtual driver modules
  46. PUCHAR pPdModule[ SdClass_Maximum ]; // protocol driver modules
  47. PUCHAR pTdModule; // transport driver module
  48. PUCHAR pPrModule; // protocol resolver module
  49. PUCHAR pScriptModule; // scripting module
  50. /*
  51. * Pointers into the above client data
  52. */
  53. ULONG TextModeCount; // number of supported text modes
  54. PFSTEXTMODE pTextModes; // pointer to array of supported text modes
  55. /*
  56. * Data accessed by winstation driver module
  57. */
  58. ULONG fTextOnly : 1; // text only client connection
  59. ULONG fIcaDetected : 1; // ICA data stream has been detected
  60. /*
  61. * Initialization data from host (host -> client)
  62. */
  63. PUCHAR pHostWdModule; // winstation driver module
  64. PUCHAR pHostPdModule[ SdClass_Maximum ]; // protocol driver modules
  65. PUCHAR pHostTdModule; // transport driver module
  66. /*
  67. * Transport driver version information
  68. */
  69. BYTE TdVersionL; // lowest supported version
  70. BYTE TdVersionH; // highest supported version
  71. BYTE TdVersion; // connect version level
  72. } CLIENTMODULES, * PCLIENTMODULES;
  73. /*
  74. * TermDD Device Name
  75. */
  76. #define ICA_DEVICE_NAME L"\\Device\\Termdd"
  77. #define ICAOPENPACKET "TermddOpenPacketXX"
  78. #define ICA_OPEN_PACKET_NAME_LENGTH (sizeof(ICAOPENPACKET) - 1)
  79. /*
  80. * Structures used on NtCreateFile() for TermSrv.
  81. */
  82. typedef enum _ICA_OPEN_TYPE {
  83. IcaOpen_Stack,
  84. IcaOpen_Channel
  85. } ICA_OPEN_TYPE;
  86. typedef union _ICA_TYPE_INFO {
  87. STACKCLASS StackClass;
  88. struct {
  89. CHANNELCLASS ChannelClass;
  90. VIRTUALCHANNELNAME VirtualName;
  91. };
  92. } ICA_TYPE_INFO, *PICA_TYPE_INFO;
  93. typedef struct _ICA_OPEN_PACKET {
  94. HANDLE IcaHandle;
  95. ICA_OPEN_TYPE OpenType;
  96. ICA_TYPE_INFO TypeInfo;
  97. } ICA_OPEN_PACKET;
  98. typedef ICA_OPEN_PACKET UNALIGNED * PICA_OPEN_PACKET;
  99. /*
  100. * ICA IOCTL code definitions
  101. */
  102. #define IOCTL_ICA_BASE FILE_DEVICE_TERMSRV
  103. #define _ICA_CTL_CODE( request, method ) \
  104. CTL_CODE( IOCTL_ICA_BASE, request, method, FILE_ANY_ACCESS )
  105. /*=============================================================================
  106. == ICA Driver IOCTLs
  107. =============================================================================*/
  108. /*
  109. * IOCTL_ICA_SET_TRACE
  110. *
  111. * Set WinStation trace options
  112. *
  113. * input - ICATRACE
  114. * output - nothing
  115. */
  116. #define IOCTL_ICA_SET_TRACE _ICA_CTL_CODE( 0, METHOD_NEITHER )
  117. typedef struct _ICA_TRACE {
  118. WCHAR TraceFile[256];
  119. BOOLEAN fDebugger;
  120. BOOLEAN fTimestamp;
  121. ULONG TraceClass;
  122. ULONG TraceEnable;
  123. WCHAR TraceOption[64];
  124. } ICA_TRACE, * PICA_TRACE;
  125. /*
  126. * IOCTL_ICA_TRACE
  127. *
  128. * Write trace record to winstation trace file
  129. *
  130. * input - ICA_TRACE_BUFFER
  131. * output - nothing
  132. */
  133. #define IOCTL_ICA_TRACE _ICA_CTL_CODE( 1, METHOD_NEITHER )
  134. typedef struct _ICA_TRACE_BUFFER {
  135. ULONG TraceClass;
  136. ULONG TraceEnable;
  137. ULONG DataLength;
  138. BYTE Data[256]; // must be last in structure
  139. } ICA_TRACE_BUFFER, * PICA_TRACE_BUFFER;
  140. typedef struct _ICA_KEEP_ALIVE {
  141. BOOLEAN start;
  142. ULONG interval ;
  143. } ICA_KEEP_ALIVE, *PICA_KEEP_ALIVE;
  144. /*
  145. * IOCTL_ICA_SET_SYSTEM_TRACE
  146. *
  147. * Set system wide API trace options
  148. *
  149. * input - ICATRACE
  150. * output - nothing
  151. */
  152. #define IOCTL_ICA_SET_SYSTEM_TRACE _ICA_CTL_CODE( 2, METHOD_NEITHER )
  153. /*
  154. * IOCTL_ICA_SYSTEM_TRACE
  155. *
  156. * Write trace record to system wide trace file
  157. *
  158. * input - ICA_TRACE_BUFFER
  159. * output - nothing
  160. */
  161. #define IOCTL_ICA_SYSTEM_TRACE _ICA_CTL_CODE( 3, METHOD_NEITHER )
  162. /*
  163. * IOCTL_ICA_UNBIND_VIRTUAL_CHANNEL
  164. *
  165. * Unbind a virtual channel to prevent future uses of the channel.
  166. *
  167. * input - VIRTUAL_NAME
  168. * output - nothing
  169. */
  170. #define IOCTL_ICA_UNBIND_VIRTUAL_CHANNEL _ICA_CTL_CODE( 4, METHOD_NEITHER )
  171. /*
  172. * IOCTL_ICA_SET_SYSTEM_PARAMETERS
  173. *
  174. * Used to inform TermDD of non-trace system settings. Allows registry reads
  175. * to occur mostly in TermSrv.
  176. *
  177. * input - TERMSRV_SYSTEM_PARAMS
  178. * output - nothing
  179. */
  180. #define IOCTL_ICA_SET_SYSTEM_PARAMETERS _ICA_CTL_CODE( 5, METHOD_NEITHER )
  181. /*
  182. * IOCTL_ICA_SYSTEM_KEEPALIVE
  183. *
  184. *
  185. * input - enable/disable keep alive
  186. * output - nothing
  187. */
  188. #define IOCTL_ICA_SYSTEM_KEEP_ALIVE _ICA_CTL_CODE( 6, METHOD_NEITHER )
  189. #define DEFAULT_MOUSE_THROTTLE_SIZE (200 * sizeof(MOUSE_INPUT_DATA))
  190. #define DEFAULT_KEYBOARD_THROTTLE_SIZE (200 * sizeof(KEYBOARD_INPUT_DATA))
  191. typedef struct _TERMSRV_SYSTEM_PARAMS
  192. {
  193. // Byte sizes used as upper limit to data stored in channel queues.
  194. // Nonzero sizes prevent an attacking client from allocating all the
  195. // system nonpaged pool for channel storage.
  196. ULONG MouseThrottleSize;
  197. ULONG KeyboardThrottleSize;
  198. } TERMSRV_SYSTEM_PARAMS, *PTERMSRV_SYSTEM_PARAMS;
  199. /*=============================================================================
  200. == ICA Stack IOCTLs
  201. =============================================================================*/
  202. /*
  203. * Stack driver configuration
  204. */
  205. typedef struct _ICA_STACK_CONFIG {
  206. DLLNAME SdDLL[ SdClass_Maximum ];
  207. SDCLASS SdClass[ SdClass_Maximum ];
  208. DLLNAME WdDLL;
  209. } ICA_STACK_CONFIG, *PICA_STACK_CONFIG;
  210. /*
  211. * IOCTL_ICA_STACK_PUSH
  212. *
  213. * Load a new stack driver to the top of the stack
  214. *
  215. * input - ICA_STACK_PUSH
  216. * output - nothing
  217. */
  218. #define IOCTL_ICA_STACK_PUSH _ICA_CTL_CODE( 10, METHOD_NEITHER )
  219. typedef enum _STACKMODULECLASS {
  220. Stack_Module_Pd,
  221. Stack_Module_Wd
  222. } STACKMODULECLASS;
  223. typedef struct _ICA_STACK_PUSH {
  224. STACKMODULECLASS StackModuleType; // IN
  225. DLLNAME StackModuleName; // IN
  226. char OEMId[4]; // IN - WinFrame Server OEM Id
  227. WDCONFIG WdConfig; // IN - WD configuration data
  228. PDCONFIG PdConfig; // IN - PD configuration data
  229. WINSTATIONNAME WinStationRegName; // IN - WinStation registry name
  230. } ICA_STACK_PUSH, *PICA_STACK_PUSH;
  231. /*
  232. * IOCTL_ICA_STACK_POP
  233. *
  234. * Unload the top stack driver
  235. *
  236. * input - nothing
  237. * output - nothing
  238. */
  239. #define IOCTL_ICA_STACK_POP _ICA_CTL_CODE( 11, METHOD_NEITHER )
  240. /*
  241. * IOCTL_ICA_STACK_CREATE_ENDPOINT
  242. *
  243. * Create a new stack endpoint
  244. *
  245. * Issued on a "Listen Stack" based on the registry template
  246. *
  247. * input - ICA_STACK_ADDRESS (optional local address -- used by shadow)
  248. * output - ICA_STACK_ADDRESS (optional)
  249. */
  250. #define IOCTL_ICA_STACK_CREATE_ENDPOINT _ICA_CTL_CODE( 12, METHOD_NEITHER )
  251. /*
  252. * IOCTL_ICA_STACK_CD_CREATE_ENDPOINT
  253. *
  254. * Create a new stack endpoint with the supplied handle.
  255. *
  256. * Issued on a "Listen Stack" based on the registry template
  257. *
  258. * input - <endpoint data>
  259. * output - <endpoint data>
  260. */
  261. #define IOCTL_ICA_STACK_CD_CREATE_ENDPOINT _ICA_CTL_CODE( 13, METHOD_NEITHER )
  262. /*
  263. * IOCTL_ICA_STACK_OPEN_ENDPOINT
  264. *
  265. * Open an existing stack endpoint
  266. *
  267. * input - <endpoint data>
  268. * output - nothing
  269. */
  270. #define IOCTL_ICA_STACK_OPEN_ENDPOINT _ICA_CTL_CODE( 14, METHOD_NEITHER )
  271. /*
  272. * IOCTL_ICA_STACK_CLOSE_ENDPOINT
  273. *
  274. * Close stack endpoint (closing stack does not close the endpoint)
  275. * - terminates client connection
  276. *
  277. * input - nothing
  278. * output - nothing
  279. */
  280. #define IOCTL_ICA_STACK_CLOSE_ENDPOINT _ICA_CTL_CODE( 15, METHOD_NEITHER )
  281. /*
  282. * IOCTL_ICA_STACK_ENABLE_DRIVER
  283. *
  284. * Enables protocol driver functionality (e.g. compression, encryption, ...)
  285. *
  286. * Issued on a "Listen Stack" based on the registry template
  287. *
  288. * input - nothing
  289. * output - nothing
  290. */
  291. #define IOCTL_ICA_STACK_ENABLE_DRIVER _ICA_CTL_CODE( 16, METHOD_NEITHER )
  292. /*
  293. * IOCTL_ICA_STACK_CONNECTION_WAIT
  294. *
  295. * Waits for a client connection (listens)
  296. *
  297. * Issued on a "Listen Stack"
  298. *
  299. * input - nothing
  300. * output - <endpoint data>
  301. */
  302. #define IOCTL_ICA_STACK_CONNECTION_WAIT _ICA_CTL_CODE( 17, METHOD_NEITHER )
  303. /*
  304. * IOCTL_ICA_STACK_WAIT_FOR_ICA
  305. *
  306. * Wait for ICA detect string in WinStation driver
  307. *
  308. * Issued on a "Listen Stack"
  309. *
  310. * Also returns the "Query Stack" which is the host stack that the following
  311. * queries will be done on. If no stack is returned, just use the
  312. * original "Listen Stack" from the registry template.
  313. *
  314. * input - nothing
  315. * output - ICA_STACK_CONFIG (optional)
  316. */
  317. #define IOCTL_ICA_STACK_WAIT_FOR_ICA _ICA_CTL_CODE( 18, METHOD_NEITHER )
  318. /*
  319. * IOCTL_ICA_STACK_CONNECTION_QUERY
  320. *
  321. * Issues the client query commands. The client responds with client
  322. * module data that contains the "Negotiated Stack"
  323. *
  324. * Issued on a "Query Stack"
  325. *
  326. * input - nothing
  327. * output - ICA_STACK_CONFIG
  328. */
  329. #define IOCTL_ICA_STACK_CONNECTION_QUERY _ICA_CTL_CODE( 19, METHOD_NEITHER )
  330. /*
  331. * IOCTL_ICA_STACK_CONNECTION_SEND
  332. *
  333. * Initialize and send host module data to the client
  334. *
  335. * Issued on a "Negotiated Stack"
  336. *
  337. * input - nothing
  338. * output - nothing
  339. */
  340. #define IOCTL_ICA_STACK_CONNECTION_SEND _ICA_CTL_CODE( 20, METHOD_NEITHER )
  341. /*
  342. * IOCTL_ICA_STACK_CONNECTION_REQUEST
  343. *
  344. * Initiates a connection to a listening remote endpoint
  345. *
  346. * input - ICA_STACK_ADDRESS (remote address -- used by shadow)
  347. * output - <endpoint data>
  348. */
  349. #define IOCTL_ICA_STACK_CONNECTION_REQUEST _ICA_CTL_CODE( 21, METHOD_NEITHER )
  350. /*
  351. * IOCTL_ICA_STACK_QUERY_PARAMS
  352. *
  353. * Query protocol or transport driver parameters
  354. * used by wincfg and winadmin
  355. *
  356. * input - PDCLASS
  357. * output - PDPARAMS
  358. */
  359. #define IOCTL_ICA_STACK_QUERY_PARAMS _ICA_CTL_CODE( 22, METHOD_NEITHER )
  360. /*
  361. * IOCTL_ICA_STACK_SET_PARAMS
  362. *
  363. * Set protocol or transport driver parameters
  364. * used by wincfg and winadmin
  365. *
  366. * input - PDPARAMS
  367. * output - nothing
  368. */
  369. #define IOCTL_ICA_STACK_SET_PARAMS _ICA_CTL_CODE( 23, METHOD_NEITHER )
  370. /*
  371. * IOCTL_ICA_STACK_ENCRYPTION_OFF
  372. *
  373. * Permanently turn stack encryption off
  374. *
  375. * input - nothing
  376. * output - nothing
  377. */
  378. #define IOCTL_ICA_STACK_ENCRYPTION_OFF _ICA_CTL_CODE( 24, METHOD_NEITHER )
  379. /*
  380. * IOCTL_ICA_STACK_ENCRYPTION_PERM
  381. *
  382. * Permanently turn stack encryption on
  383. *
  384. * input - nothing
  385. * output - nothing
  386. */
  387. #define IOCTL_ICA_STACK_ENCRYPTION_PERM _ICA_CTL_CODE( 25, METHOD_NEITHER )
  388. /*
  389. * IOCTL_ICA_STACK_CALLBACK_INITIATE
  390. *
  391. * Initiate a modem callback
  392. *
  393. * input - ICA_STACK_CALLBACK
  394. * output - nothing
  395. */
  396. #define IOCTL_ICA_STACK_CALLBACK_INITIATE _ICA_CTL_CODE( 26, METHOD_NEITHER )
  397. typedef struct _ICA_STACK_CALLBACK {
  398. WCHAR PhoneNumber[ CALLBACK_LENGTH + 1 ];
  399. } ICA_STACK_CALLBACK, *PICA_STACK_CALLBACK;
  400. /*
  401. * IOCTL_ICA_STACK_QUERY_LAST_ERROR
  402. *
  403. * Query transport driver error code and message
  404. *
  405. * input - nothing
  406. * output - ICA_STACK_LAST_ERROR
  407. */
  408. #define IOCTL_ICA_STACK_QUERY_LAST_ERROR _ICA_CTL_CODE( 27, METHOD_NEITHER )
  409. #define MAX_ERRORMESSAGE 256
  410. typedef struct _ICA_STACK_LAST_ERROR {
  411. ULONG Error;
  412. CHAR Message[ MAX_ERRORMESSAGE ];
  413. } ICA_STACK_LAST_ERROR, *PICA_STACK_LAST_ERROR;
  414. /*
  415. * IOCTL_ICA_STACK_WAIT_FOR_STATUS
  416. *
  417. * Wait for status change
  418. * only valid with async transport driver
  419. *
  420. * input - nothing
  421. * output - nothing
  422. */
  423. #define IOCTL_ICA_STACK_WAIT_FOR_STATUS _ICA_CTL_CODE( 28, METHOD_NEITHER )
  424. /*
  425. * IOCTL_ICA_STACK_QUERY_STATUS
  426. *
  427. * Query stack statistics
  428. * - byte counts, signal status, error counts
  429. *
  430. * input - nothing
  431. * output - PROTOCOLSTATUS
  432. */
  433. #define IOCTL_ICA_STACK_QUERY_STATUS _ICA_CTL_CODE( 29, METHOD_NEITHER )
  434. /*
  435. * IOCTL_ICA_STACK_REGISTER_HOTKEY
  436. *
  437. * Register hotkey used to cancel shadow
  438. * - a message will be sent on the "command" handle when the hotkey is detected
  439. *
  440. * input - ICA_STACK_HOTKEY
  441. * output - nothing
  442. */
  443. #define IOCTL_ICA_STACK_REGISTER_HOTKEY _ICA_CTL_CODE( 30, METHOD_NEITHER )
  444. typedef struct _ICA_STACK_HOTKEY {
  445. BYTE HotkeyVk;
  446. USHORT HotkeyModifiers;
  447. } ICA_STACK_HOTKEY, *PICA_STACK_HOTKEY;
  448. /*
  449. * IOCTL_ICA_STACK_CANCEL_IO
  450. *
  451. * Cancel all current and future I/O
  452. * - no further i/o can be done on this stack
  453. *
  454. * input - nothing
  455. * output - nothing
  456. */
  457. #define IOCTL_ICA_STACK_CANCEL_IO _ICA_CTL_CODE( 31, METHOD_NEITHER )
  458. /*
  459. * IOCTL_ICA_STACK_QUERY_STATE
  460. *
  461. * Query the stack driver state
  462. * - use during reconnections
  463. *
  464. * input - nothing
  465. * output - array of ICA_STACK_STATE_HEADER
  466. */
  467. #define IOCTL_ICA_STACK_QUERY_STATE _ICA_CTL_CODE( 32, METHOD_NEITHER )
  468. /*
  469. * Stack driver state header
  470. *
  471. * ** this is a variable length data structure **
  472. */
  473. typedef struct _ICA_STACK_STATE_HEADER {
  474. SDCLASS SdClass; // type of stack driver
  475. ULONG DataLength; // length of the following data
  476. #ifdef COMPILERERROR
  477. BYTE Data[0];
  478. #else
  479. BYTE * Data;
  480. #endif
  481. } ICA_STACK_STATE_HEADER, *PICA_STACK_STATE_HEADER;
  482. /*
  483. * IOCTL_ICA_STACK_SET_STATE
  484. *
  485. * Set the stack driver state
  486. * - use during reconnections
  487. *
  488. * input - array of ICA_STACK_STATE_HEADER
  489. * output - nothing
  490. */
  491. #define IOCTL_ICA_STACK_SET_STATE _ICA_CTL_CODE( 33, METHOD_NEITHER )
  492. /*
  493. * IOCTL_ICA_STACK_QUERY_LAST_INPUT_TIME
  494. *
  495. * Query last input time for inactivity timeout
  496. *
  497. * input - nothing
  498. * output - ICA_STACK_LAST_INPUT_TIME
  499. */
  500. #define IOCTL_ICA_STACK_QUERY_LAST_INPUT_TIME _ICA_CTL_CODE( 34, METHOD_NEITHER )
  501. typedef struct _ICA_STACK_LAST_INPUT_TIME {
  502. LARGE_INTEGER LastInputTime;
  503. } ICA_STACK_LAST_INPUT_TIME, *PICA_STACK_LAST_INPUT_TIME;
  504. /*
  505. * IOCTL_ICA_STACK_TRACE
  506. *
  507. * Write trace record to winstation trace file
  508. *
  509. * input - ICA_TRACE_BUFFER
  510. * output - nothing
  511. */
  512. #define IOCTL_ICA_STACK_TRACE _ICA_CTL_CODE( 35, METHOD_NEITHER )
  513. /*
  514. * IOCTL_ICA_STACK_CALLBACK_COMPLETE
  515. *
  516. * input - nothing
  517. * output - nothing
  518. */
  519. #define IOCTL_ICA_STACK_CALLBACK_COMPLETE _ICA_CTL_CODE( 36, METHOD_NEITHER )
  520. /*
  521. * IOCTL_ICA_STACK_CD_CANCEL_IO
  522. *
  523. * This is done before the connection driver is closed
  524. * - releases tapi threads
  525. *
  526. * input - nothing
  527. * output - nothing
  528. */
  529. #define IOCTL_ICA_STACK_CD_CANCEL_IO _ICA_CTL_CODE( 37, METHOD_NEITHER )
  530. /*
  531. * IOCTL_ICA_STACK_QUERY_CLIENT
  532. *
  533. * Query the client data
  534. *
  535. * input - nothing
  536. * output - WINSTATIONCLIENTW
  537. */
  538. #define IOCTL_ICA_STACK_QUERY_CLIENT _ICA_CTL_CODE( 38, METHOD_NEITHER )
  539. /*
  540. * IOCTL_ICA_STACK_QUERY_MODULE_DATA
  541. *
  542. * Query the client module data
  543. *
  544. * input - nothing
  545. * output - (buffer containing all the C2H module data from the client)
  546. */
  547. #define IOCTL_ICA_STACK_QUERY_MODULE_DATA _ICA_CTL_CODE( 39, METHOD_NEITHER )
  548. /*
  549. * IOCTL_ICA_STACK_REGISTER_BROKEN
  550. *
  551. * Register an event to be signaled when the stack connection is broken
  552. *
  553. * input - ICA_STACK_BROKEN
  554. * output - nothing
  555. */
  556. #define IOCTL_ICA_STACK_REGISTER_BROKEN _ICA_CTL_CODE( 40, METHOD_NEITHER )
  557. typedef struct _ICA_STACK_BROKEN {
  558. HANDLE BrokenEvent;
  559. } ICA_STACK_BROKEN, *PICA_STACK_BROKEN;
  560. /*
  561. * IOCTL_ICA_STACK_ENABLE_IO
  562. *
  563. * Enable I/O for a stack (used by shadow)
  564. *
  565. * input - nothing
  566. * output - nothing
  567. */
  568. #define IOCTL_ICA_STACK_ENABLE_IO _ICA_CTL_CODE( 41, METHOD_NEITHER )
  569. /*
  570. * IOCTL_ICA_STACK_DISABLE_IO
  571. *
  572. * Disable I/O for a stack (used by shadow)
  573. *
  574. * input - nothing
  575. * output - nothing
  576. */
  577. #define IOCTL_ICA_STACK_DISABLE_IO _ICA_CTL_CODE( 42, METHOD_NEITHER )
  578. /*
  579. * IOCTL_ICA_STACK_SET_CONNECTED
  580. *
  581. * Mark a stack as connected (used by shadow)
  582. *
  583. * input - nothing
  584. * output - nothing
  585. */
  586. #define IOCTL_ICA_STACK_SET_CONNECTED _ICA_CTL_CODE( 43, METHOD_NEITHER )
  587. /*
  588. * IOCTL_ICA_STACK_SET_CLIENT_DATA
  589. *
  590. * Send arbitrary data to the client
  591. *
  592. * input - ICA_STACK_CLIENT_DATA
  593. * output - nothing
  594. */
  595. #define IOCTL_ICA_STACK_SET_CLIENT_DATA _ICA_CTL_CODE( 44, METHOD_NEITHER )
  596. typedef struct _ICA_STACK_CLIENT_DATA {
  597. CLIENTDATANAME DataName;
  598. BOOLEAN fUnicodeData;
  599. /* CHAR Data[]; Variable length data */
  600. } ICA_STACK_CLIENT_DATA, *PICA_STACK_CLIENT_DATA;
  601. /*
  602. * IOCTL_ICA_STACK_QUERY_BUFFER
  603. *
  604. * Get WD/TD buffer info
  605. *
  606. * input -
  607. * output - ICA_STACK_QUERY_BUFFER
  608. */
  609. #define IOCTL_ICA_STACK_QUERY_BUFFER _ICA_CTL_CODE( 45, METHOD_NEITHER )
  610. typedef struct _ICA_STACK_QUERY_BUFFER {
  611. ULONG WdBufferCount;
  612. ULONG TdBufferSize;
  613. } ICA_STACK_QUERY_BUFFER, *PICA_STACK_QUERY_BUFFER;
  614. /*
  615. * IOCTL_ICA_STACK_DISCONNECT
  616. *
  617. * Disconnect stack
  618. *
  619. * input - ICA_STACK_RECONNECT
  620. * output - nothing
  621. */
  622. #define IOCTL_ICA_STACK_DISCONNECT _ICA_CTL_CODE( 46, METHOD_NEITHER )
  623. /*
  624. * IOCTL_ICA_STACK_RECONNECT
  625. *
  626. * Reconnect stack to a new connection
  627. *
  628. * input - ICA_STACK_RECONNECT
  629. * output - nothing
  630. */
  631. #define IOCTL_ICA_STACK_RECONNECT _ICA_CTL_CODE( 47, METHOD_NEITHER )
  632. typedef struct _ICA_STACK_RECONNECT {
  633. HANDLE hIca;
  634. ULONG sessionId;
  635. } ICA_STACK_RECONNECT, *PICA_STACK_RECONNECT;
  636. /*
  637. * IOCTL_ICA_STACK_CONSOLE_CONNECT
  638. *
  639. * Connect WinStation to Console session
  640. *
  641. * Issued on a Console Stack
  642. *
  643. * input - nothing
  644. * output - ICA_STACK_CONFIG (optional)
  645. */
  646. #define IOCTL_ICA_STACK_CONSOLE_CONNECT _ICA_CTL_CODE( 48, METHOD_NEITHER )
  647. /*
  648. * IOCTL_ICA_STACK_SET_CONFIG
  649. *
  650. * Set stack config information
  651. *
  652. * input - ICA_STACK_CONFIG_DATA
  653. * output - nothing
  654. */
  655. #define IOCTL_ICA_STACK_SET_CONFIG _ICA_CTL_CODE( 49, METHOD_NEITHER )
  656. typedef struct _ICA_STACK_CONFIG_DATA {
  657. ULONG colorDepth : 3;
  658. ULONG fDisableEncryption : 1;
  659. ULONG encryptionLevel : 3;
  660. ULONG fDisableAutoReconnect : 1;
  661. } ICA_STACK_CONFIG_DATA, *PICA_STACK_CONFIG_DATA;
  662. /*=============================================================================
  663. == ICA Generic Channel IOCTLs
  664. =============================================================================*/
  665. /*
  666. * IOCTL_ICA_CHANNEL_TRACE
  667. *
  668. * Write trace record to winstation trace file
  669. *
  670. * input - ICA_TRACE_BUFFER
  671. * output - nothing
  672. */
  673. #define IOCTL_ICA_CHANNEL_TRACE _ICA_CTL_CODE( 50, METHOD_NEITHER )
  674. /*
  675. * IOCTL_ICA_CHANNEL_ENABLE_SHADOW
  676. *
  677. * Enable shadowing for this channel
  678. *
  679. * input - nothing
  680. * output - nothing
  681. */
  682. #define IOCTL_ICA_CHANNEL_ENABLE_SHADOW _ICA_CTL_CODE( 51, METHOD_NEITHER )
  683. /*
  684. * IOCTL_ICA_CHANNEL_END_SHADOW
  685. *
  686. * End shadowing for this channel
  687. *
  688. * input - ICA_CHANNEL_END_SHADOW_DATA struct
  689. * output - nothing
  690. */
  691. #define IOCTL_ICA_CHANNEL_END_SHADOW _ICA_CTL_CODE( 52, METHOD_NEITHER )
  692. typedef struct _ICA_CHANNEL_END_SHADOW_DATA {
  693. NTSTATUS StatusCode;
  694. BOOLEAN bLogError;
  695. } ICA_CHANNEL_END_SHADOW_DATA, *PICA_CHANNEL_END_SHADOW_DATA;
  696. /*
  697. * IOCTL_ICA_CHANNEL_DISABLE_SHADOW
  698. *
  699. * Disable shadowing for this channel
  700. *
  701. * input - nothing
  702. * output - nothing
  703. */
  704. #define IOCTL_ICA_CHANNEL_DISABLE_SHADOW _ICA_CTL_CODE( 53, METHOD_NEITHER )
  705. /*
  706. * IOCTL_ICA_CHANNEL_DISABLE_SESSION_IO
  707. *
  708. * Disable Keyboard and mouse IO from Help Session
  709. *
  710. * input - nothing
  711. * output - nothing
  712. */
  713. #define IOCTL_ICA_CHANNEL_DISABLE_SESSION_IO _ICA_CTL_CODE( 54, METHOD_NEITHER )
  714. /*
  715. * IOCTL_ICA_CHANNEL_ENABLE_SESSION_IO
  716. *
  717. * Enable Keyboard and mouse IO from Help Session
  718. *
  719. * input - nothing
  720. * output - nothing
  721. */
  722. #define IOCTL_ICA_CHANNEL_ENABLE_SESSION_IO _ICA_CTL_CODE( 55, METHOD_NEITHER )
  723. /*
  724. * IOCTL_ICA_STACK_SET_BROKENREASON
  725. *
  726. * Sets the broken reason to the TD from user mode
  727. * Used so that TD can report back the correct broken reason
  728. *
  729. * input - ICA_STACK_BROKENREASON
  730. * output - nothing
  731. */
  732. #define IOCTL_ICA_STACK_SET_BROKENREASON _ICA_CTL_CODE( 56, METHOD_NEITHER )
  733. #define TD_USER_BROKENREASON_UNEXPECTED 0x0000
  734. #define TD_USER_BROKENREASON_TERMINATING 0x0001
  735. typedef struct _ICA_STACK_BROKENREASON {
  736. ULONG BrokenReason;
  737. } ICA_STACK_BROKENREASON, *PICA_STACK_BROKENREASON;
  738. /*=============================================================================
  739. == ICA Virtual IOCTLs
  740. =============================================================================*/
  741. #define IOCTL_ICA_VIRTUAL_LOAD_FILTER _ICA_CTL_CODE( 60, METHOD_NEITHER )
  742. #define IOCTL_ICA_VIRTUAL_UNLOAD_FILTER _ICA_CTL_CODE( 61, METHOD_NEITHER )
  743. #define IOCTL_ICA_VIRTUAL_ENABLE_FILTER _ICA_CTL_CODE( 62, METHOD_NEITHER )
  744. #define IOCTL_ICA_VIRTUAL_DISABLE_FILTER _ICA_CTL_CODE( 63, METHOD_NEITHER )
  745. /*
  746. * IOCTL_ICA_VIRTUAL_BOUND
  747. *
  748. * Check if there is a client bound to this virtual channel
  749. *
  750. * input - nothing
  751. * output - nothing
  752. */
  753. #define IOCTL_ICA_VIRTUAL_BOUND _ICA_CTL_CODE( 64, METHOD_NEITHER )
  754. /*
  755. * IOCTL_ICA_VIRTUAL_CANCEL_INPUT
  756. *
  757. * Cancel input i/o on this virtual channel
  758. *
  759. * input - nothing
  760. * output - nothing
  761. */
  762. #define IOCTL_ICA_VIRTUAL_CANCEL_INPUT _ICA_CTL_CODE( 65, METHOD_NEITHER )
  763. /*
  764. * IOCTL_ICA_VIRTUAL_CANCEL_OUTPUT
  765. *
  766. * Cancel output i/o on this virtual channel
  767. *
  768. * input - nothing
  769. * output - nothing
  770. */
  771. #define IOCTL_ICA_VIRTUAL_CANCEL_OUTPUT _ICA_CTL_CODE( 66, METHOD_NEITHER )
  772. /*
  773. * IOCTL_ICA_VIRTUAL_QUERY_MODULE_DATA
  774. *
  775. * Query client module data for this virtual channel
  776. *
  777. * input - nothing
  778. * output - module data (starts with common header VD_C2H)
  779. */
  780. #define IOCTL_ICA_VIRTUAL_QUERY_MODULE_DATA _ICA_CTL_CODE( 67, METHOD_NEITHER )
  781. /*
  782. * IOCTL_ICA_VIRTUAL_QUERY_BINDINGS
  783. *
  784. * Query virtual channel bindings for this winstaion
  785. *
  786. * input - nothing
  787. * output - array of WD_VCBIND structures
  788. */
  789. #define IOCTL_ICA_VIRTUAL_QUERY_BINDINGS _ICA_CTL_CODE( 68, METHOD_NEITHER )
  790. //-----------------------------------------------------------------------------
  791. //
  792. // Outcome of licensing protocol
  793. //
  794. // LICENSE_PROTOCOL_SUCCESS - Indicate that the licensing protocol has completed
  795. // successfully.
  796. //
  797. //-----------------------------------------------------------------------------
  798. #define LICENSE_PROTOCOL_SUCCESS 1
  799. /*=============================================================================
  800. == ICA Licensing IOCTLs
  801. =============================================================================*/
  802. /*
  803. * IOCTL_ICA_STACK_QUERY_LICENSE_CAPABILITIES
  804. *
  805. * Query the client licensing capabilities
  806. *
  807. * input - nothing
  808. * output - licensing capabilities structure
  809. */
  810. #define IOCTL_ICA_STACK_QUERY_LICENSE_CAPABILITIES _ICA_CTL_CODE( 69, METHOD_NEITHER )
  811. /*
  812. * IOCTL_ICA_STACK_REQUEST_CLIENT_LICENSE
  813. *
  814. * sending and receiving client licensing data
  815. *
  816. * input - licensing data to send
  817. * output - licensing data received from client
  818. */
  819. #define IOCTL_ICA_STACK_REQUEST_CLIENT_LICENSE _ICA_CTL_CODE( 70, METHOD_NEITHER )
  820. /*
  821. * IOCTL_ICA_STACK_SEND_CLIENT_LICENSE
  822. *
  823. * sending and licensing data
  824. *
  825. * input - licensing data to send
  826. * output - nothing
  827. */
  828. #define IOCTL_ICA_STACK_SEND_CLIENT_LICENSE _ICA_CTL_CODE( 71, METHOD_NEITHER )
  829. /*
  830. * IOCTL_ICA_STACK_LICENSE_PROTOCOL_COMPLETE
  831. *
  832. * indicate whether the licensing protocol has completed successfully
  833. *
  834. * input - licensing protocol status
  835. * output - nothing
  836. */
  837. #define IOCTL_ICA_STACK_LICENSE_PROTOCOL_COMPLETE _ICA_CTL_CODE( 72, METHOD_NEITHER )
  838. /*
  839. * IOCTL_ICA_STACK_GET_LICENSE_DATA
  840. *
  841. * retrieve the cached license data
  842. *
  843. * input - buffer to receive the licensing data
  844. * output - number of bytes copied
  845. */
  846. #define IOCTL_ICA_STACK_GET_LICENSE_DATA _ICA_CTL_CODE( 73, METHOD_NEITHER )
  847. /*
  848. * IOCTL_ICA_STACK_SEND_KEEPALIVE_PDU
  849. *
  850. * send a keepalive packet to the client to detect if a session is still alive
  851. *
  852. * input - nothing
  853. * output - nothing
  854. */
  855. #define IOCTL_ICA_STACK_SEND_KEEPALIVE_PDU _ICA_CTL_CODE( 74, METHOD_NEITHER)
  856. // IOCTL_TS_STACK_QUERY_LOAD_BALANCE_INFO
  857. //
  858. // Used for cluster-aware systems to query the protocol stack for client
  859. // capabilities and information related to load balancing. Input to the
  860. // IOCTL is null, output is TS_LOAD_BALANCE_INFO shown below.
  861. #define IOCTL_TS_STACK_QUERY_LOAD_BALANCE_INFO _ICA_CTL_CODE(75, METHOD_NEITHER)
  862. // This struct contains client-provided info pertaining to clustering.
  863. // RequestedSessionID (and bRequestedSessionIDFieldValid) are used
  864. // when the client has already been redirected by another server and
  865. // has the session ID info for reconnection. Presence of this field
  866. // implies we should not re-redirect the client. InitialProgram and
  867. // ProtocolType are the same info as provided by the DoConnect parameter
  868. // to WsxInitializeClientData(). and are used to filter sessions
  869. // retieved from the cluster session directory.
  870. typedef struct
  871. {
  872. ULONG bClientSupportsRedirection : 1;
  873. ULONG bRequestedSessionIDFieldValid : 1;
  874. ULONG bClientRequireServerAddr : 1;
  875. ULONG bUseSmartcardLogon : 1;
  876. ULONG RequestedSessionID;
  877. ULONG ClientRedirectionVersion;
  878. ULONG ProtocolType; // PROTOCOL_ICA or PROTOCOL_RDP.
  879. WCHAR UserName[256];
  880. WCHAR Domain[128];
  881. WCHAR Password[128];
  882. WCHAR InitialProgram[256];
  883. } TS_LOAD_BALANCE_INFO, *PTS_LOAD_BALANCE_INFO;
  884. // IOCTL_TS_STACK_SEND_CLIENT_REDIRECTION
  885. //
  886. // Used for cluster-aware clients to force-reconnect the client to a different
  887. // server. Input is TS_CLIENT_REDIRECTION_INFO below, output is null.
  888. #define IOCTL_TS_STACK_SEND_CLIENT_REDIRECTION _ICA_CTL_CODE(76, METHOD_NEITHER)
  889. /*
  890. * IOCTL_ICA_STACK_QUERY_CLIENT_EXTENDED
  891. *
  892. * Query the client data for Long UserName, Password and Domain
  893. *
  894. * input - nothing
  895. * output - ExtendedClientCredentials
  896. */
  897. #define IOCTL_ICA_STACK_QUERY_CLIENT_EXTENDED _ICA_CTL_CODE( 77, METHOD_NEITHER )
  898. /*
  899. * IOCTL_TS_STACK_QUERY_REMOTEADDRESS
  900. *
  901. * Query for the client IP address
  902. *
  903. * input - <endpoint data>
  904. * output - sockaddr structure
  905. */
  906. #define IOCTL_TS_STACK_QUERY_REMOTEADDRESS _ICA_CTL_CODE( 78, METHOD_NEITHER )
  907. /*
  908. * IOCTL_ICA_CHANNEL_CLOSE_COMMAND_CHANNEL
  909. *
  910. * Used to close the Command channel when we terminate a WinStation.
  911. *
  912. * input - nothing
  913. * output - nothing
  914. */
  915. #define IOCTL_ICA_CHANNEL_CLOSE_COMMAND_CHANNEL _ICA_CTL_CODE( 79, METHOD_NEITHER )
  916. /*
  917. * IOCTL_ICA_STACK_QUERY_LOCALADDRESS
  918. *
  919. * Query for the local address
  920. *
  921. * input - <endpoint data>
  922. * output - sockaddr structure
  923. */
  924. #define IOCTL_ICA_STACK_QUERY_LOCALADDRESS _ICA_CTL_CODE( 80, METHOD_NEITHER )
  925. /*
  926. * IOCTL_ICA_STACK_QUERY_AUTORECONNECT
  927. *
  928. * Queries for Client->Server or Server->Client autoreconnect info
  929. *
  930. * input - BOOL set TRUE to get S->C info. False to get C->S
  931. * output - AutoReconnect info
  932. */
  933. #define IOCTL_ICA_STACK_QUERY_AUTORECONNECT _ICA_CTL_CODE( 81, METHOD_NEITHER )
  934. typedef struct
  935. {
  936. ULONG SessionID;
  937. ULONG Flags;
  938. #define TARGET_NET_ADDRESS 0x1
  939. #define LOAD_BALANCE_INFO 0x2
  940. #define LB_USERNAME 0x4
  941. #define LB_DOMAIN 0x8
  942. #define LB_PASSWORD 0x10
  943. #define LB_DONTSTOREUSERNAME 0x20
  944. #define LB_SMARTCARD_LOGON 0x40
  945. // used to inform client the machine IP for later ARC use
  946. #define LB_NOREDIRECT 0x80
  947. // For each variable length field, the format is like:
  948. // ULONG Length
  949. // BYTE Data[]
  950. } TS_CLIENT_REDIRECTION_INFO;
  951. /*=============================================================================
  952. == Keyboard IOCTLs
  953. =============================================================================*/
  954. /*
  955. * IOCTL_KEYBOARD_ICA_INPUT
  956. *
  957. * Simulate keyboard input
  958. *
  959. * input - array of KEYBOARD_INPUT_DATA structures
  960. * output - nothing
  961. */
  962. #define IOCTL_KEYBOARD_ICA_INPUT _ICA_CTL_CODE( 0x200, METHOD_NEITHER )
  963. /*
  964. * IOCTL_KEYBOARD_ICA_LAYOUT
  965. *
  966. * Send keyboard layout from Win32K to WD
  967. *
  968. * input - buffer containing keyboard layout
  969. * output - nothing
  970. */
  971. #define IOCTL_KEYBOARD_ICA_LAYOUT _ICA_CTL_CODE( 0x201, METHOD_NEITHER )
  972. /*
  973. * IOCTL_KEYBOARD_ICA_SCANMAP
  974. *
  975. * Send keyboard scan map from Win32K to WD
  976. *
  977. * input - buffer containing keyboard scan map
  978. * output - nothing
  979. */
  980. #define IOCTL_KEYBOARD_ICA_SCANMAP _ICA_CTL_CODE( 0x202, METHOD_NEITHER )
  981. /*
  982. * IOCTL_KEYBOARD_ICA_TYPE
  983. *
  984. * Send keyboard type from Win32K to WD
  985. *
  986. * input - buffer containing keyboard type
  987. * output - nothing
  988. */
  989. #define IOCTL_KEYBOARD_ICA_TYPE _ICA_CTL_CODE( 0x203, METHOD_NEITHER )
  990. /*=============================================================================
  991. == ICA Mouse IOCTLs
  992. =============================================================================*/
  993. /*
  994. * IOCTL_MOUSE_ICA_INPUT
  995. *
  996. * Simulate mouse input
  997. *
  998. * input - array of MOUSE_INPUT_DATA structures
  999. * output - nothing
  1000. */
  1001. #define IOCTL_MOUSE_ICA_INPUT _ICA_CTL_CODE( 0x300, METHOD_NEITHER )
  1002. /*=============================================================================
  1003. == ICA Video IOCTLs
  1004. =============================================================================*/
  1005. #define IOCTL_VIDEO_ICA_QUERY_FONT_PAIRS _ICA_CTL_CODE( 0x400, METHOD_BUFFERED )
  1006. #define IOCTL_VIDEO_ICA_ENABLE_GRAPHICS _ICA_CTL_CODE( 0x401, METHOD_BUFFERED )
  1007. #define IOCTL_VIDEO_ICA_DISABLE_GRAPHICS _ICA_CTL_CODE( 0x402, METHOD_BUFFERED )
  1008. #define IOCTL_VIDEO_ICA_SET_CP _ICA_CTL_CODE( 0x403, METHOD_BUFFERED )
  1009. #define IOCTL_VIDEO_ICA_STOP_OK _ICA_CTL_CODE( 0x404, METHOD_BUFFERED )
  1010. #define IOCTL_VIDEO_ICA_REVERSE_MOUSE_POINTER _ICA_CTL_CODE( 0x405, METHOD_BUFFERED )
  1011. #define IOCTL_VIDEO_ICA_COPY_FRAME_BUFFER _ICA_CTL_CODE( 0x406, METHOD_BUFFERED )
  1012. #define IOCTL_VIDEO_ICA_WRITE_TO_FRAME_BUFFER _ICA_CTL_CODE( 0x407, METHOD_BUFFERED )
  1013. #define IOCTL_VIDEO_ICA_INVALIDATE_MODES _ICA_CTL_CODE( 0x408, METHOD_BUFFERED )
  1014. #define IOCTL_VIDEO_ICA_SCROLL _ICA_CTL_CODE( 0x409, METHOD_BUFFERED )
  1015. /*
  1016. * IOCTL_ICA_STACK_SECURE_DESKTOP_ENTER
  1017. *
  1018. * Turn encryption on if enabled. SAS desktop is going up.
  1019. *
  1020. * input - nothing
  1021. * output - nothing
  1022. */
  1023. #define IOCTL_ICA_STACK_ENCRYPTION_ENTER _ICA_CTL_CODE( 0x410, METHOD_NEITHER )
  1024. /*
  1025. * IOCTL_ICA_STACK_SECURE_DESKTOP_EXIT
  1026. *
  1027. * Turn encryption off if enabled. SAS desktop is going away.
  1028. *
  1029. * input - nothing
  1030. * output - nothing
  1031. */
  1032. #define IOCTL_ICA_STACK_ENCRYPTION_EXIT _ICA_CTL_CODE( 0x411, METHOD_NEITHER )
  1033. /*
  1034. * IOCTL_VIDEO_CREATE_THREAD
  1035. *
  1036. * Called by video driver to create a worker thread
  1037. *
  1038. * input - PVIDEO_ICA_CREATE_THREAD
  1039. * output - nothing
  1040. */
  1041. #define IOCTL_VIDEO_CREATE_THREAD _ICA_CTL_CODE( 0x412, METHOD_BUFFERED )
  1042. /*
  1043. * IOCTL_ICA_MVGA_
  1044. *
  1045. * Used by Direct ICA
  1046. *
  1047. */
  1048. #define IOCTL_ICA_MVGA_GET_INFO _ICA_CTL_CODE( 0x420, METHOD_BUFFERED )
  1049. #define IOCTL_ICA_MVGA_VIDEO_SET_CURRENT_MODE _ICA_CTL_CODE( 0x421, METHOD_BUFFERED )
  1050. #define IOCTL_ICA_MVGA_VIDEO_MAP_VIDEO_MEMORY _ICA_CTL_CODE( 0x422, METHOD_BUFFERED )
  1051. #define IOCTL_ICA_MVGA_VIDEO_UNMAP_VIDEO_MEMORY _ICA_CTL_CODE( 0x423, METHOD_BUFFERED )
  1052. /*
  1053. * IOCTL_SD_MODULE_INIT
  1054. *
  1055. * Initialize a newly loaded WD/PD/TD module. This returns the
  1056. * modules private interface pointers for direct calling between
  1057. * the drivers. These pointers are valid until NtUnloadDriver()
  1058. * is called on the module.
  1059. *
  1060. * This is only available from kernel mode IRP_MJ_INTERNAL_DEVICE_CONTROL.
  1061. */
  1062. #define IOCTL_SD_MODULE_INIT _ICA_CTL_CODE( 3000, METHOD_NEITHER )
  1063. typedef struct _SD_MODULE_INIT {
  1064. PVOID SdLoadProc;
  1065. } SD_MODULE_INIT, *PSD_MODULE_INIT;
  1066. #ifndef _WINCON_
  1067. typedef struct _SMALL_RECT {
  1068. SHORT Left;
  1069. SHORT Top;
  1070. SHORT Right;
  1071. SHORT Bottom;
  1072. } SMALL_RECT, *PSMALL_RECT;
  1073. #ifdef _DEFCHARINFO_
  1074. typedef struct _CHAR_INFO {
  1075. union {
  1076. WCHAR UnicodeChar;
  1077. CHAR AsciiChar;
  1078. } Char;
  1079. USHORT Attributes;
  1080. } CHAR_INFO, *PCHAR_INFO;
  1081. typedef struct _COORD {
  1082. SHORT X;
  1083. SHORT Y;
  1084. } COORD, *PCOORD;
  1085. #endif
  1086. #endif // _WINCON_
  1087. typedef struct _ICA_FONT_PAIR {
  1088. ULONG Index;
  1089. ULONG Rows;
  1090. ULONG Columns;
  1091. ULONG ResolutionX;
  1092. ULONG ResolutionY;
  1093. ULONG FontSizeX;
  1094. ULONG FontSizeY;
  1095. } ICA_FONT_PAIR, *PICA_FONT_PAIR;
  1096. typedef struct _VIDEO_ICA_MODE_FONT_PAIR {
  1097. ULONG Count;
  1098. #ifdef COMPILERERROR
  1099. ICA_FONT_PAIR FontPair[0];
  1100. #else
  1101. ICA_FONT_PAIR* FontPair;
  1102. #endif
  1103. } VIDEO_ICA_MODE_FONT_PAIR, *PVIDEO_ICA_MODE_FONT_PAIR;
  1104. typedef struct _VIDEO_ICA_SET_CP {
  1105. ULONG CodePage;
  1106. ULONG TextModeIndex;
  1107. } VIDEO_ICA_SET_CP, *PVIDEO_ICA_SET_CP;
  1108. typedef struct _VIDEO_ICA_COPY_FRAME_BUFFER {
  1109. ULONG DestFrameBufOffset;
  1110. ULONG SourceFrameBufOffset;
  1111. ULONG ByteCount;
  1112. } VIDEO_ICA_COPY_FRAME_BUFFER, *PVIDEO_ICA_COPY_FRAME_BUFFER;
  1113. typedef struct _VIDEO_ICA_WRITE_TO_FRAME_BUFFER {
  1114. PCHAR_INFO pBuffer;
  1115. ULONG ByteCount;
  1116. ULONG FrameBufOffset;
  1117. } VIDEO_ICA_WRITE_TO_FRAME_BUFFER, *PVIDEO_ICA_WRITE_TO_FRAME_BUFFER;
  1118. typedef enum _ICASCROLLCLASS {
  1119. IcaScrollScreenUp,
  1120. IcaScrollRect,
  1121. IcaScrollNothing,
  1122. } ICASCROLLCLASS;
  1123. typedef struct _VIDEO_ICA_SCROLL {
  1124. SMALL_RECT ScrollRect;
  1125. SMALL_RECT MergeRect1;
  1126. SMALL_RECT MergeRect2;
  1127. COORD TargetPoint;
  1128. CHAR_INFO Fill;
  1129. ICASCROLLCLASS Type;
  1130. } VIDEO_ICA_SCROLL, * PVIDEO_ICA_SCROLL;
  1131. typedef struct _VIDEO_ICA_CREATE_THREAD {
  1132. PVOID ThreadAddress;
  1133. ULONG ThreadPriority;
  1134. PVOID ThreadContext;
  1135. } VIDEO_ICA_CREATE_THREAD, * PVIDEO_ICA_CREATE_THREAD;
  1136. /*=============================================================================
  1137. == Command Channel
  1138. =============================================================================*/
  1139. /*
  1140. * Command Channel functions
  1141. */
  1142. #define ICA_COMMAND_BROKEN_CONNECTION 1
  1143. #define ICA_COMMAND_REDRAW_RECTANGLE 2 // SetFocus
  1144. #define ICA_COMMAND_REDRAW_SCREEN 3 // SetFocus
  1145. #define ICA_COMMAND_STOP_SCREEN_UPDATES 4 // KillFocus
  1146. #define ICA_COMMAND_SOFT_KEYBOARD 5
  1147. #define ICA_COMMAND_SHADOW_HOTKEY 6
  1148. #define ICA_COMMAND_DISPLAY_IOCTL 7
  1149. /*
  1150. * Common header for all command channel functions
  1151. */
  1152. typedef struct _ICA_COMMAND_HEADER {
  1153. UCHAR Command;
  1154. } ICA_COMMAND_HEADER, *PICA_COMMAND_HEADER;
  1155. /*
  1156. * Broken connection requests
  1157. */
  1158. typedef enum _BROKENCLASS {
  1159. Broken_Unexpected = 1,
  1160. Broken_Disconnect,
  1161. Broken_Terminate,
  1162. } BROKENCLASS;
  1163. typedef enum _BROKENSOURCECLASS {
  1164. BrokenSource_User = 1,
  1165. BrokenSource_Server,
  1166. } BROKENSOURCECLASS;
  1167. /*
  1168. * ICA_COMMAND_BROKEN_CONNECTION
  1169. */
  1170. typedef struct _ICA_BROKEN_CONNECTION {
  1171. BROKENCLASS Reason;
  1172. BROKENSOURCECLASS Source;
  1173. } ICA_BROKEN_CONNECTION, *PICA_BROKEN_CONNECTION;
  1174. /*
  1175. * ICA_COMMAND_REDRAW_RECTANGLE
  1176. */
  1177. typedef struct _ICA_REDRAW_RECTANGLE {
  1178. SMALL_RECT Rect;
  1179. } ICA_REDRAW_RECTANGLE, *PICA_REDRAW_RECTANGLE;
  1180. /*
  1181. * ICA_COMMAND_SOFT_KEYBOARD
  1182. */
  1183. typedef struct _ICA_SOFT_KEYBOARD {
  1184. ULONG SoftKeyCmd;
  1185. } ICA_SOFT_KEYBOARD, *PICA_SOFT_KEYBOARD;
  1186. /*
  1187. * ICA_COMMAND_DISPLAY_IOCTL
  1188. */
  1189. #define MAX_DISPLAY_IOCTL_DATA 2041
  1190. #define DISPLAY_IOCTL_FLAG_REDRAW 0x1
  1191. typedef struct _ICA_DISPLAY_IOCTL {
  1192. ULONG DisplayIOCtlFlags;
  1193. ULONG cbDisplayIOCtlData;
  1194. UCHAR DisplayIOCtlData[ MAX_DISPLAY_IOCTL_DATA ];
  1195. } ICA_DISPLAY_IOCTL, *PICA_DISPLAY_IOCTL;
  1196. /*
  1197. * ICA Channel Commands
  1198. */
  1199. typedef struct _ICA_CHANNEL_COMMAND {
  1200. ICA_COMMAND_HEADER Header;
  1201. union {
  1202. ICA_BROKEN_CONNECTION BrokenConnection;
  1203. ICA_REDRAW_RECTANGLE RedrawRectangle;
  1204. ICA_SOFT_KEYBOARD SoftKeyboard;
  1205. ICA_DISPLAY_IOCTL DisplayIOCtl;
  1206. };
  1207. } ICA_CHANNEL_COMMAND, *PICA_CHANNEL_COMMAND;
  1208. /*
  1209. * ICA_DEVICE_BITMAP_INFO
  1210. *
  1211. */
  1212. typedef struct _ICA_DEVICE_BITMAP_INFO {
  1213. LONG cx;
  1214. LONG cy;
  1215. } ICA_DEVICE_BITMAP_INFO, *PICA_DEVICE_BITMAP_INFO;
  1216. /*=============================================================================
  1217. == Tracing
  1218. =============================================================================*/
  1219. /*
  1220. * IcaTrace - Trace Class
  1221. */
  1222. #define TC_ICASRV 0x00000001 // ica service
  1223. #define TC_ICAAPI 0x00000002 // icadd interface dll
  1224. #define TC_ICADD 0x00000004 // ica device driver
  1225. #define TC_WD 0x00000008 // winstation driver
  1226. #define TC_CD 0x00000010 // connection driver
  1227. #define TC_PD 0x00000020 // protocol driver
  1228. #define TC_TD 0x00000040 // transport driver
  1229. #define TC_RELIABLE 0x00000100 // reliable protocol driver
  1230. #define TC_FRAME 0x00000200 // frame protocol driver
  1231. #define TC_COMP 0x00000400 // compression
  1232. #define TC_CRYPT 0x00000800 // encryption
  1233. #define TC_TW 0x10000000 // thinwire
  1234. #define TC_DISPLAY 0x10000000 // display driver
  1235. #define TC_WFSHELL 0x20000000
  1236. #define TC_WX 0x40000000 // winstation extension
  1237. #define TC_LOAD 0x80000000 // load balancing
  1238. #define TC_ALL 0xffffffff // everything
  1239. /*
  1240. * IcaTrace - Trace Type
  1241. */
  1242. #define TT_API1 0x00000001 // api level 1
  1243. #define TT_API2 0x00000002 // api level 2
  1244. #define TT_API3 0x00000004 // api level 3
  1245. #define TT_API4 0x00000008 // api level 4
  1246. #define TT_OUT1 0x00000010 // output level 1
  1247. #define TT_OUT2 0x00000020 // output level 2
  1248. #define TT_OUT3 0x00000040 // output level 3
  1249. #define TT_OUT4 0x00000080 // output level 4
  1250. #define TT_IN1 0x00000100 // input level 1
  1251. #define TT_IN2 0x00000200 // input level 2
  1252. #define TT_IN3 0x00000400 // input level 3
  1253. #define TT_IN4 0x00000800 // input level 4
  1254. #define TT_ORAW 0x00001000 // raw output data
  1255. #define TT_IRAW 0x00002000 // raw input data
  1256. #define TT_OCOOK 0x00004000 // cooked output data
  1257. #define TT_ICOOK 0x00008000 // cooked input data
  1258. #define TT_SEM 0x00010000 // semaphores
  1259. #define TT_NONE 0x10000000 // only view errors
  1260. #define TT_ERROR 0xffffffff // error condition
  1261. /*
  1262. * RDP Display Driver: DrvEscape escape numbers
  1263. */
  1264. #define ESC_TIMEROBJ_SIGNALED 0x01
  1265. #define ESC_SET_WD_TIMEROBJ 0x02
  1266. #define ESC_GET_DEVICEBITMAP_SUPPORT 0x05
  1267. /*=============================================================================
  1268. ==
  1269. Optional Channel Write IRP Flags. These are passed by reference to a ULONG value,
  1270. in the first field of the IRP.Tail.Overlay.DriverContext array for channel IRP_MJ_WRITE
  1271. IRP's. See IcaWriteChannel for details.
  1272. ============================================================================*/
  1273. #define CHANNEL_WRITE_LOWPRIO 0x00000001 // Write can block behind
  1274. // default priority writes.
  1275. #endif //ICADDH