update for HEAD-2003021201
[reactos.git] / lib / crtdll / misc / debug.c
diff --git a/lib/crtdll/misc/debug.c b/lib/crtdll/misc/debug.c
new file mode 100644 (file)
index 0000000..16b94a5
--- /dev/null
@@ -0,0 +1,19 @@
+#include <windows.h>
+#include <stdarg.h>
+#include <stdio.h>
+#include <string.h>
+
+
+void debug_printf(char* fmt, ...)
+{
+   va_list args;
+   char buffer[255];
+   HANDLE OutputHandle;
+   
+   AllocConsole();
+   OutputHandle = GetStdHandle(STD_OUTPUT_HANDLE);
+   va_start(args,fmt);
+   vsprintf(buffer,fmt,args);
+   WriteConsoleA(OutputHandle, buffer, strlen(buffer), NULL, NULL);
+   va_end(args);
+}