i wonder if anyone has experienced a problem with Heap Allocation using Variable length records.
the code is something like HeapAlloc,handle,Heap Zero Memory, length of data...
this would probably usually be used with a data mask or structure eg sizeof Some data structure
Generally This work fine
but failed rather oddly one one data length
I have a data header of N bytes followed by variable length data ,
and when N+data = 16 bytes [ie fell on some sort of boundary the allocation bombed ... i tried multiples of 16 + data length eg header = 12... data lengths 4,20,36,etc but strangely
this didnt fail ...
also it might be a first time issue in the operating system as i recall[though i cant be sure now !!] it didnt do this if the second item fell on a boundary
to resolve the issue
i added a byte to the estimated length, as if it had a terminating zero, and didnt get the problem subsequently with any data length
[i should add that the data is irrelevant in this discussion where it is processed as hex ]
i didnt have the time to use Olly to see just where this was occurring in the op sys but will prob do so at some point .. regards mike b