Bug 985 – dll-imported functions return values broken

Status
RESOLVED
Resolution
INVALID
Severity
critical
Priority
P2
Component
dmd
Product
D
Version
D1 (retired)
Platform
x86
OS
Windows
Creation time
2007-02-19T09:27:00Z
Last change time
2014-02-16T15:21:56Z
Assigned to
bugzilla
Creator
dbugz

Attachments

IDFilenameSummaryContent-TypeSize
105dlltest.ziptest caseapplication/octet-stream2931

Comments

Comment #0 by dbugz — 2007-02-19T09:27:27Z
Values retrieved from dll function calls by return, seems to be random garbage. I have set up extremely simple test case reproducing misbehavior: 0. Extract attached archive to project directory. 1. Compile visualstudio project. 2. Copy dll and lib to projects folder. 3. Run `coffimplib.exe -f dlltest.lib`. 4. Run `make_d.cmd` to compile D test program. Run test.exe to see if output is, or is not expected: "dlltest.get_test():123"
Comment #1 by dbugz — 2007-02-19T09:29:29Z
Created attachment 105 test case Attached test suite reproducing error.
Comment #2 by thomas-dloop — 2007-02-23T16:36:28Z
dlltest.h: # extern "C"{ # extern unsigned long __cdecl get_test(); # } dlltest.d: # # extern(C) ulong get_test(); # On 32bit systems dlltest.d should be: # # extern(C) uint get_test(); #