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
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,
header
=
HeapAlloc
(
GetProcessHeap
(),
0
,
headerlen
*
sizeof
(
WCHAR
));
if
(
!
(
BuffersInW
.
lpcszHeader
=
header
))
{
INTERNET_
SetLastError
(
ERROR_OUTOFMEMORY
);
SetLastError
(
ERROR_OUTOFMEMORY
);
return
FALSE
;
}
BuffersInW
.
dwHeadersLength
=
MultiByteToWideChar
(
CP_ACP
,
0
,
...
...
@@ -4203,30 +4203,25 @@ static const object_vtbl_t HTTPSESSIONVtbl = {
* NULL on failure
*
*/
HINTERNET
HTTP_Connect
(
appinfo_t
*
hIC
,
LPCWSTR
lpszServerName
,
INTERNET_PORT
nServerPort
,
LPCWSTR
lpszUserName
,
LPCWSTR
lpszPassword
,
DWORD
dwFlags
,
DWORD_PTR
dwContext
,
DWORD
dwInternalFlags
)
DWORD
HTTP_Connect
(
appinfo_t
*
hIC
,
LPCWSTR
lpszServerName
,
INTERNET_PORT
nServerPort
,
LPCWSTR
lpszUserName
,
LPCWSTR
lpszPassword
,
DWORD
dwFlags
,
DWORD_PTR
dwContext
,
DWORD
dwInternalFlags
,
HINTERNET
*
ret
)
{
http_session_t
*
lpwhs
=
NULL
;
HINTERNET
handle
=
NULL
;
DWORD
res
=
ERROR_SUCCESS
;
TRACE
(
"-->
\n
"
);
if
(
!
lpszServerName
||
!
lpszServerName
[
0
])
{
INTERNET_SetLastError
(
ERROR_INVALID_PARAMETER
);
goto
lerror
;
}
return
ERROR_INVALID_PARAMETER
;
assert
(
hIC
->
hdr
.
htype
==
WH_HINIT
);
lpwhs
=
HeapAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
sizeof
(
http_session_t
));
if
(
NULL
==
lpwhs
)
{
INTERNET_SetLastError
(
ERROR_OUTOFMEMORY
);
goto
lerror
;
}
if
(
!
lpwhs
)
return
ERROR_OUTOFMEMORY
;
/*
* 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,
if
(
NULL
==
handle
)
{
ERR
(
"Failed to alloc handle
\n
"
);
INTERNET_SetLastError
(
ERROR_OUTOFMEMORY
)
;
goto
lerror
;
res
=
ERROR_OUTOFMEMORY
;
goto
lerror
;
}
if
(
hIC
->
lpszProxy
&&
hIC
->
dwAccessType
==
INTERNET_OPEN_TYPE_PROXY
)
{
...
...
@@ -4288,7 +4283,10 @@ lerror:
*/
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,
{
appinfo_t
*
hIC
;
HINTERNET
rc
=
NULL
;
DWORD
res
=
ERROR_SUCCESS
;
TRACE
(
"(%p, %s, %i, %s, %s, %i, %i, %lx)
\n
"
,
hInternet
,
debugstr_w
(
lpszServerName
),
nServerPort
,
debugstr_w
(
lpszUserName
),
debugstr_w
(
lpszPassword
),
...
...
@@ -956,16 +957,14 @@ HINTERNET WINAPI InternetConnectW(HINTERNET hInternet,
if
(
!
lpszServerName
)
{
INTERNET_
SetLastError
(
ERROR_INVALID_PARAMETER
);
SetLastError
(
ERROR_INVALID_PARAMETER
);
return
NULL
;
}
/* Clear any error information */
INTERNET_SetLastError
(
0
);
hIC
=
(
appinfo_t
*
)
WININET_GetObject
(
hInternet
);
if
(
(
hIC
==
NULL
)
||
(
hIC
->
hdr
.
htype
!=
WH_HINIT
)
)
{
INTERNET_SetLastError
(
ERROR_INVALID_HANDLE
)
;
res
=
ERROR_INVALID_HANDLE
;
goto
lend
;
}
...
...
@@ -974,11 +973,13 @@ HINTERNET WINAPI InternetConnectW(HINTERNET hInternet,
case
INTERNET_SERVICE_FTP
:
rc
=
FTP_Connect
(
hIC
,
lpszServerName
,
nServerPort
,
lpszUserName
,
lpszPassword
,
dwFlags
,
dwContext
,
0
);
if
(
!
rc
)
res
=
INTERNET_GetLastError
();
break
;
case
INTERNET_SERVICE_HTTP
:
r
c
=
HTTP_Connect
(
hIC
,
lpszServerName
,
nServerPort
,
lpszUserName
,
lpszPassword
,
dwFlags
,
dwContext
,
0
);
r
es
=
HTTP_Connect
(
hIC
,
lpszServerName
,
nServerPort
,
lpszUserName
,
lpszPassword
,
dwFlags
,
dwContext
,
0
,
&
rc
);
break
;
case
INTERNET_SERVICE_GOPHER
:
...
...
@@ -990,6 +991,7 @@ lend:
WININET_Release
(
&
hIC
->
hdr
);
TRACE
(
"returning %p
\n
"
,
rc
);
SetLastError
(
res
);
return
rc
;
}
...
...
@@ -2835,6 +2837,7 @@ static HINTERNET INTERNET_InternetOpenUrlW(appinfo_t *hIC, LPCWSTR lpszUrl,
WCHAR
protocol
[
32
],
hostName
[
MAXHOSTNAME
],
userName
[
1024
];
WCHAR
password
[
1024
],
path
[
2048
],
extra
[
1024
];
HINTERNET
client
=
NULL
,
client1
=
NULL
;
DWORD
res
;
TRACE
(
"(%p, %s, %s, %08x, %08x, %08lx)
\n
"
,
hIC
,
debugstr_w
(
lpszUrl
),
debugstr_w
(
lpszHeaders
),
dwHeadersLength
,
dwFlags
,
dwContext
);
...
...
@@ -2882,10 +2885,12 @@ static HINTERNET INTERNET_InternetOpenUrlW(appinfo_t *hIC, LPCWSTR lpszUrl,
if
(
urlComponents
.
nScheme
==
INTERNET_SCHEME_HTTPS
)
dwFlags
|=
INTERNET_FLAG_SECURE
;
/* FIXME: should use pointers, not handles, as handles are not thread-safe */
client
=
HTTP_Connect
(
hIC
,
hostName
,
urlComponents
.
nPort
,
userName
,
password
,
dwFlags
,
dwContext
,
INET_OPENURL
);
if
(
client
==
NULL
)
res
=
HTTP_Connect
(
hIC
,
hostName
,
urlComponents
.
nPort
,
userName
,
password
,
dwFlags
,
dwContext
,
INET_OPENURL
,
&
client
);
if
(
res
!=
ERROR_SUCCESS
)
{
INTERNET_SetLastError
(
res
);
break
;
}
if
(
urlComponents
.
dwExtraInfoLength
)
{
WCHAR
*
path_extra
;
...
...
dlls/wininet/internet.h
View file @
b73e31c6
...
...
@@ -397,10 +397,10 @@ HINTERNET FTP_Connect(appinfo_t *hIC, LPCWSTR lpszServerName,
LPCWSTR
lpszPassword
,
DWORD
dwFlags
,
DWORD_PTR
dwContext
,
DWORD
dwInternalFlags
);
HINTERNET
HTTP_Connect
(
appinfo_t
*
hIC
,
LPCWSTR
lpszServerName
,
INTERNET_PORT
nServerPort
,
LPCWSTR
lpszUserName
,
LPCWSTR
lpszPassword
,
DWORD
dwFlags
,
DWORD_PTR
dwContext
,
DWORD
dwInternalFlags
);
DWORD
HTTP_Connect
(
appinfo_t
*
,
LPCWSTR
,
INTERNET_PORT
nServerPort
,
LPCWSTR
lpszUserName
,
LPCWSTR
lpszPassword
,
DWORD
dwFlags
,
DWORD_PTR
dwContext
,
DWORD
dwInternalFlags
,
HINTERNET
*
);
BOOL
GetAddress
(
LPCWSTR
lpszServerName
,
INTERNET_PORT
nServerPort
,
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