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
a5e80b2d
Commit
a5e80b2d
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 not fail for 0-length reads at EOF.
parent
c35485d6
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
2 additions
and
18 deletions
+2
-18
file.c
dlls/ntdll/file.c
+2
-2
file.c
dlls/ntdll/tests/file.c
+0
-16
No files found.
dlls/ntdll/file.c
View file @
a5e80b2d
...
...
@@ -636,7 +636,7 @@ NTSTATUS WINAPI NtReadFile(HANDLE hFile, HANDLE hEvent,
lseek
(
unix_handle
,
offset
->
QuadPart
+
result
,
SEEK_SET
);
total
=
result
;
status
=
total
?
STATUS_SUCCESS
:
STATUS_END_OF_FILE
;
status
=
(
total
||
!
length
)
?
STATUS_SUCCESS
:
STATUS_END_OF_FILE
;
goto
done
;
}
}
...
...
@@ -665,7 +665,7 @@ NTSTATUS WINAPI NtReadFile(HANDLE hFile, HANDLE hEvent,
{
case
FD_TYPE_FILE
:
case
FD_TYPE_CHAR
:
status
=
STATUS_END_OF_FILE
;
status
=
length
?
STATUS_END_OF_FILE
:
STATUS_SUCCESS
;
goto
done
;
case
FD_TYPE_SERIAL
:
break
;
...
...
dlls/ntdll/tests/file.c
View file @
a5e80b2d
...
...
@@ -2168,12 +2168,9 @@ todo_wine
bytes
=
-
1
;
SetLastError
(
0xdeadbeef
);
ret
=
ReadFile
(
hfile
,
buf
,
0
,
&
bytes
,
&
ovl
);
todo_wine
ok
(
ret
,
"ReadFile error %d
\n
"
,
GetLastError
());
todo_wine
ok
(
GetLastError
()
==
0xdeadbeef
,
"expected 0xdeadbeef, got %d
\n
"
,
GetLastError
());
ok
(
bytes
==
0
,
"bytes %u
\n
"
,
bytes
);
todo_wine
ok
((
NTSTATUS
)
ovl
.
Internal
==
STATUS_SUCCESS
,
"expected STATUS_SUCCESS, got %#lx
\n
"
,
ovl
.
Internal
);
ok
(
ovl
.
InternalHigh
==
0
,
"expected 0, got %lu
\n
"
,
ovl
.
InternalHigh
);
...
...
@@ -2189,11 +2186,8 @@ todo_wine
U
(
iob
).
Status
=
-
1
;
iob
.
Information
=
-
1
;
status
=
pNtReadFile
(
hfile
,
0
,
NULL
,
NULL
,
&
iob
,
buf
,
0
,
NULL
,
NULL
);
todo_wine
ok
(
status
==
STATUS_SUCCESS
,
"NtReadFile error %#x
\n
"
,
status
);
todo_wine
ok
(
U
(
iob
).
Status
==
STATUS_SUCCESS
,
"expected STATUS_SUCCESS, got %#x
\n
"
,
U
(
iob
).
Status
);
todo_wine
ok
(
iob
.
Information
==
0
,
"expected 0, got %lu
\n
"
,
iob
.
Information
);
U
(
iob
).
Status
=
-
1
;
...
...
@@ -2210,11 +2204,8 @@ todo_wine
iob
.
Information
=
-
1
;
offset
.
QuadPart
=
sizeof
(
contents
);
status
=
pNtReadFile
(
hfile
,
0
,
NULL
,
NULL
,
&
iob
,
buf
,
0
,
&
offset
,
NULL
);
todo_wine
ok
(
status
==
STATUS_SUCCESS
,
"NtReadFile error %#x
\n
"
,
status
);
todo_wine
ok
(
U
(
iob
).
Status
==
STATUS_SUCCESS
,
"expected STATUS_SUCCESS, got %#x
\n
"
,
U
(
iob
).
Status
);
todo_wine
ok
(
iob
.
Information
==
0
,
"expected 0, got %lu
\n
"
,
iob
.
Information
);
U
(
iob
).
Status
=
-
1
;
...
...
@@ -2231,11 +2222,8 @@ todo_wine
iob
.
Information
=
-
1
;
offset
.
QuadPart
=
(
LONGLONG
)
-
2
/* FILE_USE_FILE_POINTER_POSITION */
;
status
=
pNtReadFile
(
hfile
,
0
,
NULL
,
NULL
,
&
iob
,
buf
,
0
,
&
offset
,
NULL
);
todo_wine
ok
(
status
==
STATUS_SUCCESS
,
"NtReadFile error %#x
\n
"
,
status
);
todo_wine
ok
(
U
(
iob
).
Status
==
STATUS_SUCCESS
,
"expected STATUS_SUCCESS, got %#x
\n
"
,
U
(
iob
).
Status
);
todo_wine
ok
(
iob
.
Information
==
0
,
"expected 0, got %lu
\n
"
,
iob
.
Information
);
for
(
i
=
-
20
;
i
<
0
;
i
++
)
...
...
@@ -2351,7 +2339,6 @@ todo_wine
/* ReadFile return value depends on Windows version and testing it is not practical */
ReadFile
(
hfile
,
buf
,
0
,
&
bytes
,
&
ovl
);
ok
(
bytes
==
0
,
"bytes %u
\n
"
,
bytes
);
todo_wine
ok
((
NTSTATUS
)
ovl
.
Internal
==
STATUS_SUCCESS
,
"expected STATUS_SUCCESS, got %#lx
\n
"
,
ovl
.
Internal
);
ok
(
ovl
.
InternalHigh
==
0
,
"expected 0, got %lu
\n
"
,
ovl
.
InternalHigh
);
...
...
@@ -2547,11 +2534,8 @@ todo_wine
}
else
{
todo_wine
ok
(
status
==
STATUS_SUCCESS
,
"expected STATUS_SUCCESS, got %#x
\n
"
,
status
);
todo_wine
ok
(
U
(
iob
).
Status
==
STATUS_SUCCESS
,
"expected STATUS_SUCCESS, got %#x
\n
"
,
U
(
iob
).
Status
);
todo_wine
ok
(
iob
.
Information
==
0
,
"expected 0, got %lu
\n
"
,
iob
.
Information
);
}
...
...
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