Commit 17c31068 authored by Mike McCormack's avatar Mike McCormack Committed by Alexandre Julliard

Eliminate casts of the return value of HeapAlloc.

parent 3a0f930a
......@@ -1448,7 +1448,7 @@ static HRESULT WINAPI OLEClipbrd_IDataObject_EnumFormatEtc(
* and create an IEnumFORMATETC enumerator from this list.
*/
cfmt = CountClipboardFormats();
afmt = (FORMATETC *)HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY,
afmt = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY,
sizeof(FORMATETC) * cfmt);
/*
* Open the Windows clipboard, associating it with our hidden window
......@@ -1576,9 +1576,7 @@ LPENUMFORMATETC OLEClipbrd_IEnumFORMATETC_Construct(UINT cfmt, const FORMATETC a
DWORD size=cfmt * sizeof(FORMATETC);
LPMALLOC pIMalloc;
ef = (IEnumFORMATETCImpl*)HeapAlloc(GetProcessHeap(),
HEAP_ZERO_MEMORY,
sizeof(IEnumFORMATETCImpl));
ef = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(IEnumFORMATETCImpl));
if (!ef)
return NULL;
......
......@@ -441,7 +441,7 @@ static void COMPOBJ_DLLList_Add(HANDLE hLibrary)
if (openDllList == NULL) {
/* empty list -- add first node */
openDllList = (OpenDll*)HeapAlloc(GetProcessHeap(),0, sizeof(OpenDll));
openDllList = HeapAlloc(GetProcessHeap(),0, sizeof(OpenDll));
openDllList->hLibrary=hLibrary;
openDllList->next = NULL;
} else {
......@@ -456,7 +456,7 @@ static void COMPOBJ_DLLList_Add(HANDLE hLibrary)
if (!found) {
/* dll not found, add it */
tmp = openDllList;
openDllList = (OpenDll*)HeapAlloc(GetProcessHeap(),0, sizeof(OpenDll));
openDllList = HeapAlloc(GetProcessHeap(),0, sizeof(OpenDll));
openDllList->hLibrary = hLibrary;
openDllList->next = tmp;
}
......
......@@ -63,8 +63,7 @@ static BSTR WINAPI ERRORINFO_SysAllocString(const OLECHAR* in)
* buffer for the character count and an extra character at the
* end for the '\0'.
*/
newBuffer = (DWORD*)HeapAlloc(GetProcessHeap(),
0,
newBuffer = HeapAlloc(GetProcessHeap(), 0,
bufferSize + sizeof(WCHAR) + sizeof(DWORD));
/*
......
......@@ -224,7 +224,7 @@ HRESULT WINAPI CoCreateFreeThreadedMarshaler (LPUNKNOWN punkOuter, LPUNKNOWN * p
TRACE ("(%p %p)\n", punkOuter, ppunkMarshal);
ftm = (FTMarshalImpl *) HeapAlloc (GetProcessHeap (), 0, sizeof (FTMarshalImpl));
ftm = HeapAlloc (GetProcessHeap (), 0, sizeof (FTMarshalImpl));
if (!ftm)
return E_OUTOFMEMORY;
......
......@@ -88,9 +88,7 @@ static LPOLEADVISEHOLDER OleAdviseHolderImpl_Constructor()
OleAdviseHolderImpl* lpoah;
DWORD index;
lpoah= (OleAdviseHolderImpl*)HeapAlloc(GetProcessHeap(),
0,
sizeof(OleAdviseHolderImpl));
lpoah = HeapAlloc(GetProcessHeap(), 0, sizeof(OleAdviseHolderImpl));
lpoah->lpVtbl = &oahvt;
lpoah->ref = 1;
......@@ -430,9 +428,7 @@ static IDataAdviseHolder* DataAdviseHolder_Constructor()
{
DataAdviseHolder* newHolder;
newHolder = (DataAdviseHolder*)HeapAlloc(GetProcessHeap(),
0,
sizeof(DataAdviseHolder));
newHolder = HeapAlloc(GetProcessHeap(), 0, sizeof(DataAdviseHolder));
newHolder->lpVtbl = &DataAdviseHolderImpl_VTable;
newHolder->ref = 1;
......
......@@ -172,7 +172,7 @@ BigBlockFile * BIGBLOCKFILE_Construct(
{
LPBIGBLOCKFILE This;
This = (LPBIGBLOCKFILE)HeapAlloc(GetProcessHeap(), 0, sizeof(BigBlockFile));
This = HeapAlloc(GetProcessHeap(), 0, sizeof(BigBlockFile));
if (This == NULL)
return NULL;
......
......@@ -3416,7 +3416,7 @@ BlockChainStream* Storage32Impl_SmallBlocksToBigBlocks(
cbTotalRead = 0;
cbTotalWritten = 0;
buffer = (BYTE *) HeapAlloc(GetProcessHeap(),0,DEF_SMALL_BLOCK_SIZE);
buffer = HeapAlloc(GetProcessHeap(),0,DEF_SMALL_BLOCK_SIZE);
do
{
successRead = SmallBlockChainStream_ReadAt(*ppsbChain,
......@@ -6331,7 +6331,7 @@ HRESULT OLECONVERT_LoadOLE10(LPOLESTREAM pOleStream, OLECONVERT_OLESTREAM_DATA *
{
if(pData->dwOleObjFileNameLength < 1) /* there is no file name exist */
pData->dwOleObjFileNameLength = sizeof(pData->dwOleObjFileNameLength);
pData->pstrOleObjFileName = (CHAR *)HeapAlloc(GetProcessHeap(), 0, pData->dwOleObjFileNameLength);
pData->pstrOleObjFileName = HeapAlloc(GetProcessHeap(), 0, pData->dwOleObjFileNameLength);
if(pData->pstrOleObjFileName)
{
dwSize = pOleStream->lpstbl->Get(pOleStream, (void *)(pData->pstrOleObjFileName),pData->dwOleObjFileNameLength);
......@@ -6388,7 +6388,7 @@ HRESULT OLECONVERT_LoadOLE10(LPOLESTREAM pOleStream, OLECONVERT_OLESTREAM_DATA *
{
if(pData->dwDataLength > 0)
{
pData->pData = (BYTE *)HeapAlloc(GetProcessHeap(),0,pData->dwDataLength);
pData->pData = HeapAlloc(GetProcessHeap(),0,pData->dwDataLength);
/* Get Data (ex. IStorage, Metafile, or BMP) */
if(pData->pData)
......@@ -6615,7 +6615,7 @@ DWORD OLECONVERT_WriteOLE20ToBuffer(LPSTORAGE pStorage, BYTE **pData)
if(hFile != INVALID_HANDLE_VALUE)
{
nDataLength = GetFileSize(hFile, NULL);
*pData = (BYTE *) HeapAlloc(GetProcessHeap(),0,nDataLength);
*pData = HeapAlloc(GetProcessHeap(),0,nDataLength);
ReadFile(hFile, *pData, nDataLength, &nDataLength, 0);
CloseHandle(hFile);
}
......@@ -7294,7 +7294,7 @@ void OLECONVERT_GetOle10PresData(LPSTORAGE pStorage, OLECONVERT_OLESTREAM_DATA *
IStream_Read(pStream, &(pOleStreamData->dwDataLength), sizeof(pOleStreamData->dwDataLength), NULL);
if(pOleStreamData->dwDataLength > 0)
{
pOleStreamData->pData = (LPSTR) HeapAlloc(GetProcessHeap(),0,pOleStreamData->dwDataLength);
pOleStreamData->pData = HeapAlloc(GetProcessHeap(),0,pOleStreamData->dwDataLength);
IStream_Read(pStream, pOleStreamData->pData, pOleStreamData->dwDataLength, NULL);
}
IStream_Release(pStream);
......@@ -7383,7 +7383,7 @@ void OLECONVERT_GetOle20PresData(LPSTORAGE pStorage, OLECONVERT_OLESTREAM_DATA *
MetaFilePict.hMF = 0;
/* Get Metafile Data */
pOleStreamData[1].pData = (BYTE *) HeapAlloc(GetProcessHeap(),0,pOleStreamData[1].dwDataLength);
pOleStreamData[1].pData = HeapAlloc(GetProcessHeap(),0,pOleStreamData[1].dwDataLength);
memcpy(pOleStreamData[1].pData, &MetaFilePict, sizeof(MetaFilePict));
IStream_Read(pStream, &(pOleStreamData[1].pData[sizeof(MetaFilePict)]), pOleStreamData[1].dwDataLength-sizeof(METAFILEPICT16), NULL);
}
......
......@@ -101,8 +101,7 @@ HRESULT WINAPI IAutoComplete_Constructor(IUnknown * pUnkOuter, REFIID riid, LPVO
if (pUnkOuter && !IsEqualIID (riid, &IID_IUnknown))
return CLASS_E_NOAGGREGATION;
lpac = (IAutoCompleteImpl*)HeapAlloc(GetProcessHeap(),
HEAP_ZERO_MEMORY, sizeof(IAutoCompleteImpl));
lpac = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(IAutoCompleteImpl));
if (!lpac)
return E_OUTOFMEMORY;
......@@ -280,7 +279,7 @@ static HRESULT WINAPI IAutoComplete_fnInit(
LONG len;
/* pwszRegKeyPath contains the key as well as the value, so we split */
key = (WCHAR*)HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, (lstrlenW(pwzsRegKeyPath)+1)*sizeof(WCHAR));
key = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, (lstrlenW(pwzsRegKeyPath)+1)*sizeof(WCHAR));
strcpyW(key, pwzsRegKeyPath);
value = strrchrW(key, '\\');
*value = 0;
......@@ -294,7 +293,7 @@ static HRESULT WINAPI IAutoComplete_fnInit(
if (res == ERROR_SUCCESS) {
res = RegQueryValueW(hKey, value, result, &len);
if (res == ERROR_SUCCESS) {
This->quickComplete = (WCHAR*)HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, len*sizeof(WCHAR));
This->quickComplete = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, len*sizeof(WCHAR));
strcpyW(This->quickComplete, result);
}
RegCloseKey(hKey);
......@@ -303,7 +302,7 @@ static HRESULT WINAPI IAutoComplete_fnInit(
}
if ((pwszQuickComplete) && (!This->quickComplete)) {
This->quickComplete = (WCHAR*)HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, (lstrlenW(pwszQuickComplete)+1)*sizeof(WCHAR));
This->quickComplete = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, (lstrlenW(pwszQuickComplete)+1)*sizeof(WCHAR));
lstrcpyW(This->quickComplete, pwszQuickComplete);
}
......@@ -482,7 +481,7 @@ static LRESULT APIENTRY ACEditSubclassProc(HWND hwnd, UINT uMsg, WPARAM wParam,
/* If quickComplete is set and control is pressed, replace the string */
control = GetKeyState(VK_CONTROL) & 0x8000;
if (control && This->quickComplete) {
hwndQCText = (WCHAR*)HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY,
hwndQCText = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY,
(lstrlenW(This->quickComplete)+lstrlenW(hwndText))*sizeof(WCHAR));
sel = sprintfW(hwndQCText, This->quickComplete, hwndText);
SendMessageW(hwnd, WM_SETTEXT, 0, (LPARAM)hwndQCText);
......@@ -525,7 +524,7 @@ static LRESULT APIENTRY ACEditSubclassProc(HWND hwnd, UINT uMsg, WPARAM wParam,
int len;
len = SendMessageW(This->hwndListBox, LB_GETTEXTLEN, sel, (LPARAM)NULL);
msg = (WCHAR*) HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, (len+1)*sizeof(WCHAR));
msg = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, (len+1)*sizeof(WCHAR));
SendMessageW(This->hwndListBox, LB_GETTEXT, sel, (LPARAM)msg);
SendMessageW(hwnd, WM_SETTEXT, 0, (LPARAM)msg);
SendMessageW(hwnd, EM_SETSEL, lstrlenW(msg), lstrlenW(msg));
......@@ -562,7 +561,7 @@ static LRESULT APIENTRY ACEditSubclassProc(HWND hwnd, UINT uMsg, WPARAM wParam,
SendMessageW(This->hwndListBox, LB_RESETCONTENT, 0, 0);
HeapFree(GetProcessHeap(), 0, This->txtbackup);
This->txtbackup = (WCHAR*) HeapAlloc(GetProcessHeap(),
This->txtbackup = HeapAlloc(GetProcessHeap(),
HEAP_ZERO_MEMORY, (lstrlenW(hwndText)+1)*sizeof(WCHAR));
lstrcpyW(This->txtbackup, hwndText);
......@@ -631,7 +630,7 @@ static LRESULT APIENTRY ACLBoxSubclassProc(HWND hwnd, UINT uMsg, WPARAM wParam,
break;
case WM_LBUTTONDOWN:
len = SendMessageW(This->hwndListBox, LB_GETTEXTLEN, sel, (LPARAM)NULL);
msg = (WCHAR*) HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, (len+1)*sizeof(WCHAR));
msg = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, (len+1)*sizeof(WCHAR));
sel = (INT)SendMessageW(hwnd, LB_GETCURSEL, 0, 0);
SendMessageW(hwnd, LB_GETTEXT, sel, (LPARAM)msg);
SendMessageW(This->hwndEdit, WM_SETTEXT, 0, (LPARAM)msg);
......
......@@ -193,7 +193,7 @@ static BOOL DeleteList(
IEnumIDList * IEnumIDList_Constructor(void)
{
IEnumIDListImpl *lpeidl = (IEnumIDListImpl*)HeapAlloc(GetProcessHeap(),
IEnumIDListImpl *lpeidl = HeapAlloc(GetProcessHeap(),
HEAP_ZERO_MEMORY, sizeof(IEnumIDListImpl));
if (lpeidl)
......
......@@ -74,7 +74,7 @@ IExtractIconW* IExtractIconW_Constructor(LPCITEMIDLIST pidl)
TRACE("%p\n", pidl);
ei = (IExtractIconWImpl*)HeapAlloc(GetProcessHeap(),0,sizeof(IExtractIconWImpl));
ei = HeapAlloc(GetProcessHeap(),0,sizeof(IExtractIconWImpl));
ei->ref=1;
ei->lpVtbl = &eivt;
ei->lpvtblPersistFile = &pfvt;
......
......@@ -287,11 +287,11 @@ HICON16 WINAPI ExtractIconEx16(
int i;
if (phiconLarge)
ilarge = (HICON*)HeapAlloc(GetProcessHeap(),0,nIcons*sizeof(HICON));
ilarge = HeapAlloc(GetProcessHeap(),0,nIcons*sizeof(HICON));
else
ilarge = NULL;
if (phiconSmall)
ismall = (HICON*)HeapAlloc(GetProcessHeap(),0,nIcons*sizeof(HICON));
ismall = HeapAlloc(GetProcessHeap(),0,nIcons*sizeof(HICON));
else
ismall = NULL;
ret = HICON_16(ExtractIconExA(lpszFile,nIconIndex,ilarge,ismall,nIcons));
......@@ -368,7 +368,7 @@ SEGPTR WINAPI FindEnvironmentString16(LPSTR str)
DWORD WINAPI DoEnvironmentSubst16(LPSTR str,WORD length)
{
LPSTR lpEnv = MapSL(GetDOSEnvironment16());
LPSTR lpBuffer = (LPSTR)HeapAlloc( GetProcessHeap(), 0, length);
LPSTR lpBuffer = HeapAlloc( GetProcessHeap(), 0, length);
LPSTR lpstr = str;
LPSTR lpbstr = lpBuffer;
......
......@@ -518,7 +518,7 @@ IClassFactory * IDefClF_fnConstructor(LPFNCREATEINSTANCE lpfnCI, PLONG pcRefDll,
{
IDefClFImpl* lpclf;
lpclf = (IDefClFImpl*)HeapAlloc(GetProcessHeap(),0,sizeof(IDefClFImpl));
lpclf = HeapAlloc(GetProcessHeap(),0,sizeof(IDefClFImpl));
lpclf->ref = 1;
lpclf->lpVtbl = &dclfvt;
lpclf->lpfnCI = lpfnCI;
......@@ -713,7 +713,7 @@ UINT WINAPI DragQueryFileA(
LPWSTR lpszFileW = NULL;
if(lpszFile) {
lpszFileW = (LPWSTR) HeapAlloc(GetProcessHeap(), 0, lLength*sizeof(WCHAR));
lpszFileW = HeapAlloc(GetProcessHeap(), 0, lLength*sizeof(WCHAR));
if(lpszFileW == NULL) {
goto end;
}
......@@ -770,7 +770,7 @@ UINT WINAPI DragQueryFileW(
LPSTR lpszFileA = NULL;
if(lpszwFile) {
lpszFileA = (LPSTR) HeapAlloc(GetProcessHeap(), 0, lLength);
lpszFileA = HeapAlloc(GetProcessHeap(), 0, lLength);
if(lpszFileA == NULL) {
goto end;
}
......
......@@ -198,7 +198,7 @@ static int FM_InitMenuPopup(HMENU hmenu, LPCITEMIDLIST pAlternatePidl)
MENUINFO MenuInfo;
HMENU hMenuPopup = CreatePopupMenu();
lpFmMi = (LPFMINFO) HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(FMINFO));
lpFmMi = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(FMINFO));
lpFmMi->pidl = ILCombine(pidl, pidlTemp);
lpFmMi->uEnumFlags = SHCONTF_FOLDERS | SHCONTF_NONFOLDERS;
......@@ -269,7 +269,7 @@ HMENU WINAPI FileMenu_Create (
TRACE("0x%08lx 0x%08x %p 0x%08x 0x%08x hMenu=%p\n",
crBorderColor, nBorderWidth, hBorderBmp, nSelHeight, uFlags, hMenu);
menudata = (LPFMINFO)HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(FMINFO));
menudata = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(FMINFO));
menudata->crBorderColor = crBorderColor;
menudata->nBorderWidth = nBorderWidth;
menudata->hBorderBmp = hBorderBmp;
......
......@@ -172,7 +172,7 @@ typedef void (CALLBACK *PFNSHGETSETTINGSPROC)(LPSHELLFLAGSTATE lpsfs, DWORD dwMa
*/
IShellView * IShellView_Constructor( IShellFolder * pFolder)
{ IShellViewImpl * sv;
sv=(IShellViewImpl*)HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(IShellViewImpl));
sv=HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(IShellViewImpl));
sv->ref=1;
sv->lpVtbl=&svvt;
sv->lpvtblOleCommandTarget=&ctvt;
......
......@@ -59,7 +59,7 @@ IContextMenu2 *ISvBgCm_Constructor(IShellFolder* pSFParent, BOOL bDesktop)
{
BgCmImpl* cm;
cm = (BgCmImpl*)HeapAlloc(GetProcessHeap(),HEAP_ZERO_MEMORY,sizeof(BgCmImpl));
cm = HeapAlloc(GetProcessHeap(),HEAP_ZERO_MEMORY,sizeof(BgCmImpl));
cm->lpVtbl = &cmvt;
cm->ref = 1;
cm->pSFParent = pSFParent;
......
......@@ -82,7 +82,7 @@ IContextMenu2 *ISvItemCm_Constructor(LPSHELLFOLDER pSFParent, LPCITEMIDLIST pidl
{ ItemCmImpl* cm;
UINT u;
cm = (ItemCmImpl*)HeapAlloc(GetProcessHeap(),HEAP_ZERO_MEMORY,sizeof(ItemCmImpl));
cm = HeapAlloc(GetProcessHeap(),HEAP_ZERO_MEMORY,sizeof(ItemCmImpl));
cm->lpVtbl = &cmvt;
cm->ref = 1;
cm->pidl = ILClone(pidl);
......
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