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.

56 lines
1.2 KiB

  1. /*++
  2. Copyright (c) 1989 Microsoft Corporation
  3. Module Name:
  4. conreqst.c
  5. Abstract:
  6. This module implements the POSIX console API calls
  7. Author:
  8. Avi Nathan (avin) 23-Jul-1991
  9. Revision History:
  10. Ellen Aycock-Wright (ellena) 15-Sept-1991 Modified for POSIX
  11. --*/
  12. #include "psxdll.h"
  13. NTSTATUS
  14. SendConsoleRequest(IN OUT PSCREQUESTMSG Request)
  15. {
  16. HANDLE SessionPort;
  17. NTSTATUS Status;
  18. PORT_MSG_TOTAL_LENGTH(*Request) = sizeof(SCREQUESTMSG);
  19. PORT_MSG_DATA_LENGTH(*Request) = sizeof(SCREQUESTMSG) - sizeof(PORT_MESSAGE);
  20. PORT_MSG_ZERO_INIT(*Request) = 0L;
  21. SessionPort = ((PPEB_PSX_DATA)(NtCurrentPeb()->SubSystemData))->SessionPortHandle;
  22. Status = NtRequestWaitReplyPort(SessionPort, (PPORT_MESSAGE)Request,
  23. (PPORT_MESSAGE) Request);
  24. if (!NT_SUCCESS(Status)) {
  25. KdPrint(("PSXDLL: Unable to send CON request: %X\n", Status));
  26. if (0xffffffff == Status) {
  27. return STATUS_UNSUCCESSFUL;
  28. }
  29. //
  30. // Probably somebody shot posix.exe, or he died for some other
  31. // reason. We'll shoot the user's process for him.
  32. //
  33. _exit(99);
  34. }
  35. ASSERT(PORT_MSG_TYPE(*Request) == LPC_REPLY);
  36. return Request->Status;
  37. }