Is it possible to confirm connection to network withing FWPPC?
Is it possible to confirm connection to network withing FWPPC?
Darrell,
If you mean local network, then you may check for a file existence:
if File( "\machine\path\filename" )
For Internet access, you may use:
Function IsInternet()
WSAStartup()
RETURN GetHostByName( "www.microsoft.com" ) != "0.0.0.0"
Thank you Antonio
Antonio,
I got a FWPPC GPF occurred. Fix GPFStack() when using IsInternet function below.
Antonio,
The GPF was caused by the WSAStartup() function. I removed it and I did not get the GPF. Is this function required?
Darrell,
Is IsInternet() working without it ?
Hi Antonio,
No, it returns IP 0.0.0.0; however the internet is working and my FWPPC application sees host \cargo\data. Should GetHostByName() use 'cargo' or '\cargo'?
Thank you,
#pragma BEGINDUMP
#include <hbapi.h>
#include <WinSock2.h>
HB_FUNC( WSASTARTUP )
{
static WSADATA wsa;
hb_retni( WSAStartup( 0x202, &wsa ) );
}
#pragma ENDDUMPAntonio,
Got the following error when trying to build application.
FiveCEC.lib(WINSOCK.obj) : error LNK2005: HB_FUN_WSASTARTUP already defined in CDM-NET.obj
FiveCEC.lib(WINSOCK.obj) : warning LNK4006: HB_FUN_WSASTARTUP already defined in CDM-NET.obj; second definition ignored
Creating library CDM-NET.lib and object CDM-NET.exp
CDM-NET.exe : fatal error LNK1169: one or more multiply defined symbols found
Darrell,
use this flag for link.exe: /force:MULTIPLE
Antonio,
I am getting a fatal application error.
Darrel,
What FWPPC build are you using ? Please tell me the dates of the libraries, thanks
fivece.lib 08/26/2007 @ 23:24
fivecec.lib 08/26/2007 @ 23:20
function Main()
MsgInfo( IsInternet() )
return nil
Function IsInternet()
WSAStartup()
RETURN GetHostByName( "www.microsoft.com" ) != "0.0.0.0"
If you mean local network, then you may check for a file existence:
if File( "\\machine\path\filename" )