Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
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-winehq
Commits
61b123fa
Commit
61b123fa
authored
Aug 05, 2021
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ntdll: Set the I/O status block through the 32-bit pointer for Wow64 processes.
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
28754a04
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
45 additions
and
21 deletions
+45
-21
file.c
dlls/ntdll/unix/file.c
+3
-3
process.c
dlls/ntdll/unix/process.c
+1
-1
serial.c
dlls/ntdll/unix/serial.c
+6
-14
server.c
dlls/ntdll/unix/server.c
+1
-3
unix_private.h
dlls/ntdll/unix/unix_private.h
+34
-0
No files found.
dlls/ntdll/unix/file.c
View file @
61b123fa
...
...
@@ -1966,7 +1966,7 @@ static NTSTATUS get_mountmgr_fs_info( HANDLE handle, int fd, struct mountmgr_uni
OBJECT_ATTRIBUTES
attr
;
UNICODE_STRING
string
;
char
*
unix_name
;
IO_STATUS_BLOCK
io
;
IO_STATUS_BLOCK
io
=
{
0
}
;
HANDLE
mountmgr
;
NTSTATUS
status
;
int
letter
;
...
...
@@ -4937,7 +4937,7 @@ static NTSTATUS get_io_timeouts( HANDLE handle, enum server_fd_type type, ULONG
{
/* GetCommTimeouts */
SERIAL_TIMEOUTS
st
;
IO_STATUS_BLOCK
io
;
IO_STATUS_BLOCK
io
=
{
0
}
;
status
=
NtDeviceIoControlFile
(
handle
,
NULL
,
NULL
,
NULL
,
&
io
,
IOCTL_SERIAL_GET_TIMEOUTS
,
NULL
,
0
,
&
st
,
sizeof
(
st
)
);
...
...
@@ -5024,7 +5024,7 @@ static NTSTATUS get_io_avail_mode( HANDLE handle, enum server_fd_type type, BOOL
{
/* GetCommTimeouts */
SERIAL_TIMEOUTS
st
;
IO_STATUS_BLOCK
io
;
IO_STATUS_BLOCK
io
=
{
0
}
;
status
=
NtDeviceIoControlFile
(
handle
,
NULL
,
NULL
,
NULL
,
&
io
,
IOCTL_SERIAL_GET_TIMEOUTS
,
NULL
,
0
,
&
st
,
sizeof
(
st
)
);
...
...
dlls/ntdll/unix/process.c
View file @
61b123fa
...
...
@@ -407,7 +407,7 @@ static void set_stdio_fd( int stdin_fd, int stdout_fd )
*/
static
BOOL
is_unix_console_handle
(
HANDLE
handle
)
{
IO_STATUS_BLOCK
io
;
IO_STATUS_BLOCK
io
=
{
0
}
;
return
!
NtDeviceIoControlFile
(
handle
,
NULL
,
NULL
,
NULL
,
&
io
,
IOCTL_CONDRV_IS_UNIX
,
NULL
,
0
,
NULL
,
0
);
}
...
...
dlls/ntdll/unix/serial.c
View file @
61b123fa
...
...
@@ -841,7 +841,7 @@ typedef struct async_commio
{
HANDLE
hDevice
;
DWORD
*
events
;
IO_STATUS_BLOCK
*
iosb
;
client_ptr_t
iosb
;
HANDLE
hEvent
;
DWORD
evtmask
;
DWORD
cookie
;
...
...
@@ -995,23 +995,15 @@ static void CALLBACK wait_for_event(LPVOID arg)
}
if
(
needs_close
)
close
(
fd
);
}
if
(
commio
->
iosb
)
{
if
(
*
commio
->
events
)
{
commio
->
iosb
->
u
.
Status
=
STATUS_SUCCESS
;
commio
->
iosb
->
Information
=
sizeof
(
DWORD
);
}
else
commio
->
iosb
->
u
.
Status
=
STATUS_CANCELLED
;
}
if
(
*
commio
->
events
)
set_async_iosb
(
commio
->
iosb
,
STATUS_SUCCESS
,
sizeof
(
DWORD
)
);
else
set_async_iosb
(
commio
->
iosb
,
STATUS_CANCELLED
,
0
);
stop_waiting
(
commio
->
hDevice
);
if
(
commio
->
hEvent
)
NtSetEvent
(
commio
->
hEvent
,
NULL
);
free
(
commio
);
NtTerminateThread
(
GetCurrentThread
(),
0
);
}
static
NTSTATUS
wait_on
(
HANDLE
hDevice
,
int
fd
,
HANDLE
hEvent
,
PIO_STATUS_BLOCK
piosb
,
DWORD
*
events
)
static
NTSTATUS
wait_on
(
HANDLE
hDevice
,
int
fd
,
HANDLE
hEvent
,
client_ptr_t
iosb_ptr
,
DWORD
*
events
)
{
async_commio
*
commio
;
NTSTATUS
status
;
...
...
@@ -1025,7 +1017,7 @@ static NTSTATUS wait_on(HANDLE hDevice, int fd, HANDLE hEvent, PIO_STATUS_BLOCK
commio
->
hDevice
=
hDevice
;
commio
->
events
=
events
;
commio
->
iosb
=
piosb
;
commio
->
iosb
=
iosb_ptr
;
commio
->
hEvent
=
hEvent
;
commio
->
pending_write
=
0
;
status
=
get_wait_mask
(
commio
->
hDevice
,
&
commio
->
evtmask
,
&
commio
->
cookie
,
(
commio
->
evtmask
&
EV_TXEMPTY
)
?
&
commio
->
pending_write
:
NULL
,
TRUE
);
...
...
@@ -1315,7 +1307,7 @@ static NTSTATUS io_control( HANDLE device, HANDLE event, PIO_APC_ROUTINE apc, vo
case
IOCTL_SERIAL_WAIT_ON_MASK
:
if
(
out_buffer
&&
out_size
==
sizeof
(
DWORD
))
{
if
(
!
(
status
=
wait_on
(
device
,
fd
,
event
,
io
,
out_buffer
)))
if
(
!
(
status
=
wait_on
(
device
,
fd
,
event
,
io
sb_client_ptr
(
io
)
,
out_buffer
)))
sz
=
sizeof
(
DWORD
);
}
else
...
...
dlls/ntdll/unix/server.c
View file @
61b123fa
...
...
@@ -377,7 +377,6 @@ static void invoke_system_apc( const apc_call_t *call, apc_result_t *result, BOO
break
;
case
APC_ASYNC_IO
:
{
IO_STATUS_BLOCK
*
iosb
=
wine_server_get_ptr
(
call
->
async_io
.
sb
);
struct
async_fileio
*
user
=
wine_server_get_ptr
(
call
->
async_io
.
user
);
ULONG_PTR
info
=
0
;
...
...
@@ -386,8 +385,7 @@ static void invoke_system_apc( const apc_call_t *call, apc_result_t *result, BOO
if
(
result
->
async_io
.
status
!=
STATUS_PENDING
)
{
result
->
async_io
.
total
=
info
;
iosb
->
Status
=
result
->
async_io
.
status
;
iosb
->
Information
=
info
;
set_async_iosb
(
call
->
async_io
.
sb
,
result
->
async_io
.
status
,
info
);
}
break
;
}
...
...
dlls/ntdll/unix/unix_private.h
View file @
61b123fa
...
...
@@ -354,8 +354,42 @@ static inline NTSTATUS wait_async( HANDLE handle, BOOL alertable )
return
NtWaitForSingleObject
(
handle
,
alertable
,
NULL
);
}
static
inline
void
set_async_iosb
(
client_ptr_t
iosb
,
NTSTATUS
status
,
ULONG_PTR
info
)
{
if
(
!
iosb
)
return
;
#ifdef _WIN64
if
(
NtCurrentTeb
()
->
WowTebOffset
)
{
struct
iosb32
{
NTSTATUS
Status
;
ULONG
Information
;
}
*
io
=
wine_server_get_ptr
(
iosb
);
io
->
Status
=
status
;
io
->
Information
=
info
;
}
else
#endif
{
IO_STATUS_BLOCK
*
io
=
wine_server_get_ptr
(
iosb
);
#ifdef NONAMELESSUNION
io
->
u
.
Status
=
status
;
#else
io
->
Status
=
status
;
#endif
io
->
Information
=
info
;
}
}
static
inline
client_ptr_t
iosb_client_ptr
(
IO_STATUS_BLOCK
*
io
)
{
#ifdef _WIN64
#ifdef NONAMELESSUNION
if
(
io
&&
NtCurrentTeb
()
->
WowTebOffset
)
return
wine_server_client_ptr
(
io
->
u
.
Pointer
);
#else
if
(
io
&&
NtCurrentTeb
()
->
WowTebOffset
)
return
wine_server_client_ptr
(
io
->
Pointer
);
#endif
#endif
return
wine_server_client_ptr
(
io
);
}
...
...
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