Fixed OutputDebugString() to use the new int 2D debug service
authorPhillip Susi <phreak@iag.net>
Sun, 23 Jan 2000 08:16:20 +0000 (08:16 +0000)
committerPhillip Susi <phreak@iag.net>
Sun, 23 Jan 2000 08:16:20 +0000 (08:16 +0000)
Moved include of rules.mak up to top so it picks up the HOST variable from there

svn path=/trunk/; revision=956

reactos/lib/kernel32/internal/dprintf.c
reactos/lib/ntdll/def/ntdll.def
reactos/lib/ntdll/def/ntdll.edf
reactos/lib/ntdll/makefile

index ad0f79a..b5d46f1 100644 (file)
@@ -3,34 +3,36 @@
 #include <stdarg.h>
 #include <stdio.h>
 
+ULONG DbgService( ULONG Service, PVOID Context1, PVOID Context2 );
+
 VOID STDCALL OutputDebugStringA(LPCSTR lpOutputString)
 {
-   WCHAR DebugStringW[161];
-   int i,j;
-   i = 0;
-   j = 0;
-   while ( lpOutputString[i] != 0 )
-     {
-       while ( j < 160 && lpOutputString[i] != 0 )
-         {
-            DebugStringW[j] = (WCHAR)lpOutputString[i];                
-            i++;
-            j++;
-         }
-       DebugStringW[j] = 0;
-       OutputDebugStringW(DebugStringW);
-       j = 0;
-     }   
-   return;
+  ANSI_STRING AnsiString;
+  AnsiString.Buffer = lpOutputString;
+  AnsiString.Length = AnsiString.MaximumLength = lstrlenA( lpOutputString );
+  DbgService( 1, &AnsiString, NULL );
 }
 
 VOID STDCALL OutputDebugStringW(LPCWSTR lpOutputString)
 {
    UNICODE_STRING UnicodeOutput;
+   ANSI_STRING AnsiString;
+   char buff[512];
 
    UnicodeOutput.Buffer = (WCHAR *)lpOutputString;
    UnicodeOutput.Length = lstrlenW(lpOutputString)*sizeof(WCHAR);
    UnicodeOutput.MaximumLength = UnicodeOutput.Length;
-       
-   NtDisplayString(&UnicodeOutput);
+   AnsiString.Buffer = buff;
+   AnsiString.MaximumLength = 512;
+   AnsiString.Length = 0;
+   if( UnicodeOutput.Length > 512 )
+     UnicodeOutput.Length = 512;
+   if( NT_SUCCESS( RtlUnicodeStringToAnsiString( &AnsiString, &UnicodeOutput, FALSE ) ) )
+     DbgService( 1, &AnsiString, NULL );
 }
+
+
+
+
+
+
index b36af1b..c7e6d2f 100644 (file)
@@ -1,4 +1,4 @@
-; $Id: ntdll.def,v 1.36 2000/01/10 20:33:50 ekohl Exp $
+; $Id: ntdll.def,v 1.37 2000/01/23 08:16:20 phreak Exp $
 ;
 ; ReactOS Operating System
 ;
@@ -7,6 +7,7 @@ LIBRARY ntdll.dll
 EXPORTS
 DbgBreakPoint
 DbgPrint
+DbgService
 DbgUserBreakPoint
 NlsAnsiCodePage
 NlsMbCodePageTag
index fc37188..3076309 100644 (file)
@@ -1,4 +1,4 @@
-; $Id: ntdll.edf,v 1.26 2000/01/10 20:33:50 ekohl Exp $
+; $Id: ntdll.edf,v 1.27 2000/01/23 08:16:20 phreak Exp $
 ;
 ; ReactOS Operating System
 ;
@@ -635,3 +635,4 @@ LdrUnloadDll
 LdrAccessResource
 LdrFindResource_U
 ;RtlCopyMemory=RtlCopyMemory@12
+DbgService
index 3037233..e0652bf 100644 (file)
@@ -1,4 +1,4 @@
-# $Id: makefile,v 1.35 2000/01/14 02:22:17 ekohl Exp $
+# $Id: makefile,v 1.36 2000/01/23 08:16:20 phreak Exp $
 #
 # ReactOS Operating System
 #
@@ -6,6 +6,7 @@ TARGET=ntdll
 
 BASE_CFLAGS = -I../../include -D__NTDLL__
 
+include ../../rules.mak
 IMAGE_BASE = 0x77f60000
 
 ifneq ($(HOST),mingw32-windows)
@@ -130,5 +131,4 @@ else
 endif
 
 #WARNINGS_ARE_ERRORS = yes
-include ../../rules.mak