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.

75 lines
1.3 KiB

  1. /*++
  2. Copyright (c) 1996 Microsoft Corporation
  3. Module Name:
  4. poll.c
  5. Abstract:
  6. This module contains code to poll for debugger breakin.
  7. Author:
  8. David N. Cutler (davec) 27-Nov-96
  9. Revision History:
  10. --*/
  11. #include "bd.h"
  12. LOGICAL
  13. BdPollBreakIn(
  14. VOID
  15. )
  16. /*++
  17. Routine Description:
  18. This function checks to determine if a breakin packet is pending.
  19. If a packet is present.
  20. A packet is present if:
  21. There is a valid character which matches BREAK_CHAR.
  22. Return Value:
  23. A function value of TRUE is returned if a breakin packet is present.
  24. Otherwise, a value of FALSE is returned.
  25. --*/
  26. {
  27. LOGICAL BreakIn;
  28. UCHAR Input;
  29. ULONG Status;
  30. //
  31. // If the debugger is enabled, check if a breakin by the kernel
  32. // debugger is pending.
  33. //
  34. BreakIn = FALSE;
  35. if (BdDebuggerEnabled != FALSE) {
  36. if (BdControlCPending != FALSE) {
  37. BdControlCPressed = TRUE;
  38. BreakIn = TRUE;
  39. BdControlCPending = FALSE;
  40. } else {
  41. Status = BlPortPollByte(BdFileId, &Input);
  42. if ((Status == CP_GET_SUCCESS) &&
  43. (Input == BREAKIN_PACKET_BYTE)) {
  44. BreakIn = TRUE;
  45. BdControlCPressed = TRUE;
  46. }
  47. }
  48. }
  49. return BreakIn;
  50. }