Hi folks,
Oleg has been doing a lot of good work, and we are now down to 73 HeapReAlloc and 73 non-HeapReAlloc entries to review. I'm still not sure how the comctl32.ReAlloc() should behave, any help in getting that resolved would be highly appreciated.
Here is the update list:
./controls/edit.c: hloc32W_new = LocalReAlloc(es->hloc32W, alloc_size, LMEM_MOVEABLE | LMEM_ZEROINIT); ./controls/edit.c: if ((hNew32W = LocalReAlloc(es->hloc32W, alloc_size, LMEM_MOVEABLE | LMEM_ZEROINIT))) { ./controls/edit.c: hloc32A_new = LocalReAlloc(es->hloc32A, alloc_size, LMEM_MOVEABLE | LMEM_ZEROINIT); ./controls/edit.c: hloc16_new = LOCAL_ReAlloc(hInstance, es->hloc16, alloc_size, LMEM_MOVEABLE | LMEM_ZEROINIT); ./dlls/avifil32/avifile.c: This->idxFmtChanges = GlobalReAllocPtr(This->idxFmtChanges, This->nIdxFmtChanges * sizeof(AVIINDEXENTRY), GHND); ./dlls/avifil32/avifile.c: This->idxFrames = GlobalReAllocPtr(This->idxFrames, This->nIdxFrames * sizeof(AVIINDEXENTRY), GHND); ./dlls/avifil32/avifile.c: (LPDWORD)GlobalReAllocPtr(This->lpBuffer, max(size, This->sInfo.dwSuggestedBufferSize), GMEM_MOVEABLE); ./dlls/avifil32/api.c: pOptions->lpFormat = GlobalReAllocPtr(pOptions->lpFormat, size, GMEM_MOVEABLE); ./dlls/avifil32/api.c: (lpBuffer = GlobalReAllocPtr(lpBuffer, cbBuffer *= 2, GPTR)) != NULL); ./dlls/avifil32/api.c: (lpBuffer = GlobalReAllocPtr(lpBuffer, cbBuffer *= 2, GPTR)) != NULL); ./dlls/avifil32/api.c: (lpBuffer = GlobalReAllocPtr(lpBuffer, cbBuffer *= 2, GPTR)) != NULL); ./dlls/avifil32/extrachunk.c: lp = (LPDWORD)GlobalReAllocPtr(extra->lp, extra->cb + size + 2 * sizeof(DWORD), GHND); ./dlls/avifil32/extrachunk.c: lp = (LPDWORD)GlobalReAllocPtr(extra->lp, extra->cb + cb, GHND); ./dlls/avifil32/getframe.c: This->lpInFormat = GlobalReAllocPtr(This->lpInFormat, This->cbInBuffer, 0); ./dlls/avifil32/getframe.c: (LPBITMAPINFOHEADER)GlobalReAllocPtr(This->lpOutFormat, size, GMEM_MOVEABLE); ./dlls/avifil32/acmstream.c: This->acmStreamHdr.pbSrc = GlobalReAllocPtr(This->acmStreamHdr.pbSrc, ./dlls/avifil32/acmstream.c: This->acmStreamHdr.pbDst = GlobalReAllocPtr(This->acmStreamHdr.pbDst, ./dlls/avifil32/icmstream.c: (LPBITMAPINFOHEADER)GlobalReAllocPtr(This->lpbiPrev,size,GMEM_MOVEABLE); ./dlls/avifil32/icmstream.c: (LPBITMAPINFOHEADER)GlobalReAllocPtr(This->lpbiPrev,size,GMEM_MOVEABLE); ./dlls/avifil32/editstream.c: GlobalReAllocPtr(This->pStreams, (This->nTableSize + 32) * sizeof(EditStreamTable), GMEM_SHARE|GHND); ./dlls/avifil32/editstream.c: pEdit->pStreams = GlobalReAllocPtr(pEdit->pStreams, This->nStreams * sizeof(EditStreamTable),GMEM_SHARE|GHND); ./dlls/comctl32/comctl32undoc.c:LPVOID WINAPI ReAlloc (LPVOID lpSrc, DWORD dwSize) ./dlls/comctl32/comctl32undoc.c: LPSTR ptr = ReAlloc (*lppDest, strlen (lpSrc) + 1); ./dlls/comctl32/comctl32undoc.c: LPWSTR ptr = ReAlloc (*lppDest, len * sizeof(WCHAR)); ./dlls/comctl32/comctl32undoc.c: LPWSTR ptr = ReAlloc (*lppDest, len*sizeof(WCHAR)); ./dlls/comctl32/comctl32undoc.c: lpTemp = ReAlloc (hdsa->pData, nSize); ./dlls/comctl32/comctl32undoc.c: lpTemp = ReAlloc (hdsa->pData, nSize); ./dlls/comctl32/comctl32undoc.c: lpDest = ReAlloc (hdsa->pData, nSize); ./dlls/comctl32/monthcal.c: infoPtr->monthdayState = ReAlloc(infoPtr->monthdayState, ./dlls/comctl32/propsheet.c: psInfo->proppage = (PropPageInfo*) ReAlloc(psInfo->proppage, ./dlls/comctl32/trackbar.c: infoPtr->tics=ReAlloc (infoPtr->tics, ./dlls/comctl32/trackbar.c: infoPtr->tics=ReAlloc( infoPtr->tics, ./dlls/comctl32/treeview.c: newText = (LPWSTR)ReAlloc(wineItem->pszText, buflen); ./dlls/comctl32/treeview.c: LPSTR newText = ReAlloc(wineItem->pszText, len); ./dlls/comctl32/treeview.c: LPSTR newText = ReAlloc(wineItem->pszText, len); ./dlls/comctl32/treeview.c: wineItem->pszText = ReAlloc(wineItem->pszText, ./dlls/comctl32/treeview.c: if (NULL == ReAlloc(editedItem->pszText, iLength + 1)) ./dlls/commdlg/printdlg.c: *hmem = GlobalReAlloc(*hmem, size, GMEM_MOVEABLE); ./dlls/commdlg/printdlg.c: *hmem = GlobalReAlloc(*hmem, size, GMEM_MOVEABLE); ./dlls/commdlg/printdlg.c: lppd->hDevMode = GlobalReAlloc(lppd->hDevMode, ./dlls/commdlg/printdlg.c: lppd->hDevMode = GlobalReAlloc(lppd->hDevMode, ./dlls/commdlg/printdlg16.c: *hmem = GlobalReAlloc16(*hmem, size, GMEM_MOVEABLE); ./dlls/commdlg/printdlg16.c: lppd->hDevMode = GlobalReAlloc16(lppd->hDevMode, ./dlls/kernel/toolhelp.c: notifys=(struct notify*)HeapReAlloc( GetProcessHeap(), 0, notifys, ./dlls/kernel/toolhelp.c: notifys=(struct notify*)HeapReAlloc( GetProcessHeap(), 0, notifys, ./dlls/kernel/local16.c: hseg = GlobalReAlloc16( hseg, 0x10000, GMEM_FIXED ); ./dlls/kernel/local16.c:HLOCAL16 LOCAL_ReAlloc( HANDLE16 ds, HLOCAL16 handle, WORD size, WORD flags ) ./dlls/kernel/local16.c:HLOCAL16 WINAPI LocalReAlloc16( HLOCAL16 handle, WORD size, UINT16 flags ) ./dlls/kernel/local16.c: return LOCAL_ReAlloc( CURRENT_DS, handle, size, flags ); ./dlls/kernel/local16.c:DWORD WINAPI Local32ReAlloc16( HANDLE heap, DWORD addr, INT16 type, ./dlls/kernel/local16.c: ptr = HeapReAlloc( header->heap, ./dlls/kernel/resource16.c: handle = GlobalReAlloc16( hMemObj, pNameInfo->length << sizeShift, 0 ); ./dlls/kernel/resource16.c: handle = GlobalReAlloc16( hMemObj, pNameInfo->length << sizeShift, 0 ); ./dlls/mpr/mpr_main.c:LPVOID WINAPI MPR_ReAlloc( LPVOID lpSrc, DWORD dwSize ) ./dlls/msvcrt/heap.c: return HeapReAlloc(GetProcessHeap(), HEAP_REALLOC_IN_PLACE_ONLY, mem, size); ./dlls/msvcrt/heap.c: return HeapReAlloc(GetProcessHeap(), 0, ptr, size); ./dlls/netapi32/apibuf.c: *NewBuffer = HeapReAlloc(GetProcessHeap(), 0, OldBuffer, NewByteCount); ./dlls/ntdll/heap.c: * RtlReAllocateHeap (NTDLL.@) ./dlls/ntdll/heap.c:PVOID WINAPI RtlReAllocateHeap( HANDLE heap, ULONG flags, PVOID ptr, ULONG size ) ./dlls/ntdll/loadorder.c: env_list.order = RtlReAllocateHeap(GetProcessHeap(), 0, env_list.order, ./dlls/ntdll/relay.c: *dll = RtlReAllocateHeap(ntdll_get_process_heap(), ./dlls/ntdll/path.c: name = (WCHAR*)RtlReAllocateHeap(ntdll_get_process_heap(), 0, ./dlls/ole32/hglobalstream.c: This->supportHandle = GlobalReAlloc(This->supportHandle, ./dlls/ole32/ifs.c: Malloc32.SpyedBlocks = (LPVOID*)LocalReAlloc((HLOCAL)Malloc32.SpyedBlocks, NewLength, GMEM_ZEROINIT); ./dlls/ole32/ifs.c: pNewMemory = HeapReAlloc(GetProcessHeap(),0,pv,cb); ./dlls/ole32/memlockbytes.c: This->supportHandle = GlobalReAlloc(This->supportHandle, ./dlls/ole32/ole16.c: ret = MapLS( HeapReAlloc( GetProcessHeap(), 0, MapSL(pv), cb ) ); ./dlls/ole32/memlockbytes16.c: This->supportHandle = GlobalReAlloc16(This->supportHandle, ./dlls/oleaut32/ole2disp.c:INT16 WINAPI SysReAllocString16(LPBSTR16 pbstr,LPCOLESTR16 oleStr) ./dlls/oleaut32/ole2disp.c:int WINAPI SysReAllocStringLen16(BSTR16 *old,const char *in,int len) ./dlls/oleaut32/oleaut.c:int WINAPI SysReAllocStringLen(BSTR* old, const OLECHAR* str, unsigned int len) ./dlls/oleaut32/oleaut.c: DWORD *ptr = HeapReAlloc(GetProcessHeap(),0,((DWORD*)*old)-1,newbytelen+sizeof(WCHAR)+sizeof(DWORD)); ./dlls/oleaut32/oleaut.c:INT WINAPI SysReAllocString(LPBSTR old,LPCOLESTR str) ./dlls/oleaut32/usrmarshal.c: SysReAllocStringLen(pstr, (OLECHAR*)&str->asData, str->clSize); ./dlls/rpcrt4/rpc_binding.c: LPSTR ndst = HeapReAlloc(GetProcessHeap(), 0, dst, (len+slen+2)*sizeof(CHAR)); ./dlls/rpcrt4/rpc_binding.c: LPWSTR ndst = HeapReAlloc(GetProcessHeap(), 0, dst, (len+slen+2)*sizeof(WCHAR)); ./dlls/setupapi/virtcopy.c: vhstrlist = HeapReAlloc(heap, HEAP_ZERO_MEMORY, vhstrlist, ./dlls/setupapi/virtcopy.c: pvnlist = HeapReAlloc(heap, HEAP_ZERO_MEMORY, pvnlist, ./dlls/setupapi/parser.c: if ((new_array = HeapReAlloc( GetProcessHeap(), HEAP_ZERO_MEMORY, array, new_count * elem ))) ./dlls/setupapi/parser.c: if (!(section = HeapReAlloc( GetProcessHeap(), 0, section, size ))) return NULL; ./dlls/setupapi/parser.c: file->sections = HeapReAlloc( GetProcessHeap(), 0, file->sections, ./dlls/setupapi/parser.c: file->fields = HeapReAlloc( GetProcessHeap(), 0, file->fields, ./dlls/setupapi/parser.c: file->strings = HeapReAlloc( GetProcessHeap(), HEAP_REALLOC_IN_PLACE_ONLY, file->strings, ./dlls/shell32/shell32_main.c: hargv=GlobalReAlloc(hargv, size, 0); ./dlls/shell32/shellole.c: addr = (LPVOID) LocalReAlloc((HANDLE) pv, cb, GMEM_ZEROINIT | GMEM_MOVEABLE); ./dlls/shlwapi/clist.c: lpTemp = (LPSHLWAPI_CLIST)LocalReAlloc((HLOCAL)pItem, ulSize, ./dlls/shlwapi/clist.c: lpIter = (LPSHLWAPI_CLIST)LocalReAlloc((HLOCAL)*lppList, ./dlls/shlwapi/clist.c: lpList = (LPSHLWAPI_CLIST)LocalReAlloc((HLOCAL)*lppList, ulNewSize, ./dlls/user/dde/misc.c: hData = GlobalReAlloc((HGLOBAL)hData, new_sz + sizeof(DDE_DATAHANDLE_HEAD), ./dlls/wineps/glyphlist.c: newGlyphList = (GLYPHNAME **) HeapReAlloc(PSDRV_Heap, 0, glyphList, ./dlls/wineps/ppd.c: buf = HeapReAlloc( PSDRV_Heap, 0, buf, ./dlls/wineps/ppd.c: buf = HeapReAlloc( PSDRV_Heap, 0, buf, len + sl + 1 ); ./dlls/wineps/type1.c: str->str = HeapReAlloc(GetProcessHeap(), 0, str->str, str->max_len); ./dlls/wineps/type1.c: t1->glyph_sent = HeapReAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, ./dlls/wineps/type42.c: t42->glyf_blocks = HeapReAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, ./dlls/wineps/type42.c: t42->glyph_sent = HeapReAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, ./dlls/winmm/lolvldrv.c: HeapReAlloc(GetProcessHeap(), 0, (llTypes[type].lpMlds) ? llTypes[type].lpMlds - 1 : NULL, ./dlls/winmm/time.c: HeapReAlloc(GetProcessHeap(), 0, ./dlls/winmm/mciavi/mmoutput.c: wma->lpAudioIndex = HeapReAlloc(GetProcessHeap(), 0, ./dlls/winmm/wineoss/audio.c: omr->messages = HeapReAlloc(GetProcessHeap(),0,omr->messages, omr->ring_buffer_size * sizeof(OSS_MSG)); ./dlls/winmm/wineoss/audio.c: This->notifies = HeapReAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, ./dlls/winmm/winearts/audio.c: mr->messages = HeapReAlloc(GetProcessHeap(),0,mr->messages, mr->ring_buffer_size * sizeof(RING_MSG)); ./dlls/winmm/winealsa/audio.c: omr->messages = HeapReAlloc(GetProcessHeap(),0,omr->messages, omr->ring_buffer_size * sizeof(ALSA_MSG)); ./dlls/winmm/winenas/audio.c: mr->messages = HeapReAlloc(GetProcessHeap(),0,mr->messages, mr->ring_buffer_size * sizeof(RING_MSG)); ./dlls/winmm/winejack/audio.c: wwo->sound_buffer = HeapReAlloc(GetProcessHeap(), 0, wwo->sound_buffer, wwo->buffer_size); ./dlls/winsock/async.c: extrabuf=HeapReAlloc(GetProcessHeap(),0,extrabuf,ebufsize) ; ./dlls/winsock/socket.c: extrabuf=HeapReAlloc(GetProcessHeap(),0,extrabuf,ebufsize) ; ./dlls/winsock/socket.c: extrabuf=HeapReAlloc(GetProcessHeap(),0,extrabuf,ebufsize) ; ./dlls/winspool/info.c: pent=HeapReAlloc(GetProcessHeap(),0,pent,strlen(pent)+strlen(buf)+2); ./dlls/winspool/info.c: LPWSTR *new_array = HeapReAlloc( GetProcessHeap(), HEAP_ZERO_MEMORY, printer_array, ./dlls/x11drv/xrender.c: glyphsetCache = HeapReAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, ./dlls/x11drv/xrender.c: entry->realized = HeapReAlloc(GetProcessHeap(), ./dlls/x11drv/xrender.c: entry->bitmaps = HeapReAlloc(GetProcessHeap(), ./dlls/x11drv/xrender.c: entry->gis = HeapReAlloc(GetProcessHeap(), ./dlls/x11drv/clipboard.c: HeapReAlloc(GetProcessHeap(),0,val, total); ./graphics/painting.c: *PtsOut = HeapReAlloc( GetProcessHeap(), 0, *PtsOut, ./graphics/x11drv/xfont.c: !(buffer = HeapReAlloc( GetProcessHeap(), 0, buffer, *buf_size = len ))) ./graphics/x11drv/xfont.c: if( (newCache = (fontObject*)HeapReAlloc(GetProcessHeap(), 0, ./graphics/x11drv/palette.c: mapping = HeapReAlloc( GetProcessHeap(), 0, palPtr->mapping, ./objects/gdiobj.c: if ((new_handle = (HGDIOBJ)(ULONG_PTR)LOCAL_ReAlloc( GDI_HeapSel, h, size, LMEM_MOVEABLE ))) ./objects/gdiobj.c: void *new_ptr = HeapReAlloc( GetProcessHeap(), 0, large_handles[i], size ); ./objects/metafile.c: mh = HeapReAlloc( GetProcessHeap(), 0, mh, size ); ./objects/metafile.c: mh = HeapReAlloc( GetProcessHeap(), 0, mh, ./objects/metafile.c: return (HMETAFILE16)GlobalReAlloc16( hMeta, 0, ./objects/palette.c: int *newMap = (int*) HeapReAlloc(GetProcessHeap(), 0, ./objects/region.c: *firstrect = HeapReAlloc( GetProcessHeap(), 0, *firstrect, (2 * (sizeof(RECT)) * (reg->size))); ./objects/region.c: if (! (dst->rects = HeapReAlloc( GetProcessHeap(), 0, dst->rects, ./objects/region.c: newReg->rects = HeapReAlloc( GetProcessHeap(), 0, newReg->rects, ./objects/region.c: if (!(reg->rects = HeapReAlloc( GetProcessHeap(), 0, reg->rects, ./programs/regapi/regapi.c: lpsCurrentValue=HeapReAlloc(GetProcessHeap(),HEAP_ZERO_MEMORY,lpsCurrentValue,dwSize); ./programs/regapi/regapi.c: lpsData=HeapReAlloc(GetProcessHeap(),HEAP_ZERO_MEMORY,lpsData,lLen); ./programs/regapi/regapi.c: lpbData=HeapReAlloc(GetProcessHeap(),HEAP_ZERO_MEMORY,lpbData,dwLen); ./programs/regapi/regapi.c: stdInput=HeapReAlloc(GetProcessHeap(), 0,stdInput,curSize+=STDIN_MAX_LEN); ./programs/regapi/regapi.c: stdInput=HeapReAlloc(GetProcessHeap(),0,stdInput,strlen(stdInput)+STDIN_MAX_LEN); ./programs/wineconsole/dialog.c: di->font = HeapReAlloc(GetProcessHeap(), 0, di->font, sizeof(*di->font) * (di->nFont + 1)); ./programs/wineconsole/wineconsole.c: data->cells = HeapReAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, data->cells, ./programs/wineconsole/curses.c: PRIVATE(data)->line = HeapReAlloc(GetProcessHeap(), 0, PRIVATE(data)->line, ./programs/winhelp/hlp2sgml.c:void* WINAPI HeapReAlloc( HANDLE heap, DWORD flags, void* ptr, DWORD size) ./programs/winhelp/hlpfile.c: bi = HeapReAlloc(GetProcessHeap(), 0, bi, sizeof(*bi) + nc * sizeof(RGBQUAD)); ./programs/winhelp/hlpfile.c: hlpfile->bmps = HeapReAlloc(GetProcessHeap(), 0, hlpfile->bmps, ./programs/winhelp/hlpfile.c: hlpfile->windows = HeapReAlloc(GetProcessHeap(), 0, hlpfile->windows, ./programs/regedit/regproc.c: lpsData=HeapReAlloc(GetProcessHeap(),HEAP_ZERO_MEMORY,lpsData,lLen); ./programs/regedit/regproc.c: lpbData=HeapReAlloc(GetProcessHeap(),HEAP_ZERO_MEMORY,lpbData,dwLen); ./programs/regedit/regproc.c: new_buffer = HeapReAlloc (GetProcessHeap(), 0, line, new_size); ./programs/regedit/regproc.c: *buffer = HeapReAlloc(GetProcessHeap(), 0, *buffer, ./programs/regedit/regproc.c: *val_buf = HeapReAlloc(GetProcessHeap(), 0, *val_buf, *val_size);
"Dimitrie O. Paun" dpaun@rogers.com writes:
Oleg has been doing a lot of good work, and we are now down to 73 HeapReAlloc and 73 non-HeapReAlloc entries to review. I'm still not sure how the comctl32.ReAlloc() should behave, any help in getting that resolved would be highly appreciated.
It seems comctl32.ReAlloc handles NULL properly, so the current implementation is correct.
"Dimitrie O. Paun" dpaun@rogers.com writes:
Hi folks,
Oleg has been doing a lot of good work, and we are now down to 73 HeapReAlloc and 73 non-HeapReAlloc entries to review. I'm still not sure how the comctl32.ReAlloc() should behave, any help in getting that resolved would be highly appreciated.
Here is the update list:
These are okay:
./dlls/avifil32/api.c: pOptions->lpFormat = GlobalReAllocPtr(pOptions->lpFormat, size, GMEM_MOVEABLE); ./dlls/avifil32/api.c: (lpBuffer = GlobalReAllocPtr(lpBuffer, cbBuffer *= 2, GPTR)) != NULL); ./dlls/avifil32/api.c: (lpBuffer = GlobalReAllocPtr(lpBuffer, cbBuffer *= 2, GPTR)) != NULL); ./dlls/avifil32/api.c: (lpBuffer = GlobalReAllocPtr(lpBuffer, cbBuffer *= 2, GPTR)) != NULL); ./dlls/avifil32/extrachunk.c: lp = (LPDWORD)GlobalReAllocPtr(extra->lp, extra->cb + size + 2 * sizeof(DWORD), GHND); ./dlls/avifil32/extrachunk.c: lp = (LPDWORD)GlobalReAllocPtr(extra->lp, extra->cb + cb, GHND); ./dlls/avifil32/getframe.c: This->lpInFormat = GlobalReAllocPtr(This->lpInFormat, This->cbInBuffer, 0); ./dlls/avifil32/getframe.c: (LPBITMAPINFOHEADER)GlobalReAllocPtr(This->lpOutFormat, size, GMEM_MOVEABLE); ./dlls/avifil32/icmstream.c: (LPBITMAPINFOHEADER)GlobalReAllocPtr(This->lpbiPrev,size,GMEM_MOVEABLE); ./dlls/avifil32/icmstream.c: (LPBITMAPINFOHEADER)GlobalReAllocPtr(This->lpbiPrev,size,GMEM_MOVEABLE); ./dlls/avifil32/editstream.c: GlobalReAllocPtr(This->pStreams, (This->nTableSize + 32) * sizeof(EditStreamTable), GMEM_SHARE|GHND); ./dlls/avifil32/editstream.c: pEdit->pStreams = GlobalReAllocPtr(pEdit->pStreams, This->nStreams * sizeof(EditStreamTable),GMEM_SHARE|GHND);
These must be fixed because GlobalReAlloc under Win98SE doesn't allocates memory when handle is NULL:
./dlls/avifil32/avifile.c: This->idxFmtChanges = GlobalReAllocPtr(This->idxFmtChanges, This->nIdxFmtChanges * sizeof(AVIINDEXENTRY), GHND); ./dlls/avifil32/avifile.c: This->idxFrames = GlobalReAllocPtr(This->idxFrames, This->nIdxFrames * sizeof(AVIINDEXENTRY), GHND); ./dlls/avifil32/avifile.c: (LPDWORD)GlobalReAllocPtr(This->lpBuffer, max(size, This->sInfo.dwSuggestedBufferSize), GMEM_MOVEABLE); ./dlls/avifil32/acmstream.c: This->acmStreamHdr.pbSrc = GlobalReAllocPtr(This->acmStreamHdr.pbSrc, ./dlls/avifil32/acmstream.c: This->acmStreamHdr.pbDst = GlobalReAllocPtr(This->acmStreamHdr.pbDst,
Will make the above ones, was my mistake.
Michael