re-add dbgprint - now as win32 module

svn path=/trunk/; revision=28845
This commit is contained in:
Christoph von Wittich 2007-09-04 14:28:29 +00:00
parent a1493f0b00
commit a920a77e55
2 changed files with 66 additions and 0 deletions

View file

@ -0,0 +1,58 @@
/* $Id: dbgprint.c 24720 2006-11-11 16:07:35Z janderwald $
*
* PROJECT: ReactOS DbgPrint Utility
* LICENSE: GPL - See COPYING in the top level directory
* FILE: tools/dbgprint/dbgprint.c
* PURPOSE: outputs a text via DbgPrint API
* PROGRAMMERS: Johannes Anderwald (johannes.anderwald@student.tugraz.at)
*/
#include <windows.h>
#include <tchar.h>
#include <debug.h>
int _tmain(int argc, TCHAR ** argv)
{
TCHAR * buf;
int bufsize;
int i;
int offset;
bufsize = 0;
for(i = 1; i < argc; i++)
{
bufsize += _tcslen(argv[i]) + 1;
}
if (!bufsize)
{
return -1;
}
buf = HeapAlloc(GetProcessHeap(), 0, (bufsize+1) * sizeof(TCHAR));
if (!buf)
{
return -1;
}
offset = 0;
for(i = 1; i < argc; i++)
{
int length = _tcslen(argv[i]);
_tcsncpy(&buf[offset], argv[i], length);
offset += length;
if (i + 1 < argc)
{
buf[offset] = _T(' ');
}
else
{
buf[offset] = _T('\n');
buf[offset+1] = _T('\0');
}
offset++;
}
DbgPrint(buf);
HeapFree(GetProcessHeap(), 0, buf);
return 0;
}

View file

@ -0,0 +1,8 @@
<module name="dbgprint" type="win32cui" installbase="system32" installname="dbgprint.exe">
<define name="__USE_W32API" />
<define name="_WIN32_IE">0x0501</define>
<define name="_WIN32_WINNT">0x0501</define>
<library>kernel32</library>
<library>ntdll</library>
<file>dbgprint.c</file>
</module>