diff options
author | Adam <you@example.com> | 2020-05-17 05:51:50 +0200 |
---|---|---|
committer | Adam <you@example.com> | 2020-05-17 05:51:50 +0200 |
commit | e611b132f9b8abe35b362e5870b74bce94a1e58e (patch) | |
tree | a5781d2ec0e085eeca33cf350cf878f2efea6fe5 /private/ntos/fw/mips/debug.c | |
download | NT4.0-e611b132f9b8abe35b362e5870b74bce94a1e58e.tar NT4.0-e611b132f9b8abe35b362e5870b74bce94a1e58e.tar.gz NT4.0-e611b132f9b8abe35b362e5870b74bce94a1e58e.tar.bz2 NT4.0-e611b132f9b8abe35b362e5870b74bce94a1e58e.tar.lz NT4.0-e611b132f9b8abe35b362e5870b74bce94a1e58e.tar.xz NT4.0-e611b132f9b8abe35b362e5870b74bce94a1e58e.tar.zst NT4.0-e611b132f9b8abe35b362e5870b74bce94a1e58e.zip |
Diffstat (limited to 'private/ntos/fw/mips/debug.c')
-rw-r--r-- | private/ntos/fw/mips/debug.c | 119 |
1 files changed, 119 insertions, 0 deletions
diff --git a/private/ntos/fw/mips/debug.c b/private/ntos/fw/mips/debug.c new file mode 100644 index 000000000..da20a3401 --- /dev/null +++ b/private/ntos/fw/mips/debug.c @@ -0,0 +1,119 @@ +// TITLE("Debug Support Functions") +//++ +// +// Copyright (c) 1990 Microsoft Corporation +// +// Module Name: +// +// debug.s +// +// Abstract: +// +// This module implements functions to support debugging NT. +// +// Author: +// +// Steven R. Wood (stevewo) 3-Aug-1989 +// +// Environment: +// +// Any mode. +// +// Revision History: +// +//-- + +#include "stdarg.h" +#include "stdio.h" +#include "ntrtlp.h" + +// +// Define procedure prototypes for debug input and output. +// + +NTSTATUS +DebugPrint ( + IN PSTRING Output + ); + +ULONG +DebugPrompt ( + IN PSTRING Output, + IN PSTRING Input + ); + + +ULONG +DbgPrint ( + PCHAR Format, + ... + ) + +{ + + va_list ArgumentList; + UCHAR Buffer[512]; + STRING Output; + + // + // Format the output into a buffer and then print it. + // + + va_start(ArgumentList, Format); + Output.Length = vsprintf(&Buffer[0], Format, ArgumentList); + Output.Buffer = &Buffer[0]; + va_end(ArgumentList); + return DebugPrint(&Output); +} + +ULONG +DbgPrompt ( + IN PCHAR Prompt, + OUT PCHAR Response, + IN ULONG MaximumResponseLength + ) + +//++ +// +// Routine Description: +// +// This function displays the prompt string on the debugging console and +// then reads a line of text from the debugging console. The line read +// is returned in the memory pointed to by the second parameter. The +// third parameter specifies the maximum number of characters that can +// be stored in the response area. +// +// Arguments: +// +// Prompt - specifies the text to display as the prompt. +// +// Response - specifies where to store the response read from the +// debugging console. +// +// Prompt - specifies the maximum number of characters that can be +// stored in the Response buffer. +// +// Return Value: +// +// Number of characters stored in the Response buffer. Includes the +// terminating newline character, but not the null character after +// that. +// +//-- + +{ + + STRING Input; + STRING Output; + + // + // Output the prompt string and read input. + // + + Input.MaximumLength = MaximumResponseLength; + Input.Buffer = Response; + Output.Length = strlen(Prompt); + Output.Buffer = Prompt; + return DebugPrompt(&Output, &Input); +} + |