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');
71 OutputDebugStringA(psBuffer2
);
80 else if (_tcsstr(argv
[1], "--process") && (argc
== 3))
85 pPipe
= _tpopen(argv
[2], "r");
88 while(fgets(psBuffer
, 128, pPipe
))
91 OutputDebugStringA(psBuffer
);
98 buf
= HeapAlloc(GetProcessHeap(), 0, (bufsize
+1) * sizeof(TCHAR
));
105 for(i
= 1; i
< argc
; i
++)
107 int length
= _tcslen(argv
[i
]);
108 _tcsncpy(&buf
[offset
], argv
[i
], length
);
112 buf
[offset
] = _T(' ');
116 buf
[offset
] = _T('\n');
117 buf
[offset
+1] = _T('\0');
122 OutputDebugString(buf
);
123 HeapFree(GetProcessHeap(), 0, buf
);