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
8e2586db
Commit
8e2586db
authored
Apr 27, 2016
by
Jacek Caban
Committed by
Alexandre Julliard
Apr 28, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wininet: Don't use INTERNET_MAX_HOST_NAME_LENGTH in InternetCheckConnectionW.
Signed-off-by:
Jacek Caban
<
jacek@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
e0c7741d
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
25 additions
and
17 deletions
+25
-17
internet.c
dlls/wininet/internet.c
+25
-17
No files found.
dlls/wininet/internet.c
View file @
8e2586db
...
...
@@ -3330,13 +3330,12 @@ BOOL WINAPI InternetCheckConnectionW( LPCWSTR lpszUrl, DWORD dwFlags, DWORD dwRe
BOOL
rc
=
FALSE
;
static
const
CHAR
ping
[]
=
"ping -c 1 "
;
static
const
CHAR
redirect
[]
=
" >/dev/null 2>/dev/null"
;
CHAR
*
command
=
NULL
;
WCHAR
hostW
[
INTERNET_MAX_HOST_NAME_LENGTH
];
DWORD
len
;
WCHAR
*
host
;
DWORD
len
,
host_len
;
INTERNET_PORT
port
;
int
status
=
-
1
;
FIXME
(
"
\n
"
);
FIXME
(
"
(%s %x %x)
\n
"
,
debugstr_w
(
lpszUrl
),
dwFlags
,
dwReserved
);
/*
* Crack or set the Address
...
...
@@ -3355,27 +3354,34 @@ BOOL WINAPI InternetCheckConnectionW( LPCWSTR lpszUrl, DWORD dwFlags, DWORD dwRe
}
else
{
URL_COMPONENTSW
components
;
URL_COMPONENTSW
components
=
{
sizeof
(
components
)}
;
ZeroMemory
(
&
components
,
sizeof
(
URL_COMPONENTSW
));
components
.
lpszHostName
=
(
LPWSTR
)
hostW
;
components
.
dwHostNameLength
=
INTERNET_MAX_HOST_NAME_LENGTH
;
components
.
dwHostNameLength
=
1
;
if
(
!
InternetCrackUrlW
(
lpszUrl
,
0
,
0
,
&
components
))
goto
End
;
TRACE
(
"host name : %s
\n
"
,
debugstr_w
(
components
.
lpszHostName
));
host
=
components
.
lpszHostName
;
host_len
=
components
.
dwHostNameLength
;
port
=
components
.
nPort
;
TRACE
(
"
port: %d
\n
"
,
port
);
TRACE
(
"
host name: %s port: %d
\n
"
,
debugstr_wn
(
host
,
host_len
)
,
port
);
}
if
(
dwFlags
&
FLAG_ICC_FORCE_CONNECTION
)
{
struct
sockaddr_storage
saddr
;
socklen_t
sa_len
=
sizeof
(
saddr
);
WCHAR
*
host_z
;
int
fd
;
BOOL
b
;
if
(
!
GetAddress
(
hostW
,
port
,
(
struct
sockaddr
*
)
&
saddr
,
&
sa_len
,
NULL
))
host_z
=
heap_strndupW
(
host
,
host_len
);
if
(
!
host_z
)
return
FALSE
;
b
=
GetAddress
(
host_z
,
port
,
(
struct
sockaddr
*
)
&
saddr
,
&
sa_len
,
NULL
);
heap_free
(
host_z
);
if
(
!
b
)
goto
End
;
init_winsock
();
fd
=
socket
(
saddr
.
ss_family
,
SOCK_STREAM
,
0
);
...
...
@@ -3391,15 +3397,18 @@ BOOL WINAPI InternetCheckConnectionW( LPCWSTR lpszUrl, DWORD dwFlags, DWORD dwRe
/*
* Build our ping command
*/
len
=
WideCharToMultiByte
(
CP_UNIXCP
,
0
,
hostW
,
-
1
,
NULL
,
0
,
NULL
,
NULL
);
command
=
heap_alloc
(
strlen
(
ping
)
+
len
+
strlen
(
redirect
));
strcpy
(
command
,
ping
);
WideCharToMultiByte
(
CP_UNIXCP
,
0
,
hostW
,
-
1
,
command
+
strlen
(
ping
),
len
,
NULL
,
NULL
);
strcat
(
command
,
redirect
);
char
*
command
;
len
=
WideCharToMultiByte
(
CP_UNIXCP
,
0
,
host
,
host_len
,
NULL
,
0
,
NULL
,
NULL
);
command
=
heap_alloc
(
strlen
(
ping
)
+
len
+
strlen
(
redirect
)
+
1
);
strcpy
(
command
,
ping
);
WideCharToMultiByte
(
CP_UNIXCP
,
0
,
host
,
host_len
,
command
+
sizeof
(
ping
)
-
1
,
len
,
NULL
,
NULL
);
strcpy
(
command
+
sizeof
(
ping
)
-
1
+
len
,
redirect
);
TRACE
(
"Ping command is : %s
\n
"
,
command
);
status
=
system
(
command
);
heap_free
(
command
);
TRACE
(
"Ping returned a code of %i
\n
"
,
status
);
...
...
@@ -3409,7 +3418,6 @@ BOOL WINAPI InternetCheckConnectionW( LPCWSTR lpszUrl, DWORD dwFlags, DWORD dwRe
}
End:
heap_free
(
command
);
if
(
rc
==
FALSE
)
INTERNET_SetLastError
(
ERROR_NOT_CONNECTED
);
...
...
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