Bug 6909 – incorrect definition of the OVERLAPPED struct in core.sys.windows.windows ?

Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P3
Component
druntime
Product
D
Version
D2
Platform
x86
OS
Windows
Creation time
2011-11-08T13:42:00Z
Last change time
2012-10-09T17:48:14Z
Assigned to
nobody
Creator
webby

Comments

Comment #0 by webby — 2011-11-08T13:42:10Z
While trying to get the Juno library building with the latest DMD2, i found that core.sys.windows.windows defines OVERLAPPED as: struct OVERLAPPED { DWORD Internal; DWORD InternalHigh; DWORD Offset; DWORD OffsetHigh; HANDLE hEvent; } whereas Juno defines it as: struct OVERLAPPED { uint Internal; uint InternalHigh; union { struct { uint Offset; uint OffsetHigh; } void* Pointer; } Handle hEvent; } And as Juno makes use of the Pointer member, the druntime version fails to compile. The MinGW Windows headers define it as: typedef struct _OVERLAPPED { ULONG_PTR Internal; ULONG_PTR InternalHigh; __GNUC_EXTENSION union { __GNUC_EXTENSION struct { DWORD Offset; DWORD OffsetHigh; }; PVOID Pointer; }; HANDLE hEvent; } OVERLAPPED,*POVERLAPPED,*LPOVERLAPPED; and the MSDN is similar, so the Juno version looks correct.
Comment #1 by webby — 2011-11-08T13:47:22Z
Comment #2 by andrej.mitrovich — 2011-11-08T14:12:08Z
You're right. But you might want to try using this instead of core.sys.windows* (it's much more updated): http://dsource.org/projects/bindings/wiki/WindowsApi/
Comment #3 by webby — 2011-11-08T14:18:39Z
Didn't think of looking at that version! I was just starting by removing the duplicate declarations that Juno itself contains though, and depending on another external lib is a bit much for a few trivial things.
Comment #4 by alex — 2012-10-09T17:48:14Z
The definition is correct in druntime now.