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