Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-cw
Commits
66395882
Commit
66395882
authored
Aug 03, 2011
by
Francois Gouget
Committed by
Alexandre Julliard
Aug 04, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
kernel32: Fix writing to a pipe in WriteConsoleW().
parent
322049ce
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
6 deletions
+20
-6
console.c
dlls/kernel32/console.c
+20
-6
No files found.
dlls/kernel32/console.c
View file @
66395882
...
...
@@ -45,6 +45,7 @@
# include <sys/poll.h>
#endif
#define NONAMELESSUNION
#include "ntstatus.h"
#define WIN32_NO_STATUS
#include "windef.h"
...
...
@@ -2361,7 +2362,9 @@ BOOL WINAPI WriteConsoleW(HANDLE hConsoleOutput, LPCVOID lpBuffer, DWORD nNumber
{
char
*
ptr
;
unsigned
len
;
BOOL
ret
;
HANDLE
hFile
;
NTSTATUS
status
;
IO_STATUS_BLOCK
iosb
;
close
(
fd
);
/* FIXME: mode ENABLED_OUTPUT is not processed (or actually we rely on underlying Unix/TTY fd
...
...
@@ -2372,17 +2375,28 @@ BOOL WINAPI WriteConsoleW(HANDLE hConsoleOutput, LPCVOID lpBuffer, DWORD nNumber
return
FALSE
;
WideCharToMultiByte
(
CP_UNIXCP
,
0
,
lpBuffer
,
nNumberOfCharsToWrite
,
ptr
,
len
,
NULL
,
NULL
);
ret
=
WriteFile
(
wine_server_ptr_handle
(
console_handle_unmap
(
hConsoleOutput
)),
ptr
,
len
,
lpNumberOfCharsWritten
,
NULL
);
if
(
ret
&&
lpNumberOfCharsWritten
)
hFile
=
wine_server_ptr_handle
(
console_handle_unmap
(
hConsoleOutput
));
status
=
NtWriteFile
(
hFile
,
NULL
,
NULL
,
NULL
,
&
iosb
,
ptr
,
len
,
0
,
NULL
);
if
(
status
==
STATUS_PENDING
)
{
if
(
*
lpNumberOfCharsWritten
==
len
)
WaitForSingleObject
(
hFile
,
INFINITE
);
status
=
iosb
.
u
.
Status
;
}
if
(
status
!=
STATUS_PENDING
&&
lpNumberOfCharsWritten
)
{
if
(
iosb
.
Information
==
len
)
*
lpNumberOfCharsWritten
=
nNumberOfCharsToWrite
;
else
FIXME
(
"Conversion not supported yet
\n
"
);
}
HeapFree
(
GetProcessHeap
(),
0
,
ptr
);
return
ret
;
if
(
status
!=
STATUS_SUCCESS
)
{
SetLastError
(
RtlNtStatusToDosError
(
status
));
return
FALSE
;
}
return
TRUE
;
}
if
(
!
GetConsoleMode
(
hConsoleOutput
,
&
mode
)
||
!
GetConsoleScreenBufferInfo
(
hConsoleOutput
,
&
csbi
))
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment