Setupapi - (Take 2) implement MyFree, MyMalloc and MyRealloc
Huw D M Davies
h.davies1 at physics.ox.ac.uk
Mon Jan 24 04:35:00 CST 2005
On Sun, Jan 23, 2005 at 08:42:52PM -0800, Steven Edwards wrote:
> Changelog:
> Eric Kohl <eric.kohl at t-online.de>
> Implement MyFree, MyMalloc and MyRealloc
...
> --- /dev/null 2005-01-23 12:40:28.000000000 -0500
> +++ misc.c 2005-01-23 18:50:33.000000000 -0500
> +LPVOID WINAPI MyMalloc(DWORD dwSize)
> +{
> + return HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, dwSize);
> +}
> +
...
> +LPVOID WINAPI MyRealloc(LPVOID lpSrc, DWORD dwSize)
> +{
> + if (lpSrc == NULL)
> + return HeapAlloc(GetProcessHeap(), 0, dwSize);
> +
> + return HeapReAlloc(GetProcessHeap(), 0, lpSrc, dwSize);
> +}
So MyAlloc zeros the memory while MyRealloc doesn't - is this really
correct? If so I think a comment, at the very least, is in order.
Huw.
--
Huw Davies
huw at codeweavers.com
More information about the wine-devel
mailing list