Re: riched20: Make sure to use GlobalAlloc with GlobalFree.
24 Oct
2006
24 Oct
'06
11:08 a.m.
Mike McCormack wrote:
ret->ref = 1; ret->cur = 0; ret->fmtetc_cnt = fmtetc_cnt; - ret->fmtetc = HeapAlloc(GetProcessHeap(), 0, fmtetc_cnt*sizeof(FORMATETC)); + ret->fmtetc = GlobalAlloc(GMEM_ZEROINIT, fmtetc_cnt*sizeof(FORMATETC)); memcpy(ret->fmtetc, fmtetc, fmtetc_cnt*sizeof(FORMATETC)); *lplpformatetc = (LPENUMFORMATETC)ret; return S_OK;
Why use GMEM_ZEROINIT when you initialise all of the memory straight after the GlobalAlloc call? -- Rob Shearman
6988
Age (days ago)
6988
Last active (days ago)
0 comments
1 participants
participants (1)
-
Robert Shearman