ReactOS  0.4.15-dev-506-ga3ec01c
kdlock.c File Reference
#include <ntoskrnl.h>
#include <debug.h>
Include dependency graph for kdlock.c:

Go to the source code of this file.

Macros

#define NDEBUG
 

Functions

VOID NTAPI KdpPortLock (VOID)
 
VOID NTAPI KdpPortUnlock (VOID)
 
BOOLEAN NTAPI KdpPollBreakInWithPortLock (VOID)
 
BOOLEAN NTAPI KdPollBreakIn (VOID)
 

Macro Definition Documentation

◆ NDEBUG

#define NDEBUG

Definition at line 12 of file kdlock.c.

Function Documentation

◆ KdPollBreakIn()

BOOLEAN NTAPI KdPollBreakIn ( VOID  )

Definition at line 75 of file kdlock.c.

76 {
77  BOOLEAN DoBreak = FALSE, Enable;
78 
79  /* First make sure that KD is enabled */
81  {
82  /* Disable interrupts */
84 
85  /* Check if a CTRL-C is in the queue */
87  {
88  /* Set it and prepare for break */
90  DoBreak = TRUE;
92  }
93  else
94  {
95  /* Try to acquire the lock */
97  {
98  /* Now get a packet */
100  NULL,
101  NULL,
102  NULL,
104  {
105  /* Successful breakin */
106  DoBreak = TRUE;
108  }
109 
110  /* Let go of the port */
111  KdpPortUnlock();
112  }
113  }
114 
115  /* Re-enable interrupts if they were enabled previously */
116  if (Enable) _enable();
117  }
118 
119  /* Tell the caller to do a break */
120  return DoBreak;
121 }
#define KdPacketReceived
Definition: kddll.h:5
#define TRUE
Definition: types.h:120
void __cdecl _enable(void)
Definition: intrin_arm.h:373
_In_ ULONGLONG _In_ ULONGLONG _In_ BOOLEAN Enable
Definition: ntddpcm.h:140
KDP_STATUS NTAPI KdReceivePacket(IN ULONG PacketType, OUT PSTRING MessageHeader, OUT PSTRING MessageData, OUT PULONG DataLength, IN OUT PKD_CONTEXT KdContext)
Definition: kddll.c:80
KSPIN_LOCK KdpDebuggerLock
Definition: kddata.c:67
VOID NTAPI KdpPortUnlock(VOID)
Definition: kdlock.c:27
BOOLEAN KdpControlCPressed
Definition: kddata.c:68
unsigned char BOOLEAN
smooth NULL
Definition: ftsmooth.c:416
BOOLEAN KdDebuggerEnabled
Definition: kdmain.c:48
FORCEINLINE BOOLEAN KeDisableInterrupts(VOID)
Definition: ke.h:176
KD_CONTEXT KdpContext
Definition: kddata.c:65
BOOLEAN KdpControlCPending
Definition: windbgkd.h:227
BOOLEAN FASTCALL KeTryToAcquireSpinLockAtDpcLevel(IN OUT PKSPIN_LOCK SpinLock)
Definition: spinlock.c:303
#define PACKET_TYPE_KD_POLL_BREAKIN
Definition: windbgkd.h:49

◆ KdpPollBreakInWithPortLock()

BOOLEAN NTAPI KdpPollBreakInWithPortLock ( VOID  )

Definition at line 35 of file kdlock.c.

36 {
37  BOOLEAN DoBreak = FALSE;
38 
39  /* First make sure that KD is enabled */
41  {
42  /* Check if a CTRL-C is in the queue */
44  {
45  /* Set it and prepare for break */
46  DoBreak = TRUE;
48  }
49  else
50  {
51  /* Now get a packet */
53  NULL,
54  NULL,
55  NULL,
57  {
58  /* Successful breakin */
59  DoBreak = TRUE;
60  }
61  }
62  }
63 
64  /* Tell the caller to do a break */
65  return DoBreak;
66 }
#define KdPacketReceived
Definition: kddll.h:5
#define TRUE
Definition: types.h:120
KDP_STATUS NTAPI KdReceivePacket(IN ULONG PacketType, OUT PSTRING MessageHeader, OUT PSTRING MessageData, OUT PULONG DataLength, IN OUT PKD_CONTEXT KdContext)
Definition: kddll.c:80
unsigned char BOOLEAN
smooth NULL
Definition: ftsmooth.c:416
BOOLEAN KdDebuggerEnabled
Definition: kdmain.c:48
KD_CONTEXT KdpContext
Definition: kddata.c:65
BOOLEAN KdpControlCPending
Definition: windbgkd.h:227
#define PACKET_TYPE_KD_POLL_BREAKIN
Definition: windbgkd.h:49

◆ KdpPortLock()

VOID NTAPI KdpPortLock ( VOID  )

Definition at line 19 of file kdlock.c.

20 {
21  /* Acquire the lock */
23 }
KSPIN_LOCK KdpDebuggerLock
Definition: kddata.c:67
VOID FASTCALL KiAcquireSpinLock(IN PKSPIN_LOCK SpinLock)
Definition: ntoskrnl.c:28

◆ KdpPortUnlock()

VOID NTAPI KdpPortUnlock ( VOID  )

Definition at line 27 of file kdlock.c.

28 {
29  /* Release the lock */
31 }
KSPIN_LOCK KdpDebuggerLock
Definition: kddata.c:67
VOID FASTCALL KiReleaseSpinLock(IN PKSPIN_LOCK SpinLock)
Definition: ntoskrnl.c:35

Referenced by KdPollBreakIn().