Today encountered very strange problem, the normal development of the unit code, in a program compiled no problem, the same unit reference to the B program compiled by the small red umbrella virus tr/spy.banker.gen4 [Trojan], automatic isolation deletion.
Today's anti-virus software, is really a struggle, today an afternoon of the troubleshooting code, and finally found that the problem is actually in the call Windows API place, the overall two code will be reported virus:
Issue Code 1:
//Unit 1 declaring reference API functionsfunctionGetcpinfoex (codepage:uint; Flags:dword; varLPCPINFO:TCPINFOEX): BOOL;stdcall; Externalkernel32 Name{$IFDEF UNICODE} 'GETCPINFOEXW'; {$ELSE} 'Getcpinfoexa'; {$ENDIF}//Unit 2 //once the getcpinfoex of unit 1 is called, the virus is immediately reported, ifGetcpinfoex (Fcodepage,0, Lcpinfo) Then //Getcpinfoex, which is modified to call the Windows unit, does not ifWindows.getcpinfoex (Fcodepage,0, Lcpinfo) Then//It must be very strange to say that in Unit 1 reference GETCPINFOEX will generate virus signatures?
Issue Code 2:
Unit 3: // once called enumsystemcodepages, the virus is immediately reported . Windows.enumsystemcodepages (@DoEnumCodePageCallBackEx, Dwflag);
At the end of the world, all you have to do is dynamically load the DLL and invoke the API.
Delphi compiled the program by the small Red umbrella reported virus Tr/spy.banker.gen4 [Trojan]