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.

114 lines
2.4 KiB

  1. /*++
  2. Copyright (c) 1989 Microsoft Corporation
  3. Module Name:
  4. psxses.h
  5. Abstract:
  6. Main header file for PSXSES module.
  7. This module contains includes for both WIN32 and native NT modules.
  8. Most files are clean WIN32 sources. files named nt* contain NT
  9. calls and provides the interaction with psx server and client.
  10. Author:
  11. Avi Nathan (avin) 17-Jul-1991
  12. Environment:
  13. User Mode Only
  14. Revision History:
  15. Ellen Aycock-Wright (ellena) 15-Sept-1991 Modified for POSIX
  16. --*/
  17. #include <nt.h>
  18. #include <ntrtl.h>
  19. #include <nturtl.h>
  20. #include <windows.h>
  21. #include "sesport.h"
  22. #include "util.h"
  23. HANDLE PsxSSPortHandle;
  24. HANDLE PsxSessionPort; // psxses side listner and reply
  25. HANDLE PsxSessionDataSectionHandle;
  26. HANDLE SSSessionHandle;
  27. PVOID PsxSessionDataBase;
  28. #define PSX_SESSION_PORT_MEMORY_SIZE 0x10000L //BUG BUG Should this be >?
  29. // Stuff for psx terminal emulator
  30. HANDLE hConsoleInput;
  31. HANDLE hConsoleOutput;
  32. extern BOOLEAN DoTrickyIO;
  33. extern BOOLEAN bStop;
  34. extern CRITICAL_SECTION StopMutex;
  35. extern HANDLE hStopEvent;
  36. extern COORD TrackedCoord;
  37. extern SHORT ScreenRowNum, ScreenColNum; // screen dimension
  38. DWORD TermioInit(void);
  39. #if DBG
  40. BOOL fVerbose;
  41. BOOL fTrace;
  42. #endif
  43. #define CTRL(c) ((c) & 0x1f)
  44. /*
  45. * address of the shared memory section of the console port.
  46. */
  47. PVOID PsxSesConPortBaseAddress;
  48. DWORD InitPsxSessionPort(VOID);
  49. BOOL StartProcess(DWORD SessionPortHandle,
  50. char *PgmName,
  51. char *CurrentDir,
  52. int argc,
  53. char **args,
  54. char **envp);
  55. DWORD WINAPI ServeSessionRequests(LPVOID Parameter);
  56. BOOL ServeTmRequest(PSCTMREQUEST PReq, PVOID PStatus);
  57. BOOL ServeTcRequest(PSCTCREQUEST PReq, PVOID PStatus);
  58. BOOL ServeConRequest(PSCCONREQUEST PReq, PDWORD PStatus);
  59. DWORD GetPsxChar(OUT PCHAR AsciiChar);
  60. VOID TerminateSession(ULONG ExitStatus);
  61. BOOL EventHandlerRoutine(IN DWORD CtrlType);
  62. VOID SetEventHandlers(IN BOOL fSet);
  63. DWORD AnsiInput(OUT LPSTR DestStr, IN DWORD cnt);
  64. DWORD AnsiOutput(OUT LPSTR SourceStr, IN DWORD cnt);
  65. ssize_t TermInput(
  66. IN HANDLE cs,
  67. OUT LPSTR DestStr,
  68. IN DWORD cnt,
  69. IN int flags,
  70. OUT int *pError
  71. );
  72. DWORD TermOutput(IN HANDLE cs, OUT LPSTR SourceStr, IN DWORD cnt);
  73. VOID SignalSession(int SignalType);
  74. typedef struct _CLIENT_AND_PORT {
  75. LIST_ENTRY Links;
  76. CLIENT_ID ClientId;
  77. HANDLE CommPort;
  78. } CLIENT_AND_PORT, *PCLIENT_AND_PORT;
  79. LIST_ENTRY ClientPortsList;