11dd794565232dff590b5b8484c5a942b753521a
[reactos.git] / reactos / ntoskrnl / dbg / print.c
1 /*
2 * ReactOS kernel
3 * Copyright (C) 1998, 1999, 2000, 2001 ReactOS Team
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
18 */
19 /* $Id: print.c,v 1.18 2004/08/13 05:00:35 ion Exp $
20 *
21 * COPYRIGHT: See COPYING in the top level directory
22 * PROJECT: ReactOS kernel
23 * FILE: ntoskrnl/dbg/print.c
24 * PURPOSE: Debug output
25 * PROGRAMMER: Eric Kohl (ekohl@abo.rhein-zeitung.de)
26 * PORTABILITY: Unchecked
27 * UPDATE HISTORY:
28 * 14/10/99: Created
29 */
30
31 /* INCLUDES *****************************************************************/
32
33 #include <ddk/ntddk.h>
34 #include <internal/kd.h>
35
36 #include <internal/debug.h>
37 /* FUNCTIONS ****************************************************************/
38
39 #if 0
40 ULONG DbgService (ULONG Service, PVOID Context1, PVOID Context2);
41 __asm__ ("\n\t.global _DbgService\n\t"
42 "_DbgService:\n\t"
43 "mov 4(%esp), %eax\n\t"
44 "mov 8(%esp), %ecx\n\t"
45 "mov 12(%esp), %edx\n\t"
46 "int $0x2D\n\t"
47 "ret\n\t");
48 #endif
49
50 /*
51 * Note: DON'T CHANGE THIS FUNCTION!!!
52 * DON'T CALL HalDisplayString OR SOMETING ELSE!!!
53 * You'll only break the serial/bochs debugging feature!!!
54 */
55
56 /*
57 * @implemented
58 */
59 ULONG
60 DbgPrint(PCH Format, ...)
61 {
62 ANSI_STRING DebugString;
63 CHAR Buffer[1024];
64 va_list ap;
65
66 /* init ansi string */
67 DebugString.Buffer = Buffer;
68 DebugString.MaximumLength = sizeof(Buffer);
69
70 va_start (ap, Format);
71 DebugString.Length = _vsnprintf (Buffer, sizeof( Buffer ), Format, ap);
72 va_end (ap);
73
74 KdpPrintString (&DebugString);
75
76 return (ULONG)DebugString.Length;
77 }
78
79 /*
80 * @unimplemented
81 */
82 ULONG
83 __cdecl
84 DbgPrintEx(
85 IN ULONG ComponentId,
86 IN ULONG Level,
87 IN PCH Format,
88 ...
89 )
90 {
91 UNIMPLEMENTED;
92 return 0;
93 }
94
95 /*
96 * @unimplemented
97 */
98 ULONG
99 __cdecl
100 DbgPrintReturnControlC(
101 PCH Format,
102 ...
103 )
104 {
105 UNIMPLEMENTED;
106 return 0;
107 }
108
109 /*
110 * @unimplemented
111 */
112 VOID STDCALL
113 DbgPrompt (PCH OutputString,
114 PCH InputString,
115 USHORT InputSize)
116 {
117 ANSI_STRING Output;
118 ANSI_STRING Input;
119
120 Input.Length = 0;
121 Input.MaximumLength = InputSize;
122 Input.Buffer = InputString;
123
124 Output.Length = strlen (OutputString);
125 Output.MaximumLength = Output.Length + 1;
126 Output.Buffer = OutputString;
127
128 /* FIXME: Not implemented yet! */
129 // KdpPromptString (&Output,
130 // &Input);
131 }
132
133 /*
134 * @unimplemented
135 */
136 STDCALL
137 NTSTATUS
138 DbgQueryDebugFilterState(
139 IN ULONG ComponentId,
140 IN ULONG Level
141 )
142 {
143 UNIMPLEMENTED;
144 return STATUS_NOT_IMPLEMENTED;
145 }
146
147 /*
148 * @unimplemented
149 */
150 STDCALL
151 NTSTATUS
152 DbgSetDebugFilterState(
153 IN ULONG ComponentId,
154 IN ULONG Level,
155 IN BOOLEAN State
156 )
157 {
158 UNIMPLEMENTED;
159 return STATUS_NOT_IMPLEMENTED;
160 }
161
162 /* EOF */