+ return output_string( GetStdHandle(STD_ERROR_HANDLE), fmtW, buffer );
+}
+
+static int output_header( const WCHAR *prop, ULONG column_width )
+{
+ static const WCHAR bomW[] = {0xfeff}, fmtW[] = {'%','-','*','s','\r','\n',0};
+ int len;
+ DWORD count;
+ WCHAR buffer[8192];
+
+ len = snprintfW( buffer, ARRAY_SIZE(buffer), fmtW, column_width, prop );
+
+ if (!WriteConsoleW( GetStdHandle(STD_OUTPUT_HANDLE), buffer, len, &count, NULL )) /* redirected */
+ {
+ WriteFile( GetStdHandle(STD_OUTPUT_HANDLE), bomW, sizeof(bomW), &count, FALSE );
+ WriteFile( GetStdHandle(STD_OUTPUT_HANDLE), buffer, len * sizeof(WCHAR), &count, FALSE );
+ count += sizeof(bomW);
+ }
+
+ return count;
+}
+
+static int output_line( const WCHAR *str, ULONG column_width )
+{
+ static const WCHAR fmtW[] = {'%','-','*','s','\r','\n',0};
+ return output_string( GetStdHandle(STD_OUTPUT_HANDLE), fmtW, column_width, str );