[NTOS:KD/KDBG] Code enhancements for KDBG/KD.
authorHermès Bélusca-Maïto <hermes.belusca-maito@reactos.org>
Sun, 17 Nov 2019 15:44:22 +0000 (16:44 +0100)
committerHermès Bélusca-Maïto <hermes.belusca-maito@reactos.org>
Sun, 17 Nov 2019 22:21:50 +0000 (23:21 +0100)
commit9537653ee79376b200be87ebabd7e6ce7a30065f
treea687515dec94b3f78e708b36e3cda6fb9d048a1a
parenta4b6e0d929b0696fa7c9a258476ea1ff5778a125
[NTOS:KD/KDBG] Code enhancements for KDBG/KD.

- Introduce KdpScreenAcquire() / KdpScreenRelease() helpers that allow
  to correctly acquire or release the screen when using INBV for
  "Screen-Mode" debugging.

- Introduce KdpAcquireLock() / KdpReleaseLock() helpers so as to reduce
  the copy-pasted code required when acquiring spin-locks in the KD debug
  logger functions.

- Close the opened KdpLogFileHandle file in the KdpInitDebugLog() logger
  in case we failed to create the logger writer thread.
  Also use explicit kernel-mode handle when opening the log file.

- static-ify some local variables, remove few hardcoded values, and
  minor formatting.

- Correctly define the INIT_FUNCTION's.
ntoskrnl/include/internal/kd.h
ntoskrnl/kd/kdinit.c
ntoskrnl/kd/kdio.c
ntoskrnl/kd64/kdinit.c
ntoskrnl/kdbg/kdb.c