diff --git a/reactos/base/applications/cmdutils/dbgprint/dbgprint.c b/reactos/base/applications/cmdutils/dbgprint/dbgprint.c new file mode 100644 index 00000000000..93d9115d716 --- /dev/null +++ b/reactos/base/applications/cmdutils/dbgprint/dbgprint.c @@ -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 +#include +#include + +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; +} diff --git a/reactos/base/applications/cmdutils/dbgprint/dbgprint.rbuild b/reactos/base/applications/cmdutils/dbgprint/dbgprint.rbuild new file mode 100644 index 00000000000..958e0597f80 --- /dev/null +++ b/reactos/base/applications/cmdutils/dbgprint/dbgprint.rbuild @@ -0,0 +1,8 @@ + + + 0x0501 + 0x0501 + kernel32 + ntdll + dbgprint.c +