@@ -82,7 +82,7 @@ int QueryDevices(VOID)
82
82
if (Buffer == NULL )
83
83
{
84
84
/* We failed, bail out */
85
- wprintf ( L"ERROR: Not enough memory\n" );
85
+ ConPuts ( StdErr , L"ERROR: Not enough memory\n" );
86
86
return 0 ;
87
87
}
88
88
@@ -95,7 +95,7 @@ int QueryDevices(VOID)
95
95
if (GetLastError () != ERROR_INSUFFICIENT_BUFFER )
96
96
{
97
97
/* We failed, bail out */
98
- wprintf ( L"ERROR: QueryDosDeviceW(...) failed: 0x%lx\n" , GetLastError ());
98
+ ConPrintf ( StdErr , L"ERROR: QueryDosDeviceW(...) failed: 0x%lx\n" , GetLastError ());
99
99
HeapFree (GetProcessHeap (), 0 , Buffer );
100
100
return 0 ;
101
101
}
@@ -106,7 +106,7 @@ int QueryDevices(VOID)
106
106
if (ptr == NULL )
107
107
{
108
108
/* We failed, bail out */
109
- wprintf ( L"ERROR: Not enough memory\n" );
109
+ ConPuts ( StdErr , L"ERROR: Not enough memory\n" );
110
110
HeapFree (GetProcessHeap (), 0 , Buffer );
111
111
return 0 ;
112
112
}
@@ -167,12 +167,12 @@ int ShowParallelStatus(INT nPortNum)
167
167
}
168
168
else
169
169
{
170
- wprintf ( L" QueryDosDeviceW(%s) returned unrecognised form %s.\n" , szPortName , buffer );
170
+ ConPrintf ( StdErr , L" QueryDosDeviceW(%s) returned unrecognised form %s.\n" , szPortName , buffer );
171
171
}
172
172
}
173
173
else
174
174
{
175
- wprintf ( L"ERROR: QueryDosDeviceW(%s) failed: 0x%lx\n" , szPortName , GetLastError ());
175
+ ConPrintf ( StdErr , L"ERROR: QueryDosDeviceW(%s) failed: 0x%lx\n" , szPortName , GetLastError ());
176
176
}
177
177
178
178
return 1 ;
@@ -187,7 +187,7 @@ int SetParallelState(INT nPortNum)
187
187
swprintf (szTargetPath , L"COM%d" , nPortNum );
188
188
if (!DefineDosDeviceW (DDD_REMOVE_DEFINITION , szPortName , szTargetPath ))
189
189
{
190
- wprintf ( L"SetParallelState(%d) - DefineDosDevice(%s) failed: 0x%lx\n" , nPortNum , szPortName , GetLastError ());
190
+ ConPrintf ( StdErr , L"SetParallelState(%d) - DefineDosDevice(%s) failed: 0x%lx\n" , nPortNum , szPortName , GetLastError ());
191
191
}
192
192
193
193
ShowParallelStatus (nPortNum );
@@ -408,12 +408,12 @@ int SetConsoleStateOld(IN PCWSTR ArgStr)
408
408
Quit :
409
409
ClearScreen (hConOut , & csbi );
410
410
if (!ResizeTextConsole (hConOut , & csbi , Resolution ))
411
- wprintf ( L"The screen cannot be set to the number of lines and columns specified.\n" );
411
+ ConPuts ( StdErr , L"The screen cannot be set to the number of lines and columns specified.\n" );
412
412
413
413
return 0 ;
414
414
415
415
invalid_parameter :
416
- wprintf ( L"Invalid parameter - %s\n" , ArgStr );
416
+ ConPrintf ( StdErr , L"Invalid parameter - %s\n" , ArgStr );
417
417
return 1 ;
418
418
}
419
419
@@ -486,7 +486,7 @@ int SetConsoleState(IN PCWSTR ArgStr)
486
486
else
487
487
{
488
488
invalid_parameter :
489
- wprintf ( L"Invalid parameter - %s\n" , ArgStr );
489
+ ConPrintf ( StdErr , L"Invalid parameter - %s\n" , ArgStr );
490
490
return 1 ;
491
491
}
492
492
}
@@ -495,7 +495,7 @@ int SetConsoleState(IN PCWSTR ArgStr)
495
495
{
496
496
ClearScreen (hConOut , & csbi );
497
497
if (!ResizeTextConsole (hConOut , & csbi , Resolution ))
498
- wprintf ( L"The screen cannot be set to the number of lines and columns specified.\n" );
498
+ ConPuts ( StdErr , L"The screen cannot be set to the number of lines and columns specified.\n" );
499
499
}
500
500
else if (kbdMode )
501
501
{
@@ -537,7 +537,7 @@ int SetConsoleCPState(IN PCWSTR ArgStr)
537
537
else
538
538
{
539
539
invalid_parameter :
540
- wprintf ( L"Invalid parameter - %s\n" , ArgStr );
540
+ ConPrintf ( StdErr , L"Invalid parameter - %s\n" , ArgStr );
541
541
return 1 ;
542
542
}
543
543
@@ -570,24 +570,24 @@ SerialPortQuery(INT nPortNum, LPDCB pDCB, LPCOMMTIMEOUTS pCommTimeouts, BOOL bWr
570
570
571
571
if (hPort == INVALID_HANDLE_VALUE )
572
572
{
573
- wprintf ( L"Illegal device name - %s\n" , szPortName );
574
- wprintf ( L"Last error = 0x%lx\n" , GetLastError ());
573
+ ConPrintf ( StdErr , L"Illegal device name - %s\n" , szPortName );
574
+ ConPrintf ( StdErr , L"Last error = 0x%lx\n" , GetLastError ());
575
575
return FALSE;
576
576
}
577
577
578
578
Success = bWrite ? SetCommState (hPort , pDCB )
579
579
: GetCommState (hPort , pDCB );
580
580
if (!Success )
581
581
{
582
- wprintf ( L"Failed to %s the status for device COM%d:\n" , bWrite ? L"set" : L"get" , nPortNum );
582
+ ConPrintf ( StdErr , L"Failed to %s the status for device COM%d:\n" , bWrite ? L"set" : L"get" , nPortNum );
583
583
goto Quit ;
584
584
}
585
585
586
586
Success = bWrite ? SetCommTimeouts (hPort , pCommTimeouts )
587
587
: GetCommTimeouts (hPort , pCommTimeouts );
588
588
if (!Success )
589
589
{
590
- wprintf ( L"Failed to %s timeout status for device COM%d:\n" , bWrite ? L"set" : L"get" , nPortNum );
590
+ ConPrintf ( StdErr , L"Failed to %s timeout status for device COM%d:\n" , bWrite ? L"set" : L"get" , nPortNum );
591
591
goto Quit ;
592
592
}
593
593
@@ -619,12 +619,12 @@ int ShowSerialStatus(INT nPortNum)
619
619
}
620
620
if (dcb .Parity >= ARRAYSIZE (parity_strings ))
621
621
{
622
- wprintf ( L"ERROR: Invalid value for Parity Bits %d:\n" , dcb .Parity );
622
+ ConPrintf ( StdErr , L"ERROR: Invalid value for Parity Bits %d:\n" , dcb .Parity );
623
623
dcb .Parity = 0 ;
624
624
}
625
625
if (dcb .StopBits >= ARRAYSIZE (stopbit_strings ))
626
626
{
627
- wprintf ( L"ERROR: Invalid value for Stop Bits %d:\n" , dcb .StopBits );
627
+ ConPrintf ( StdErr , L"ERROR: Invalid value for Stop Bits %d:\n" , dcb .StopBits );
628
628
dcb .StopBits = 0 ;
629
629
}
630
630
@@ -1087,7 +1087,7 @@ int SetSerialState(INT nPortNum, IN PCWSTR ArgStr)
1087
1087
1088
1088
if (!Success )
1089
1089
{
1090
- wprintf ( L"Invalid parameter - %s\n" , ArgStr );
1090
+ ConPrintf ( StdErr , L"Invalid parameter - %s\n" , ArgStr );
1091
1091
return 1 ;
1092
1092
}
1093
1093
@@ -1165,7 +1165,7 @@ int wmain(int argc, WCHAR* argv[])
1165
1165
ArgStr = HeapAlloc (GetProcessHeap (), 0 , (ArgStrSize + 1 ) * sizeof (WCHAR ));
1166
1166
if (ArgStr == NULL )
1167
1167
{
1168
- wprintf ( L"ERROR: Not enough memory\n" );
1168
+ ConPuts ( StdErr , L"ERROR: Not enough memory\n" );
1169
1169
return 1 ;
1170
1170
}
1171
1171
@@ -1215,7 +1215,7 @@ int wmain(int argc, WCHAR* argv[])
1215
1215
if (!* argStr || _wcsnicmp (argStr , L"/STA" , 4 ) == 0 )
1216
1216
ret = ShowParallelStatus (nPortNum );
1217
1217
else
1218
- wprintf ( L"ERROR: LPT port redirection is not implemented!\n" );
1218
+ ConPuts ( StdErr , L"ERROR: LPT port redirection is not implemented!\n" );
1219
1219
// TODO: Implement setting LPT port redirection using SetParallelState().
1220
1220
goto Quit ;
1221
1221
}
@@ -1282,7 +1282,7 @@ int wmain(int argc, WCHAR* argv[])
1282
1282
goto Quit ;
1283
1283
1284
1284
invalid_parameter :
1285
- wprintf ( L"Invalid parameter - %s\n" , ArgStr );
1285
+ ConPrintf ( StdErr , L"Invalid parameter - %s\n" , ArgStr );
1286
1286
goto Quit ;
1287
1287
1288
1288
Quit :
0 commit comments