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
b73e31c6
Commit
b73e31c6
authored
Dec 21, 2009
by
Jacek Caban
Committed by
Alexandre Julliard
Dec 21, 2009
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wininet: Return error directly from HTTP_Connect.
parent
e1958a67
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
33 additions
and
30 deletions
+33
-30
http.c
dlls/wininet/http.c
+15
-17
internet.c
dlls/wininet/internet.c
+14
-9
internet.h
dlls/wininet/internet.h
+4
-4
No files found.
dlls/wininet/http.c
View file @
b73e31c6
...
@@ -3880,7 +3880,7 @@ BOOL WINAPI HttpSendRequestExA(HINTERNET hRequest,
...
@@ -3880,7 +3880,7 @@ BOOL WINAPI HttpSendRequestExA(HINTERNET hRequest,
header
=
HeapAlloc
(
GetProcessHeap
(),
0
,
headerlen
*
sizeof
(
WCHAR
));
header
=
HeapAlloc
(
GetProcessHeap
(),
0
,
headerlen
*
sizeof
(
WCHAR
));
if
(
!
(
BuffersInW
.
lpcszHeader
=
header
))
if
(
!
(
BuffersInW
.
lpcszHeader
=
header
))
{
{
INTERNET_
SetLastError
(
ERROR_OUTOFMEMORY
);
SetLastError
(
ERROR_OUTOFMEMORY
);
return
FALSE
;
return
FALSE
;
}
}
BuffersInW
.
dwHeadersLength
=
MultiByteToWideChar
(
CP_ACP
,
0
,
BuffersInW
.
dwHeadersLength
=
MultiByteToWideChar
(
CP_ACP
,
0
,
...
@@ -4203,30 +4203,25 @@ static const object_vtbl_t HTTPSESSIONVtbl = {
...
@@ -4203,30 +4203,25 @@ static const object_vtbl_t HTTPSESSIONVtbl = {
* NULL on failure
* NULL on failure
*
*
*/
*/
HINTERNET
HTTP_Connect
(
appinfo_t
*
hIC
,
LPCWSTR
lpszServerName
,
DWORD
HTTP_Connect
(
appinfo_t
*
hIC
,
LPCWSTR
lpszServerName
,
INTERNET_PORT
nServerPort
,
LPCWSTR
lpszUserName
,
INTERNET_PORT
nServerPort
,
LPCWSTR
lpszUserName
,
LPCWSTR
lpszPassword
,
DWORD
dwFlags
,
DWORD_PTR
dwContext
,
LPCWSTR
lpszPassword
,
DWORD
dwFlags
,
DWORD_PTR
dwContext
,
DWORD
dwInternalFlags
)
DWORD
dwInternalFlags
,
HINTERNET
*
ret
)
{
{
http_session_t
*
lpwhs
=
NULL
;
http_session_t
*
lpwhs
=
NULL
;
HINTERNET
handle
=
NULL
;
HINTERNET
handle
=
NULL
;
DWORD
res
=
ERROR_SUCCESS
;
TRACE
(
"-->
\n
"
);
TRACE
(
"-->
\n
"
);
if
(
!
lpszServerName
||
!
lpszServerName
[
0
])
if
(
!
lpszServerName
||
!
lpszServerName
[
0
])
{
return
ERROR_INVALID_PARAMETER
;
INTERNET_SetLastError
(
ERROR_INVALID_PARAMETER
);
goto
lerror
;
}
assert
(
hIC
->
hdr
.
htype
==
WH_HINIT
);
assert
(
hIC
->
hdr
.
htype
==
WH_HINIT
);
lpwhs
=
HeapAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
sizeof
(
http_session_t
));
lpwhs
=
HeapAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
sizeof
(
http_session_t
));
if
(
NULL
==
lpwhs
)
if
(
!
lpwhs
)
{
return
ERROR_OUTOFMEMORY
;
INTERNET_SetLastError
(
ERROR_OUTOFMEMORY
);
goto
lerror
;
}
/*
/*
* According to my tests. The name is not resolved until a request is sent
* According to my tests. The name is not resolved until a request is sent
...
@@ -4248,8 +4243,8 @@ HINTERNET HTTP_Connect(appinfo_t *hIC, LPCWSTR lpszServerName,
...
@@ -4248,8 +4243,8 @@ HINTERNET HTTP_Connect(appinfo_t *hIC, LPCWSTR lpszServerName,
if
(
NULL
==
handle
)
if
(
NULL
==
handle
)
{
{
ERR
(
"Failed to alloc handle
\n
"
);
ERR
(
"Failed to alloc handle
\n
"
);
INTERNET_SetLastError
(
ERROR_OUTOFMEMORY
)
;
res
=
ERROR_OUTOFMEMORY
;
goto
lerror
;
goto
lerror
;
}
}
if
(
hIC
->
lpszProxy
&&
hIC
->
dwAccessType
==
INTERNET_OPEN_TYPE_PROXY
)
{
if
(
hIC
->
lpszProxy
&&
hIC
->
dwAccessType
==
INTERNET_OPEN_TYPE_PROXY
)
{
...
@@ -4288,7 +4283,10 @@ lerror:
...
@@ -4288,7 +4283,10 @@ lerror:
*/
*/
TRACE
(
"%p --> %p (%p)
\n
"
,
hIC
,
handle
,
lpwhs
);
TRACE
(
"%p --> %p (%p)
\n
"
,
hIC
,
handle
,
lpwhs
);
return
handle
;
if
(
res
==
ERROR_SUCCESS
)
*
ret
=
handle
;
return
res
;
}
}
...
...
dlls/wininet/internet.c
View file @
b73e31c6
...
@@ -949,6 +949,7 @@ HINTERNET WINAPI InternetConnectW(HINTERNET hInternet,
...
@@ -949,6 +949,7 @@ HINTERNET WINAPI InternetConnectW(HINTERNET hInternet,
{
{
appinfo_t
*
hIC
;
appinfo_t
*
hIC
;
HINTERNET
rc
=
NULL
;
HINTERNET
rc
=
NULL
;
DWORD
res
=
ERROR_SUCCESS
;
TRACE
(
"(%p, %s, %i, %s, %s, %i, %i, %lx)
\n
"
,
hInternet
,
debugstr_w
(
lpszServerName
),
TRACE
(
"(%p, %s, %i, %s, %s, %i, %i, %lx)
\n
"
,
hInternet
,
debugstr_w
(
lpszServerName
),
nServerPort
,
debugstr_w
(
lpszUserName
),
debugstr_w
(
lpszPassword
),
nServerPort
,
debugstr_w
(
lpszUserName
),
debugstr_w
(
lpszPassword
),
...
@@ -956,16 +957,14 @@ HINTERNET WINAPI InternetConnectW(HINTERNET hInternet,
...
@@ -956,16 +957,14 @@ HINTERNET WINAPI InternetConnectW(HINTERNET hInternet,
if
(
!
lpszServerName
)
if
(
!
lpszServerName
)
{
{
INTERNET_
SetLastError
(
ERROR_INVALID_PARAMETER
);
SetLastError
(
ERROR_INVALID_PARAMETER
);
return
NULL
;
return
NULL
;
}
}
/* Clear any error information */
INTERNET_SetLastError
(
0
);
hIC
=
(
appinfo_t
*
)
WININET_GetObject
(
hInternet
);
hIC
=
(
appinfo_t
*
)
WININET_GetObject
(
hInternet
);
if
(
(
hIC
==
NULL
)
||
(
hIC
->
hdr
.
htype
!=
WH_HINIT
)
)
if
(
(
hIC
==
NULL
)
||
(
hIC
->
hdr
.
htype
!=
WH_HINIT
)
)
{
{
INTERNET_SetLastError
(
ERROR_INVALID_HANDLE
)
;
res
=
ERROR_INVALID_HANDLE
;
goto
lend
;
goto
lend
;
}
}
...
@@ -974,11 +973,13 @@ HINTERNET WINAPI InternetConnectW(HINTERNET hInternet,
...
@@ -974,11 +973,13 @@ HINTERNET WINAPI InternetConnectW(HINTERNET hInternet,
case
INTERNET_SERVICE_FTP
:
case
INTERNET_SERVICE_FTP
:
rc
=
FTP_Connect
(
hIC
,
lpszServerName
,
nServerPort
,
rc
=
FTP_Connect
(
hIC
,
lpszServerName
,
nServerPort
,
lpszUserName
,
lpszPassword
,
dwFlags
,
dwContext
,
0
);
lpszUserName
,
lpszPassword
,
dwFlags
,
dwContext
,
0
);
if
(
!
rc
)
res
=
INTERNET_GetLastError
();
break
;
break
;
case
INTERNET_SERVICE_HTTP
:
case
INTERNET_SERVICE_HTTP
:
r
c
=
HTTP_Connect
(
hIC
,
lpszServerName
,
nServerPort
,
r
es
=
HTTP_Connect
(
hIC
,
lpszServerName
,
nServerPort
,
lpszUserName
,
lpszPassword
,
dwFlags
,
dwContext
,
0
);
lpszUserName
,
lpszPassword
,
dwFlags
,
dwContext
,
0
,
&
rc
);
break
;
break
;
case
INTERNET_SERVICE_GOPHER
:
case
INTERNET_SERVICE_GOPHER
:
...
@@ -990,6 +991,7 @@ lend:
...
@@ -990,6 +991,7 @@ lend:
WININET_Release
(
&
hIC
->
hdr
);
WININET_Release
(
&
hIC
->
hdr
);
TRACE
(
"returning %p
\n
"
,
rc
);
TRACE
(
"returning %p
\n
"
,
rc
);
SetLastError
(
res
);
return
rc
;
return
rc
;
}
}
...
@@ -2835,6 +2837,7 @@ static HINTERNET INTERNET_InternetOpenUrlW(appinfo_t *hIC, LPCWSTR lpszUrl,
...
@@ -2835,6 +2837,7 @@ static HINTERNET INTERNET_InternetOpenUrlW(appinfo_t *hIC, LPCWSTR lpszUrl,
WCHAR
protocol
[
32
],
hostName
[
MAXHOSTNAME
],
userName
[
1024
];
WCHAR
protocol
[
32
],
hostName
[
MAXHOSTNAME
],
userName
[
1024
];
WCHAR
password
[
1024
],
path
[
2048
],
extra
[
1024
];
WCHAR
password
[
1024
],
path
[
2048
],
extra
[
1024
];
HINTERNET
client
=
NULL
,
client1
=
NULL
;
HINTERNET
client
=
NULL
,
client1
=
NULL
;
DWORD
res
;
TRACE
(
"(%p, %s, %s, %08x, %08x, %08lx)
\n
"
,
hIC
,
debugstr_w
(
lpszUrl
),
debugstr_w
(
lpszHeaders
),
TRACE
(
"(%p, %s, %s, %08x, %08x, %08lx)
\n
"
,
hIC
,
debugstr_w
(
lpszUrl
),
debugstr_w
(
lpszHeaders
),
dwHeadersLength
,
dwFlags
,
dwContext
);
dwHeadersLength
,
dwFlags
,
dwContext
);
...
@@ -2882,10 +2885,12 @@ static HINTERNET INTERNET_InternetOpenUrlW(appinfo_t *hIC, LPCWSTR lpszUrl,
...
@@ -2882,10 +2885,12 @@ static HINTERNET INTERNET_InternetOpenUrlW(appinfo_t *hIC, LPCWSTR lpszUrl,
if
(
urlComponents
.
nScheme
==
INTERNET_SCHEME_HTTPS
)
dwFlags
|=
INTERNET_FLAG_SECURE
;
if
(
urlComponents
.
nScheme
==
INTERNET_SCHEME_HTTPS
)
dwFlags
|=
INTERNET_FLAG_SECURE
;
/* FIXME: should use pointers, not handles, as handles are not thread-safe */
/* FIXME: should use pointers, not handles, as handles are not thread-safe */
client
=
HTTP_Connect
(
hIC
,
hostName
,
urlComponents
.
nPort
,
res
=
HTTP_Connect
(
hIC
,
hostName
,
urlComponents
.
nPort
,
userName
,
password
,
dwFlags
,
dwContext
,
INET_OPENURL
);
userName
,
password
,
dwFlags
,
dwContext
,
INET_OPENURL
,
&
client
);
if
(
client
==
NULL
)
if
(
res
!=
ERROR_SUCCESS
)
{
INTERNET_SetLastError
(
res
);
break
;
break
;
}
if
(
urlComponents
.
dwExtraInfoLength
)
{
if
(
urlComponents
.
dwExtraInfoLength
)
{
WCHAR
*
path_extra
;
WCHAR
*
path_extra
;
...
...
dlls/wininet/internet.h
View file @
b73e31c6
...
@@ -397,10 +397,10 @@ HINTERNET FTP_Connect(appinfo_t *hIC, LPCWSTR lpszServerName,
...
@@ -397,10 +397,10 @@ HINTERNET FTP_Connect(appinfo_t *hIC, LPCWSTR lpszServerName,
LPCWSTR
lpszPassword
,
DWORD
dwFlags
,
DWORD_PTR
dwContext
,
LPCWSTR
lpszPassword
,
DWORD
dwFlags
,
DWORD_PTR
dwContext
,
DWORD
dwInternalFlags
);
DWORD
dwInternalFlags
);
HINTERNET
HTTP_Connect
(
appinfo_t
*
hIC
,
LPCWSTR
lpszServerName
,
DWORD
HTTP_Connect
(
appinfo_t
*
,
LPCWSTR
,
INTERNET_PORT
nServerPort
,
LPCWSTR
lpszUserName
,
INTERNET_PORT
nServerPort
,
LPCWSTR
lpszUserName
,
LPCWSTR
lpszPassword
,
DWORD
dwFlags
,
DWORD_PTR
dwContext
,
LPCWSTR
lpszPassword
,
DWORD
dwFlags
,
DWORD_PTR
dwContext
,
DWORD
dwInternalFlags
);
DWORD
dwInternalFlags
,
HINTERNET
*
);
BOOL
GetAddress
(
LPCWSTR
lpszServerName
,
INTERNET_PORT
nServerPort
,
BOOL
GetAddress
(
LPCWSTR
lpszServerName
,
INTERNET_PORT
nServerPort
,
struct
sockaddr
*
psa
,
socklen_t
*
sa_len
);
struct
sockaddr
*
psa
,
socklen_t
*
sa_len
);
...
...
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