Fixed OutputDebugString() to use the new int 2D debug service

Moved include of rules.mak up to top so it picks up the HOST variable from there

svn path=/trunk/; revision=956
This commit is contained in:
Phillip Susi 2000-01-23 08:16:20 +00:00
parent 74131ebded
commit 2001008199
4 changed files with 27 additions and 23 deletions

View 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 );
}

View 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

View 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

View 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