2 * PROJECT: ReactOS DbgPrint Utility
3 * LICENSE: GPL - See COPYING in the top level directory
4 * FILE: tools/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 */
46 pPipe
= _tpopen(argv
[2], "r");
49 while(fgets(psBuffer
, 128, pPipe
))
51 if (psBuffer
[0] == ' ')
55 strcat(cmd
, psBuffer
+4);
56 /* run the current test */
57 strcpy(test
, "\n\nRunning ");
59 OutputDebugStringA(test
);
60 pPipe2
= _popen(cmd
, "r");
63 while(fgets(psBuffer2
, 128, pPipe2
))
65 nlptr2
= strchr(psBuffer2
, '\n');
69 OutputDebugStringA(psBuffer2
);
78 else if (_tcsstr(argv
[1], "--process") && (argc
== 3))
83 pPipe
= _tpopen(argv
[2], "r");
86 while(fgets(psBuffer
, 128, pPipe
))
89 OutputDebugStringA(psBuffer
);
96 buf
= HeapAlloc(GetProcessHeap(), 0, (bufsize
+1) * sizeof(TCHAR
));
103 for(i
= 1; i
< argc
; i
++)
105 int length
= _tcslen(argv
[i
]);
106 _tcsncpy(&buf
[offset
], argv
[i
], length
);
110 buf
[offset
] = _T(' ');
114 buf
[offset
] = _T('\n');
115 buf
[offset
+1] = _T('\0');
120 OutputDebugString(buf
);
121 HeapFree(GetProcessHeap(), 0, buf
);