/*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS Run-Time Library
- * FILE: ntoskrnl/rtl/dbgprint.c
+ * FILE: lib/rtl/debug.c
* PURPOSE: Debug Print and Prompt routines
* PROGRAMMERS: Alex Ionescu (alex@relsoft.net)
* Royce Mitchel III
IN va_list ap,
IN BOOLEAN HandleBreakpoint)
{
- NTSTATUS Status = STATUS_SUCCESS;
+ NTSTATUS Status;
ANSI_STRING DebugString;
CHAR Buffer[512];
ULONG Length, PrefixLength;
EXCEPTION_RECORD ExceptionRecord;
/* Check if we should print it or not */
- if ((ComponentId != -1) && !(NtQueryDebugFilterState(ComponentId, Level)))
+ if ((ComponentId != -1U) &&
+ !(NtQueryDebugFilterState(ComponentId, Level)))
{
/* This message is masked */
- return Status;
+ return STATUS_SUCCESS;
}
/* For user mode, don't recursively DbgPrint */
- if (RtlpSetInDbgPrint(TRUE)) return Status;
+ if (RtlpSetInDbgPrint(TRUE)) return STATUS_SUCCESS;
/* Guard against incorrect pointers */
- _SEH_TRY
+ _SEH2_TRY
{
/* Get the length and normalize it */
PrefixLength = strlen(Prefix);
Format,
ap);
}
- _SEH_HANDLE
+ _SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER)
{
/* Fail */
Length = PrefixLength = 0;
- Status = _SEH_GetExceptionCode();
+ _SEH2_YIELD(return _SEH2_GetExceptionCode());
}
- _SEH_END;
- if (!NT_SUCCESS(Status)) return Status;
+ _SEH2_END;
/* Check if we went past the buffer */
- if (Length == -1)
+ if (Length == -1U)
{
/* Terminate it if we went over-board */
Buffer[sizeof(Buffer) - 1] = '\n';
DbgPrint(PCCH Format,
...)
{
- ULONG n;
+ ULONG n;
va_list ap;
/* Call the internal routine that also handles ControlC */
va_start(ap, Format);
n = vDbgPrintExWithPrefixInternal("",
- -1,
- DPFLTR_ERROR_LEVEL,
- Format,
- ap,
- TRUE);
+ -1,
+ DPFLTR_ERROR_LEVEL,
+ Format,
+ ap,
+ TRUE);
va_end(ap);
- return n;
+ return n;
}
/*
IN PCCH Format,
...)
{
- ULONG n;
+ ULONG n;
va_list ap;
/* Call the internal routine that also handles ControlC */
va_start(ap, Format);
n = vDbgPrintExWithPrefixInternal("",
- ComponentId,
- Level,
- Format,
- ap,
- TRUE);
+ ComponentId,
+ Level,
+ Format,
+ ap,
+ TRUE);
va_end(ap);
- return n;
+ return n;
}
/*
DbgPrintReturnControlC(PCH Format,
...)
{
- ULONG n;
+ ULONG n;
va_list ap;
/* Call the internal routine that also handles ControlC */
va_start(ap, Format);
n = vDbgPrintExWithPrefixInternal("",
- -1,
- DPFLTR_ERROR_LEVEL,
- Format,
- ap,
- FALSE);
+ -1,
+ DPFLTR_ERROR_LEVEL,
+ Format,
+ ap,
+ FALSE);
va_end(ap);
- return n;
+ return n;
}
/*
/* Load the symbols */
DebugService2(Name, &SymbolInfo, BREAKPOINT_UNLOAD_SYMBOLS);
}
-
-/* EOF */