Issue 43535 - crash due to a DLL function badly declared
Summary: crash due to a DLL function badly declared
Status: CLOSED WONT_FIX
Alias: None
Product: App Dev
Classification: Unclassified
Component: api (show other issues)
Version: 3.3.0 or older (OOo)
Hardware: PC Windows 2000
: P3 Trivial
Target Milestone: ---
Assignee: ab
QA Contact: issues@api
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-02-25 11:15 UTC by audirac
Modified: 2013-02-24 21:07 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Latest Confirmation in: ---
Developer Difficulty: ---


Attachments
file for crash test, containing 2 basic macro modules (7.90 KB, application/vnd.sun.xml.calc)
2005-02-25 11:17 UTC, audirac
no flags Details
The DLL useful for the Declared function (224.00 KB, application/octet-stream)
2005-02-25 11:19 UTC, audirac
no flags Details

Note You need to log in before you can comment on or make changes to this issue.
Description audirac 2005-02-25 11:15:02 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
Comment 1 audirac 2005-02-25 11:17:31 UTC
Created attachment 23029 [details]
file for crash test, containing 2 basic macro modules
Comment 2 audirac 2005-02-25 11:19:11 UTC
Created attachment 23030 [details]
The DLL useful for the Declared function
Comment 3 stephan.wunderlich 2005-03-01 12:53:38 UTC
sw->ab: please have a look at this
Comment 4 ab 2005-03-24 12:29:52 UTC
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.
Comment 5 ab 2009-02-17 15:15:20 UTC
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
Comment 6 ab 2009-02-17 15:16:42 UTC
.
Comment 7 ab 2009-02-17 15:17:07 UTC
CLOSED