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
7eaadabc
Commit
7eaadabc
authored
Mar 09, 2017
by
Jacek Caban
Committed by
Alexandre Julliard
Mar 10, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wininet: Merge InternetReadFile and InternetReadFileEx implementations.
Signed-off-by:
Jacek Caban
<
jacek@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
a546e8ac
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
13 additions
and
58 deletions
+13
-58
ftp.c
dlls/wininet/ftp.c
+2
-10
http.c
dlls/wininet/http.c
+1
-37
internet.c
dlls/wininet/internet.c
+9
-7
internet.h
dlls/wininet/internet.h
+1
-2
http.c
dlls/wininet/tests/http.c
+0
-2
No files found.
dlls/wininet/ftp.c
View file @
7eaadabc
...
...
@@ -1184,7 +1184,8 @@ static DWORD FTPFILE_QueryOption(object_header_t *hdr, DWORD option, void *buffe
return
INET_QueryOption
(
hdr
,
option
,
buffer
,
size
,
unicode
);
}
static
DWORD
FTPFILE_ReadFile
(
object_header_t
*
hdr
,
void
*
buffer
,
DWORD
size
,
DWORD
*
read
)
static
DWORD
FTPFILE_ReadFile
(
object_header_t
*
hdr
,
void
*
buffer
,
DWORD
size
,
DWORD
*
read
,
DWORD
flags
,
DWORD_PTR
context
)
{
ftp_file_t
*
file
=
(
ftp_file_t
*
)
hdr
;
int
res
;
...
...
@@ -1208,12 +1209,6 @@ static DWORD FTPFILE_ReadFile(object_header_t *hdr, void *buffer, DWORD size, DW
return
error
;
}
static
DWORD
FTPFILE_ReadFileEx
(
object_header_t
*
hdr
,
void
*
buf
,
DWORD
size
,
DWORD
*
ret_size
,
DWORD
flags
,
DWORD_PTR
context
)
{
return
FTPFILE_ReadFile
(
hdr
,
buf
,
size
,
ret_size
);
}
static
DWORD
FTPFILE_WriteFile
(
object_header_t
*
hdr
,
const
void
*
buffer
,
DWORD
size
,
DWORD
*
written
)
{
ftp_file_t
*
lpwh
=
(
ftp_file_t
*
)
hdr
;
...
...
@@ -1300,7 +1295,6 @@ static const object_vtbl_t FTPFILEVtbl = {
FTPFILE_QueryOption
,
INET_SetOption
,
FTPFILE_ReadFile
,
FTPFILE_ReadFileEx
,
FTPFILE_WriteFile
,
FTPFILE_QueryDataAvailable
,
NULL
,
...
...
@@ -2404,7 +2398,6 @@ static const object_vtbl_t FTPSESSIONVtbl = {
NULL
,
NULL
,
NULL
,
NULL
,
NULL
};
...
...
@@ -3543,7 +3536,6 @@ static const object_vtbl_t FTPFINDNEXTVtbl = {
NULL
,
NULL
,
NULL
,
NULL
,
FTPFINDNEXT_FindNextFileW
};
...
...
dlls/wininet/http.c
View file @
7eaadabc
...
...
@@ -3163,7 +3163,7 @@ static DWORD async_read(http_request_t *req, void *buf, DWORD size, DWORD read_p
return
ERROR_IO_PENDING
;
}
static
DWORD
HTTPREQ_ReadFile
Ex
(
object_header_t
*
hdr
,
void
*
buf
,
DWORD
size
,
DWORD
*
ret_read
,
static
DWORD
HTTPREQ_ReadFile
(
object_header_t
*
hdr
,
void
*
buf
,
DWORD
size
,
DWORD
*
ret_read
,
DWORD
flags
,
DWORD_PTR
context
)
{
http_request_t
*
req
=
(
http_request_t
*
)
hdr
;
...
...
@@ -3251,40 +3251,6 @@ static DWORD HTTPREQ_WriteFile(object_header_t *hdr, const void *buffer, DWORD s
return
res
;
}
static
DWORD
HTTPREQ_ReadFile
(
object_header_t
*
hdr
,
void
*
buffer
,
DWORD
size
,
DWORD
*
read
)
{
http_request_t
*
req
=
(
http_request_t
*
)
hdr
;
DWORD
res
;
if
(
req
->
session
->
appInfo
->
hdr
.
dwFlags
&
INTERNET_FLAG_ASYNC
)
{
if
(
TryEnterCriticalSection
(
&
req
->
read_section
))
{
if
(
get_avail_data
(
req
)
||
end_of_read_data
(
req
))
{
res
=
HTTPREQ_Read
(
req
,
buffer
,
size
,
read
,
BLOCKING_DISALLOW
);
LeaveCriticalSection
(
&
req
->
read_section
);
return
res
;
}
LeaveCriticalSection
(
&
req
->
read_section
);
}
*
read
=
0
;
return
async_read
(
req
,
buffer
,
size
,
0
,
read
);
}
EnterCriticalSection
(
&
req
->
read_section
);
if
(
hdr
->
dwError
==
INTERNET_HANDLE_IN_USE
)
hdr
->
dwError
=
ERROR_INTERNET_INTERNAL_ERROR
;
res
=
HTTPREQ_Read
(
req
,
buffer
,
size
,
read
,
BLOCKING_WAITALL
);
if
(
res
==
ERROR_SUCCESS
)
res
=
hdr
->
dwError
;
LeaveCriticalSection
(
&
req
->
read_section
);
return
res
;
}
static
DWORD
HTTPREQ_QueryDataAvailable
(
object_header_t
*
hdr
,
DWORD
*
available
,
DWORD
flags
,
DWORD_PTR
ctx
)
{
http_request_t
*
req
=
(
http_request_t
*
)
hdr
;
...
...
@@ -3362,7 +3328,6 @@ static const object_vtbl_t HTTPREQVtbl = {
HTTPREQ_QueryOption
,
HTTPREQ_SetOption
,
HTTPREQ_ReadFile
,
HTTPREQ_ReadFileEx
,
HTTPREQ_WriteFile
,
HTTPREQ_QueryDataAvailable
,
NULL
,
...
...
@@ -5850,7 +5815,6 @@ static const object_vtbl_t HTTPSESSIONVtbl = {
NULL
,
NULL
,
NULL
,
NULL
,
NULL
};
...
...
dlls/wininet/internet.c
View file @
7eaadabc
...
...
@@ -982,7 +982,6 @@ static const object_vtbl_t APPINFOVtbl = {
APPINFO_SetOption
,
NULL
,
NULL
,
NULL
,
NULL
};
...
...
@@ -2166,8 +2165,11 @@ BOOL WINAPI InternetReadFile(HINTERNET hFile, LPVOID lpBuffer,
return
FALSE
;
}
if
(
hdr
->
vtbl
->
ReadFile
)
res
=
hdr
->
vtbl
->
ReadFile
(
hdr
,
lpBuffer
,
dwNumOfBytesToRead
,
pdwNumOfBytesRead
);
if
(
hdr
->
vtbl
->
ReadFile
)
{
res
=
hdr
->
vtbl
->
ReadFile
(
hdr
,
lpBuffer
,
dwNumOfBytesToRead
,
pdwNumOfBytesRead
,
0
,
0
);
if
(
res
==
ERROR_IO_PENDING
)
*
pdwNumOfBytesRead
=
0
;
}
WININET_Release
(
hdr
);
...
...
@@ -2225,8 +2227,8 @@ BOOL WINAPI InternetReadFileExA(HINTERNET hFile, LPINTERNET_BUFFERSA lpBuffersOu
return
FALSE
;
}
if
(
hdr
->
vtbl
->
ReadFile
Ex
)
res
=
hdr
->
vtbl
->
ReadFile
Ex
(
hdr
,
lpBuffersOut
->
lpvBuffer
,
lpBuffersOut
->
dwBufferLength
,
if
(
hdr
->
vtbl
->
ReadFile
)
res
=
hdr
->
vtbl
->
ReadFile
(
hdr
,
lpBuffersOut
->
lpvBuffer
,
lpBuffersOut
->
dwBufferLength
,
&
lpBuffersOut
->
dwBufferLength
,
dwFlags
,
dwContext
);
WININET_Release
(
hdr
);
...
...
@@ -2263,8 +2265,8 @@ BOOL WINAPI InternetReadFileExW(HINTERNET hFile, LPINTERNET_BUFFERSW lpBuffer,
return
FALSE
;
}
if
(
hdr
->
vtbl
->
ReadFile
Ex
)
res
=
hdr
->
vtbl
->
ReadFile
Ex
(
hdr
,
lpBuffer
->
lpvBuffer
,
lpBuffer
->
dwBufferLength
,
&
lpBuffer
->
dwBufferLength
,
if
(
hdr
->
vtbl
->
ReadFile
)
res
=
hdr
->
vtbl
->
ReadFile
(
hdr
,
lpBuffer
->
lpvBuffer
,
lpBuffer
->
dwBufferLength
,
&
lpBuffer
->
dwBufferLength
,
dwFlags
,
dwContext
);
WININET_Release
(
hdr
);
...
...
dlls/wininet/internet.h
View file @
7eaadabc
...
...
@@ -279,8 +279,7 @@ typedef struct {
void
(
*
CloseConnection
)(
object_header_t
*
);
DWORD
(
*
QueryOption
)(
object_header_t
*
,
DWORD
,
void
*
,
DWORD
*
,
BOOL
);
DWORD
(
*
SetOption
)(
object_header_t
*
,
DWORD
,
void
*
,
DWORD
);
DWORD
(
*
ReadFile
)(
object_header_t
*
,
void
*
,
DWORD
,
DWORD
*
);
DWORD
(
*
ReadFileEx
)(
object_header_t
*
,
void
*
,
DWORD
,
DWORD
*
,
DWORD
,
DWORD_PTR
);
DWORD
(
*
ReadFile
)(
object_header_t
*
,
void
*
,
DWORD
,
DWORD
*
,
DWORD
,
DWORD_PTR
);
DWORD
(
*
WriteFile
)(
object_header_t
*
,
const
void
*
,
DWORD
,
DWORD
*
);
DWORD
(
*
QueryDataAvailable
)(
object_header_t
*
,
DWORD
*
,
DWORD
,
DWORD_PTR
);
DWORD
(
*
FindNextFileW
)(
object_header_t
*
,
void
*
);
...
...
dlls/wininet/tests/http.c
View file @
7eaadabc
...
...
@@ -4520,7 +4520,6 @@ static void test_async_read(int port)
{
ok
(
GetLastError
()
==
ERROR_IO_PENDING
,
"expected ERROR_IO_PENDING, got %u
\n
"
,
GetLastError
()
);
ok
(
bytes
==
0
,
"expected 0, got %u
\n
"
,
bytes
);
todo_wine
CHECK_NOTIFIED
(
INTERNET_STATUS_RECEIVING_RESPONSE
);
SET_EXPECT
(
INTERNET_STATUS_REQUEST_COMPLETE
);
if
(
!
pending_reads
++
)
...
...
@@ -4543,7 +4542,6 @@ static void test_async_read(int port)
if
(
!
bytes
)
break
;
}
todo_wine
ok
(
pending_reads
==
1
,
"expected 1 pending read, got %u
\n
"
,
pending_reads
);
ok
(
!
strcmp
(
buffer
,
page1
),
"unexpected buffer content
\n
"
);
close_async_handle
(
ses
,
hCompleteEvent
,
2
);
...
...
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