newLISP Development Release v.10.6.3

Started by Lutz, July 08, 2015, 08:23:46 AM

Previous topic - Next topic

Lutz

This development release adds new functionality to existing functions and fixes bugs.



Files and release notes: http://www.newlisp.org/downloads">http://www.newlisp.org/downloads



Thanks to everybody participating in this release. Special thanks to Kosh, who did most of the work for the Windows 64-bit release.

HPW

#1
Hello,



Thanks Lutz for the ongoing development.



Unfourtunatly my Norton Internet Security delete the windows installers because it reports WS.Reputation.1



But Virustotal scans without problem:



https://www.virustotal.com/de/file/590ff4f8c68cfec4ed3d2322345650349ec1505fe7e3bf7ca87379c4afb9cdc0/analysis/1436374630/">https://www.virustotal.com/de/file/590f ... 436374630/">https://www.virustotal.com/de/file/590ff4f8c68cfec4ed3d2322345650349ec1505fe7e3bf7ca87379c4afb9cdc0/analysis/1436374630/



https://www.virustotal.com/de/file/2c9bc62618261419bd428792adbd46d42e16ea95356f2071dfeb4e787847209f/analysis/1436374825/">https://www.virustotal.com/de/file/2c9b ... 436374825/">https://www.virustotal.com/de/file/2c9bc62618261419bd428792adbd46d42e16ea95356f2071dfeb4e787847209f/analysis/1436374825/



I will report a false positiv.



Regards
Hans-Peter

HPW

#2
Hello,



In my regular testing against my neobook demo app, I get a error with commands which get imported into the newlsip.dll (32 bit). They now throw a access violation in my (Turtle3:run).



Until 10.602 all run without problems.



I noticed a different DLL-size from 10602 to 10603:

301.568 Bytes

286.734 Bytes



Any changes how Dll-callbacks were done?



The following command throws the violation:

(hpwImageTextOut "RImage1" "Dragon Fractal" "380" "70" "Times" "12" "clWhite" "clNavy")



> hpwImageTextOut      

(lambda (nbpara1 nbpara2 nbpara3 nbpara4  nbpara5 nbpara6 nbpara7 nbpara8) (hpwImageExec

  "" "9" nbpara1 nbpara2 nbpara3 nbpara4 nbpara5 nbpara6 nbpara7 nbpara8))



> hpwImageExec

hpwImageExec@2D814CC



hpwImageExec is the imported command from the neobook dll.



Regards
Hans-Peter

rickyboy

#3
Quote from: "Lutz"This development release adds new functionality to existing functions and fixes bugs.  [...] Special thanks to Kosh, who did most of the work for the Windows 64-bit release.

Thanks, Lutz!  Thanks, kosh[04]!
(λx. x x) (λx. x x)

Lutz

#4
Since the new development v.10.6.3, a newer development systems with GCC version 4.9.2 from the TDM system is used and running on Windows 7. Before v.10.6.3, Windows newLISP development was on Windows XP. It was time to move on to Windows 7 as a minimum, to take advantage of 64-bit Windows.



This is how simple ffi and extended ffi 'import' and 'callback' are tested:



newlisp-10.6.3/qa-specifif-tests/qa-libffi : simple and extended ffi for callbacks and imports

newlisp-10.6.3/qa-specifif-tests/qa-libc-libffi : extended ffi only and using system libraries

newlisp-10.6.3/examples/opengl-demo.lsp : simple ffi and callback 32-bit only

newlisp-10.6.3/examples/opengl-demo-ffi.lsp : extended ffi and callback 32-bit and 64-bit (UNIX only)



specifically for Windows 32-bit, great example how to work with various Windows DLLs:



newlisp-10.6.3/examples/win32demo.lsp : simple ffi only and with callbacks



When importing self compiled libs on Windows and using the simple ffi, try importing with "cdecl". See these changes in the qa-libffi file from v10.6.2 to v10.6.3. Try also the extended ffi, present on all Windows versions and all shipped installers for OSX and Linux. Also, the extended ffi does not need to specify "cdecl" versus using the default stdcall on Windows.

HPW

#5
Hello,



The exported function hpwImageExec is compiled with stdcall-option.

It has worked for years now with the newlisp.dll

I have also other exported functions with stdcall which still works with 10603.



I have to further investigate where the access vioaltion occurs.





Regards
Hans-Peter

HPW

#6
Hello,



The only difference I see between the working and non-working calls,

are the fact that the working calls are exported from the DLL which loads the newlisp.dll



The non-working (they do there work/drawing but the boolean-return seems to throw the access violation) are in a DLL which is loaded in the main-app parralel to the newlisp-caller DLL.



Not sure if that can make a difference now.



Edit:



There is a second working command in the DLL: hpwImageCmdList

It return a 1 for result=True



> hpwImageCmdList

hpwImageCmdList@376ECEC

> hpwImageExec

hpwImageExec@37714CC



Here the delphi function which throw the access violation:

FUNCTION hpwImageExec( password,cmdid,Params0,Params1,Params2,Params3,Params4,Params5,Params6,Params7,Params8,Params9 : PChar ) : BOOLEAN;  stdcall;
VAR
  IDNum : Integer;
BEGIN
  Result := FALSE;
  IF ExtPasswordcheck(password) Then
    BEGIN
      IDNum := StrToInt(cmdid);
      { Examine the Action string to determine which Plug-In command to execute... }
      CASE IDNum OF    
        1 : Result := CreateImageControl( Params0, Params1, Params2, Params3, Params4, Params5, Params6, Params7 );
        2 : Result := RemoveImageControl( Params0, FALSE );
        3 : Result := ImageDrawLine( Params0, Params1, Params2, Params3, Params4, Params5, Params6, Params7 );
        4 : Result := ImageDrawLines( Params0, Params1, Params2, Params3, Params4, Params5 );
        5 : Result := ImageFillRect( Params0, Params1, Params2, Params3, Params4, Params5 );
        6 : Result := ImageRectangle( Params0, Params1, Params2, Params3, Params4, Params5, Params6 );
        7 : Result := ImageFrameRect( Params0, Params1, Params2, Params3, Params4, Params5 );
        8 : Result := ImagePixels( Params0, Params1, Params2, Params3);
        9 : Result := ImageTextOut( Params0, Params1, Params2, Params3, Params4, Params5, Params6, Params7);
       10 : Result := ImageTextOutAngle( Params0, Params1, Params2, Params3, Params4, Params5, Params6, Params7, Params8);
       11 : Result := ImageFloodFill( Params0, Params1, Params2, Params3);
       13 : Result := ImageColorSwap( Params0, Params1, Params2, Params3, Params4, Params5, Params6);
       15 : Result := ImageLoadFromFile( Params0, Params1, Params2, Params3, Params4, Params5);
       16 : Result := ImageSaveToFile( Params0, Params1, Params2, Params3, Params4, Params5);
       17 : Result := ImageSize( Params0, Params1, Params2);
       18 : Result := ImageScaleFromFile( Params0, Params1, Params2, Params3, Params4, Params5, Params6, Params7);
       19 : Result := ImageFileTurn( Params0, Params1, Params2);
       20 : Result := ImageLoadFromExe( Params0, Params1, Params2, Params3, Params4, Params5);
       21 : Result := ImageLoadFromMimeStream( Params0, Params1, Params2, Params3, Params4, Params5);
       22 : Result := ImageSaveToMimeStream( Params0, Params1, Params2, Params3, Params4, Params5);
       27 : Result := ImageCopyFromClip( Params0, Params1, Params2, Params3, Params4);
       28 : Result := ImageCopyToClip( Params0, Params1, Params2, Params3, Params4 );
       29 : Result := ImageScaleFromClip( Params0, Params1, Params2, Params3, Params4, Params5, Params6 );
       30 : Result := ImageToClip( Params0, Params1, Params2);
       31 : Result := ImageToRTF( Params0, Params1, Params2, Params3, Params4, Params5);
       32 : Result := ImageNViewLibSetLanguage( Params0, Params1);
       33 : Result := ImageNViewLibLoad( Params0, Params1, Params2, Params3, Params4, Params5);
       34 : Result := ImageNViewLibImageSize( Params0, Params1, Params2, Params3);
       40 : Result := ImageLoadFromWMF( Params0, Params1, Params2, Params3, Params4, Params5);
       70 : Result := ImageSetAlign( Params0, Params1);
       71 : Result := ImageSetPos( Params0, Params1, Params2);
       72 : Result := ImageSetSize( Params0, Params1, Params2);
       73 : Result := ImageMove( Params0, Params1, Params2);
       74 : Result := ImageSetCursor( Params0, Params1, Params2);
       75 : Result := ImageSetHint( Params0, Params1, Params2);
       76 : Result := ImageDragAndDrop( Params0, Params1, Params2, Params3, Params4);
       77 : Result := ImageCheckHotspot( Params0, Params1, Params2, Params3, Params4, Params5, Params6, Params7 );
       78 : Result := ImageSetCheckDrop( Params0, Params1, Params2, Params3, Params4 );
       79 : Result := ImageSetDragImage( Params0, Params1, Params2, Params3, Params4, Params5 );
       80 : Result := ImageSetActions( Params0, Params1, Params2, Params3, Params4, Params5, Params6, Params7 );
       81 : Result := ImageGetPixel( Params0, Params1, Params2, Params3);
       82 : Result := ImageGetColor( Params0, Params1, Params2, Params3, Params4);
       83 : Result := ImageCompare( Params0, Params1, Params2, Params3, Params4, Params5, Params6, Params7, Params8);
       84 : Result := ImageFind( Params0, Params1, Params2, Params3, Params4, Params5);
       90 : Result := CreateScrollBarControl( Params0, Params1, Params2 );
       91 : Result := RemoveScrollBarControl( Params0, FALSE );
       92 : Result := ScrollbarSetParams( Params0, Params1, Params2, Params3);
       93 : Result := ScrollbarSmallChange( Params0, Params1);
       94 : Result := ScrollbarLargeChange( Params0, Params1);
       95 : Result := ScrollbarPageSize( Params0, Params1);
      100 : Result := ActivatePopup( Params0, Params1, Params2);
      101 : Result := SetPopupItem( Params0, Params1, Params2);
      102 : Result := ImageLoadCursor( Params0, Params1);
      103 : Result := ImageLoadCursorBitmap( Params0, Params1, Params2, Params3, Params4);
      104 : Result := ImageLoadFromFileEx( Params0, Params1, Params2, Params3, Params4, Params5);
      105 : Result := ImageFileOpenPictureBox( Params0, Params1, Params2, Params3, Params4, Params5);
      106 : Result := ImageLoadStamp( Params0, Params1, Params2, Params3);
      107 : Result := ImageStampConfig( Params0, Params1, Params2, Params3, Params4, Params5, Params6);
      108 : Result := ImageBitBlt( Params0, Params1, Params2, Params3, Params4, Params5);
      109 : Result := ImageDrawShadow( Params0, Params1, Params2, Params3, Params4, Params5, Params6, Params7, Params8);
      110 : Result := ImageFontBox( Params0, Params1, Params2, Params3, Params4, Params5, Params6, Params7, Params8);
      111 : Result := ImageColorBox( Params0, Params1, Params2);
      112 : Result := ImageGetRectArea( Params0, Params1);
      113 : Result := ImageConvToHSL( Params0, Params1, Params2, Params3);
      114 : Result := ImageColorCircle( Params0, Params1, Params2, Params3, Params4);
      115 : Result := ImageStampUpdateBuffer( Params0);
      116 : Result := ImageGetBoundery( Params0, Params1, Params2, Params3, Params4, Params5, Params6);
      117 : Result := ImageStamp( Params0, Params1, Params2);
       ELSE Result := FALSE;
      END;
    END;
END;






Regards
Hans-Peter

HPW

#7
Hello,



Looking with the dependency walker at both DLL, I noticed that 10603 has the WEP-entry point as the first entry where it was the last in 10602.



And there is a new newLispLibConsole.

What to do with it in DLL?



Regards
Hans-Peter

HPW

#8
Hello,



I finally figured it out:



DLL < 10603 were tolerant when calling the function with less parameter than defined.



FUNCTION hpwImageExec( password,cmdid,Params0,Params1,Params2,Params3,Params4,Params5,Params6,Params7,Params8,Params9 : PChar ) : BOOLEAN;  stdcall;



So adding an empty param solves the exception:



(hpwImageExec "" "3" "RImage1" "0" "0" "100" "100" "clRed" "" "psSolid" "2" "")



Regards
Hans-Peter

HPW

#9
And mail from symantec:


Quote
Upon further analysis and investigation we have verified your submission and, as such, the detection(s) for the following file(s) will be removed from our products:



        D57CA6F8688BE2661ECCDCEA2EB24C8D - newlisp_10603_win_gs_163.exe





The updated detection(s) will be distributed in the next set of virus definitions, available via LiveUpdate or from our website at http://securityresponse.symantec.com/avcenter/defs.download.html">http://securityresponse.symantec.com/av ... nload.html">http://securityresponse.symantec.com/avcenter/defs.download.html



Please note that whitelisting can take up to 24 hours to take effect.







Upon further analysis and investigation we have verified your submission and, as such, the detection(s) for the following file(s) will be removed from our products:



        E99D50886F30187F7ABA3E14A07C6292 - newlisp_10603_win64_gs_163.exe





The updated detection(s) will be distributed in the next set of virus definitions, available via LiveUpdate or from our website at http://securityresponse.symantec.com/avcenter/defs.download.html">http://securityresponse.symantec.com/av ... nload.html">http://securityresponse.symantec.com/avcenter/defs.download.html



Please note that whitelisting can take up to 24 hours to take effect.
Hans-Peter

Lutz

#10
Thanks Hans-Peter for bringing this to Symantec's attention.

HPW

#11
Hello,



In CodePatters chapter 24 you can read:
QuoteOnly on MS Windows, the installer comes with a precompiled newlisp.dll and will install it in the WINDOWSsystem32 directory (since v.10.3.3) and in the Program Files/newlisp/ directory.


Is it right? I see no newlisp.dll in system32.



Regards
Hans-Peter

Lutz

#12
Only installs in the newLISP program directory.



Corrected here: http://www.newlisp.org/downloads/CodePatterns.html#toc-24">http://www.newlisp.org/downloads/CodePa ... tml#toc-24">http://www.newlisp.org/downloads/CodePatterns.html#toc-24

and here: http://www.newlisp.org/downloads/development/CodePatterns.html#toc-24">http://www.newlisp.org/downloads/develo ... tml#toc-24">http://www.newlisp.org/downloads/development/CodePatterns.html#toc-24

xytroxon

#13
I noticed that just below that section, in the "Registering callbacks" section.


(set 'LIBRARY (if (= ostype "Win32") "newlisp.dll" "newlisp.dylib"))

and...


(set 'CALLTYPE (if (= ostype "Win32") "stdcall" "cdecl"))

The ostype string being compared should  be changed to "windows".



-- xytroxon
\"Many computers can print only capital letters, so we shall not use lowercase letters.\"

-- Let\'s Talk Lisp (c) 1976

Lutz

#14
This was already changed: http://www.newlisp.org/downloads/development/CodePatterns.html">http://www.newlisp.org/downloads/develo ... terns.html">http://www.newlisp.org/downloads/development/CodePatterns.html showing 10.6.3 in the title page.



Perhaps you where looking in the version for 10.6.2 in the main download directory. It also has a current date, but does not have the "Win32" -> "Windows" update. I will keep both versions updated till the next stable release, but in a version sensitive manner.