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
b4ab43b3
Commit
b4ab43b3
authored
Sep 18, 2013
by
Dmitry Timoshkov
Committed by
Alexandre Julliard
Sep 20, 2013
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
kernel32: Remove a 0-length read optimization from ReadFile.
parent
70930fa1
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
3 additions
and
16 deletions
+3
-16
file.c
dlls/kernel32/file.c
+0
-1
comm.c
dlls/kernel32/tests/comm.c
+0
-1
mailslot.c
dlls/kernel32/tests/mailslot.c
+0
-3
pipe.c
dlls/kernel32/tests/pipe.c
+3
-6
file.c
dlls/ntdll/tests/file.c
+0
-5
No files found.
dlls/kernel32/file.c
View file @
b4ab43b3
...
...
@@ -408,7 +408,6 @@ BOOL WINAPI ReadFile( HANDLE hFile, LPVOID buffer, DWORD bytesToRead,
bytesRead
,
overlapped
);
if
(
bytesRead
)
*
bytesRead
=
0
;
/* Do this before anything else */
if
(
!
bytesToRead
)
return
TRUE
;
if
(
is_console_handle
(
hFile
))
{
...
...
dlls/kernel32/tests/comm.c
View file @
b4ab43b3
...
...
@@ -2152,7 +2152,6 @@ todo_wine
bytes
=
0xdeadbeef
;
SetLastError
(
0xdeadbeef
);
ret
=
ReadFile
(
hcom
,
buf
,
0
,
&
bytes
,
NULL
);
todo_wine
ok
(
!
ret
,
"ReadFile should fail
\n
"
);
todo_wine
ok
(
GetLastError
()
==
ERROR_INVALID_PARAMETER
,
"expected ERROR_INVALID_PARAMETER, got %d
\n
"
,
GetLastError
());
...
...
dlls/kernel32/tests/mailslot.c
View file @
b4ab43b3
...
...
@@ -80,16 +80,13 @@ static int mailslot_test(void)
count
=
0xdeadbeef
;
SetLastError
(
0xdeadbeef
);
ret
=
ReadFile
(
INVALID_HANDLE_VALUE
,
buffer
,
0
,
&
count
,
NULL
);
todo_wine
ok
(
!
ret
,
"ReadFile should fail
\n
"
);
todo_wine
ok
(
GetLastError
()
==
ERROR_INVALID_HANDLE
,
"wrong error %u
\n
"
,
GetLastError
());
ok
(
count
==
0
,
"expected 0, got %u
\n
"
,
count
);
count
=
0xdeadbeef
;
SetLastError
(
0xdeadbeef
);
ret
=
ReadFile
(
hSlot
,
buffer
,
0
,
&
count
,
NULL
);
todo_wine
ok
(
!
ret
,
"ReadFile should fail
\n
"
);
todo_wine
ok
(
GetLastError
()
==
ERROR_SEM_TIMEOUT
,
"wrong error %u
\n
"
,
GetLastError
());
...
...
dlls/kernel32/tests/pipe.c
View file @
b4ab43b3
...
...
@@ -1860,9 +1860,7 @@ static void test_readfileex_pending(void)
num_bytes
=
0xdeadbeef
;
SetLastError
(
0xdeadbeef
);
ret
=
ReadFile
(
INVALID_HANDLE_VALUE
,
read_buf
,
0
,
&
num_bytes
,
NULL
);
todo_wine
ok
(
!
ret
,
"ReadFile should fail
\n
"
);
todo_wine
ok
(
GetLastError
()
==
ERROR_INVALID_HANDLE
,
"wrong error %u
\n
"
,
GetLastError
());
ok
(
num_bytes
==
0
,
"expected 0, got %u
\n
"
,
num_bytes
);
...
...
@@ -1877,12 +1875,11 @@ todo_wine
todo_wine
ok
(
GetLastError
()
==
ERROR_IO_PENDING
,
"expected ERROR_IO_PENDING, got %d
\n
"
,
GetLastError
());
ok
(
num_bytes
==
0
,
"bytes %u
\n
"
,
num_bytes
);
todo_wine
ok
((
NTSTATUS
)
overlapped
.
Internal
==
STATUS_PENDING
,
"expected STATUS_PENDING, got %#lx
\n
"
,
overlapped
.
Internal
);
todo_wine
ok
(
overlapped
.
InternalHigh
==
-
1
,
"expected -1, got %lu
\n
"
,
overlapped
.
InternalHigh
);
wait
=
WaitForSingleObject
(
event
,
100
);
todo_wine
ok
(
wait
==
WAIT_TIMEOUT
,
"WaitForSingleObject returned %x
\n
"
,
wait
);
num_bytes
=
0xdeadbeef
;
...
...
@@ -1890,13 +1887,13 @@ todo_wine
ok
(
ret
,
"WriteFile failed
\n
"
);
ok
(
num_bytes
==
1
,
"bytes %u
\n
"
,
num_bytes
);
wait
=
WaitForSingleObject
(
event
,
0
);
wait
=
WaitForSingleObject
(
event
,
100
);
todo_wine
ok
(
wait
==
WAIT_OBJECT_0
,
"WaitForSingleObject returned %x
\n
"
,
wait
);
ok
(
num_bytes
==
1
,
"bytes %u
\n
"
,
num_bytes
);
todo_wine
ok
((
NTSTATUS
)
overlapped
.
Internal
==
STATUS_SUCCESS
,
"expected STATUS_SUCCESS, got %#lx
\n
"
,
overlapped
.
Internal
);
todo_wine
ok
(
overlapped
.
InternalHigh
==
0
,
"expected 0, got %lu
\n
"
,
overlapped
.
InternalHigh
);
/* read the pending byte and clear the pipe */
...
...
dlls/ntdll/tests/file.c
View file @
b4ab43b3
...
...
@@ -1986,9 +1986,7 @@ static void test_read_write(void)
bytes
=
0xdeadbeef
;
SetLastError
(
0xdeadbeef
);
ret
=
ReadFile
(
INVALID_HANDLE_VALUE
,
buf
,
0
,
&
bytes
,
NULL
);
todo_wine
ok
(
!
ret
,
"ReadFile should fail
\n
"
);
todo_wine
ok
(
GetLastError
()
==
ERROR_INVALID_HANDLE
,
"expected ERROR_INVALID_HANDLE, got %d
\n
"
,
GetLastError
());
ok
(
bytes
==
0
,
"bytes %u
\n
"
,
bytes
);
...
...
@@ -2201,9 +2199,7 @@ todo_wine
bytes
=
0xdeadbeef
;
SetLastError
(
0xdeadbeef
);
ret
=
ReadFile
(
INVALID_HANDLE_VALUE
,
buf
,
0
,
&
bytes
,
NULL
);
todo_wine
ok
(
!
ret
,
"ReadFile should fail
\n
"
);
todo_wine
ok
(
GetLastError
()
==
ERROR_INVALID_HANDLE
,
"expected ERROR_INVALID_HANDLE, got %d
\n
"
,
GetLastError
());
ok
(
bytes
==
0
,
"bytes %u
\n
"
,
bytes
);
...
...
@@ -2220,7 +2216,6 @@ todo_wine
ok
(
bytes
==
0
,
"bytes %u
\n
"
,
bytes
);
todo_wine
ok
((
NTSTATUS
)
ovl
.
Internal
==
STATUS_SUCCESS
,
"expected STATUS_SUCCESS, got %#lx
\n
"
,
ovl
.
Internal
);
todo_wine
ok
(
ovl
.
InternalHigh
==
0
,
"expected 0, got %lu
\n
"
,
ovl
.
InternalHigh
);
bytes
=
0xdeadbeef
;
...
...
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