Apache OpenOffice (AOO) Bugzilla – Issue 43535
crash due to a DLL function badly declared
Last modified: 2013-02-24 21:07:08 UTC
Hello, I use a functions of a DLL. When the type is badly declared, openoffice crashes. -------------------- Module which works: Option Explicit ' The DLL function is properly declared with the type "Long" Declare Function ibdev_nocrash Lib "Gpib-32.dll" Alias "ibdev" (ByVal bdid As Long, ByVal pad As Long, ByVal sad As Long, ByVal tmo As Long, ByVal eot As Long, ByVal eos As Long) As Long Sub No_Crash() Dim SFQ As Long Dim Const AddSFQ As Long = 8 'IEEE address SFQ SFQ = ibdev_nocrash(0, AddSFQ, 0, 13, 1, 0) End Sub -------------------- Module which gives rise to crash: Option Explicit ' The DLL function is badly declared with the type "String" instead of "Long" Declare Function ibdev_crash Lib "Gpib-32.dll" Alias "ibdev" (ByVal bdid As Long, ByVal pad As Long, ByVal sad As Long, ByVal tmo As Long, ByVal eot As Long, ByVal eos As Long) As String Sub Crash() Dim SFQ As String Dim Const AddSFQ As Long = 8 'IEEE address SFQ SFQ = ibdev_crash(0, AddSFQ, 0, 13, 1, 0) End Sub I try to attach a test file (.sxc) and the appropriate DLL. Cheers! Guillaume Audirac
Created attachment 23029 [details] file for crash test, containing 2 basic macro modules
Created attachment 23030 [details] The DLL useful for the Declared function
sw->ab: please have a look at this
This task will be very difficult to fix, as calling into DLLs is a very low level and so risky functionality. It's questionable if such a problem can be detected in advance. Started for now, but close to WONTFIX.
I see no sense in keeping this one open. It's far from being addressed and although a crash I don't consider it to be important -> WONTFIX
.
CLOSED