crypt32(1/2): Allocate crypt32 memory from a private heap

Juan Lang juan.lang at gmail.com
Tue Aug 19 09:50:59 CDT 2008


This miniseries is optional, I suppose.  The rationale for it is this:
 crypt32 is unfortunately rather prone to memory errors, with all the
pointer arithmetic and casting it does.  By allocating memory from a
separate heap, and allocating internally used memory from the same
heap (done in the next patch in this series), the tests use a separate
heap from the crypt32 one.  (The crypt32 APIs often return memory
allocated with GlobalAlloc.)  If there's a memory error, the tests now
often fail with an unexpectetd GetLastError(), since the heap mismatch
results in ERROR_INVALID_PARAMETER being set.  Before, the process
heap was just corrupted, and a test somewhere after the failure point
could fail randomly.

And no, valgrind didn't help me find these, so it's not a useful alternative.
--Juan
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0010-Allocate-crypt32-memory-from-a-private-heap.patch
Type: text/x-patch
Size: 1955 bytes
Desc: not available
Url : http://www.winehq.org/pipermail/wine-patches/attachments/20080819/d5849f9f/attachment.bin 


More information about the wine-patches mailing list