http://bugs.winehq.org/show_bug.cgi?id=8554
Summary: 'net' utility prints text to xterm, not to wineconsole Product: Wine Version: 0.9.37. Platform: Other OS/Version: other Status: UNCONFIRMED Severity: normal Priority: P2 Component: wine-programs AssignedTo: wine-bugs@winehq.org ReportedBy: lich@math.spbu.ru
If I type in xterm $ wineconsole --backend=user cmd
and in console c:> net
the text will be printed in xterm, not in wineconsole.
The reason is hidden in AllocConsole - Windows keeps StdHandles values, allowing to use smth like:
HANDLE h = GetStdHandle(STD_OUTPUT_HANDLE); FreeConsole(); AllocConsole(); WriteConsole(h....) // This will use NEW console!
This allows msvcrt to work correct when new console is created. From this point of view current implementation of msvcrt is correct, but does not work, because wine does not keep handles.
Proposed solution: do not use msvcrt and use output routines like in cmd - they contain some tricks with codepages output.
And it may be much better to unicodize net.exe utility. It will solve many possible problems in the future.