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
1ee3ad47
Commit
1ee3ad47
authored
Nov 30, 2009
by
Jacek Caban
Committed by
Alexandre Julliard
Nov 30, 2009
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wininet: Directly return error status from WriteFile implementations.
parent
b77868cb
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
13 additions
and
13 deletions
+13
-13
ftp.c
dlls/wininet/ftp.c
+2
-2
http.c
dlls/wininet/http.c
+2
-4
internet.c
dlls/wininet/internet.c
+6
-5
internet.h
dlls/wininet/internet.h
+2
-1
netconnection.c
dlls/wininet/netconnection.c
+1
-1
No files found.
dlls/wininet/ftp.c
View file @
1ee3ad47
...
@@ -1156,7 +1156,7 @@ static DWORD FTPFILE_ReadFileExW(object_header_t *hdr, INTERNET_BUFFERSW *buffer
...
@@ -1156,7 +1156,7 @@ static DWORD FTPFILE_ReadFileExW(object_header_t *hdr, INTERNET_BUFFERSW *buffer
return
FTPFILE_ReadFile
(
hdr
,
buffers
->
lpvBuffer
,
buffers
->
dwBufferLength
,
&
buffers
->
dwBufferLength
);
return
FTPFILE_ReadFile
(
hdr
,
buffers
->
lpvBuffer
,
buffers
->
dwBufferLength
,
&
buffers
->
dwBufferLength
);
}
}
static
BOOL
FTPFILE_WriteFile
(
object_header_t
*
hdr
,
const
void
*
buffer
,
DWORD
size
,
DWORD
*
written
)
static
DWORD
FTPFILE_WriteFile
(
object_header_t
*
hdr
,
const
void
*
buffer
,
DWORD
size
,
DWORD
*
written
)
{
{
ftp_file_t
*
lpwh
=
(
ftp_file_t
*
)
hdr
;
ftp_file_t
*
lpwh
=
(
ftp_file_t
*
)
hdr
;
int
res
;
int
res
;
...
@@ -1164,7 +1164,7 @@ static BOOL FTPFILE_WriteFile(object_header_t *hdr, const void *buffer, DWORD si
...
@@ -1164,7 +1164,7 @@ static BOOL FTPFILE_WriteFile(object_header_t *hdr, const void *buffer, DWORD si
res
=
send
(
lpwh
->
nDataSocket
,
buffer
,
size
,
0
);
res
=
send
(
lpwh
->
nDataSocket
,
buffer
,
size
,
0
);
*
written
=
res
>
0
?
res
:
0
;
*
written
=
res
>
0
?
res
:
0
;
return
res
>=
0
;
return
res
>=
0
?
ERROR_SUCCESS
:
sock_get_error
(
errno
)
;
}
}
static
void
FTP_ReceiveRequestData
(
ftp_file_t
*
file
,
BOOL
first_notif
)
static
void
FTP_ReceiveRequestData
(
ftp_file_t
*
file
,
BOOL
first_notif
)
...
...
dlls/wininet/http.c
View file @
1ee3ad47
...
@@ -2489,7 +2489,7 @@ done:
...
@@ -2489,7 +2489,7 @@ done:
return
res
;
return
res
;
}
}
static
BOOL
HTTPREQ_WriteFile
(
object_header_t
*
hdr
,
const
void
*
buffer
,
DWORD
size
,
DWORD
*
written
)
static
DWORD
HTTPREQ_WriteFile
(
object_header_t
*
hdr
,
const
void
*
buffer
,
DWORD
size
,
DWORD
*
written
)
{
{
DWORD
res
;
DWORD
res
;
http_request_t
*
lpwhr
=
(
http_request_t
*
)
hdr
;
http_request_t
*
lpwhr
=
(
http_request_t
*
)
hdr
;
...
@@ -2500,11 +2500,9 @@ static BOOL HTTPREQ_WriteFile(object_header_t *hdr, const void *buffer, DWORD si
...
@@ -2500,11 +2500,9 @@ static BOOL HTTPREQ_WriteFile(object_header_t *hdr, const void *buffer, DWORD si
res
=
NETCON_send
(
&
lpwhr
->
netConnection
,
buffer
,
size
,
0
,
(
LPINT
)
written
);
res
=
NETCON_send
(
&
lpwhr
->
netConnection
,
buffer
,
size
,
0
,
(
LPINT
)
written
);
if
(
res
==
ERROR_SUCCESS
)
if
(
res
==
ERROR_SUCCESS
)
lpwhr
->
dwBytesWritten
+=
*
written
;
lpwhr
->
dwBytesWritten
+=
*
written
;
else
SetLastError
(
res
);
INTERNET_SendCallback
(
&
lpwhr
->
hdr
,
lpwhr
->
hdr
.
dwContext
,
INTERNET_STATUS_REQUEST_SENT
,
written
,
sizeof
(
DWORD
));
INTERNET_SendCallback
(
&
lpwhr
->
hdr
,
lpwhr
->
hdr
.
dwContext
,
INTERNET_STATUS_REQUEST_SENT
,
written
,
sizeof
(
DWORD
));
return
res
==
ERROR_SUCCESS
;
return
res
;
}
}
static
void
HTTPREQ_AsyncQueryDataAvailableProc
(
WORKREQUEST
*
workRequest
)
static
void
HTTPREQ_AsyncQueryDataAvailableProc
(
WORKREQUEST
*
workRequest
)
...
...
dlls/wininet/internet.c
View file @
1ee3ad47
...
@@ -1862,7 +1862,7 @@ BOOL WINAPI InternetWriteFile(HINTERNET hFile, LPCVOID lpBuffer,
...
@@ -1862,7 +1862,7 @@ BOOL WINAPI InternetWriteFile(HINTERNET hFile, LPCVOID lpBuffer,
DWORD
dwNumOfBytesToWrite
,
LPDWORD
lpdwNumOfBytesWritten
)
DWORD
dwNumOfBytesToWrite
,
LPDWORD
lpdwNumOfBytesWritten
)
{
{
object_header_t
*
lpwh
;
object_header_t
*
lpwh
;
BOOL
re
tval
=
FALSE
;
BOOL
re
s
;
TRACE
(
"(%p %p %d %p)
\n
"
,
hFile
,
lpBuffer
,
dwNumOfBytesToWrite
,
lpdwNumOfBytesWritten
);
TRACE
(
"(%p %p %d %p)
\n
"
,
hFile
,
lpBuffer
,
dwNumOfBytesToWrite
,
lpdwNumOfBytesWritten
);
...
@@ -1874,16 +1874,17 @@ BOOL WINAPI InternetWriteFile(HINTERNET hFile, LPCVOID lpBuffer,
...
@@ -1874,16 +1874,17 @@ BOOL WINAPI InternetWriteFile(HINTERNET hFile, LPCVOID lpBuffer,
}
}
if
(
lpwh
->
vtbl
->
WriteFile
)
{
if
(
lpwh
->
vtbl
->
WriteFile
)
{
re
tval
=
lpwh
->
vtbl
->
WriteFile
(
lpwh
,
lpBuffer
,
dwNumOfBytesToWrite
,
lpdwNumOfBytesWritten
);
re
s
=
lpwh
->
vtbl
->
WriteFile
(
lpwh
,
lpBuffer
,
dwNumOfBytesToWrite
,
lpdwNumOfBytesWritten
);
}
else
{
}
else
{
WARN
(
"No Writefile method.
\n
"
);
WARN
(
"No Writefile method.
\n
"
);
SetLastError
(
ERROR_INVALID_HANDLE
);
res
=
ERROR_INVALID_HANDLE
;
retval
=
FALSE
;
}
}
WININET_Release
(
lpwh
);
WININET_Release
(
lpwh
);
return
retval
;
if
(
res
!=
ERROR_SUCCESS
)
SetLastError
(
res
);
return
res
==
ERROR_SUCCESS
;
}
}
...
...
dlls/wininet/internet.h
View file @
1ee3ad47
...
@@ -143,7 +143,7 @@ typedef struct {
...
@@ -143,7 +143,7 @@ typedef struct {
DWORD
(
*
ReadFile
)(
object_header_t
*
,
void
*
,
DWORD
,
DWORD
*
);
DWORD
(
*
ReadFile
)(
object_header_t
*
,
void
*
,
DWORD
,
DWORD
*
);
DWORD
(
*
ReadFileExA
)(
object_header_t
*
,
INTERNET_BUFFERSA
*
,
DWORD
,
DWORD_PTR
);
DWORD
(
*
ReadFileExA
)(
object_header_t
*
,
INTERNET_BUFFERSA
*
,
DWORD
,
DWORD_PTR
);
DWORD
(
*
ReadFileExW
)(
object_header_t
*
,
INTERNET_BUFFERSW
*
,
DWORD
,
DWORD_PTR
);
DWORD
(
*
ReadFileExW
)(
object_header_t
*
,
INTERNET_BUFFERSW
*
,
DWORD
,
DWORD_PTR
);
BOOL
(
*
WriteFile
)(
object_header_t
*
,
const
void
*
,
DWORD
,
DWORD
*
);
DWORD
(
*
WriteFile
)(
object_header_t
*
,
const
void
*
,
DWORD
,
DWORD
*
);
DWORD
(
*
QueryDataAvailable
)(
object_header_t
*
,
DWORD
*
,
DWORD
,
DWORD_PTR
);
DWORD
(
*
QueryDataAvailable
)(
object_header_t
*
,
DWORD
*
,
DWORD
,
DWORD_PTR
);
DWORD
(
*
FindNextFileW
)(
object_header_t
*
,
void
*
);
DWORD
(
*
FindNextFileW
)(
object_header_t
*
,
void
*
);
}
object_vtbl_t
;
}
object_vtbl_t
;
...
@@ -443,6 +443,7 @@ BOOL NETCON_recv(WININET_NETCONNECTION *connection, void *buf, size_t len, int f
...
@@ -443,6 +443,7 @@ BOOL NETCON_recv(WININET_NETCONNECTION *connection, void *buf, size_t len, int f
BOOL
NETCON_query_data_available
(
WININET_NETCONNECTION
*
connection
,
DWORD
*
available
);
BOOL
NETCON_query_data_available
(
WININET_NETCONNECTION
*
connection
,
DWORD
*
available
);
LPCVOID
NETCON_GetCert
(
WININET_NETCONNECTION
*
connection
);
LPCVOID
NETCON_GetCert
(
WININET_NETCONNECTION
*
connection
);
DWORD
NETCON_set_timeout
(
WININET_NETCONNECTION
*
connection
,
BOOL
send
,
int
value
);
DWORD
NETCON_set_timeout
(
WININET_NETCONNECTION
*
connection
,
BOOL
send
,
int
value
);
int
sock_get_error
(
int
);
extern
void
URLCacheContainers_CreateDefaults
(
void
);
extern
void
URLCacheContainers_CreateDefaults
(
void
);
extern
void
URLCacheContainers_DeleteAll
(
void
);
extern
void
URLCacheContainers_DeleteAll
(
void
);
...
...
dlls/wininet/netconnection.c
View file @
1ee3ad47
...
@@ -315,7 +315,7 @@ BOOL NETCON_connected(WININET_NETCONNECTION *connection)
...
@@ -315,7 +315,7 @@ BOOL NETCON_connected(WININET_NETCONNECTION *connection)
}
}
/* translate a unix error code into a winsock one */
/* translate a unix error code into a winsock one */
static
int
sock_get_error
(
int
err
)
int
sock_get_error
(
int
err
)
{
{
#if !defined(__MINGW32__) && !defined (_MSC_VER)
#if !defined(__MINGW32__) && !defined (_MSC_VER)
switch
(
err
)
switch
(
err
)
...
...
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