FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour Anti-virus security warning when calling "SetHelpFile( ... )
Posts: 3
Joined: Tue Sep 07, 2010 06:25 AM
Anti-virus security warning when calling "SetHelpFile( ... )
Posted: Wed Sep 08, 2010 03:06 AM
Hi,

My anti-virus (ZoneAlarm, version 9.3, the latest...) is giving me a serious security warning when the SET HELPFILE function is called.

Image of the warning:


I was able to isolate the call of the security warning by inserting a MsgInfo() before and after the call to SET HELPFILE TO.

I am getting the error in my application and don't want my users to stress with this.

The problem can be reproduce with one of the FWH samples (fwh\samples\testhlp2.prg)
1) Modify the file fwh\samples\testhlp2.prg and replace CurDrive() with HB_CurDrive()
2) Add some MsgInfo() before and after the SET HELPFILE TO "fwcmd.chm" line (See code example)
3) Compile and start the application ( BUILDH testhlp2 )

The message does appear with my ZoneAlarm, but I do not have any kind of warning on my daughter's PC who is using avast! anti-virus.

Code (fw): Select all Collapse
function Main()

   SetKey( K_F1, { | nKey | MsgInfo( "Help" ) } )

#ifdef __HARBOUR__

MsgInfo("Before SET HELPFILE TO")
   SET HELPFILE TO "fwcmd.chm"      // Here you set your default HELP file
MsgInfo("After SET HELPFILE TO")
   HelpSetTopic(  "winhelp" )
#else

   SET HELPFILE TO "fwfun.hlp"

#endif


Any help or comments would be really appreciated.....

My configuration:
Windows 7 32 bit
FWH 10.8
Harbour 2.1
BCC55


Claude.
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: Anti-virus security warning when calling "SetHelpFile( ... )
Posted: Wed Sep 08, 2010 07:44 AM
Claude,

Many thanks for your feedback,

We are reviewing it to find what may be the reason for the anti-virus alert.

Also we have detected some typos in source\winapi\help32.prg. These are the required changes:
Code (fw): Select all Collapse
static function IsHelpFile( cHelpFile )

   local lReturn := .T.

   do case
      case empty( cHelpFile )
             MsgStop( "No Help file defined with SetHelpFile()!", " Attention" )
             lReturn := .F.
             
      case ! file( cHelpfile )
             MsgStop( "Help file '" + cHelpfile + "' does not exist" + CRLF + ;
                      "or its name (with path) is too long!", " Attention" )
             lReturn := .F.
   endcase

return lReturn
regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: Anti-virus security warning when calling "SetHelpFile( ... )
Posted: Wed Sep 08, 2010 07:56 AM
Claude,

In source\winapi\help.c could you please comment out these lines:
Code (fw): Select all Collapse
static void SetF1Menu( void )
{
   FARPROC lpF1Hook;

   if( ! Hook &&
       ( lpF1Hook = ( FARPROC ) MakeProcInstance( ( FARPROC ) TrapF1, GetInstance() ) ) )
   {
      // Hook = SetWindowsHookEx( WH_MSGFILTER, ( HOOKPROC ) lpF1Hook,
      //                          GetInstance(), 0 );
   }
}

and compile it and link the resulting OBJ to your application and check if that cures the antivirus alarm ? thanks :-)
regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 3
Joined: Tue Sep 07, 2010 06:25 AM
Re: Anti-virus security warning when calling "SetHelpFile( ... )
Posted: Wed Sep 08, 2010 08:38 AM
Hi Antonio,

Many thanks for the quick reply.

I did both changes (help32.prg and help.c).

When I compile, i get the following warning:
Code (fw): Select all Collapse
Borland C++ 5.5.1 for Win32 Copyright (c) 1993, 2000 Borland
help.c:
Warning W8060 help.c 108: Possibly incorrect assignment in function SetF1Menu
Warning W8004 help.c 117: 'lpF1Hook' is assigned a value that is never used in function SetF1Menu


The good news is that I don't have the security warning from ZoneAlarm anymore and the "Help" seems to work fine.
Should I worry about those warnings ?

Thanks!

Claude.
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: Anti-virus security warning when calling "SetHelpFile( ... )
Posted: Wed Sep 08, 2010 08:45 AM

Claude,

You can safely ignore those warnings. No problem at all with them :-)

Many thanks for your feedback!

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 3
Joined: Tue Sep 07, 2010 06:25 AM
Re: Anti-virus security warning when calling "SetHelpFile( ... )
Posted: Wed Sep 08, 2010 04:49 PM

Cool !

Thanks again.

Continue the discussion