2 * PROJECT: ReactOS DbgPrint Utility
3 * LICENSE: GPL - See COPYING in the top level directory
4 * FILE: base/applications/cmdutils/dbgprint/dbgprint.c
5 * PURPOSE: outputs a text via DbgPrint API
6 * PROGRAMMERS: Johannes Anderwald (johannes.anderwald@reactos.org)
7 * Christoph von Wittich (Christoph_vW@ReactOS.org)
17 int _tmain(int argc
, TCHAR
** argv
)
25 for(i
= 1; i
< argc
; i
++)
27 bufsize
+= _tcslen(argv
[i
]) + 1;
35 if (_tcsstr(argv
[1], "--winetest") && (argc
== 3))
45 /* get available tests */
47 strcat(cmd
, " --list");
48 pPipe
= _tpopen(cmd
, "r");
51 while(fgets(psBuffer
, 128, pPipe
))
53 if (psBuffer
[0] == ' ')
57 strcat(cmd
, psBuffer
+4);
58 /* run the current test */
59 strcpy(test
, "\n\nRunning ");
61 OutputDebugStringA(test
);
62 pPipe2
= _popen(cmd
, "r");
65 while(fgets(psBuffer2
, 128, pPipe2
))
67 nlptr2
= strchr(psBuffer2
, '\n');
73 OutputDebugStringA(psBuffer2
);
82 else if (_tcsstr(argv
[1], "--process") && (argc
== 3))
87 pPipe
= _tpopen(argv
[2], "r");
90 while(fgets(psBuffer
, 128, pPipe
))
93 OutputDebugStringA(psBuffer
);
100 buf
= HeapAlloc(GetProcessHeap(), 0, (bufsize
+1) * sizeof(TCHAR
));
107 for(i
= 1; i
< argc
; i
++)
109 size_t length
= _tcslen(argv
[i
]);
110 _tcsncpy(&buf
[offset
], argv
[i
], length
);
114 buf
[offset
] = _T(' ');
118 buf
[offset
] = _T('\n');
119 buf
[offset
+1] = _T('\0');
124 OutputDebugString(buf
);
125 HeapFree(GetProcessHeap(), 0, buf
);