blob: da20a3401c2d705c28cce4ad25624a8e7df1c812 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
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);
}
|