PDA

View Full Version : Is Network connection allways open



Michael Hartlef
15-07-2007, 08:13
Hi Eros,

I try to convert the HawkNL headers (a network library) and samples that I wrote for IBasic Pro to thinBasic. For some reason I can't get it to work, HawkNL allways tells me that there is allready a connection running. So my question is, does TB allways opens a network connection when you run a script? I have a feeling it does because every time a script crashes on my computer, my AVIRA antivir tells me that thinBasic_INET.dll is fishy. You told me before that there is nothing wrong with it, but why does it get triggered? At least it looks like.

Michael

Michael Hartlef
15-07-2007, 08:56
Never mind, stupid type conversions. I think it is to early on sunday :D

ErosOlmi
15-07-2007, 09:50
Mike,

INet module does not open any connection unless requested. LoadLocalSymbols is the following. No connection at all, just definistion of new keywords.

'----------------------------------------------------------------------------
FUNCTION LoadLocalSymbols ALIAS "LoadLocalSymbols" (OPTIONAL BYVAL sPath AS STRING) EXPORT AS LONG
' This function is automatically called by thinCore whenever this DLL is loaded.
' This function MUST be present in every external DLL you want to use
' with thinBasic
' Use this function to initialize every variable you need and for loading the
' new symbol (read Keyword) you have created.
'----------------------------------------------------------------------------

thinBasic_LoadSymbol "INET_GetState", %thinBasic_ReturnNumber, CODEPTR(Exec_INET_GetState), %thinBasic_ForceOverWrite
thinBasic_LoadSymbol "INET_GetConnectionMode", %thinBasic_ReturnNumber, CODEPTR(Exec_INET_GetConnectionMode), %thinBasic_ForceOverWrite
thinBasic_LoadSymbol "INET_OpenDialUpDialog", %thinBasic_ReturnNumber, CODEPTR(Exec_INET_OpenDialUpDialog), %thinBasic_ForceOverWrite
thinBasic_LoadSymbol "INET_UrlDownload", %thinBasic_ReturnNumber, CODEPTR(Exec_INET_URLDownload), %thinBasic_ForceOverWrite
thinBasic_LoadSymbol "INET_GetIp", %thinBasic_ReturnString, CODEPTR(Exec_INET_GetIP), %thinBasic_ForceOverWrite
thinBasic_LoadSymbol "INET_GetRemoteMACAddress", %thinBasic_ReturnString, CODEPTR(Exec_INET_GetRemoteMACAddress),%thinBasic_ForceOverWrite
thinBasic_LoadSymbol "INET_Ping", %thinBasic_ReturnString, CODEPTR(Exec_INET_Ping), %thinBasic_ForceOverWrite


thinBasic_AddEquate "%INTERNET_CONNECTION_MODEM", "", %INTERNET_CONNECTION_MODEM
thinBasic_AddEquate "%INTERNET_CONNECTION_LAN", "", %INTERNET_CONNECTION_LAN
thinBasic_AddEquate "%INTERNET_CONNECTION_PROXY", "", %INTERNET_CONNECTION_PROXY
thinBasic_AddEquate "%INTERNET_CONNECTION_MODEM_BUSY", "", %INTERNET_CONNECTION_MODEM_BUSY
thinBasic_AddEquate "%INTERNET_RAS_INSTALLED", "", %INTERNET_RAS_INSTALLED
thinBasic_AddEquate "%INTERNET_CONNECTION_OFFLINE", "", %INTERNET_CONNECTION_OFFLINE
thinBasic_AddEquate "%INTERNET_CONNECTION_CONFIGURED", "", %INTERNET_CONNECTION_CONFIGURED

FUNCTION = 0&
END FUNCTION

Of course when one or more of the INet fucntionalities are executed, a connection take place and if you AV and/or personal firewall check applications connecting to the network it is quite sure that INet will be intercepted. All applications going to the net are intercepted, for example, by ZoneAlarm as "suspicious" but if the starter is you, you should instruct your AV or personal firewall to allow.

Obviously, every time you reinstall thinBasic for a new update, for your AV or PFW, INet module will be new so even if you already authorized it, you need to do again. ZoneAlarm Pro has a nice features for programmers. You can tell ZA Pro that a certain application of dll is subject to frequently changes (whan you compile again a module you in reality change it completelly) so it will not warn you every time.

In any case, let me know if any other problem.

Ciao
Eros

Michael Hartlef
15-07-2007, 09:53
Thanks Eros, no problems besides dealing with strings/pointers.

Anyway, I got my sample running and I will post it now! :)