ReactOS  0.4.15-dev-1018-g0695ecb
kdio.c
Go to the documentation of this file.
1 /*
2  * COPYRIGHT: See COPYING in the top level directory
3  * PROJECT: ReactOS kernel
4  * FILE: ntoskrnl/kd/kdio.c
5  * PURPOSE: NT Kernel Debugger Input/Output Functions
6  *
7  * PROGRAMMERS: Alex Ionescu (alex@relsoft.net)
8  */
9 
10 /* INCLUDES ******************************************************************/
11 
12 #include <ntoskrnl.h>
13 #include <reactos/buildno.h>
14 
15 #define NDEBUG
16 #include <debug.h>
17 
18 /* GLOBALS *******************************************************************/
19 
20 #define KdpBufferSize (1024 * 512)
23 static volatile ULONG KdpCurrentPosition = 0;
24 static volatile ULONG KdpFreeBytes = 0;
28 ANSI_STRING KdpLogFileName = RTL_CONSTANT_STRING("\\SystemRoot\\debug.log");
29 
33 
34 /* Current Port in use. FIXME: Do we support more than one? */
36 
37 #define KdpScreenLineLengthDefault 80
40 
41 const ULONG KdpDmesgBufferSize = 128 * 1024; // 512*1024; // 5*1024*1024;
44 volatile ULONG KdpDmesgFreeBytes = 0;
48 
49 /* UTILITY FUNCTIONS *********************************************************/
50 
51 /*
52  * Get the total size of the memory before
53  * Mm is initialized, by counting the number
54  * of physical pages. Useful for debug logging.
55  *
56  * Strongly inspired by:
57  * mm\ARM3\mminit.c : MiScanMemoryDescriptors(...)
58  *
59  * See also: kd64\kdinit.c
60  */
61 static INIT_FUNCTION
62 SIZE_T
64 {
65  PLIST_ENTRY ListEntry;
67  SIZE_T NumberOfPhysicalPages = 0;
68 
69  /* Loop the memory descriptors */
70  for (ListEntry = LoaderBlock->MemoryDescriptorListHead.Flink;
71  ListEntry != &LoaderBlock->MemoryDescriptorListHead;
72  ListEntry = ListEntry->Flink)
73  {
74  /* Get the descriptor */
75  Descriptor = CONTAINING_RECORD(ListEntry,
77  ListEntry);
78 
79  /* Check if this is invisible memory */
80  if ((Descriptor->MemoryType == LoaderFirmwarePermanent) ||
81  (Descriptor->MemoryType == LoaderSpecialMemory) ||
82  (Descriptor->MemoryType == LoaderHALCachedMemory) ||
83  (Descriptor->MemoryType == LoaderBBTMemory))
84  {
85  /* Skip this descriptor */
86  continue;
87  }
88 
89  /* Check if this is bad memory */
90  if (Descriptor->MemoryType != LoaderBad)
91  {
92  /* Count this in the total of pages */
93  NumberOfPhysicalPages += Descriptor->PageCount;
94  }
95  }
96 
97  /* Round size up. Assumed to better match actual physical RAM size */
98  return ALIGN_UP_BY(NumberOfPhysicalPages * PAGE_SIZE, 1024 * 1024) / (1024 * 1024);
99 }
100 
101 /* See also: kd64\kdinit.c */
102 static INIT_FUNCTION
103 VOID
105 {
106  DPRINT1("-----------------------------------------------------\n");
107  DPRINT1("ReactOS " KERNEL_VERSION_STR " (Build " KERNEL_VERSION_BUILD_STR ") (Commit " KERNEL_VERSION_COMMIT_HASH ")\n");
108  DPRINT1("%u System Processor [%u MB Memory]\n", KeNumberProcessors, MemSizeMBs);
109  DPRINT1("Command Line: %s\n", KeLoaderBlock->LoadOptions);
111 }
112 
113 /* LOCKING FUNCTIONS *********************************************************/
114 
115 KIRQL
116 NTAPI
118 {
119  KIRQL OldIrql;
120 
121  /* Acquire the spinlock without waiting at raised IRQL */
122  while (TRUE)
123  {
124  /* Loop until the spinlock becomes available */
125  while (!KeTestSpinLock(SpinLock));
126 
127  /* Spinlock is free, raise IRQL to high level */
129 
130  /* Try to get the spinlock */
132  break;
133 
134  /* Someone else got the spinlock, lower IRQL back */
136  }
137 
138  return OldIrql;
139 }
140 
141 VOID
142 NTAPI
144  IN KIRQL OldIrql)
145 {
146  /* Release the spinlock */
148  // KeReleaseSpinLockFromDpcLevel(SpinLock);
149 
150  /* Restore the old IRQL */
152 }
153 
154 /* FILE DEBUG LOG FUNCTIONS **************************************************/
155 
156 static VOID
157 NTAPI
159 {
160  ULONG beg, end, num;
162 
164 
165  while (TRUE)
166  {
168 
169  /* Bug */
170  /* Keep KdpCurrentPosition and KdpFreeBytes values in local
171  * variables to avoid their possible change from Producer part,
172  * KdpPrintToLogFile function
173  */
175  num = KdpFreeBytes;
176 
177  /* Now securely calculate values, based on local variables */
178  beg = (end + num) % KdpBufferSize;
179  num = KdpBufferSize - num;
180 
181  /* Nothing to do? */
182  if (num == 0)
183  continue;
184 
185  if (end > beg)
186  {
188  KdpDebugBuffer + beg, num, NULL, NULL);
189  }
190  else
191  {
193  KdpDebugBuffer + beg, KdpBufferSize - beg, NULL, NULL);
194 
197  }
198 
200  }
201 }
202 
203 static VOID
204 NTAPI
206  ULONG StringLength)
207 {
208  KIRQL OldIrql;
209  ULONG beg, end, num;
210 
211  if (KdpDebugBuffer == NULL) return;
212 
213  /* Acquire the printing spinlock without waiting at raised IRQL */
215 
216  beg = KdpCurrentPosition;
217  num = KdpFreeBytes;
218  if (StringLength < num)
219  num = StringLength;
220 
221  if (num != 0)
222  {
223  end = (beg + num) % KdpBufferSize;
225  KdpFreeBytes -= num;
226 
227  if (end > beg)
228  {
230  }
231  else
232  {
235  }
236  }
237 
238  /* Release the spinlock */
240 
241  /* Signal the logger thread */
244 }
245 
246 VOID
247 NTAPI
248 KdpDebugLogInit(PKD_DISPATCH_TABLE DispatchTable,
249  ULONG BootPhase)
250 {
255  HANDLE ThreadHandle;
257  SIZE_T MemSizeMBs;
258 
259  if (!KdpDebugMode.File) return;
260 
261  if (BootPhase == 0)
262  {
264 
265  /* Write out the functions that we support for now */
266  DispatchTable->KdpInitRoutine = KdpDebugLogInit;
267  DispatchTable->KdpPrintRoutine = KdpPrintToLogFile;
268 
269  /* Register as a Provider */
270  InsertTailList(&KdProviders, &DispatchTable->KdProvidersList);
271  }
272  else if (BootPhase == 1)
273  {
274  /* Allocate a buffer for debug log */
277 
278  /* Initialize spinlock */
280 
281  /* Display separator + ReactOS version at start of the debug log */
282  /* Round size up. Assumed to better match actual physical RAM size */
283  MemSizeMBs = ALIGN_UP_BY(MmNumberOfPhysicalPages * PAGE_SIZE, 1024 * 1024) / (1024 * 1024);
284  KdpPrintBanner(MemSizeMBs);
285  }
286  else if (BootPhase == 2)
287  {
288  HalDisplayString("\r\n File log debugging enabled\r\n\r\n");
289  }
290  else if (BootPhase == 3)
291  {
292  /* Setup the log name */
294  if (!NT_SUCCESS(Status)) return;
295 
297  &FileName,
299  NULL,
300  NULL);
301 
302  /* Create the log file */
306  &Iosb,
307  NULL,
312  NULL,
313  0);
314 
316 
317  if (!NT_SUCCESS(Status))
318  return;
319 
321 
322  /* Create the logger thread */
323  Status = PsCreateSystemThread(&ThreadHandle,
325  NULL,
326  NULL,
327  NULL,
329  NULL);
330  if (!NT_SUCCESS(Status))
331  {
333  return;
334  }
335 
336  Priority = 7;
337  NtSetInformationThread(ThreadHandle,
339  &Priority,
340  sizeof(Priority));
341  }
342 }
343 
344 /* SERIAL FUNCTIONS **********************************************************/
345 
346 VOID
347 NTAPI
349  ULONG Length)
350 {
351  PCHAR pch = (PCHAR)Message;
352  KIRQL OldIrql;
353 
354  /* Acquire the printing spinlock without waiting at raised IRQL */
356 
357  /* Output the message */
358  while (pch < Message + Length && *pch != '\0')
359  {
360  if (*pch == '\n')
361  {
363  }
365  pch++;
366  }
367 
368  /* Release the spinlock */
370 }
371 
372 VOID
373 NTAPI
374 KdpSerialInit(PKD_DISPATCH_TABLE DispatchTable,
375  ULONG BootPhase)
376 {
377  SIZE_T MemSizeMBs;
378  if (!KdpDebugMode.Serial) return;
379 
380  if (BootPhase == 0)
381  {
382  /* Write out the functions that we support for now */
383  DispatchTable->KdpInitRoutine = KdpSerialInit;
384  DispatchTable->KdpPrintRoutine = KdpSerialDebugPrint;
385 
386  /* Initialize the Port */
388  {
389  KdpDebugMode.Serial = FALSE;
390  return;
391  }
393 
394  /* Initialize spinlock */
396 
397  /* Register as a Provider */
398  InsertTailList(&KdProviders, &DispatchTable->KdProvidersList);
399 
400  /* Display separator + ReactOS version at start of the debug log */
401  MemSizeMBs = KdpGetMemorySizeInMBs(KeLoaderBlock);
402  KdpPrintBanner(MemSizeMBs);
403  }
404  else if (BootPhase == 2)
405  {
406  HalDisplayString("\r\n Serial debugging enabled\r\n\r\n");
407  }
408 }
409 
410 /* SCREEN FUNCTIONS **********************************************************/
411 
412 VOID
414 {
415  if (InbvIsBootDriverInstalled() /* &&
416  !InbvCheckDisplayOwnership() */)
417  {
418  /* Acquire ownership and reset the display */
426  }
427 }
428 
429 // extern VOID NTAPI InbvSetDisplayOwnership(IN BOOLEAN DisplayOwned);
430 
431 VOID
433 {
436  {
437  /* Release the display */
438  // InbvSetDisplayOwnership(FALSE);
440  }
441 }
442 
443 /*
444  * Screen debug logger function KdpScreenPrint() writes text messages into
445  * KdpDmesgBuffer, using it as a circular buffer. KdpDmesgBuffer contents could
446  * be later (re)viewed using dmesg command of kdbg. KdpScreenPrint() protects
447  * KdpDmesgBuffer from simultaneous writes by use of KdpDmesgLogSpinLock.
448  */
449 static VOID
450 NTAPI
452  ULONG Length)
453 {
454  PCHAR pch = (PCHAR)Message;
455  KIRQL OldIrql;
456  ULONG beg, end, num;
457 
458  while (pch < Message + Length && *pch)
459  {
460  if (*pch == '\b')
461  {
462  /* HalDisplayString does not support '\b'. Workaround it and use '\r' */
463  if (KdpScreenLineLength > 0)
464  {
465  /* Remove last character from buffer */
468 
469  /* Clear row and print line again */
470  HalDisplayString("\r");
472  }
473  }
474  else
475  {
478  }
479 
481  {
482  /* Print buffered characters */
485 
486  /* Clear line buffer */
487  KdpScreenLineBuffer[0] = '\0';
489  }
490 
491  ++pch;
492  }
493 
494  /* Print buffered characters */
496  {
499  }
500 
501  /* Dmesg: store Message in the buffer to show it later */
502  if (KdbpIsInDmesgMode)
503  return;
504 
505  if (KdpDmesgBuffer == NULL)
506  return;
507 
508  /* Acquire the printing spinlock without waiting at raised IRQL */
510 
511  /* Invariant: always_true(KdpDmesgFreeBytes == KdpDmesgBufferSize);
512  * set num to min(KdpDmesgFreeBytes, Length).
513  */
516  if (num != 0)
517  {
518  end = (beg + num) % KdpDmesgBufferSize;
519  if (end > beg)
520  {
522  }
523  else
524  {
527  }
529 
530  /* Counting the total bytes written */
532  }
533 
534  /* Release the spinlock */
536 
537  /* Optional step(?): find out a way to notify about buffer exhaustion,
538  * and possibly fall into kbd to use dmesg command: user will read
539  * debug messages before they will be wiped over by next writes.
540  */
541 }
542 
543 VOID
544 NTAPI
545 KdpScreenInit(PKD_DISPATCH_TABLE DispatchTable,
546  ULONG BootPhase)
547 {
548  SIZE_T MemSizeMBs;
549  if (!KdpDebugMode.Screen) return;
550 
551  if (BootPhase == 0)
552  {
553  /* Write out the functions that we support for now */
554  DispatchTable->KdpInitRoutine = KdpScreenInit;
555  DispatchTable->KdpPrintRoutine = KdpScreenPrint;
556 
557  /* Register as a Provider */
558  InsertTailList(&KdProviders, &DispatchTable->KdProvidersList);
559  }
560  else if (BootPhase == 1)
561  {
562  /* Allocate a buffer for dmesg log buffer. +1 for terminating null,
563  * see kdbp_cli.c:KdbpCmdDmesg()/2
564  */
569 
570  /* Take control of the display */
572 
573  /* Initialize spinlock */
575 
576  /* Display separator + ReactOS version at start of the debug log */
577  /* Round size up. Assumed to better match actual physical RAM size */
578  MemSizeMBs = ALIGN_UP_BY(MmNumberOfPhysicalPages * PAGE_SIZE, 1024 * 1024) / (1024 * 1024);
579  KdpPrintBanner(MemSizeMBs);
580  }
581  else if (BootPhase == 2)
582  {
583  HalDisplayString("\r\n Screen debugging enabled\r\n\r\n");
584  }
585 }
586 
587 /* GENERAL FUNCTIONS *********************************************************/
588 
589 BOOLEAN
590 NTAPI
593 {
594  PLIST_ENTRY CurrentEntry;
595  PKD_DISPATCH_TABLE CurrentTable;
596 
597  if (!KdpDebugMode.Value) return FALSE;
598 
599  /* Call the registered handlers */
600  CurrentEntry = KdProviders.Flink;
601  while (CurrentEntry != &KdProviders)
602  {
603  /* Get the current table */
604  CurrentTable = CONTAINING_RECORD(CurrentEntry,
605  KD_DISPATCH_TABLE,
606  KdProvidersList);
607 
608  /* Call it */
609  CurrentTable->KdpPrintRoutine(Output->Buffer, Output->Length);
610 
611  /* Next Table */
612  CurrentEntry = CurrentEntry->Flink;
613  }
614 
615  /* Call the Wrapper Routine */
616  if (WrapperTable.KdpPrintRoutine)
617  WrapperTable.KdpPrintRoutine(Output->Buffer, Output->Length);
618 
619  return FALSE;
620 }
621 
622 extern STRING KdbPromptString;
623 
624 BOOLEAN
625 NTAPI
627  _In_ PSTRING PromptString,
628  _In_ PSTRING ResponseString)
629 {
630 #ifdef KDBG
631  KIRQL OldIrql;
632  STRING StringChar;
633  CHAR Response;
634  USHORT i;
635  ULONG DummyScanCode;
636 
637  StringChar.Buffer = &Response;
638  StringChar.Length = StringChar.MaximumLength = sizeof(Response);
639 
640  /* Display the string and print a new line for log neatness */
641  KdpPrintString(PromptString);
642  *StringChar.Buffer = '\n';
643  KdpPrintString(&StringChar);
644 
645  /* Print the kdb prompt */
647 
648  // TODO: Use an improved KdbpReadCommand() function for our purposes.
649 
650  /* Acquire the printing spinlock without waiting at raised IRQL */
652 
654  KbdDisableMouse();
655 
656  /* Loop the whole string */
657  for (i = 0; i < ResponseString->MaximumLength; i++)
658  {
659  /* Check if this is serial debugging mode */
661  {
662  /* Get the character from serial */
663  do
664  {
666  } while (Response == -1);
667  }
668  else
669  {
670  /* Get the response from the keyboard */
671  do
672  {
673  Response = KdbpTryGetCharKeyboard(&DummyScanCode, MAXULONG);
674  } while (Response == -1);
675  }
676 
677  /* Check for return */
678  if (Response == '\r')
679  {
680  /*
681  * We might need to discard the next '\n'.
682  * Wait a bit to make sure we receive it.
683  */
685 
686  /* Check the mode */
688  {
689  /* Read and discard the next character, if any */
691  }
692  else
693  {
694  /* Read and discard the next character, if any */
695  KdbpTryGetCharKeyboard(&DummyScanCode, 5);
696  }
697 
698  /*
699  * Null terminate the output string -- documentation states that
700  * DbgPrompt does not null terminate, but it does
701  */
702  *(PCHAR)(ResponseString->Buffer + i) = 0;
703  break;
704  }
705 
706  /* Write it back and print it to the log */
707  *(PCHAR)(ResponseString->Buffer + i) = Response;
709  KdpPrintString(&StringChar);
711  }
712 
713  /* Return the length */
714  ResponseString->Length = i;
715 
717  KbdEnableMouse();
718 
719  /* Release the spinlock */
721 
722  /* Print a new line */
723  *StringChar.Buffer = '\n';
724  KdpPrintString(&StringChar);
725 #endif
726 
727  /* Success; we don't need to resend */
728  return FALSE;
729 }
730 
731 /* EOF */
signed char * PCHAR
Definition: retypes.h:7
static BOOLEAN KdpLoggingEnabled
Definition: kdio.c:21
static CHAR KdpScreenLineBuffer[KdpScreenLineLengthDefault+1]
Definition: kdio.c:38
IN PUNICODE_STRING IN POBJECT_ATTRIBUTES ObjectAttributes
Definition: conport.c:35
VOID NTAPI InbvNotifyDisplayOwnershipLost(IN INBV_RESET_DISPLAY_PARAMETERS Callback)
Definition: inbv.c:638
#define IN
Definition: typedefs.h:39
#define THREAD_ALL_ACCESS
Definition: nt_native.h:1339
#define KeRaiseIrql(irql, oldIrql)
Definition: env_spec_w32.h:597
NTSYSAPI VOID NTAPI RtlCopyMemory(VOID UNALIGNED *Destination, CONST VOID UNALIGNED *Source, ULONG Length)
static HANDLE KdpLogFileHandle
Definition: kdio.c:27
FORCEINLINE _Post_maybenull_ _Must_inspect_result_ _In_ SIZE_T _In_ ULONG _In_ EX_POOL_PRIORITY Priority
Definition: exfuncs.h:700
PSTR ArcBootDeviceName
Definition: arc.h:503
#define KeLowerIrql(oldIrql)
Definition: env_spec_w32.h:602
KDP_DEBUG_MODE KdpDebugMode
Definition: kdinit.c:25
volatile ULONG KdpDmesgCurrentPosition
Definition: kdio.c:43
#define OBJ_CASE_INSENSITIVE
Definition: winternl.h:228
static volatile ULONG KdpFreeBytes
Definition: kdio.c:24
PCHAR KdpDmesgBuffer
Definition: kdio.c:42
ULONG KdbDebugState
Definition: kdb.c:45
#define TRUE
Definition: types.h:120
char CHAR
Definition: xmlstorage.h:175
static ULONG KdpScreenLineLength
Definition: kdio.c:39
LONG NTSTATUS
Definition: precomp.h:26
#define SCREEN_WIDTH
Definition: pc98video.c:27
static KSPIN_LOCK KdpDmesgLogSpinLock
Definition: kdio.c:47
VOID NTAPI KdpSerialInit(PKD_DISPATCH_TABLE DispatchTable, ULONG BootPhase)
Definition: kdio.c:374
VOID NTAPI InbvSolidColorFill(IN ULONG Left, IN ULONG Top, IN ULONG Right, IN ULONG Bottom, IN ULONG Color)
Definition: inbv.c:716
static INIT_FUNCTION VOID KdpPrintBanner(IN SIZE_T MemSizeMBs)
Definition: kdio.c:104
KIRQL NTAPI KdpAcquireLock(IN PKSPIN_LOCK SpinLock)
Definition: kdio.c:117
#define BV_COLOR_WHITE
Definition: display.h:30
static WCHAR String[]
Definition: stringtable.c:55
KSPIN_LOCK * PKSPIN_LOCK
Definition: env_spec_w32.h:73
GLuint GLuint end
Definition: gl.h:1545
#define InsertTailList(ListHead, Entry)
#define FILE_APPEND_DATA
Definition: nt_native.h:634
LONG NTAPI KeSetEvent(IN PKEVENT Event, IN KPRIORITY Increment, IN BOOLEAN Wait)
Definition: eventobj.c:159
NTSTATUS NTAPI KeWaitForSingleObject(IN PVOID Object, IN KWAIT_REASON WaitReason, IN KPROCESSOR_MODE WaitMode, IN BOOLEAN Alertable, IN PLARGE_INTEGER Timeout OPTIONAL)
Definition: wait.c:416
#define OBJ_KERNEL_HANDLE
Definition: winternl.h:231
LONG KPRIORITY
Definition: compat.h:551
#define pch(ap)
Definition: match.c:418
static KEVENT KdpLoggerThreadEvent
Definition: kdio.c:26
CHAR KdbpTryGetCharSerial(ULONG Retry)
Definition: kdb_serial.c:19
#define FILE_SHARE_READ
Definition: compat.h:136
CHAR KdbpTryGetCharKeyboard(PULONG ScanCode, ULONG Retry)
Definition: kdb_keyboard.c:104
LIST_ENTRY KdProviders
Definition: kdinit.c:29
_In_ PKSERVICE_ROUTINE _In_opt_ PVOID _In_opt_ PKSPIN_LOCK SpinLock
Definition: iofuncs.h:798
static KSPIN_LOCK KdpDebugLogSpinLock
Definition: kdio.c:25
static VOID NTAPI KdpPrintToLogFile(PCHAR String, ULONG StringLength)
Definition: kdio.c:205
static VOID NTAPI KdpScreenPrint(PCHAR Message, ULONG Length)
Definition: kdio.c:451
BOOLEAN NTAPI KdPortInitializeEx(PCPPORT PortInformation, ULONG ComPortNumber)
UCHAR KIRQL
Definition: env_spec_w32.h:591
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
NTSTATUS(* NTAPI)(IN PFILE_FULL_EA_INFORMATION EaBuffer, IN ULONG EaLength, OUT PULONG ErrorOffset)
Definition: IoEaTest.cpp:117
#define FALSE
Definition: types.h:117
VOID NTAPI KdpScreenInit(PKD_DISPATCH_TABLE DispatchTable, ULONG BootPhase)
Definition: kdio.c:545
STRING KdbPromptString
Definition: kdb_cli.c:136
VOID FASTCALL KiReleaseSpinLock(IN PKSPIN_LOCK SpinLock)
Definition: ntoskrnl.c:35
Definition: arc.h:130
ULONG KdpPort
Definition: kdio.c:35
#define DEFAULT_DEBUG_PORT
Definition: kdcom.c:25
VOID KdpScreenRelease(VOID)
Definition: kdio.c:432
FORCEINLINE VOID KeInitializeSpinLock(_Out_ PKSPIN_LOCK SpinLock)
Definition: kefuncs.h:238
#define FILE_WRITE_THROUGH
Definition: from_kernel.h:26
unsigned char BOOLEAN
smooth NULL
Definition: ftsmooth.c:416
VOID KbdEnableMouse(VOID)
ANSI_STRING KdpLogFileName
Definition: kdio.c:28
volatile ULONG KdbDmesgTotalWritten
Definition: kdio.c:45
VOID NTAPI KdPortPutByteEx(PCPPORT PortInformation, UCHAR ByteToSend)
NTSTATUS NTAPI NtSetInformationThread(IN HANDLE ThreadHandle, IN THREADINFOCLASS ThreadInformationClass, IN PVOID ThreadInformation, IN ULONG ThreadInformationLength)
Definition: query.c:2023
static VOID NTAPI KdpLoggerThread(PVOID Context)
Definition: kdio.c:158
PLOADER_PARAMETER_BLOCK KeLoaderBlock
Definition: krnlinit.c:29
PFLT_MESSAGE_WAITER_QUEUE CONTAINING_RECORD(Csq, DEVICE_EXTENSION, IrpQueue)) -> WaiterQ.mLock) _IRQL_raises_(DISPATCH_LEVEL) VOID NTAPI FltpAcquireMessageWaiterLock(_In_ PIO_CSQ Csq, _Out_ PKIRQL Irql)
Definition: Messaging.c:560
VOID NTAPI InbvSetTextColor(IN ULONG Color)
Definition: inbv.c:692
VOID KdpScreenAcquire(VOID)
Definition: kdio.c:413
#define PCHAR
Definition: match.c:90
BOOLEAN FASTCALL KeTestSpinLock(IN PKSPIN_LOCK SpinLock)
Definition: spinlock.c:442
#define SCREEN_HEIGHT
Definition: pc98video.c:28
struct _LIST_ENTRY * Flink
Definition: typedefs.h:121
static volatile ULONG KdpCurrentPosition
Definition: kdio.c:23
#define DEFAULT_DEBUG_BAUD_RATE
Definition: kdcom.c:28
PUCHAR KdComPortInUse
Definition: usage.c:17
NTSTATUS NTAPI NtCreateFile(OUT PHANDLE FileHandle, IN ACCESS_MASK DesiredAccess, IN POBJECT_ATTRIBUTES ObjectAttributes, OUT PIO_STATUS_BLOCK IoStatusBlock, IN PLARGE_INTEGER AllocationSize OPTIONAL, IN ULONG FileAttributes, IN ULONG ShareAccess, IN ULONG CreateDisposition, IN ULONG CreateOptions, IN PVOID EaBuffer OPTIONAL, IN ULONG EaLength)
return Iosb
Definition: create.c:4402
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:32
#define InterlockedExchangeAddUL(Addend, Value)
Definition: ex.h:1519
VOID KbdDisableMouse(VOID)
VOID NTAPI KdpReleaseLock(IN PKSPIN_LOCK SpinLock, IN KIRQL OldIrql)
Definition: kdio.c:143
GLuint GLuint num
Definition: glext.h:9618
#define KdpBufferSize
Definition: kdio.c:20
NTSYSAPI VOID NTAPI RtlFreeUnicodeString(PUNICODE_STRING UnicodeString)
#define KdpScreenLineLengthDefault
Definition: kdio.c:37
_In_ ULONG _In_ ULONG _In_ ULONG Length
Definition: ntddpcm.h:101
NTSTATUS NTAPI NtClose(IN HANDLE Handle)
Definition: obhandle.c:3399
Definition: ncftp.h:89
static PCHAR KdpDebugBuffer
Definition: kdio.c:22
CHAR Message[80]
Definition: alive.c:5
std::wstring STRING
Definition: fontsub.cpp:33
VOID NTAPI InbvAcquireDisplayOwnership(VOID)
Definition: inbv.c:528
#define FILE_ATTRIBUTE_NORMAL
Definition: compat.h:137
Status
Definition: gdiplustypes.h:24
_Requires_lock_held_ Interrupt _Releases_lock_ Interrupt _In_ _IRQL_restores_ KIRQL OldIrql
Definition: kefuncs.h:790
Definition: arc.h:85
#define ExAllocatePool(type, size)
Definition: fbtusb.h:44
#define VOID
Definition: acefi.h:82
NTSYSAPI NTSTATUS NTAPI NtWriteFile(IN HANDLE hFile, IN HANDLE hEvent OPTIONAL, IN PIO_APC_ROUTINE IoApcRoutine OPTIONAL, IN PVOID IoApcContext OPTIONAL, OUT PIO_STATUS_BLOCK pIoStatusBlock, IN PVOID WriteBuffer, IN ULONG WriteBufferLength, IN PLARGE_INTEGER FileOffset OPTIONAL, IN PULONG LockOperationKey OPTIONAL)
VOID NTAPI KdpSerialDebugPrint(PCHAR Message, ULONG Length)
Definition: kdio.c:348
#define PAGE_SIZE
Definition: env_spec_w32.h:49
volatile ULONG KdpDmesgFreeBytes
Definition: kdio.c:44
Definition: typedefs.h:119
#define SYNCHRONIZE
Definition: nt_native.h:61
const ULONG KdpDmesgBufferSize
Definition: kdio.c:41
PUCHAR Address
Definition: cportlib.h:29
CCHAR KeNumberProcessors
Definition: krnlinit.c:35
#define MAXULONG
Definition: typedefs.h:251
#define DISPATCH_LEVEL
Definition: env_spec_w32.h:696
BOOLEAN NTAPI InbvEnableDisplayString(IN BOOLEAN Enable)
Definition: inbv.c:606
#define _In_
Definition: no_sal2.h:204
BOOLEAN NTAPI InbvIsBootDriverInstalled(VOID)
Definition: inbv.c:630
ULONG_PTR SIZE_T
Definition: typedefs.h:80
#define HIGH_LEVEL
Definition: env_spec_w32.h:703
struct _FileName FileName
Definition: fatprocs.h:893
BOOLEAN NTAPI KdpPrintString(_In_ PSTRING Output)
Definition: kdio.c:591
PFN_COUNT MmNumberOfPhysicalPages
Definition: init.c:48
BOOLEAN NTAPI InbvResetDisplay(VOID)
Definition: inbv.c:664
#define KeInitializeEvent(pEvt, foo, foo2)
Definition: env_spec_w32.h:477
unsigned short USHORT
Definition: pedump.c:61
NTSYSAPI NTSTATUS NTAPI RtlAnsiStringToUnicodeString(PUNICODE_STRING DestinationString, PANSI_STRING SourceString, BOOLEAN AllocateDestinationString)
static KSPIN_LOCK KdpSerialSpinLock
Definition: kdio.c:30
static LSA_DISPATCH_TABLE DispatchTable
Definition: authpackage.c:164
ULONG KSPIN_LOCK
Definition: env_spec_w32.h:72
NTSTATUS NTAPI PsCreateSystemThread(OUT PHANDLE ThreadHandle, IN ACCESS_MASK DesiredAccess, IN POBJECT_ATTRIBUTES ObjectAttributes, IN HANDLE ProcessHandle, IN PCLIENT_ID ClientId, IN PKSTART_ROUTINE StartRoutine, IN PVOID StartContext)
Definition: thread.c:602
CPPORT SerialPortInfo
Definition: kdio.c:32
NTHALAPI VOID NTAPI HalDisplayString(PUCHAR String)
VOID NTAPI InbvInstallDisplayStringFilter(IN INBV_DISPLAY_STRING_FILTER Filter)
Definition: inbv.c:622
#define BV_COLOR_BLACK
Definition: display.h:15
#define DPRINT1
Definition: precomp.h:8
ULONG SerialPortNumber
Definition: kdio.c:31
#define FILE_SYNCHRONOUS_IO_NONALERT
Definition: from_kernel.h:31
static ULONG KdpScreenLineBufferPos
Definition: kdio.c:39
volatile BOOLEAN KdbpIsInDmesgMode
Definition: kdio.c:46
KD_DISPATCH_TABLE WrapperTable
Definition: kdinit.c:28
unsigned int ULONG
Definition: retypes.h:1
#define IO_NO_INCREMENT
Definition: iotypes.h:570
#define FILE_SUPERSEDE
Definition: from_kernel.h:53
struct Response Response
#define RtlZeroMemory(Destination, Length)
Definition: typedefs.h:262
#define ALIGN_UP_BY(size, align)
#define InitializeObjectAttributes(p, n, a, r, s)
Definition: reg.c:106
VOID NTAPI KdpDebugLogInit(PKD_DISPATCH_TABLE DispatchTable, ULONG BootPhase)
Definition: kdio.c:248
static INIT_FUNCTION SIZE_T KdpGetMemorySizeInMBs(IN PLOADER_PARAMETER_BLOCK LoaderBlock)
Definition: kdio.c:63
BOOLEAN NTAPI InbvCheckDisplayOwnership(VOID)
Definition: inbv.c:553
VOID NTAPI InbvSetScrollRegion(IN ULONG Left, IN ULONG Top, IN ULONG Right, IN ULONG Bottom)
Definition: inbv.c:681
BOOLEAN FASTCALL KeTryToAcquireSpinLockAtDpcLevel(IN OUT PKSPIN_LOCK SpinLock)
Definition: spinlock.c:303
VOID NTAPI KeStallExecutionProcessor(IN ULONG MicroSeconds)
Definition: ntoskrnl.c:95
BOOLEAN NTAPI KdpPromptString(_In_ PSTRING PromptString, _In_ PSTRING ResponseString)
Definition: kdio.c:626
_In_ PSTORAGE_PROPERTY_ID _Outptr_ PVOID * Descriptor
Definition: classpnp.h:1159
#define RTL_CONSTANT_STRING(s)
Definition: tunneltest.c:14