Bug 23625 – Function ZeroMemory missing in windows headers

Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P1
Component
druntime
Product
D
Version
D2
Platform
All
OS
Windows
Creation time
2023-01-14T12:54:03Z
Last change time
2023-01-14T21:30:32Z
Keywords
pull
Assigned to
No Owner
Creator
KytoDragon

Comments

Comment #0 by kytodragon — 2023-01-14T12:54:03Z
core.sys.windows.winbase in druntime is missing the functions ZeroMemory, FillMemory, CopyMemory and MoveMemory. They should be defined like so: alias RtlMoveMemory = memmove; alias RtlCopyMemory = memcpy; pragma(inline, true) void RtlFillMemory(PVOID Destination, SIZE_T Length, BYTE Fill) { memset(Destination, Fill, Length);} pragma(inline, true) void RtlZeroMemory(PVOID Destination, SIZE_T Length) { memset(Destination, 0, Length);} alias MoveMemory = RtlMoveMemory; alias CopyMemory = RtlCopyMemory; alias FillMemory = RtlFillMemory; alias ZeroMemory = RtlZeroMemory; Currently they are commented out. Tested with LDC 1.30 and DMD 2.094.2
Comment #1 by dlang-bot — 2023-01-14T15:51:53Z
@KytoDragon updated dlang/dmd pull request #14816 "Fix issue 23625 - Function ZeroMemory missing in windows headers" fixing this issue: - Fix 23625 - Add missing memory functions for windows https://github.com/dlang/dmd/pull/14816
Comment #2 by dlang-bot — 2023-01-14T21:30:32Z
dlang/dmd pull request #14816 "Fix issue 23625 - Function ZeroMemory missing in windows headers" was merged into master: - 5e939318609e63b83d2cf566f84f59008f0650ff by KytoDragon: Fix 23625 - Add missing memory functions for windows https://github.com/dlang/dmd/pull/14816