Bug 13751 – WaitForMultipleObjects's first argument not use on x86_64
Status
RESOLVED
Resolution
INVALID
Severity
enhancement
Priority
P1
Component
druntime
Product
D
Version
D2
Platform
x86_64
OS
Windows
Creation time
2014-11-19T13:05:00Z
Last change time
2014-11-19T14:30:22Z
Assigned to
nobody
Creator
ILikeDub
Comments
Comment #0 by ILikeDub — 2014-11-19T13:05:08Z
if you compile the dfl Library to 64 bit,you will find error:
core.sys.windows.windows.WaitForMultipleObjects(uint
nCount,void** lpHandles,....) is not callable using argument
types(ulong,void**,...)
the 'WaitForMultipleObjects' Function is in
dmd2/src/druntime/src/core/sys/windows/windows.d
the argument of first is dfl's value ,it come from a 'length'
,it's type is size_t,now it is 'ulong' on 64 bit.
So druntime must keep the same as phobos for size_t.
Comment #1 by aldacron — 2014-11-19T14:28:18Z
WaitForMultipleObjects is a Win32 API function. If you look at the documentation for it [1], the first parameter is a DWORD, which is always defined as a 32-bit integer on both 32-bit and 64-bit Windows. The prototype in DRuntime cannot change this.
The problem here is with DFL, not DRuntime. The fix is to cast the .length parameter to a DWORD when making the function call.