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
9e38c649
Commit
9e38c649
authored
Aug 01, 2000
by
Aric Stewart
Committed by
Alexandre Julliard
Aug 01, 2000
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Implemented InternetCheckConnectionA.
parent
e3d70795
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
80 additions
and
1 deletion
+80
-1
internet.c
dlls/wininet/internet.c
+79
-0
wininet.spec
dlls/wininet/wininet.spec
+1
-1
No files found.
dlls/wininet/internet.c
View file @
9e38c649
...
...
@@ -937,6 +937,85 @@ INTERNET_SCHEME GetInternetScheme(LPCSTR lpszScheme, INT nMaxCmp)
return
INTERNET_SCHEME_UNKNOWN
;
}
/***********************************************************************
* InternetCheckConnection
*
* Pings a requested host to check internet connection
*
* RETURNS
*
* TRUE on success and FALSE on failure. if a failures then
* ERROR_NOT_CONNECTED is places into GetLastError
*
*/
BOOL
WINAPI
InternetCheckConnectionA
(
LPCSTR
lpszUrl
,
DWORD
dwFlags
,
DWORD
dwReserved
)
{
/*
* this is a kludge which runs the resident ping program and reads the output.
*
* Anyone have a better idea?
*/
BOOL
rc
=
FALSE
;
char
command
[
1024
];
char
host
[
1024
];
int
status
=
-
1
;
/*
* Crack or set the Address
*/
if
(
lpszUrl
==
NULL
)
{
/*
* According to the doc we are supost to use the ip for the next
* server in the WnInet internal server database. I have
* no idea what that is or how to get it.
*
* So someone needs to implement this.
*/
FIXME
(
"Unimplemented with URL of NULL"
);
return
TRUE
;
}
else
{
URL_COMPONENTSA
componets
;
ZeroMemory
(
&
componets
,
sizeof
(
URL_COMPONENTSA
));
componets
.
lpszHostName
=
(
LPSTR
)
&
host
;
componets
.
dwHostNameLength
=
1024
;
if
(
!
InternetCrackUrlA
(
lpszUrl
,
0
,
0
,
&
componets
))
goto
End
;
TRACE
(
"host name : %s
\n
"
,
componets
.
lpszHostName
);
}
/*
* Build our ping command
*/
strcpy
(
command
,
"ping -w 1 "
);
strcat
(
command
,
host
);
strcat
(
command
,
" >/dev/null 2>/dev/null"
);
TRACE
(
"Ping command is : %s
\n
"
,
command
);
status
=
system
(
command
);
TRACE
(
"Ping returned a code of %i
\n
"
,
status
);
/* Ping return code of 0 indicates success */
if
(
status
==
0
)
rc
=
TRUE
;
End:
if
(
rc
==
FALSE
)
SetLastError
(
ERROR_NOT_CONNECTED
);
return
rc
;
}
/***********************************************************************
* INTERNET_WriteDataToStream (internal)
...
...
dlls/wininet/wininet.spec
View file @
9e38c649
...
...
@@ -88,7 +88,7 @@ init WININET_LibMain
@ stub InternetAutodialHangup
@ stdcall InternetCanonicalizeUrlA(str str ptr long) InternetCanonicalizeUrlA
@ stub InternetCanonicalizeUrlW
@ st
ub
InternetCheckConnectionA
@ st
dcall InternetCheckConnectionA(ptr long long)
InternetCheckConnectionA
@ stub InternetCheckConnectionW
@ stdcall InternetCloseHandle(long) InternetCloseHandle
@ stub InternetCombineUrlA
...
...
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