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
60ef62c8
Commit
60ef62c8
authored
Oct 30, 2013
by
Dmitry Timoshkov
Committed by
Alexandre Julliard
Oct 31, 2013
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ntdll: NtReadFile should update io status block on EOF for a synchronous read.
parent
a5e80b2d
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
17 deletions
+8
-17
file.c
dlls/ntdll/file.c
+5
-5
file.c
dlls/ntdll/tests/file.c
+3
-12
No files found.
dlls/ntdll/file.c
View file @
60ef62c8
...
...
@@ -604,14 +604,14 @@ NTSTATUS WINAPI NtReadFile(HANDLE hFile, HANDLE hEvent,
&
needs_close
,
&
type
,
&
options
);
if
(
status
)
return
status
;
async_read
=
!
(
options
&
(
FILE_SYNCHRONOUS_IO_ALERT
|
FILE_SYNCHRONOUS_IO_NONALERT
));
if
(
!
virtual_check_buffer_for_write
(
buffer
,
length
))
{
status
=
STATUS_ACCESS_VIOLATION
;
goto
done
;
}
async_read
=
!
(
options
&
(
FILE_SYNCHRONOUS_IO_ALERT
|
FILE_SYNCHRONOUS_IO_NONALERT
));
if
(
type
==
FD_TYPE_FILE
)
{
if
(
async_read
&&
(
!
offset
||
offset
->
QuadPart
<
0
))
...
...
@@ -765,14 +765,14 @@ done:
err:
if
(
needs_close
)
close
(
unix_handle
);
if
(
status
==
STATUS_SUCCESS
)
if
(
status
==
STATUS_SUCCESS
||
(
status
==
STATUS_END_OF_FILE
&&
!
async_read
)
)
{
io_status
->
u
.
Status
=
status
;
io_status
->
Information
=
total
;
TRACE
(
"= SUCCESS (%u)
\n
"
,
total
);
if
(
hEvent
)
NtSetEvent
(
hEvent
,
NULL
);
if
(
apc
)
NtQueueApcThread
(
GetCurrentThread
(),
(
PNTAPCFUNC
)
apc
,
(
ULONG_PTR
)
apc_user
,
(
ULONG_PTR
)
io_status
,
0
);
if
(
apc
&&
!
status
)
NtQueueApcThread
(
GetCurrentThread
(),
(
PNTAPCFUNC
)
apc
,
(
ULONG_PTR
)
apc_user
,
(
ULONG_PTR
)
io_status
,
0
);
}
else
{
...
...
dlls/ntdll/tests/file.c
View file @
60ef62c8
...
...
@@ -836,9 +836,9 @@ static void read_file_test(void)
ResetEvent
(
event
);
status
=
pNtReadFile
(
handle
,
event
,
apc
,
&
apc_count
,
&
iosb
,
buffer
,
2
,
&
offset
,
NULL
);
ok
(
status
==
STATUS_END_OF_FILE
,
"wrong status %x
\n
"
,
status
);
todo_wine
ok
(
U
(
iosb
).
Status
==
STATUS_END_OF_FILE
,
"wrong status %x
\n
"
,
U
(
iosb
).
Status
);
todo_wine
ok
(
iosb
.
Information
==
0
,
"wrong info %lu
\n
"
,
iosb
.
Information
);
todo_wine
ok
(
is_signaled
(
event
),
"event is not signaled
\n
"
);
ok
(
U
(
iosb
).
Status
==
STATUS_END_OF_FILE
,
"wrong status %x
\n
"
,
U
(
iosb
).
Status
);
ok
(
iosb
.
Information
==
0
,
"wrong info %lu
\n
"
,
iosb
.
Information
);
ok
(
is_signaled
(
event
),
"event is not signaled
\n
"
);
ok
(
!
apc_count
,
"apc was called
\n
"
);
SleepEx
(
1
,
TRUE
);
/* alertable sleep */
ok
(
!
apc_count
,
"apc was called
\n
"
);
...
...
@@ -2094,9 +2094,7 @@ static void test_read_write(void)
iob
.
Information
=
-
1
;
status
=
pNtReadFile
(
hfile
,
0
,
NULL
,
NULL
,
&
iob
,
buf
,
sizeof
(
buf
),
NULL
,
NULL
);
ok
(
status
==
STATUS_END_OF_FILE
,
"expected STATUS_END_OF_FILE, got %#x
\n
"
,
status
);
todo_wine
ok
(
U
(
iob
).
Status
==
STATUS_END_OF_FILE
,
"expected STATUS_END_OF_FILE, got %#x
\n
"
,
U
(
iob
).
Status
);
todo_wine
ok
(
iob
.
Information
==
0
,
"expected 0, got %lu
\n
"
,
iob
.
Information
);
SetFilePointer
(
hfile
,
0
,
NULL
,
FILE_BEGIN
);
...
...
@@ -2156,7 +2154,6 @@ todo_wine
ok
(
!
ret
,
"ReadFile should fail
\n
"
);
ok
(
GetLastError
()
==
ERROR_HANDLE_EOF
,
"expected ERROR_HANDLE_EOF, got %d
\n
"
,
GetLastError
());
ok
(
bytes
==
0
,
"bytes %u
\n
"
,
bytes
);
todo_wine
ok
((
NTSTATUS
)
ovl
.
Internal
==
STATUS_END_OF_FILE
,
"expected STATUS_END_OF_FILE, got %#lx
\n
"
,
ovl
.
Internal
);
ok
(
ovl
.
InternalHigh
==
0
,
"expected 0, got %lu
\n
"
,
ovl
.
InternalHigh
);
...
...
@@ -2178,9 +2175,7 @@ todo_wine
iob
.
Information
=
-
1
;
status
=
pNtReadFile
(
hfile
,
0
,
NULL
,
NULL
,
&
iob
,
buf
,
sizeof
(
buf
),
NULL
,
NULL
);
ok
(
status
==
STATUS_END_OF_FILE
,
"expected STATUS_END_OF_FILE, got %#x
\n
"
,
status
);
todo_wine
ok
(
U
(
iob
).
Status
==
STATUS_END_OF_FILE
,
"expected STATUS_END_OF_FILE, got %#x
\n
"
,
U
(
iob
).
Status
);
todo_wine
ok
(
iob
.
Information
==
0
,
"expected 0, got %lu
\n
"
,
iob
.
Information
);
U
(
iob
).
Status
=
-
1
;
...
...
@@ -2195,9 +2190,7 @@ todo_wine
offset
.
QuadPart
=
sizeof
(
contents
);
status
=
pNtReadFile
(
hfile
,
0
,
NULL
,
NULL
,
&
iob
,
buf
,
sizeof
(
buf
),
&
offset
,
NULL
);
ok
(
status
==
STATUS_END_OF_FILE
,
"expected STATUS_END_OF_FILE, got %#x
\n
"
,
status
);
todo_wine
ok
(
U
(
iob
).
Status
==
STATUS_END_OF_FILE
,
"expected STATUS_END_OF_FILE, got %#x
\n
"
,
U
(
iob
).
Status
);
todo_wine
ok
(
iob
.
Information
==
0
,
"expected 0, got %lu
\n
"
,
iob
.
Information
);
U
(
iob
).
Status
=
-
1
;
...
...
@@ -2213,9 +2206,7 @@ todo_wine
offset
.
QuadPart
=
(
LONGLONG
)
-
2
/* FILE_USE_FILE_POINTER_POSITION */
;
status
=
pNtReadFile
(
hfile
,
0
,
NULL
,
NULL
,
&
iob
,
buf
,
sizeof
(
buf
),
&
offset
,
NULL
);
ok
(
status
==
STATUS_END_OF_FILE
,
"expected STATUS_END_OF_FILE, got %#x
\n
"
,
status
);
todo_wine
ok
(
U
(
iob
).
Status
==
STATUS_END_OF_FILE
,
"expected STATUS_END_OF_FILE, got %#x
\n
"
,
U
(
iob
).
Status
);
todo_wine
ok
(
iob
.
Information
==
0
,
"expected 0, got %lu
\n
"
,
iob
.
Information
);
U
(
iob
).
Status
=
-
1
;
...
...
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