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.

262 lines
9.8 KiB

  1. /* File: D:\WACKER\tdll\session.h (Created: 01-Dec-1993)
  2. *
  3. * Copyright 1994 by Hilgraeve Inc. -- Monroe, MI
  4. * All rights reserved
  5. *
  6. * $Revision: 7 $
  7. * $Date: 5/29/02 2:17p $
  8. */
  9. /* --- Child window identifiers --- */
  10. #define IDC_STATUS_WIN 1 // ID of status window
  11. #define IDC_TOOLBAR_WIN 2 // ID of toolbar window
  12. #define IDC_TERMINAL_WIN 3 // ID of terminal window
  13. #define IDC_SIDEBAR_WIN 4 // ID of sidebar window
  14. /* --- Suspend identifiers --- */
  15. #define SUSPEND_SCRLCK 1
  16. #define SUSPEND_TERMINAL_MARKING 2
  17. #define SUSPEND_TERMINAL_LBTNDN 3
  18. #define SUSPEND_TERMINAL_COPY 4
  19. /* --- Command line connection flags --- */
  20. #define CMDLN_DIAL_NEW 0
  21. #define CMDLN_DIAL_DIAL 1
  22. #define CMDLN_DIAL_OPEN 2 // don't attempt connection
  23. #define CMDLN_DIAL_WINSOCK 3 // try the command line as an IP address
  24. /* --- Notification event IDs used with NotifyClient --- */
  25. #define WM_SESS_NOTIFY WM_USER+0x100
  26. #define WM_SESS_ENDDLG WM_USER+0x101
  27. #define WM_FAKE_TIMER WM_USER+0x102 // Used in timers.c
  28. #define WM_CMDLN_DIAL WM_USER+0x103
  29. #define WM_SESS_SIZE_SHOW WM_USER+0x104 // wPar=nCmdShow from WinMain()
  30. #define WM_CNCT_DIALNOW WM_USER+0x105 // wPar=connection flags.
  31. #define WM_DISCONNECT WM_USER+0x106 // wPar=disconnect flags.
  32. #define WM_HT_QUERYOPENFILE WM_USER+0x107 // lPar=global atom
  33. #define WM_SESS_SHOW_SIDEBAR WM_USER+0x108 // mrw,4/13/95
  34. #define WM_ERROR_MSG WM_USER+0x109 // jmh,3/25/96
  35. enum _emuNotify
  36. {
  37. EVENT_TERM_UPDATE, // Server has updated terminal buffer.
  38. EVENT_TERM_TRACK, // pause in data flow, can track cursor.
  39. EVENT_EMU_CLRATTR, // Clear attribute has changed.
  40. EVENT_EMU_SETTINGS, // Emulator settings changed.
  41. EVENT_FATALMEM_ERROR, // Unrecoverable memory error.
  42. EVENT_LOGFILE_ENTRY, // Server has a waiting log file item
  43. EVENT_BYTESRCH_END, // Script Byte search operation ended
  44. EVENT_USER_XFER_END, // User transfer ended
  45. EVENT_SCRIPT_XFER_END, // Script transfer ended
  46. EVENT_PORTONLY_OPEN, // similar to connection made
  47. EVENT_CONNECTION_OPENED, // connection driver made connection.
  48. EVENT_CONNECTION_CLOSED, // disconnect completed.
  49. EVENT_CONNECTION_INPROGRESS, // connection in progress
  50. EVENT_GETSTRING_END, // Get String operation ended
  51. EVENT_HOST_XFER_REQ, // host transfer request made.
  52. EVENT_HOST_XFER_ENQ, // host transfer enquiry make.
  53. EVENT_CLOOP_SEND, // CLoop send called.
  54. EVENT_SCR_FUNC_END, // A script function ended
  55. EVENT_CLOSE_SESSION, // Instructs to close the session.
  56. EVENT_ERROR_MSG, // argument has string to load.
  57. EVENT_LEARN_SOMETHING, // learning has something to do
  58. EVENT_DDE_GOT_DATA, // dde has something to return
  59. EVENT_WAIT_FOR_CALLBACK, // system should wait for callback.
  60. EVENT_KILL_CALLBACK_DLG, // dismisses callback dialog
  61. EVENT_COM_DEACTIVATED, // com driver deactivated port
  62. EVENT_CNCT_DLG, // cnct driver connection dialog message
  63. EVENT_PRINT_ERROR, // printecho error.
  64. EVENT_LED_AA_ON, // obvious...
  65. EVENT_LED_CD_ON,
  66. EVENT_LED_OH_ON,
  67. EVENT_LED_RD_ON,
  68. EVENT_LED_SD_ON,
  69. EVENT_LED_TR_ON,
  70. EVENT_LED_MR_ON,
  71. EVENT_LED_AA_OFF,
  72. EVENT_LED_CD_OFF,
  73. EVENT_LED_OH_OFF,
  74. EVENT_LED_RD_OFF,
  75. EVENT_LED_SD_OFF,
  76. EVENT_LED_TR_OFF,
  77. EVENT_LED_MR_OFF,
  78. EVENT_LOST_CONNECTION
  79. };
  80. typedef enum _emuNotify NOTIFICATION;
  81. void NotifyClient(const HSESSION hSession, const NOTIFICATION nEvent,
  82. const long lExtra);
  83. void DecodeNotification(const HWND hwndSession, WPARAM wPar, LPARAM lPar);
  84. void DecodeSessionNotification(const HWND hwndSession,
  85. const NOTIFICATION nEvent,
  86. const LPARAM lExtra);
  87. /* --- Create and Destroy Functions --- */
  88. HSESSION CreateSessionHandle(const HWND hwndSession);
  89. BOOL InitializeSessionHandle(const HSESSION hSession, const HWND hwnd,
  90. const CREATESTRUCT *pcs);
  91. BOOL ReinitializeSessionHandle(const HSESSION hSession, const int fUpdateTitle);
  92. void DestroySessionHandle(const HSESSION hSession);
  93. HWND CreateSessionToolbar(const HSESSION hSession, const HWND hwndSession);
  94. HWND CreateTerminalWindow(const HWND hwndSession);
  95. int CreateEngineThread(const HSESSION hSession);
  96. void DestroyEngineThread(const HSESSION hSession);
  97. /* --- Set and Query functions --- */
  98. HWND sessQueryHwnd(const HSESSION hSession);
  99. HWND sessQueryHwndStatusbar(const HSESSION hSession);
  100. HWND sessQueryHwndToolbar(const HSESSION hSession);
  101. HUPDATE sessQueryUpdateHdl(const HSESSION hSession);
  102. void sessSetEngineThreadHdl(const HSESSION hSession, const HANDLE hThread);
  103. HANDLE sessQueryEngineThreadHdl(const HSESSION hSession);
  104. HWND sessQueryHwndTerminal(const HSESSION hSession);
  105. HTIMERMUX sessQueryTimerMux(const HSESSION hSession);
  106. VOID sessReleaseTimerMux(const HSESSION hSession);
  107. HEMU sessQueryEmuHdl(const HSESSION hSession);
  108. HCLOOP sessQueryCLoopHdl(const HSESSION hSession);
  109. HCOM sessQueryComHdl(const HSESSION hSession);
  110. HTRANSLATE sessQueryTranslateHdl(const HSESSION hSession);
  111. void sessSetSysFileHdl(const HSESSION hSession, const SF_HANDLE hSF);
  112. SF_HANDLE sessQuerySysFileHdl(const HSESSION hSession);
  113. HBACKSCRL sessQueryBackscrlHdl(const HSESSION hSession);
  114. HXFER sessQueryXferHdl(const HSESSION hSession);
  115. HFILES sessQueryFilesDirsHdl(const HSESSION hSession);
  116. HCAPTUREFILE sessQueryCaptureFileHdl(const HSESSION hSession);
  117. HPRINT sessQueryPrintHdl(const HSESSION hSession);
  118. void sessQueryCmdLn(const HSESSION hSession, LPTSTR pach, const int len);
  119. HCNCT sessQueryCnctHdl(const HSESSION hSession);
  120. #if defined(INCL_WINSOCK)
  121. int sessQueryTelnetPort(const HSESSION hSession);
  122. #endif
  123. void sessSetTimeout(const HSESSION hSession, int nTimeout);
  124. int sessQueryTimeout(const HSESSION hSession);
  125. void sessInitializeIcons(HSESSION hSession);
  126. void sessLoadIcons(HSESSION hSession);
  127. void sessSaveIcons(HSESSION hSession);
  128. void sessSetIconID(const HSESSION hSession, const int nID);
  129. int sessQueryIconID(const HSESSION hSession);
  130. HICON sessQueryIcon(const HSESSION hSession);
  131. HICON sessQueryLittleIcon(const HSESSION hSession);
  132. void sessSetName(const HSESSION hSession, const LPTSTR pach);
  133. void sessQueryName(const HSESSION hSession, const LPTSTR pach, unsigned uSize);
  134. int sessQuerySound(const HSESSION hSession);
  135. void sessSetSound(const HSESSION hSession, int fSound);
  136. //mpt:10-28-97 added 'exit on disconnect' feature
  137. int sessQueryExit(const HSESSION hSession);
  138. void sessSetExit(const HSESSION hSession, int fExit);
  139. int sessQueryIsNewSession(const HSESSION hSession);
  140. void sessSetIsNewSession(const HSESSION hSession, int fIsNewSession);
  141. void sessQueryOldName(const HSESSION hSession, const LPTSTR pach, unsigned uSize);
  142. BOOL sessIsSessNameDefault(LPTSTR pacName);
  143. void sessQueryWindowRect(const HSESSION hSession, RECT *rec);
  144. int sessQueryWindowShowCmd(const HSESSION hSession);
  145. HWND sessQuerySidebarHwnd(const HSESSION hSession);
  146. HWND CreateSidebar(const HWND hwndSession, const HSESSION hSession);
  147. // REV: 2/28/2002 added 'Allow host initiated file transfers' feature
  148. BOOL sessQueryAllowHostXfers(const HSESSION hSession);
  149. void sessSetAllowHostXfers(const HSESSION hSession, BOOL fAllowHostXfers);
  150. /* --- sessmenu.c --- */
  151. void sessInitMenuPopupCall(const HSESSION hSession, const HMENU hMenu);
  152. void sessInitMenuPopupEdit(const HSESSION hSession, const HMENU hMenu);
  153. void sessInitMenuPopupView(const HSESSION hSession, const HMENU hMenu);
  154. void sessInitMenuPopupTransfer(const HSESSION hSession, const HMENU hMenu);
  155. void sessInitMenuPopupHelp(const HSESSION hSession, const HMENU hMenu);
  156. void HandleContextMenu(HWND hwnd, POINT point);
  157. /* --- sessutil.c --- */
  158. void sessSnapToTermWindow(const HWND hwnd);
  159. BOOL sessComputeSnapSize(const HSESSION hSession, const LPRECT prc);
  160. void sessSetMinMaxInfo(const HSESSION hSession, const PMINMAXINFO pmmi);
  161. int OpenSession(const HSESSION hSession, HWND hwnd);
  162. BOOL SaveSession(const HSESSION hSession, HWND hwnd);
  163. void SilentSaveSession(const HSESSION hSession, HWND hwnd, BOOL fExplicit);
  164. void SaveAsSession(const HSESSION hSession, HWND hwnd);
  165. void sessSaveSessionStuff(const HSESSION hSession);
  166. BOOL sessLoadSessionStuff(const HSESSION hSession);
  167. void sessSetSuspend(const HSESSION hSession, const int iReason);
  168. void sessClearSuspend(const HSESSION hSession, const int iReason);
  169. BOOL IsSessionSuspended(const HSESSION hSession);
  170. BOOL sessSaveBackScroll(const HSESSION hSession);
  171. BOOL sessRestoreBackScroll(const HSESSION hSession);
  172. BOOL sessQueryToolbarVisible(const HSESSION hSession);
  173. BOOL sessSetToolbarVisible(const HSESSION hSession, const BOOL fVisible);
  174. BOOL sessQueryStatusbarVisible(const HSESSION hSession);
  175. BOOL sessSetStatusbarVisible(const HSESSION hSession, const BOOL fVisible);
  176. void sessCmdLnDial(const HSESSION hSession);
  177. void sessUpdateAppTitle(const HSESSION hSession);
  178. BOOL sessDisconnectToContinue(const HSESSION hSession, HWND hwnd);
  179. void sessSizeAndShow(const HWND hwnd, const int nCmdShow);
  180. void sessBeeper(const HSESSION hSession);
  181. /* --- fontdlg.c --- */
  182. void DisplayFontDialog(const HSESSION hSession, BOOL fPrinterFont);
  183. /* --- termcpy.c --- */
  184. BOOL CopyMarkedTextFromTerminal(const HSESSION hSession, void **ppv,
  185. DWORD *pdwCnt, const BOOL fIncludeLF);
  186. BOOL CopyTextFromTerminal(const HSESSION hSession,
  187. const PPOINT pptBeg,
  188. const PPOINT pptEnd,
  189. void **ppv,
  190. DWORD *dwCnt,
  191. const BOOL fIncludeLF);
  192. /* --- clipbrd.c --- */
  193. BOOL PasteFromClipboardToHost(const HWND hwnd, const HSESSION hSession);
  194. /* --- toolbar.c --- */
  195. VOID ToolbarNeedsText(HSESSION hSession, LPARAM lPar);
  196. LRESULT ToolbarNotification(const HWND hwnd,
  197. const int nId,
  198. const int nNotify,
  199. const HWND hwndCtrl);
  200. void ToolbarEnableMinitelButtons(const HWND hwndToolbar, const int fEnable);
  201. void ToolbarEnableButton(const HWND hwndToolbar, const int uID, BOOL fEnable);