Author: tkreuzer Date: Thu Jul 24 11:44:01 2008 New Revision: 34747
URL: http://svn.reactos.org/svn/reactos?rev=34747&view=rev Log: convert external debug output from message boxes to real debug output on serial
Modified: branches/ros-amd64-bringup/reactos/boot/freeldr/freeldr/reactos/reactos.c
Modified: branches/ros-amd64-bringup/reactos/boot/freeldr/freeldr/reactos/reactos.c URL: http://svn.reactos.org/svn/reactos/branches/ros-amd64-bringup/reactos/boot/f... ============================================================================== --- branches/ros-amd64-bringup/reactos/boot/freeldr/freeldr/reactos/reactos.c [iso-8859-1] (original) +++ branches/ros-amd64-bringup/reactos/boot/freeldr/freeldr/reactos/reactos.c [iso-8859-1] Thu Jul 24 11:44:01 2008 @@ -874,6 +874,7 @@ }
#undef DbgPrint +#if 0 ULONG DbgPrint(const char *Format, ...) { @@ -903,5 +904,39 @@ va_end(ap); return 0; } - +#else +VOID DebugPrintChar(UCHAR Character); + +ULONG +DbgPrint(const char *Format, ...) +{ + va_list ap; + CHAR Buffer[512]; + ULONG Length; + char *ptr = Buffer; + + va_start(ap, Format); + + /* Construct a string */ + Length = _vsnprintf(Buffer, 512, Format, ap); + + /* Check if we went past the buffer */ + if (Length == -1) + { + /* Terminate it if we went over-board */ + Buffer[sizeof(Buffer) - 1] = '\n'; + + /* Put maximum */ + Length = sizeof(Buffer); + } + + while (*ptr) + { + DebugPrintChar(*ptr++); + } + + va_end(ap); + return 0; +} +#endif /* EOF */