These calls are not equal, the LocalAlloc calls zeroes out the allocated memory but the HeapAlloc does not unless the HEAP_ZERO_MEMORY flag is passed. I haven't read the code enough to know if that matters, but it seems relevant to at least discuss.
Yeah, I missed that.
But works fine and passes all tests.
If really ok, yet another improvement by avoiding useless padding.