Commit 58e62fff authored by Alex Henrie's avatar Alex Henrie Committed by Alexandre Julliard

oleview: Use CRT allocation functions.

parent 810bde3b
......@@ -120,7 +120,7 @@ static LRESULT CALLBACK PaneProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lPa
HIWORD(lParam), TRUE);
break;
case WM_DESTROY:
HeapFree(GetProcessHeap(), 0, pane);
free(pane);
break;
default:
return DefWindowProcW(hWnd, uMsg, wParam, lParam);
......@@ -149,12 +149,12 @@ BOOL CreatePanedWindow(HWND hWnd, HWND *hWndCreated, HINSTANCE hInst)
const WCHAR wszPaneClass[] = { 'P','A','N','E','\0' };
PANE *pane;
pane = HeapAlloc(GetProcessHeap(), 0, sizeof(PANE));
pane = malloc(sizeof(PANE));
*hWndCreated = CreateWindowW(wszPaneClass, NULL, WS_CHILD|WS_VISIBLE,
CW_USEDEFAULT, CW_USEDEFAULT, 0, 0, hWnd, (HMENU)pane, hInst, NULL);
if(!*hWndCreated)
{
HeapFree(GetProcessHeap(), 0, pane);
free(pane);
return FALSE;
}
......
......@@ -41,7 +41,7 @@ static LPARAM CreateITEM_INFO(INT flag, const WCHAR *info, const WCHAR *clsid, c
{
ITEM_INFO *reg;
reg = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(ITEM_INFO));
reg = calloc(1, sizeof(ITEM_INFO));
reg->cFlag = flag;
lstrcpyW(reg->info, info);
......@@ -651,7 +651,7 @@ static LRESULT CALLBACK TreeProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lPa
{
if (info->loaded)
ReleaseInst(nm->itemOld.hItem);
HeapFree(GetProcessHeap(), 0, info);
free(info);
}
break;
}
......
......@@ -124,13 +124,13 @@ static void SaveIdl(WCHAR *wszFileName)
}
len = WideCharToMultiByte( CP_UTF8, 0, data->idl, data->idlLen, NULL, 0, NULL, NULL );
wszIdl = HeapAlloc(GetProcessHeap(), 0, len);
wszIdl = malloc(len);
WideCharToMultiByte( CP_UTF8, 0, data->idl, data->idlLen, wszIdl, len, NULL, NULL );
if(!WriteFile(hFile, wszIdl, len, &dwNumWrite, NULL))
ShowLastError();
HeapFree(GetProcessHeap(), 0, wszIdl);
free(wszIdl);
CloseHandle(hFile);
}
......@@ -183,8 +183,7 @@ static void AddToTLDataStrW(TYPELIB_DATA *pTLData, const WCHAR *wszSource)
{
int SourceLen = lstrlenW(wszSource);
pTLData->idl = HeapReAlloc(GetProcessHeap(), 0, pTLData->idl,
sizeof(WCHAR)*(pTLData->idlLen+SourceLen+1));
pTLData->idl = realloc(pTLData->idl, sizeof(WCHAR) * (pTLData->idlLen + SourceLen + 1));
memcpy(&pTLData->idl[pTLData->idlLen], wszSource, sizeof(WCHAR)*(SourceLen+1));
pTLData->idlLen += SourceLen;
......@@ -205,8 +204,8 @@ static void AddToTLDataStrWithTabsW(TYPELIB_DATA *pTLData, WCHAR *wszSource)
}
if(*(pSourcePos - 1) != L'\n') newLinesNo++;
pTLData->idl = HeapReAlloc(GetProcessHeap(), 0, pTLData->idl,
sizeof(WCHAR)*(pTLData->idlLen+lineLen+4*newLinesNo+1));
pTLData->idl = realloc(pTLData->idl,
sizeof(WCHAR) * (pTLData->idlLen + lineLen + 4 * newLinesNo + 1));
pSourcePos = wszSource;
pSourceBeg = wszSource;
......@@ -244,9 +243,9 @@ static TYPELIB_DATA *InitializeTLData(void)
{
TYPELIB_DATA *pTLData;
pTLData = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(TYPELIB_DATA));
pTLData = calloc(1, sizeof(TYPELIB_DATA));
pTLData->idl = HeapAlloc(GetProcessHeap(), 0, sizeof(WCHAR));
pTLData->idl = malloc(sizeof(WCHAR));
pTLData->idl[0] = '\0';
return pTLData;
......@@ -572,12 +571,11 @@ static int EnumFuncs(ITypeInfo *pTypeInfo, TYPEATTR *pTypeAttr, HTREEITEM hParen
AddToTLDataStrW(tld, wszAfter);
}
bstrParamNames = HeapAlloc(GetProcessHeap(), 0,
sizeof(BSTR)*(pFuncDesc->cParams+1));
bstrParamNames = malloc(sizeof(BSTR) * (pFuncDesc->cParams + 1));
if(FAILED(ITypeInfo_GetNames(pTypeInfo, pFuncDesc->memid, bstrParamNames,
pFuncDesc->cParams+1, &namesNo)))
{
HeapFree(GetProcessHeap(), 0, bstrParamNames);
free(bstrParamNames);
continue;
}
SysFreeString(bstrParamNames[0]);
......@@ -660,7 +658,7 @@ static int EnumFuncs(ITypeInfo *pTypeInfo, TYPEATTR *pTypeAttr, HTREEITEM hParen
AddToTLDataStrW(tld, L");\n");
SendMessageW(typelib.hTree, TVM_INSERTITEMW, 0, (LPARAM)&tvis);
HeapFree(GetProcessHeap(), 0, bstrParamNames);
free(bstrParamNames);
SysFreeString(bstrName);
SysFreeString(bstrHelpString);
ITypeInfo_ReleaseFuncDesc(pTypeInfo, pFuncDesc);
......@@ -1449,8 +1447,8 @@ static void EmptyTLTree(void)
SendMessageW(typelib.hTree, TVM_GETITEMW, 0, (LPARAM)&tvi);
if(tvi.lParam)
{
HeapFree(GetProcessHeap(), 0, ((TYPELIB_DATA *)tvi.lParam)->idl);
HeapFree(GetProcessHeap(), 0, (TYPELIB_DATA *)tvi.lParam);
free(((TYPELIB_DATA*)tvi.lParam)->idl);
free((TYPELIB_DATA*)tvi.lParam);
}
SendMessageW(typelib.hTree, TVM_DELETEITEM, 0, (LPARAM)del);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment