From: Nikolay Sivov nsivov@codeweavers.com
Signed-off-by: Nikolay Sivov nsivov@codeweavers.com --- dlls/comctl32/combo.c | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-)
diff --git a/dlls/comctl32/combo.c b/dlls/comctl32/combo.c index 5876c2acbb8..321ed811e18 100644 --- a/dlls/comctl32/combo.c +++ b/dlls/comctl32/combo.c @@ -21,6 +21,7 @@ */
#include <stdarg.h> +#include <stdlib.h> #include <string.h>
#define OEMRESOURCE @@ -33,7 +34,6 @@ #include "vssym32.h" #include "commctrl.h" #include "wine/debug.h" -#include "wine/heap.h"
#include "comctl32.h"
@@ -125,7 +125,7 @@ static LRESULT COMBO_NCCreate(HWND hwnd, LONG style) { HEADCOMBO *lphc;
- if (COMBO_Init() && (lphc = heap_alloc_zero(sizeof(*lphc)))) + if (COMBO_Init() && (lphc = calloc(1, sizeof(*lphc)))) { lphc->self = hwnd; SetWindowLongPtrW( hwnd, 0, (LONG_PTR)lphc ); @@ -166,7 +166,7 @@ static LRESULT COMBO_NCDestroy( HEADCOMBO *lphc ) DestroyWindow( lphc->hWndLBox );
SetWindowLongPtrW( lphc->self, 0, 0 ); - heap_free( lphc ); + free( lphc ); }
return 0; @@ -635,7 +635,7 @@ static void CBPaintText(HEADCOMBO *lphc, HDC hdc_paint) size = SendMessageW(lphc->hWndLBox, LB_GETTEXTLEN, id, 0); if (size == LB_ERR) FIXME("LB_ERR probably not handled yet\n"); - if ((pText = heap_alloc((size + 1) * sizeof(WCHAR)))) + if ((pText = malloc((size + 1) * sizeof(WCHAR)))) { /* size from LB_GETTEXTLEN may be too large, from LB_GETTEXT is accurate */ size=SendMessageW(lphc->hWndLBox, LB_GETTEXT, id, (LPARAM)pText); @@ -731,7 +731,7 @@ static void CBPaintText(HEADCOMBO *lphc, HDC hdc_paint) ReleaseDC( lphc->self, hdc ); }
- heap_free(pText); + free(pText); }
/*********************************************************************** @@ -853,7 +853,7 @@ static INT CBUpdateLBox( LPHEADCOMBO lphc, BOOL bSelect ) length = SendMessageW( lphc->hWndEdit, WM_GETTEXTLENGTH, 0, 0 );
if (length > 0) - pText = heap_alloc((length + 1) * sizeof(WCHAR)); + pText = malloc((length + 1) * sizeof(WCHAR));
TRACE("\t edit text length %i\n", length );
@@ -861,7 +861,7 @@ static INT CBUpdateLBox( LPHEADCOMBO lphc, BOOL bSelect ) { GetWindowTextW( lphc->hWndEdit, pText, length + 1); idx = SendMessageW(lphc->hWndLBox, LB_FINDSTRING, -1, (LPARAM)pText); - heap_free( pText ); + free( pText ); }
SendMessageW(lphc->hWndLBox, LB_SETCURSEL, bSelect ? idx : -1, 0); @@ -890,7 +890,7 @@ static void CBUpdateEdit( LPHEADCOMBO lphc , INT index ) length = SendMessageW(lphc->hWndLBox, LB_GETTEXTLEN, index, 0); if( length != LB_ERR) { - if ((pText = heap_alloc((length + 1) * sizeof(WCHAR)))) + if ((pText = malloc((length + 1) * sizeof(WCHAR)))) SendMessageW(lphc->hWndLBox, LB_GETTEXT, index, (LPARAM)pText); } } @@ -905,7 +905,7 @@ static void CBUpdateEdit( LPHEADCOMBO lphc , INT index ) if( lphc->wState & CBF_FOCUSED ) SendMessageW(lphc->hWndEdit, EM_SETSEL, 0, -1);
- heap_free( pText ); + free( pText ); }
/*********************************************************************** @@ -1319,7 +1319,7 @@ static LRESULT COMBO_GetText( HEADCOMBO *lphc, INT count, LPWSTR buf ) /* 'length' is without the terminating character */ if (length >= count) { - WCHAR *lpBuffer = heap_alloc((length + 1) * sizeof(WCHAR)); + WCHAR *lpBuffer = malloc((length + 1) * sizeof(WCHAR)); if (!lpBuffer) goto error; length = SendMessageW(lphc->hWndLBox, LB_GETTEXT, idx, (LPARAM)lpBuffer);
@@ -1329,7 +1329,7 @@ static LRESULT COMBO_GetText( HEADCOMBO *lphc, INT count, LPWSTR buf ) lstrcpynW( buf, lpBuffer, count ); length = count; } - heap_free( lpBuffer ); + free( lpBuffer ); } else length = SendMessageW(lphc->hWndLBox, LB_GETTEXT, idx, (LPARAM)buf);