windows-nt/Source/XPSP1/NT/base/boot/bd/poll.c
2020-09-26 16:20:57 +08:00

76 lines
1.3 KiB
C
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

/*++
Copyright (c) 1996 Microsoft Corporation
Module Name:
poll.c
Abstract:
This module contains code to poll for debugger breakin.
Author:
David N. Cutler (davec) 27-Nov-96
Revision History:
--*/
#include "bd.h"
LOGICAL
BdPollBreakIn(
VOID
)
/*++
Routine Description:
This function checks to determine if a breakin packet is pending.
If a packet is present.
A packet is present if:
There is a valid character which matches BREAK_CHAR.
Return Value:
A function value of TRUE is returned if a breakin packet is present.
Otherwise, a value of FALSE is returned.
--*/
{
LOGICAL BreakIn;
UCHAR Input;
ULONG Status;
//
// If the debugger is enabled, check if a breakin by the kernel
// debugger is pending.
//
BreakIn = FALSE;
if (BdDebuggerEnabled != FALSE) {
if (BdControlCPending != FALSE) {
BdControlCPressed = TRUE;
BreakIn = TRUE;
BdControlCPending = FALSE;
} else {
Status = BlPortPollByte(BdFileId, &Input);
if ((Status == CP_GET_SUCCESS) &&
(Input == BREAKIN_PACKET_BYTE)) {
BreakIn = TRUE;
BdControlCPressed = TRUE;
}
}
}
return BreakIn;
}