Get rid of HeapAlloc casts.

This commit is contained in:
Jakob Eriksson 2005-03-24 21:01:35 +00:00 committed by Alexandre Julliard
parent 23d9ac25b2
commit 9ed61de9a2
98 changed files with 272 additions and 351 deletions

View File

@ -323,7 +323,7 @@ static void PROPSHEET_AtoW(LPCWSTR *tostr, LPCSTR frstr)
TRACE("<%s>\n", frstr);
len = MultiByteToWideChar(CP_ACP, 0, frstr, -1, 0, 0);
*tostr = (LPWSTR)HeapAlloc(GetProcessHeap(), 0, len * sizeof(WCHAR));
*tostr = HeapAlloc(GetProcessHeap(), 0, len * sizeof(WCHAR));
MultiByteToWideChar(CP_ACP, 0, frstr, -1, (LPWSTR)*tostr, len);
}

View File

@ -2958,7 +2958,7 @@ void FILEDLG95_FILENAME_FillFromSelection (HWND hwnd)
/* allocate the buffer */
if (nFiles <= 1) nLength = MAX_PATH;
lpstrAllFile = (LPSTR)HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, nLength);
lpstrAllFile = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, nLength);
lpstrAllFile[0] = '\0';
/* Generate the string for the edit control */

View File

@ -459,7 +459,7 @@ static BOOL PRINTDLG_PaperSizeA(
goto out;
}
Names = (char*)HeapAlloc(GetProcessHeap(),0,NrOfEntries*64);
Names = HeapAlloc(GetProcessHeap(),0,NrOfEntries*64);
if (NrOfEntries != (ret=DeviceCapabilitiesA(devname,portname,DC_PAPERNAMES,Names,dm))) {
FIXME("Number of returned vals %d is not %d\n",NrOfEntries,ret);
goto out;
@ -517,7 +517,7 @@ static BOOL PRINTDLG_PaperSizeW(
goto out;
}
Names = (WCHAR*)HeapAlloc(GetProcessHeap(),0,sizeof(WCHAR)*NrOfEntries*64);
Names = HeapAlloc(GetProcessHeap(),0,sizeof(WCHAR)*NrOfEntries*64);
if (NrOfEntries != (ret=DeviceCapabilitiesW(devname,portname,DC_PAPERNAMES,Names,dm))) {
FIXME("Number of returned vals %d is not %d\n",NrOfEntries,ret);
goto out;

View File

@ -427,7 +427,7 @@ BOOL16 WINAPI PrintDlg16(
ptr16 = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(PRINT_PTRA16));
ptr16->lpPrintDlg16 = lppd;
PrintStructures = &ptr16->print32;
PrintStructures->lpPrintDlg = (LPPRINTDLGA)HeapAlloc(GetProcessHeap(),HEAP_ZERO_MEMORY,sizeof(PRINTDLGA));
PrintStructures->lpPrintDlg = HeapAlloc(GetProcessHeap(),HEAP_ZERO_MEMORY,sizeof(PRINTDLGA));
#define CVAL(x) PrintStructures->lpPrintDlg->x = lppd->x;
#define MVAL(x) PrintStructures->lpPrintDlg->x = MapSL(lppd->x);
CVAL(Flags);

View File

@ -522,8 +522,8 @@ HRESULT WINAPI IDirect3DSurface8Impl_LoadTexture(LPDIRECT3DSURFACE8 iface, UINT
*/
UINT i;
PALETTEENTRY* pal = This->Device->palettes[This->Device->currentPalette];
VOID* surface = (VOID*) HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, This->myDesc.Width * This->myDesc.Height * sizeof(DWORD));
BYTE* dst = (BYTE*) surface;
VOID* surface = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, This->myDesc.Width * This->myDesc.Height * sizeof(DWORD));
BYTE* dst = surface;
BYTE* src = (BYTE*) This->allocatedMemory;
for (i = 0; i < This->myDesc.Width * This->myDesc.Height; i++) {

View File

@ -3992,14 +3992,14 @@ d3ddevice_create(IDirect3DDeviceImpl **obj, IDirectDrawImpl *d3d, IDirectDrawSur
}
/* Allocate memory for the matrices */
object->world_mat = (D3DMATRIX *) HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, 16 * sizeof(float));
object->view_mat = (D3DMATRIX *) HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, 16 * sizeof(float));
object->proj_mat = (D3DMATRIX *) HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, 16 * sizeof(float));
object->world_mat = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, 16 * sizeof(float));
object->view_mat = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, 16 * sizeof(float));
object->proj_mat = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, 16 * sizeof(float));
memcpy(object->world_mat, id_mat, 16 * sizeof(float));
memcpy(object->view_mat , id_mat, 16 * sizeof(float));
memcpy(object->proj_mat , id_mat, 16 * sizeof(float));
for (tex_num = 0; tex_num < MAX_TEXTURES; tex_num++) {
object->tex_mat[tex_num] = (D3DMATRIX *) HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, 16 * sizeof(float));
object->tex_mat[tex_num] = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, 16 * sizeof(float));
memcpy(object->tex_mat[tex_num], id_mat, 16 * sizeof(float));
object->tex_mat_is_identity[tex_num] = TRUE;
}
@ -4011,7 +4011,7 @@ d3ddevice_create(IDirect3DDeviceImpl **obj, IDirectDrawImpl *d3d, IDirectDrawSur
/* allocate the clipping planes */
object->max_clipping_planes = opengl_device_caps.wMaxUserClipPlanes;
object->clipping_planes = (d3d7clippingplane*)HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, object->max_clipping_planes * sizeof(d3d7clippingplane));
object->clipping_planes = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, object->max_clipping_planes * sizeof(d3d7clippingplane));
glHint(GL_FOG_HINT,GL_NICEST);

View File

@ -78,22 +78,21 @@ static HRESULT create_dib(IDirectDrawSurfaceImpl* This)
case 16:
case 32:
/* Allocate extra space to store the RGB bit masks. */
b_info = (BITMAPINFO*)HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY,
sizeof(BITMAPINFOHEADER)
+ 3 * sizeof(DWORD));
b_info = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY,
sizeof(BITMAPINFOHEADER) + 3 * sizeof(DWORD));
break;
case 24:
b_info = (BITMAPINFO*)HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY,
sizeof(BITMAPINFOHEADER));
b_info = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY,
sizeof(BITMAPINFOHEADER));
break;
default:
/* Allocate extra space for a palette. */
b_info = (BITMAPINFO*)HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY,
sizeof(BITMAPINFOHEADER)
+ sizeof(RGBQUAD)
* (1 << This->surface_desc.u4.ddpfPixelFormat.u1.dwRGBBitCount));
b_info = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY,
sizeof(BITMAPINFOHEADER)
+ sizeof(RGBQUAD)
* (1 << This->surface_desc.u4.ddpfPixelFormat.u1.dwRGBBitCount));
break;
}

View File

@ -290,12 +290,12 @@ DataFormat *create_DataFormat(const DIDATAFORMAT *wine_format, LPCDIDATAFORMAT a
int index = 0;
DWORD next = 0;
ret = (DataFormat *) HeapAlloc(GetProcessHeap(), 0, sizeof(DataFormat));
ret = HeapAlloc(GetProcessHeap(), 0, sizeof(DataFormat));
done = (int *) HeapAlloc(GetProcessHeap(), 0, sizeof(int) * asked_format->dwNumObjs);
done = HeapAlloc(GetProcessHeap(), 0, sizeof(int) * asked_format->dwNumObjs);
memset(done, 0, sizeof(int) * asked_format->dwNumObjs);
dt = (DataTransform *) HeapAlloc(GetProcessHeap(), 0, asked_format->dwNumObjs * sizeof(DataTransform));
dt = HeapAlloc(GetProcessHeap(), 0, asked_format->dwNumObjs * sizeof(DataTransform));
TRACE("Creating DataTransform : \n");

View File

@ -91,7 +91,7 @@ HRESULT WINAPI DirectInputCreateEx(
if (IsEqualGUID(&IID_IDirectInputA,riid) ||
IsEqualGUID(&IID_IDirectInput2A,riid) ||
IsEqualGUID(&IID_IDirectInput7A,riid)) {
This = (IDirectInputImpl*)HeapAlloc(GetProcessHeap(),0,sizeof(IDirectInputImpl));
This = HeapAlloc(GetProcessHeap(),0,sizeof(IDirectInputImpl));
This->lpVtbl = &ddi7avt;
This->ref = 1;
This->version = 1;
@ -103,7 +103,7 @@ HRESULT WINAPI DirectInputCreateEx(
if (IsEqualGUID(&IID_IDirectInputW,riid) ||
IsEqualGUID(&IID_IDirectInput2W,riid) ||
IsEqualGUID(&IID_IDirectInput7W,riid)) {
This = (IDirectInputImpl*)HeapAlloc(GetProcessHeap(),0,sizeof(IDirectInputImpl));
This = HeapAlloc(GetProcessHeap(),0,sizeof(IDirectInputImpl));
This->lpVtbl = &ddi7wvt;
This->ref = 1;
This->version = 1;
@ -113,7 +113,7 @@ HRESULT WINAPI DirectInputCreateEx(
}
if (IsEqualGUID(&IID_IDirectInput8A,riid)) {
This = (IDirectInputImpl*)HeapAlloc(GetProcessHeap(),0,sizeof(IDirectInputImpl));
This = HeapAlloc(GetProcessHeap(),0,sizeof(IDirectInputImpl));
This->lpVtbl = &ddi8avt;
This->ref = 1;
This->version = 8;
@ -123,7 +123,7 @@ HRESULT WINAPI DirectInputCreateEx(
}
if (IsEqualGUID(&IID_IDirectInput8W,riid)) {
This = (IDirectInputImpl*)HeapAlloc(GetProcessHeap(),0,sizeof(IDirectInputImpl));
This = HeapAlloc(GetProcessHeap(),0,sizeof(IDirectInputImpl));
This->lpVtbl = &ddi8wvt;
This->ref = 1;
This->version = 8;
@ -142,7 +142,7 @@ HRESULT WINAPI DirectInputCreateA(HINSTANCE hinst, DWORD dwVersion, LPDIRECTINPU
{
IDirectInputImpl* This;
TRACE("(0x%08lx,%04lx,%p,%p)\n", (DWORD)hinst,dwVersion,ppDI,punkOuter);
This = (IDirectInputImpl*)HeapAlloc(GetProcessHeap(),0,sizeof(IDirectInputImpl));
This = HeapAlloc(GetProcessHeap(),0,sizeof(IDirectInputImpl));
This->lpVtbl = &ddi7avt;
This->ref = 1;
if (dwVersion >= 0x0800) {
@ -163,7 +163,7 @@ HRESULT WINAPI DirectInputCreateW(HINSTANCE hinst, DWORD dwVersion, LPDIRECTINPU
{
IDirectInputImpl* This;
TRACE("(0x%08lx,%04lx,%p,%p)\n", (DWORD)hinst,dwVersion,ppDI,punkOuter);
This = (IDirectInputImpl*)HeapAlloc(GetProcessHeap(),0,sizeof(IDirectInputImpl));
This = HeapAlloc(GetProcessHeap(),0,sizeof(IDirectInputImpl));
This->lpVtbl = &ddi7wvt;
This->ref = 1;
if (dwVersion >= 0x0800) {

View File

@ -259,7 +259,7 @@ static SysMouseImpl *alloc_device(REFGUID rguid, LPVOID mvt, IDirectInputImpl *d
/* Per default, Wine uses its internal data format */
newDevice->df = (DIDATAFORMAT *) &Wine_InternalMouseFormat;
memcpy(newDevice->offset_array, offset_array, WINE_INTERNALMOUSE_NUM_OBJS * sizeof(int));
newDevice->wine_df = (DataFormat *) HeapAlloc(GetProcessHeap(), 0, sizeof(DataFormat));
newDevice->wine_df = HeapAlloc(GetProcessHeap(), 0, sizeof(DataFormat));
newDevice->wine_df->size = 0;
newDevice->wine_df->internal_format_size = Wine_InternalMouseFormat.dwDataSize;
newDevice->wine_df->dt = NULL;
@ -815,8 +815,7 @@ static HRESULT WINAPI SysMouseAImpl_SetProperty(LPDIRECTINPUTDEVICE8A iface,
TRACE("buffersize = %ld\n",pd->dwData);
This->data_queue = (LPDIDEVICEOBJECTDATA)HeapAlloc(GetProcessHeap(),0,
pd->dwData * sizeof(DIDEVICEOBJECTDATA));
This->data_queue = HeapAlloc(GetProcessHeap(),0, pd->dwData * sizeof(DIDEVICEOBJECTDATA));
This->queue_head = 0;
This->queue_tail = 0;
This->queue_len = pd->dwData;

View File

@ -266,7 +266,7 @@ HRESULT WINAPI IDirectMusicCommandTrack_IPersistStream_Load (LPPERSISTSTREAM ifa
nrCommands = chunkSize/dwSizeOfStruct; /* and this is the number of commands */
/* load each command seperately in new entry */
for (count = 0; count < nrCommands; count++) {
LPDMUS_PRIVATE_COMMAND pNewCommand = (LPDMUS_PRIVATE_COMMAND) HeapAlloc (GetProcessHeap (), HEAP_ZERO_MEMORY, sizeof(DMUS_PRIVATE_COMMAND));
LPDMUS_PRIVATE_COMMAND pNewCommand = HeapAlloc (GetProcessHeap (), HEAP_ZERO_MEMORY, sizeof(DMUS_PRIVATE_COMMAND));
IStream_Read (pStm, &pNewCommand->pCommand, dwSizeOfStruct, NULL);
list_add_tail (&This->Commands, &pNewCommand->entry);
}

View File

@ -236,8 +236,7 @@ static BOOL DP_CreateIUnknown( LPVOID lpDP )
{
IDirectPlay2AImpl *This = (IDirectPlay2AImpl *)lpDP;
This->unk = (DirectPlayIUnknownData*)HeapAlloc( GetProcessHeap(), HEAP_ZERO_MEMORY,
sizeof( *(This->unk) ) );
This->unk = HeapAlloc( GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof( *(This->unk) ) );
if ( This->unk == NULL )
{
return FALSE;
@ -262,8 +261,7 @@ static BOOL DP_CreateDirectPlay2( LPVOID lpDP )
{
IDirectPlay2AImpl *This = (IDirectPlay2AImpl *)lpDP;
This->dp2 = (DirectPlay2Data*)HeapAlloc( GetProcessHeap(), HEAP_ZERO_MEMORY,
sizeof( *(This->dp2) ) );
This->dp2 = HeapAlloc( GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof( *(This->dp2) ) );
if ( This->dp2 == NULL )
{
return FALSE;
@ -286,9 +284,9 @@ static BOOL DP_CreateDirectPlay2( LPVOID lpDP )
}
/* Provide an initial session desc with nothing in it */
This->dp2->lpSessionDesc = (LPDPSESSIONDESC2)HeapAlloc( GetProcessHeap(),
HEAP_ZERO_MEMORY,
sizeof( *This->dp2->lpSessionDesc ) );
This->dp2->lpSessionDesc = HeapAlloc( GetProcessHeap(),
HEAP_ZERO_MEMORY,
sizeof( *This->dp2->lpSessionDesc ) );
if( This->dp2->lpSessionDesc == NULL )
{
/* FIXME: Memory leak */
@ -426,8 +424,7 @@ static BOOL DP_CreateDirectPlay3( LPVOID lpDP )
{
IDirectPlay3AImpl *This = (IDirectPlay3AImpl *)lpDP;
This->dp3 = (DirectPlay3Data*)HeapAlloc( GetProcessHeap(), HEAP_ZERO_MEMORY,
sizeof( *(This->dp3) ) );
This->dp3 = HeapAlloc( GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof( *(This->dp3) ) );
if ( This->dp3 == NULL )
{
return FALSE;
@ -450,8 +447,7 @@ static BOOL DP_CreateDirectPlay4( LPVOID lpDP )
{
IDirectPlay4AImpl *This = (IDirectPlay4AImpl *)lpDP;
This->dp4 = (DirectPlay4Data*)HeapAlloc( GetProcessHeap(), HEAP_ZERO_MEMORY,
sizeof( *(This->dp4) ) );
This->dp4 = HeapAlloc( GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof( *(This->dp4) ) );
if ( This->dp4 == NULL )
{
return FALSE;
@ -709,9 +705,7 @@ HRESULT DP_HandleMessage( IDirectPlay2Impl* This, LPCVOID lpcMessageBody,
*lpdwMsgSize = This->dp2->spData.dwSPHeaderSize + sizeof( *lpReply );
*lplpReply = (LPDPMSG_NEWPLAYERIDREPLY)HeapAlloc( GetProcessHeap(),
HEAP_ZERO_MEMORY,
*lpdwMsgSize );
*lplpReply = HeapAlloc( GetProcessHeap(), HEAP_ZERO_MEMORY, *lpdwMsgSize );
FIXME( "Ignoring dwFlags 0x%08lx in request msg\n",
lpcMsg->dwFlags );
@ -810,8 +804,7 @@ static HRESULT WINAPI DP_IF_AddPlayerToGroup
}
/* Create a player list (ie "shortcut" ) */
lpNewPList = (lpPlayerList)HeapAlloc( GetProcessHeap(), HEAP_ZERO_MEMORY,
sizeof( *lpNewPList ) );
lpNewPList = HeapAlloc( GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof( *lpNewPList ) );
if( lpNewPList == NULL )
{
return DPERR_CANTADDPLAYER;
@ -930,8 +923,7 @@ lpGroupData DP_CreateGroup( IDirectPlay2AImpl* This, LPDPID lpid,
lpGroupData lpGData;
/* Allocate the new space and add to end of high level group list */
lpGData = (lpGroupData) HeapAlloc( GetProcessHeap(), HEAP_ZERO_MEMORY,
sizeof( *lpGData ) );
lpGData = HeapAlloc( GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof( *lpGData ) );
if( lpGData == NULL )
{
@ -1054,9 +1046,7 @@ static HRESULT WINAPI DP_IF_CreateGroup
else
{
/* Insert into the system group */
lpGroupList lpGroup = (lpGroupList) HeapAlloc( GetProcessHeap(),
HEAP_ZERO_MEMORY,
sizeof( *lpGroup ) );
lpGroupList lpGroup = HeapAlloc( GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof( *lpGroup ) );
lpGroup->lpGData = lpGData;
DPQ_INSERT( This->dp2->lpSysGroup->groups, lpGroup, groups );
@ -1203,9 +1193,7 @@ lpPlayerData DP_CreatePlayer( IDirectPlay2Impl* This, LPDPID lpid,
TRACE( "(%p)->(%p,%p,%u)\n", This, lpid, lpName, bAnsi );
/* Allocate the storage for the player and associate it with list element */
lpPData = (lpPlayerData) HeapAlloc( GetProcessHeap(),
HEAP_ZERO_MEMORY,
sizeof( *lpPData ) );
lpPData = HeapAlloc( GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof( *lpPData ) );
if( lpPData == NULL )
{
return NULL;
@ -1496,8 +1484,7 @@ static HRESULT WINAPI DP_IF_CreatePlayer
}
/* Create the list object and link it in */
lpPList = (lpPlayerList)HeapAlloc( GetProcessHeap(), HEAP_ZERO_MEMORY,
sizeof( *lpPList ) );
lpPList = HeapAlloc( GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof( *lpPList ) );
if( lpPList == NULL )
{
FIXME( "Memory leak\n" );
@ -2298,9 +2285,7 @@ static HRESULT WINAPI DP_IF_EnumSessions
if( !FAILED(hr) )
{
EnumSessionAsyncCallbackData* lpData
= (EnumSessionAsyncCallbackData*)HeapAlloc( GetProcessHeap(),
HEAP_ZERO_MEMORY,
sizeof( *lpData ) );
= HeapAlloc( GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof( *lpData ) );
/* FIXME: need to kill the thread on object deletion */
lpData->lpSpData = &This->dp2->spData;
@ -3258,9 +3243,7 @@ static HRESULT WINAPI DP_SetSessionDesc
/* FIXME: Copy into This->dp2->lpSessionDesc */
dwRequiredSize = DP_CalcSessionDescSize( lpSessDesc, bAnsi );
lpTempSessDesc = (LPDPSESSIONDESC2)HeapAlloc( GetProcessHeap(),
HEAP_ZERO_MEMORY,
dwRequiredSize );
lpTempSessDesc = HeapAlloc( GetProcessHeap(), HEAP_ZERO_MEMORY, dwRequiredSize );
if( lpTempSessDesc == NULL )
{
@ -3424,8 +3407,7 @@ static HRESULT WINAPI DP_IF_AddGroupToGroup
}
/* Create a player list (ie "shortcut" ) */
lpNewGList = (lpGroupList)HeapAlloc( GetProcessHeap(), HEAP_ZERO_MEMORY,
sizeof( *lpNewGList ) );
lpNewGList = HeapAlloc( GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof( *lpNewGList ) );
if( lpNewGList == NULL )
{
return DPERR_CANTADDPLAYER;
@ -3494,8 +3476,7 @@ static HRESULT WINAPI DP_IF_CreateGroupInGroup
/* The list has now been inserted into the interface group list. We now
need to put a "shortcut" to this group in the parent group */
lpGList = (lpGroupList)HeapAlloc( GetProcessHeap(), HEAP_ZERO_MEMORY,
sizeof( *lpGList ) );
lpGList = HeapAlloc( GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof( *lpGList ) );
if( lpGList == NULL )
{
FIXME( "Memory leak\n" );
@ -4636,10 +4617,8 @@ static HRESULT WINAPI DP_SP_SendEx
/* FIXME: This queuing should only be for async messages */
lpMElem = (LPDPMSG)HeapAlloc( GetProcessHeap(), HEAP_ZERO_MEMORY,
sizeof( *lpMElem ) );
lpMElem->msg = (DPMSG_GENERIC*)HeapAlloc( GetProcessHeap(), HEAP_ZERO_MEMORY,
dwDataSize );
lpMElem = HeapAlloc( GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof( *lpMElem ) );
lpMElem->msg = HeapAlloc( GetProcessHeap(), HEAP_ZERO_MEMORY, dwDataSize );
CopyMemory( lpMElem->msg, lpData, dwDataSize );

View File

@ -136,9 +136,7 @@ static BOOL DPSP_CreateIUnknown( LPVOID lpSP )
{
IDirectPlaySPImpl *This = (IDirectPlaySPImpl *)lpSP;
This->unk = (DirectPlaySPIUnknownData*)HeapAlloc( GetProcessHeap(),
HEAP_ZERO_MEMORY,
sizeof( *(This->unk) ) );
This->unk = HeapAlloc( GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof( *(This->unk) ) );
if ( This->unk == NULL )
{
@ -165,9 +163,7 @@ static BOOL DPSP_CreateDirectPlaySP( LPVOID lpSP, IDirectPlay2Impl* dp )
{
IDirectPlaySPImpl *This = (IDirectPlaySPImpl *)lpSP;
This->sp = (DirectPlaySPData*)HeapAlloc( GetProcessHeap(),
HEAP_ZERO_MEMORY,
sizeof( *(This->sp) ) );
This->sp = HeapAlloc( GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof( *(This->sp) ) );
if ( This->sp == NULL )
{

View File

@ -1064,8 +1064,7 @@ DWORD DPLAYX_SizeOfLobbyDataW( LPDPLCONNECTION lpConn )
LPDPSESSIONDESC2 DPLAYX_CopyAndAllocateSessionDesc2A( LPCDPSESSIONDESC2 lpSessionSrc )
{
LPDPSESSIONDESC2 lpSessionDest =
(LPDPSESSIONDESC2)HeapAlloc( GetProcessHeap(),
HEAP_ZERO_MEMORY, sizeof( *lpSessionSrc ) );
HeapAlloc( GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof( *lpSessionSrc ) );
DPLAYX_CopyIntoSessionDesc2A( lpSessionDest, lpSessionSrc );
return lpSessionDest;

View File

@ -151,8 +151,7 @@ static BOOL DPL_CreateIUnknown( LPVOID lpDPL )
{
IDirectPlayLobbyAImpl *This = (IDirectPlayLobbyAImpl *)lpDPL;
This->unk = (DirectPlayLobbyIUnknownData*)HeapAlloc( GetProcessHeap(), HEAP_ZERO_MEMORY,
sizeof( *(This->unk) ) );
This->unk = HeapAlloc( GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof( *(This->unk) ) );
if ( This->unk == NULL )
{
return FALSE;
@ -177,8 +176,7 @@ static BOOL DPL_CreateLobby1( LPVOID lpDPL )
{
IDirectPlayLobbyAImpl *This = (IDirectPlayLobbyAImpl *)lpDPL;
This->dpl = (DirectPlayLobbyData*)HeapAlloc( GetProcessHeap(), HEAP_ZERO_MEMORY,
sizeof( *(This->dpl) ) );
This->dpl = HeapAlloc( GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof( *(This->dpl) ) );
if ( This->dpl == NULL )
{
return FALSE;
@ -210,8 +208,7 @@ static BOOL DPL_CreateLobby2( LPVOID lpDPL )
{
IDirectPlayLobby2AImpl *This = (IDirectPlayLobby2AImpl *)lpDPL;
This->dpl2 = (DirectPlayLobby2Data*)HeapAlloc( GetProcessHeap(), HEAP_ZERO_MEMORY,
sizeof( *(This->dpl2) ) );
This->dpl2 = HeapAlloc( GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof( *(This->dpl2) ) );
if ( This->dpl2 == NULL )
{
return FALSE;
@ -233,8 +230,7 @@ static BOOL DPL_CreateLobby3( LPVOID lpDPL )
{
IDirectPlayLobby3AImpl *This = (IDirectPlayLobby3AImpl *)lpDPL;
This->dpl3 = (DirectPlayLobby3Data*)HeapAlloc( GetProcessHeap(), HEAP_ZERO_MEMORY,
sizeof( *(This->dpl3) ) );
This->dpl3 = HeapAlloc( GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof( *(This->dpl3) ) );
if ( This->dpl3 == NULL )
{
return FALSE;

View File

@ -112,9 +112,7 @@ static BOOL DPLSP_CreateIUnknown( LPVOID lpSP )
{
IDPLobbySPImpl *This = (IDPLobbySPImpl *)lpSP;
This->unk = (DPLobbySPIUnknownData*)HeapAlloc( GetProcessHeap(),
HEAP_ZERO_MEMORY,
sizeof( *(This->unk) ) );
This->unk = HeapAlloc( GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof( *(This->unk) ) );
if ( This->unk == NULL )
{
@ -140,9 +138,7 @@ static BOOL DPLSP_CreateDPLobbySP( LPVOID lpSP, IDirectPlay2Impl* dp )
{
IDPLobbySPImpl *This = (IDPLobbySPImpl *)lpSP;
This->sp = (DPLobbySPData*)HeapAlloc( GetProcessHeap(),
HEAP_ZERO_MEMORY,
sizeof( *(This->sp) ) );
This->sp = HeapAlloc( GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof( *(This->sp) ) );
if ( This->sp == NULL )
{

View File

@ -120,8 +120,7 @@ void NS_AddRemoteComputerAsNameServer( LPCVOID lpcNSAddrHdr,
}
/* Add this to the list */
lpCacheNode = (lpNSCacheData)HeapAlloc( GetProcessHeap(), HEAP_ZERO_MEMORY,
sizeof( *lpCacheNode ) );
lpCacheNode = HeapAlloc( GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof( *lpCacheNode ) );
if( lpCacheNode == NULL )
{
@ -133,10 +132,7 @@ void NS_AddRemoteComputerAsNameServer( LPCVOID lpcNSAddrHdr,
dwHdrSize );
CopyMemory( lpCacheNode->lpNSAddrHdr, lpcNSAddrHdr, dwHdrSize );
lpCacheNode->data = (LPDPSESSIONDESC2)HeapAlloc( GetProcessHeap(),
HEAP_ZERO_MEMORY,
sizeof( *(lpCacheNode->data) ) );
lpCacheNode->data = HeapAlloc( GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof( *(lpCacheNode->data) ) );
if( lpCacheNode->data == NULL )
{
@ -283,9 +279,7 @@ void NS_InvalidateSessionCache( LPVOID lpNSInfo )
/* Create and initialize a session cache */
BOOL NS_InitializeSessionCache( LPVOID* lplpNSInfo )
{
lpNSCache lpCache = (lpNSCache)HeapAlloc( GetProcessHeap(),
HEAP_ZERO_MEMORY,
sizeof( *lpCache ) );
lpNSCache lpCache = HeapAlloc( GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof( *lpCache ) );
*lplpNSInfo = lpCache;

View File

@ -299,7 +299,7 @@ HDC WINAPI CreateEnhMetaFileW(
if (!(dc = DC_AllocDC( &EMFDRV_Funcs, ENHMETAFILE_DC_MAGIC ))) return 0;
physDev = (EMFDRV_PDEVICE *)HeapAlloc(GetProcessHeap(),0,sizeof(*physDev));
physDev = HeapAlloc(GetProcessHeap(),0,sizeof(*physDev));
if (!physDev) {
GDI_FreeObject( dc->hSelf, dc );
return 0;

View File

@ -1664,7 +1664,7 @@ BOOL WINAPI ExtTextOutA( HDC hdc, INT x, INT y, UINT flags,
if (lpDx) {
unsigned int i = 0, j = 0;
lpDxW = (LPINT)HeapAlloc( GetProcessHeap(), 0, wlen*sizeof(INT));
lpDxW = HeapAlloc( GetProcessHeap(), 0, wlen*sizeof(INT));
while(i < count) {
if(IsDBCSLeadByteEx(codepage, str[i])) {
lpDxW[j++] = lpDx[i] + lpDx[i+1];

View File

@ -482,8 +482,7 @@ BOOL16 WINAPI Polygon16( HDC16 hdc, const POINT16* pt, INT16 count )
{
register int i;
BOOL ret;
LPPOINT pt32 = (LPPOINT)HeapAlloc( GetProcessHeap(), 0,
count*sizeof(POINT) );
LPPOINT pt32 = HeapAlloc( GetProcessHeap(), 0, count*sizeof(POINT) );
if (!pt32) return FALSE;
for (i=count;i--;)
@ -504,8 +503,7 @@ BOOL16 WINAPI Polyline16( HDC16 hdc, const POINT16* pt, INT16 count )
{
register int i;
BOOL16 ret;
LPPOINT pt32 = (LPPOINT)HeapAlloc( GetProcessHeap(), 0,
count*sizeof(POINT) );
LPPOINT pt32 = HeapAlloc( GetProcessHeap(), 0, count*sizeof(POINT) );
if (!pt32) return FALSE;
for (i=count;i--;)
@ -1879,7 +1877,7 @@ BOOL16 WINAPI ExtTextOut16( HDC16 hdc, INT16 x, INT16 y, UINT16 flags,
LPINT lpdx32 = NULL;
if (lpDx) {
lpdx32 = (LPINT)HeapAlloc( GetProcessHeap(),0, sizeof(INT)*count );
lpdx32 = HeapAlloc( GetProcessHeap(),0, sizeof(INT)*count );
if(lpdx32 == NULL) return FALSE;
for (i=count;i--;) lpdx32[i]=lpDx[i];
}
@ -2246,14 +2244,14 @@ BOOL16 WINAPI PolyPolygon16( HDC16 hdc, const POINT16* pt, const INT16* counts,
nrpts=0;
for (i=polygons;i--;)
nrpts+=counts[i];
pt32 = (LPPOINT)HeapAlloc( GetProcessHeap(), 0, sizeof(POINT)*nrpts);
pt32 = HeapAlloc( GetProcessHeap(), 0, sizeof(POINT)*nrpts);
if(pt32 == NULL) return FALSE;
for (i=nrpts;i--;)
{
pt32[i].x = pt[i].x;
pt32[i].y = pt[i].y;
}
counts32 = (LPINT)HeapAlloc( GetProcessHeap(), 0, polygons*sizeof(INT) );
counts32 = HeapAlloc( GetProcessHeap(), 0, polygons*sizeof(INT) );
if(counts32 == NULL) {
HeapFree( GetProcessHeap(), 0, pt32 );
return FALSE;
@ -2609,8 +2607,7 @@ BOOL16 WINAPI PolyBezier16( HDC16 hdc, const POINT16* lppt, INT16 cPoints )
{
int i;
BOOL16 ret;
LPPOINT pt32 = (LPPOINT)HeapAlloc( GetProcessHeap(), 0,
cPoints*sizeof(POINT) );
LPPOINT pt32 = HeapAlloc( GetProcessHeap(), 0, cPoints*sizeof(POINT) );
if(!pt32) return FALSE;
for (i=cPoints;i--;)
{
@ -2630,7 +2627,7 @@ BOOL16 WINAPI PolyBezierTo16( HDC16 hdc, const POINT16* lppt, INT16 cPoints )
{
int i;
BOOL16 ret;
LPPOINT pt32 = (LPPOINT)HeapAlloc( GetProcessHeap(), 0,
LPPOINT pt32 = HeapAlloc( GetProcessHeap(), 0,
cPoints*sizeof(POINT) );
if(!pt32) return FALSE;
for (i=cPoints;i--;)

View File

@ -156,7 +156,7 @@ INT MFDRV_StretchDIBits( PHYSDEV dev, INT xDst, INT yDst, INT widthDst,
info->bmiHeader.biBitCount );
len = sizeof(METARECORD) + 10 * sizeof(WORD) + infosize + imagesize;
mr = (METARECORD *)HeapAlloc( GetProcessHeap(), 0, len );
mr = HeapAlloc( GetProcessHeap(), 0, len );
if(!mr) return 0;
mr->rdSize = len / 2;
@ -198,7 +198,7 @@ INT MFDRV_SetDIBitsToDevice( PHYSDEV dev, INT xDst, INT yDst, DWORD cx,
info->bmiHeader.biBitCount );
len = sizeof(METARECORD) + 8 * sizeof(WORD) + infosize + imagesize;
mr = (METARECORD *)HeapAlloc( GetProcessHeap(), 0, len );
mr = HeapAlloc( GetProcessHeap(), 0, len );
if(!mr) return 0;
mr->rdSize = len / 2;

View File

@ -154,7 +154,7 @@ MFDRV_Polyline( PHYSDEV dev, const POINT* pt, INT count )
LPPOINT16 pt16;
BOOL16 ret;
pt16 = (LPPOINT16)HeapAlloc( GetProcessHeap(), 0, sizeof(POINT16)*count );
pt16 = HeapAlloc( GetProcessHeap(), 0, sizeof(POINT16)*count );
if(!pt16) return FALSE;
for (i=count;i--;)
{
@ -178,7 +178,7 @@ MFDRV_Polygon( PHYSDEV dev, const POINT* pt, INT count )
LPPOINT16 pt16;
BOOL16 ret;
pt16 = (LPPOINT16) HeapAlloc( GetProcessHeap(), 0, sizeof(POINT16)*count );
pt16 = HeapAlloc( GetProcessHeap(), 0, sizeof(POINT16)*count );
if(!pt16) return FALSE;
for (i=count;i--;)
{
@ -211,10 +211,8 @@ MFDRV_PolyPolygon( PHYSDEV dev, const POINT* pt, const INT* counts, UINT polygon
}
/* allocate space for all points */
pt16=(LPPOINT16)HeapAlloc( GetProcessHeap(), 0,
sizeof(POINT16) * totalpoint16 );
pointcounts = (INT16*)HeapAlloc( GetProcessHeap(), 0,
sizeof(INT16) * totalpoint16 );
pt16=HeapAlloc( GetProcessHeap(), 0, sizeof(POINT16) * totalpoint16 );
pointcounts = HeapAlloc( GetProcessHeap(), 0, sizeof(INT16) * totalpoint16 );
/* copy point counts */
for (i=0;i<polygons;i++) {

View File

@ -167,7 +167,7 @@ static DC *MFDRV_AllocMetaFile(void)
if (!(dc = DC_AllocDC( &MFDRV_Funcs, METAFILE_DC_MAGIC ))) return NULL;
physDev = (METAFILEDRV_PDEVICE *)HeapAlloc(GetProcessHeap(),0,sizeof(*physDev));
physDev = HeapAlloc(GetProcessHeap(),0,sizeof(*physDev));
if (!physDev)
{
GDI_FreeObject( dc->hSelf, dc );

View File

@ -398,8 +398,7 @@ BOOL WINAPI ResizePalette(
if( mapping )
{
int *newMap = (int*) HeapReAlloc(GetProcessHeap(), 0,
mapping, cEntries * sizeof(int) );
int *newMap = HeapReAlloc(GetProcessHeap(), 0, mapping, cEntries * sizeof(int) );
if(newMap == NULL)
{
ERR("Can not resize mapping -- out of memory!\n");

View File

@ -1160,8 +1160,7 @@ static BOOL PATH_PathToRegion(GdiPath *pPath, INT nPolyFillMode,
numStrokes++;
/* Allocate memory for number-of-points-in-stroke array */
pNumPointsInStroke=(int *)HeapAlloc( GetProcessHeap(), 0,
sizeof(int) * numStrokes );
pNumPointsInStroke=HeapAlloc( GetProcessHeap(), 0, sizeof(int) * numStrokes );
if(!pNumPointsInStroke)
{
SetLastError(ERROR_NOT_ENOUGH_MEMORY);
@ -1281,12 +1280,10 @@ static BOOL PATH_ReserveEntries(GdiPath *pPath, INT numEntries)
numEntriesToAllocate=numEntries;
/* Allocate new arrays */
pPointsNew=(POINT *)HeapAlloc( GetProcessHeap(), 0,
numEntriesToAllocate * sizeof(POINT) );
pPointsNew=HeapAlloc( GetProcessHeap(), 0, numEntriesToAllocate * sizeof(POINT) );
if(!pPointsNew)
return FALSE;
pFlagsNew=(BYTE *)HeapAlloc( GetProcessHeap(), 0,
numEntriesToAllocate * sizeof(BYTE) );
pFlagsNew=HeapAlloc( GetProcessHeap(), 0, numEntriesToAllocate * sizeof(BYTE) );
if(!pFlagsNew)
{
HeapFree( GetProcessHeap(), 0, pPointsNew );

View File

@ -193,9 +193,7 @@ BOOL WINAPI MapAndLoad(
CloseHandle(hFileMapping);
hFileMapping=NULL;
pLoadedImage = (PLOADED_IMAGE) HeapAlloc(
IMAGEHLP_hHeap, 0, sizeof(LOADED_IMAGE)
);
pLoadedImage = HeapAlloc(IMAGEHLP_hHeap, 0, sizeof(LOADED_IMAGE));
pNtHeader = RtlImageNtHeader(hModule);

View File

@ -1268,14 +1268,14 @@ BOOL WINAPI ImmSetCompositionStringA(
comp_len = MultiByteToWideChar(CP_ACP, 0, lpComp, dwCompLen, NULL, 0);
if (comp_len)
{
CompBuffer = (WCHAR*)HeapAlloc(GetProcessHeap(),0,comp_len * sizeof(WCHAR));
CompBuffer = HeapAlloc(GetProcessHeap(),0,comp_len * sizeof(WCHAR));
MultiByteToWideChar(CP_ACP, 0, lpComp, dwCompLen, CompBuffer, comp_len);
}
read_len = MultiByteToWideChar(CP_ACP, 0, lpRead, dwReadLen, NULL, 0);
if (read_len)
{
ReadBuffer = (WCHAR*)HeapAlloc(GetProcessHeap(),0,read_len * sizeof(WCHAR));
ReadBuffer = HeapAlloc(GetProcessHeap(),0,read_len * sizeof(WCHAR));
MultiByteToWideChar(CP_ACP, 0, lpRead, dwReadLen, ReadBuffer, read_len);
}

View File

@ -165,7 +165,7 @@ static InterfaceNameMap *sizeMap(InterfaceNameMap *map, DWORD numInterfaces)
{
if (!map) {
numInterfaces = max(numInterfaces, INITIAL_INTERFACES_ASSUMED);
map = (InterfaceNameMap *)HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY,
map = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY,
sizeof(InterfaceNameMap) +
(numInterfaces - 1) * sizeof(InterfaceNameMapEntry));
if (map)
@ -173,7 +173,7 @@ static InterfaceNameMap *sizeMap(InterfaceNameMap *map, DWORD numInterfaces)
}
else {
if (map->numAllocated < numInterfaces) {
map = (InterfaceNameMap *)HeapReAlloc(GetProcessHeap(), 0, map,
map = HeapReAlloc(GetProcessHeap(), 0, map,
sizeof(InterfaceNameMap) +
(numInterfaces - 1) * sizeof(InterfaceNameMapEntry));
if (map)
@ -321,7 +321,7 @@ static void enumerateInterfaces(void)
guessedNumInterfaces *= 2;
HeapFree(GetProcessHeap(), 0, ifc.ifc_buf);
ifc.ifc_len = sizeof(struct ifreq) * guessedNumInterfaces;
ifc.ifc_buf = (char *)HeapAlloc(GetProcessHeap(), 0, ifc.ifc_len);
ifc.ifc_buf = HeapAlloc(GetProcessHeap(), 0, ifc.ifc_len);
ret = ioctl(fd, SIOCGIFCONF, &ifc);
} while (ret == 0 &&
ifc.ifc_len == (sizeof(struct ifreq) * guessedNumInterfaces));
@ -429,7 +429,7 @@ InterfaceIndexTable *getInterfaceIndexTable(void)
EnterCriticalSection(&mapCS);
numInterfaces = getNumInterfaces();
ret = (InterfaceIndexTable *)HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY,
ret = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY,
sizeof(InterfaceIndexTable) + (numInterfaces - 1) * sizeof(DWORD));
if (ret) {
ret->numAllocated = numInterfaces;
@ -447,7 +447,7 @@ InterfaceIndexTable *getNonLoopbackInterfaceIndexTable(void)
EnterCriticalSection(&mapCS);
numInterfaces = getNumNonLoopbackInterfaces();
ret = (InterfaceIndexTable *)HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY,
ret = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY,
sizeof(InterfaceIndexTable) + (numInterfaces - 1) * sizeof(DWORD));
if (ret) {
ret->numAllocated = numInterfaces;
@ -716,7 +716,7 @@ DWORD getInterfacePhysicalByName(const char *name, PDWORD len, PBYTE addr,
if (sysctl(mib, 6, NULL, &mibLen, NULL, 0) < 0)
return ERROR_NO_MORE_FILES;
buf = (u_char *)HeapAlloc(GetProcessHeap(), 0, mibLen);
buf = HeapAlloc(GetProcessHeap(), 0, mibLen);
if (!buf)
return ERROR_NOT_ENOUGH_MEMORY;

View File

@ -123,7 +123,7 @@ DWORD WINAPI AllocateAndGetIfTableFromStack(PMIB_IFTABLE *ppIfTable,
ret = GetIfTable(*ppIfTable, &dwSize, bOrder);
if (ret == ERROR_INSUFFICIENT_BUFFER) {
*ppIfTable = (PMIB_IFTABLE)HeapAlloc(heap, flags, dwSize);
*ppIfTable = HeapAlloc(heap, flags, dwSize);
ret = GetIfTable(*ppIfTable, &dwSize, bOrder);
}
}
@ -164,7 +164,7 @@ DWORD WINAPI AllocateAndGetIpAddrTableFromStack(PMIB_IPADDRTABLE *ppIpAddrTable,
ret = GetIpAddrTable(*ppIpAddrTable, &dwSize, bOrder);
if (ret == ERROR_INSUFFICIENT_BUFFER) {
*ppIpAddrTable = (PMIB_IPADDRTABLE)HeapAlloc(heap, flags, dwSize);
*ppIpAddrTable = HeapAlloc(heap, flags, dwSize);
ret = GetIpAddrTable(*ppIpAddrTable, &dwSize, bOrder);
}
}
@ -205,7 +205,7 @@ DWORD WINAPI AllocateAndGetIpForwardTableFromStack(PMIB_IPFORWARDTABLE *
ret = GetIpForwardTable(*ppIpForwardTable, &dwSize, bOrder);
if (ret == ERROR_INSUFFICIENT_BUFFER) {
*ppIpForwardTable = (PMIB_IPFORWARDTABLE)HeapAlloc(heap, flags, dwSize);
*ppIpForwardTable = HeapAlloc(heap, flags, dwSize);
ret = GetIpForwardTable(*ppIpForwardTable, &dwSize, bOrder);
}
}
@ -246,7 +246,7 @@ DWORD WINAPI AllocateAndGetIpNetTableFromStack(PMIB_IPNETTABLE *ppIpNetTable,
ret = GetIpNetTable(*ppIpNetTable, &dwSize, bOrder);
if (ret == ERROR_INSUFFICIENT_BUFFER) {
*ppIpNetTable = (PMIB_IPNETTABLE)HeapAlloc(heap, flags, dwSize);
*ppIpNetTable = HeapAlloc(heap, flags, dwSize);
ret = GetIpNetTable(*ppIpNetTable, &dwSize, bOrder);
}
}
@ -287,7 +287,7 @@ DWORD WINAPI AllocateAndGetTcpTableFromStack(PMIB_TCPTABLE *ppTcpTable,
ret = GetTcpTable(*ppTcpTable, &dwSize, bOrder);
if (ret == ERROR_INSUFFICIENT_BUFFER) {
*ppTcpTable = (PMIB_TCPTABLE)HeapAlloc(heap, flags, dwSize);
*ppTcpTable = HeapAlloc(heap, flags, dwSize);
ret = GetTcpTable(*ppTcpTable, &dwSize, bOrder);
}
}
@ -328,7 +328,7 @@ DWORD WINAPI AllocateAndGetUdpTableFromStack(PMIB_UDPTABLE *ppUdpTable,
ret = GetUdpTable(*ppUdpTable, &dwSize, bOrder);
if (ret == ERROR_INSUFFICIENT_BUFFER) {
*ppUdpTable = (PMIB_UDPTABLE)HeapAlloc(heap, flags, dwSize);
*ppUdpTable = HeapAlloc(heap, flags, dwSize);
ret = GetUdpTable(*ppUdpTable, &dwSize, bOrder);
}
}

View File

@ -565,7 +565,7 @@ RouteTable *getRouteTable(void)
DWORD numRoutes = getNumRoutes();
RouteTable *ret;
ret = (RouteTable *)HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY,
ret = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY,
sizeof(RouteTable) + (numRoutes - 1) * sizeof(RouteEntry));
if (ret) {
FILE *fp;
@ -638,7 +638,7 @@ PMIB_IPNETTABLE getArpTable(void)
DWORD numEntries = getNumArpEntries();
PMIB_IPNETTABLE ret;
ret = (PMIB_IPNETTABLE)HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY,
ret = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY,
sizeof(MIB_IPNETTABLE) + (numEntries - 1) * sizeof(MIB_IPNETROW));
if (ret) {
FILE *fp;
@ -716,7 +716,7 @@ PMIB_UDPTABLE getUdpTable(void)
DWORD numEntries = getNumUdpEntries();
PMIB_UDPTABLE ret;
ret = (PMIB_UDPTABLE)HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY,
ret = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY,
sizeof(MIB_UDPTABLE) + (numEntries - 1) * sizeof(MIB_UDPROW));
if (ret) {
FILE *fp;
@ -768,7 +768,7 @@ PMIB_TCPTABLE getTcpTable(void)
DWORD numEntries = getNumTcpEntries();
PMIB_TCPTABLE ret;
ret = (PMIB_TCPTABLE)HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY,
ret = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY,
sizeof(MIB_TCPTABLE) + (numEntries - 1) * sizeof(MIB_TCPROW));
if (ret) {
FILE *fp;

View File

@ -1961,7 +1961,7 @@ static BOOL COMM_WaitCommEvent(
fd = get_comm_fd( hFile, GENERIC_WRITE );
if (fd < 0) return FALSE;
commio = (async_commio*) HeapAlloc(GetProcessHeap(), 0, sizeof (async_commio));
commio = HeapAlloc(GetProcessHeap(), 0, sizeof (async_commio));
if (!commio)
{
release_comm_fd( hFile, fd );

View File

@ -181,7 +181,7 @@ DWORD WINAPI FormatMessageA(
#define ADD_TO_T(c) do { \
*t++=c;\
if (t-target == talloced) {\
target = (char*)HeapReAlloc(GetProcessHeap(),HEAP_ZERO_MEMORY,target,talloced*2);\
target = HeapReAlloc(GetProcessHeap(),HEAP_ZERO_MEMORY,target,talloced*2);\
t = target+talloced;\
talloced*=2;\
}\
@ -320,7 +320,7 @@ DWORD WINAPI FormatMessageA(
}
talloced = strlen(target)+1;
if (nSize && talloced<nSize) {
target = (char*)HeapReAlloc(GetProcessHeap(),HEAP_ZERO_MEMORY,target,nSize);
target = HeapReAlloc(GetProcessHeap(),HEAP_ZERO_MEMORY,target,nSize);
}
TRACE("-- %s\n",debugstr_a(target));
if (dwFlags & FORMAT_MESSAGE_ALLOCATE_BUFFER) {
@ -398,7 +398,7 @@ DWORD WINAPI FormatMessageW(
#define ADD_TO_T(c) do {\
*t++=c;\
if (t-target == talloced) {\
target = (WCHAR*)HeapReAlloc(GetProcessHeap(),HEAP_ZERO_MEMORY,target,talloced*2*sizeof(WCHAR));\
target = HeapReAlloc(GetProcessHeap(),HEAP_ZERO_MEMORY,target,talloced*2*sizeof(WCHAR));\
t = target+talloced;\
talloced*=2;\
} \
@ -533,7 +533,7 @@ DWORD WINAPI FormatMessageW(
}
talloced = strlenW(target)+1;
if (nSize && talloced<nSize)
target = (WCHAR*)HeapReAlloc(GetProcessHeap(),HEAP_ZERO_MEMORY,target,nSize*sizeof(WCHAR));
target = HeapReAlloc(GetProcessHeap(),HEAP_ZERO_MEMORY,target,nSize*sizeof(WCHAR));
if (dwFlags & FORMAT_MESSAGE_ALLOCATE_BUFFER) {
/* nSize is the MINIMUM size */
DWORD len = strlenW(target) + 1;

View File

@ -594,7 +594,7 @@ HGLOBAL WINAPI GlobalReAlloc(
if(ISPOINTER(hmem))
{
/* reallocate fixed memory */
hnew=(HGLOBAL)HeapReAlloc(GetProcessHeap(), heap_flags, (LPVOID) hmem, size);
hnew=HeapReAlloc(GetProcessHeap(), heap_flags, hmem, size);
}
else
{

View File

@ -1922,7 +1922,7 @@ HANDLE WINAPI Local32Init16( WORD segment, DWORD tableSize,
/* Set up selector table */
nrBlocks = (totSize + 0x7fff) >> 15;
selectorTable = (LPWORD) HeapAlloc( header->heap, 0, nrBlocks * 2 );
selectorTable = HeapAlloc( header->heap, 0, nrBlocks * 2 );
selectorEven = SELECTOR_AllocBlock( base, totSize, WINE_LDT_FLAGS_DATA );
selectorOdd = SELECTOR_AllocBlock( base + 0x8000, totSize - 0x8000, WINE_LDT_FLAGS_DATA );
if ( !selectorTable || !selectorEven || !selectorOdd )

View File

@ -242,7 +242,7 @@ BOOL NE_LoadSegment( NE_MODULE *pModule, WORD segnum )
(char *)pModule + pModule->name_table + 1,
segnum, pSeg->hSeg );
reloc_entries = (struct relocation_entry_s *)HeapAlloc(GetProcessHeap(), 0, count * sizeof(struct relocation_entry_s));
reloc_entries = HeapAlloc(GetProcessHeap(), 0, count * sizeof(struct relocation_entry_s));
if(reloc_entries == NULL) {
WARN("Not enough memory for relocation entries!\n");
goto fail;

View File

@ -97,10 +97,10 @@ static HRSRC16 MapHRsrc32To16( NE_MODULE *pModule, HRSRC hRsrc32, WORD type )
{
if (map->elem)
newElem = (HRSRC_ELEM *)HeapReAlloc( GetProcessHeap(), HEAP_ZERO_MEMORY,
newElem = HeapReAlloc( GetProcessHeap(), HEAP_ZERO_MEMORY,
map->elem, (map->nAlloc + HRSRC_MAP_BLOCKSIZE) * sizeof(HRSRC_ELEM) );
else
newElem = (HRSRC_ELEM *)HeapAlloc( GetProcessHeap(), HEAP_ZERO_MEMORY,
newElem = HeapAlloc( GetProcessHeap(), HEAP_ZERO_MEMORY,
(map->nAlloc + HRSRC_MAP_BLOCKSIZE) * sizeof(HRSRC_ELEM) );
if ( !newElem )

View File

@ -72,10 +72,10 @@ BOOL16 WINAPI NotifyRegister16( HTASK16 htask, FARPROC16 lpfnCallback,
break;
if (i==nrofnotifys) {
if (notifys==NULL)
notifys=(struct notify*)HeapAlloc( GetProcessHeap(), 0,
notifys=HeapAlloc( GetProcessHeap(), 0,
sizeof(struct notify) );
else
notifys=(struct notify*)HeapReAlloc( GetProcessHeap(), 0, notifys,
notifys=HeapReAlloc( GetProcessHeap(), 0, notifys,
sizeof(struct notify)*(nrofnotifys+1));
if (!notifys) return FALSE;
nrofnotifys++;
@ -101,7 +101,7 @@ BOOL16 WINAPI NotifyUnregister16( HTASK16 htask )
if (i==-1)
return FALSE;
memcpy(notifys+i,notifys+(i+1),sizeof(struct notify)*(nrofnotifys-i-1));
notifys=(struct notify*)HeapReAlloc( GetProcessHeap(), 0, notifys,
notifys=HeapReAlloc( GetProcessHeap(), 0, notifys,
(nrofnotifys-1)*sizeof(struct notify));
nrofnotifys--;
return TRUE;

View File

@ -508,8 +508,7 @@ LONG WINAPI LZCopy( HFILE src, HFILE dest )
static LPSTR LZEXPAND_MangleName( LPCSTR fn )
{
char *p;
char *mfn = (char *)HeapAlloc( GetProcessHeap(), 0,
strlen(fn) + 3 ); /* "._" and \0 */
char *mfn = HeapAlloc( GetProcessHeap(), 0, strlen(fn) + 3 ); /* "._" and \0 */
if(mfn == NULL) return NULL;
strcpy( mfn, fn );
if (!(p = strrchr( mfn, '\\' ))) p = mfn;

View File

@ -121,7 +121,7 @@ SCODE WINAPI MAPIAllocateBuffer(ULONG cbSize, LPVOID *lppBuffer)
if (!lppBuffer)
return E_INVALIDARG;
lpBuff = (LPMAPIALLOCBUFFER)HeapAlloc(GetProcessHeap(), 0, cbSize + sizeof(*lpBuff));
lpBuff = HeapAlloc(GetProcessHeap(), 0, cbSize + sizeof(*lpBuff));
if (!lpBuff)
return MAPI_E_NOT_ENOUGH_MEMORY;

View File

@ -137,7 +137,7 @@ static void _tryLoadProvider(PCWSTR provider)
RegQueryValueExW(hKey, szProviderName, NULL, NULL, NULL, &size);
if (size)
{
name = (PWSTR)HeapAlloc(GetProcessHeap(), 0, size);
name = HeapAlloc(GetProcessHeap(), 0, size);
if (RegQueryValueExW(hKey, szProviderName, NULL, &type,
(LPBYTE)name, &size) != ERROR_SUCCESS || type != REG_SZ)
{
@ -242,7 +242,7 @@ void wnetInit(HINSTANCE hInstDll)
RegQueryValueExW(hKey, providerOrder, NULL, NULL, NULL, &size);
if (size)
{
PWSTR providers = (PWSTR)HeapAlloc(GetProcessHeap(), 0, size);
PWSTR providers = HeapAlloc(GetProcessHeap(), 0, size);
if (providers)
{
@ -263,7 +263,7 @@ void wnetInit(HINSTANCE hInstDll)
if (ptr)
numToAllocate++;
}
providerTable = (PWNetProviderTable)
providerTable =
HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY,
sizeof(WNetProviderTable)
+ (numToAllocate - 1) * sizeof(WNetProvider));
@ -274,7 +274,7 @@ void wnetInit(HINSTANCE hInstDll)
entireNetworkLen = LoadStringW(hInstDll,
IDS_ENTIRENETWORK, NULL, 0);
providerTable->entireNetwork = (LPWSTR)HeapAlloc(
providerTable->entireNetwork = HeapAlloc(
GetProcessHeap(), 0, (entireNetworkLen + 1) *
sizeof(WCHAR));
if (providerTable->entireNetwork)
@ -342,8 +342,7 @@ static LPNETRESOURCEW _copyNetResourceForEnumW(LPNETRESOURCEW lpNet)
if (lpNet)
{
ret = (LPNETRESOURCEW)HeapAlloc(GetProcessHeap(), 0,
sizeof(NETRESOURCEW));
ret = HeapAlloc(GetProcessHeap(), 0, sizeof(NETRESOURCEW));
if (ret)
{
size_t len;
@ -353,8 +352,7 @@ static LPNETRESOURCEW _copyNetResourceForEnumW(LPNETRESOURCEW lpNet)
if (lpNet->lpRemoteName)
{
len = strlenW(lpNet->lpRemoteName) + 1;
ret->lpRemoteName = (LPWSTR)HeapAlloc(GetProcessHeap(), 0,
len * sizeof(WCHAR));
ret->lpRemoteName = HeapAlloc(GetProcessHeap(), 0, len * sizeof(WCHAR));
if (ret->lpRemoteName)
strcpyW(ret->lpRemoteName, lpNet->lpRemoteName);
}
@ -376,7 +374,7 @@ static void _freeEnumNetResource(LPNETRESOURCEW lpNet)
static PWNetEnumerator _createNullEnumerator(void)
{
PWNetEnumerator ret = (PWNetEnumerator)HeapAlloc(GetProcessHeap(),
PWNetEnumerator ret = HeapAlloc(GetProcessHeap(),
HEAP_ZERO_MEMORY, sizeof(WNetEnumerator));
if (ret)
@ -387,7 +385,7 @@ static PWNetEnumerator _createNullEnumerator(void)
static PWNetEnumerator _createGlobalEnumeratorW(DWORD dwScope, DWORD dwType,
DWORD dwUsage, LPNETRESOURCEW lpNet)
{
PWNetEnumerator ret = (PWNetEnumerator)HeapAlloc(GetProcessHeap(),
PWNetEnumerator ret = HeapAlloc(GetProcessHeap(),
HEAP_ZERO_MEMORY, sizeof(WNetEnumerator));
if (ret)
@ -410,8 +408,7 @@ static PWNetEnumerator _createProviderEnumerator(DWORD dwScope, DWORD dwType,
ret = NULL;
else
{
ret = (PWNetEnumerator)HeapAlloc(GetProcessHeap(),
HEAP_ZERO_MEMORY, sizeof(WNetEnumerator));
ret = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(WNetEnumerator));
if (ret)
{
ret->enumType = WNET_ENUMERATOR_TYPE_PROVIDER;
@ -428,7 +425,7 @@ static PWNetEnumerator _createProviderEnumerator(DWORD dwScope, DWORD dwType,
static PWNetEnumerator _createContextEnumerator(DWORD dwScope, DWORD dwType,
DWORD dwUsage)
{
PWNetEnumerator ret = (PWNetEnumerator)HeapAlloc(GetProcessHeap(),
PWNetEnumerator ret = HeapAlloc(GetProcessHeap(),
HEAP_ZERO_MEMORY, sizeof(WNetEnumerator));
if (ret)
@ -640,7 +637,7 @@ DWORD WINAPI WNetOpenEnumA( DWORD dwScope, DWORD dwType, DWORD dwUsage,
ret = _thunkNetResourceArrayAToW(lpNet, &count, buf, &size);
if (ret == WN_MORE_DATA)
{
lpNetWide = (LPNETRESOURCEW)HeapAlloc(GetProcessHeap(), 0,
lpNetWide = HeapAlloc(GetProcessHeap(), 0,
size);
if (lpNetWide)
{
@ -1537,7 +1534,7 @@ DWORD WINAPI WNetGetConnectionA( LPCSTR lpLocalName,
if (len)
{
PWSTR wideLocalName = (PWSTR)HeapAlloc(GetProcessHeap(), 0, len * sizeof(WCHAR));
PWSTR wideLocalName = HeapAlloc(GetProcessHeap(), 0, len * sizeof(WCHAR));
if (wideLocalName)
{
@ -1568,7 +1565,7 @@ DWORD WINAPI WNetGetConnectionA( LPCSTR lpLocalName,
}
else if (ret == WN_MORE_DATA)
{
PWSTR wideRemote = (PWSTR)HeapAlloc(GetProcessHeap(), 0,
PWSTR wideRemote = HeapAlloc(GetProcessHeap(), 0,
wideRemoteSize * sizeof(WCHAR));
if (wideRemote)
@ -1862,8 +1859,7 @@ DWORD WINAPI WNetGetNetworkInformationA( LPCSTR lpProvider,
len = MultiByteToWideChar(CP_ACP, 0, lpProvider, -1, NULL, 0);
if (len)
{
LPWSTR wideProvider = (LPWSTR)HeapAlloc(GetProcessHeap(), 0,
len * sizeof(WCHAR));
LPWSTR wideProvider = HeapAlloc(GetProcessHeap(), 0, len * sizeof(WCHAR));
if (wideProvider)
{

View File

@ -244,7 +244,7 @@ PWINE_ACMDRIVERID MSACM_RegisterDriver(LPCWSTR pszDriverAlias, LPCWSTR pszFileNa
TRACE("(%s, %s, %p)\n",
debugstr_w(pszDriverAlias), debugstr_w(pszFileName), hinstModule);
padid = (PWINE_ACMDRIVERID) HeapAlloc(MSACM_hHeap, 0, sizeof(WINE_ACMDRIVERID));
padid = HeapAlloc(MSACM_hHeap, 0, sizeof(WINE_ACMDRIVERID));
padid->obj.dwType = WINE_ACMOBJ_DRIVERID;
padid->obj.pACMDriverID = padid;
padid->pszDriverAlias = NULL;

View File

@ -811,7 +811,7 @@ HPROFILE WINAPI OpenColorProfileW( PPROFILE profile, DWORD access, DWORD sharing
return NULL;
}
iccprofile = (icProfile *)HeapAlloc( GetProcessHeap(), 0, size );
iccprofile = HeapAlloc( GetProcessHeap(), 0, size );
if (!iccprofile)
{
ERR( "Unable to allocate memory for color profile\n" );

View File

@ -318,8 +318,7 @@ IEnumDMO * IEnumDMO_Constructor(
IEnumDMOImpl* lpedmo;
BOOL ret = FALSE;
lpedmo = (IEnumDMOImpl*)HeapAlloc(GetProcessHeap(),
HEAP_ZERO_MEMORY, sizeof(IEnumDMOImpl));
lpedmo = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(IEnumDMOImpl));
if (lpedmo)
{

View File

@ -4377,7 +4377,7 @@ static UINT ACTION_RegisterClassInfo(MSIPACKAGE *package)
HeapFree(GetProcessHeap(),0,argument);
size += (strlenW(package->files[index].TargetPath))*sizeof(WCHAR);
argument = (LPWSTR)HeapAlloc(GetProcessHeap(),0,size+sizeof(WCHAR));
argument = HeapAlloc(GetProcessHeap(),0,size+sizeof(WCHAR));
strcpyW(argument,package->files[index].TargetPath);
if (deformated)
{

View File

@ -542,7 +542,7 @@ static UINT HANDLE_CustomType2(MSIPACKAGE *package, LPCWSTR source,
if (deformated)
len += strlenW(deformated);
cmd = (WCHAR*)HeapAlloc(GetProcessHeap(),0,sizeof(WCHAR)*len);
cmd = HeapAlloc(GetProcessHeap(),0,sizeof(WCHAR)*len);
strcpyW(cmd,tmp_file);
if (deformated)
@ -595,7 +595,7 @@ static UINT HANDLE_CustomType18(MSIPACKAGE *package, LPCWSTR source,
len += strlenW(deformated);
len += 2;
cmd = (WCHAR*)HeapAlloc(GetProcessHeap(),0,len * sizeof(WCHAR));
cmd = HeapAlloc(GetProcessHeap(),0,len * sizeof(WCHAR));
strcpyW(cmd, package->files[index].TargetPath);
if (deformated)
@ -692,7 +692,7 @@ static UINT HANDLE_CustomType50(MSIPACKAGE *package, LPCWSTR source,
if (deformated)
len += strlenW(deformated);
cmd = (WCHAR*)HeapAlloc(GetProcessHeap(),0,sizeof(WCHAR)*len);
cmd = HeapAlloc(GetProcessHeap(),0,sizeof(WCHAR)*len);
strcpyW(cmd,prop);
if (deformated)

View File

@ -565,7 +565,7 @@ MSVCRT_FILE* MSVCRT__popen(const char* command, const char* mode)
comSpecLen = GetEnvironmentVariableA(comSpec, NULL, 0);
if (!comSpecLen)
comSpecLen = strlen(wcmd) + 1;
cmdcopy = (char *)HeapAlloc(GetProcessHeap(), 0, comSpecLen + strlen(cmdFlag)
cmdcopy = HeapAlloc(GetProcessHeap(), 0, comSpecLen + strlen(cmdFlag)
+ strlen(command));
if (!GetEnvironmentVariableA(comSpec, cmdcopy, comSpecLen))
strcpy(cmdcopy, wcmd);

View File

@ -1046,7 +1046,7 @@ HANDLE VFWAPI ICImageDecompress(
cbHdr = ICDecompressGetFormatSize(hic,lpbiIn);
if ( cbHdr < sizeof(BITMAPINFOHEADER) )
goto err;
pHdr = (BYTE*)HeapAlloc(GetProcessHeap(),0,cbHdr+sizeof(RGBQUAD)*256);
pHdr = HeapAlloc(GetProcessHeap(),0,cbHdr+sizeof(RGBQUAD)*256);
if ( pHdr == NULL )
goto err;
ZeroMemory( pHdr, cbHdr+sizeof(RGBQUAD)*256 );

View File

@ -57,7 +57,7 @@ struct NBCmdQueue *NBCmdQueueCreate(HANDLE heap)
if (heap == NULL)
heap = GetProcessHeap();
queue = (struct NBCmdQueue *)HeapAlloc(heap, 0, sizeof(struct NBCmdQueue));
queue = HeapAlloc(heap, 0, sizeof(struct NBCmdQueue));
if (queue)
{
queue->heap = heap;

View File

@ -102,8 +102,7 @@ struct NBNameCache *NBNameCacheCreate(HANDLE heap, DWORD entryExpireTimeMS)
if (!heap)
heap = GetProcessHeap();
cache = (struct NBNameCache *)HeapAlloc(heap, 0,
sizeof(struct NBNameCache));
cache = HeapAlloc(heap, 0, sizeof(struct NBNameCache));
if (cache)
{
cache->heap = heap;
@ -134,8 +133,7 @@ BOOL NBNameCacheAddEntry(struct NBNameCache *cache, NBNameCacheEntry *entry)
}
else
{
NBNameCacheNode *newNode = (NBNameCacheNode *)HeapAlloc(
cache->heap, 0, sizeof(NBNameCacheNode));
NBNameCacheNode *newNode = HeapAlloc(cache->heap, 0, sizeof(NBNameCacheNode));
if (newNode)
{
newNode->expireTime = GetTickCount() +

View File

@ -409,7 +409,7 @@ static BOOL NetBTFindNameAnswerCallback(void *pVoid, WORD answerCount,
{
if (queryData->cacheEntry == NULL)
{
queryData->cacheEntry = (NBNameCacheEntry *)HeapAlloc(
queryData->cacheEntry = HeapAlloc(
GetProcessHeap(), 0, sizeof(NBNameCacheEntry) +
(answerCount - 1) * sizeof(DWORD));
if (queryData->cacheEntry)
@ -546,7 +546,7 @@ static UCHAR NetBTinetResolve(const UCHAR name[NCBNAMSZ],
if (addr != INADDR_NONE)
{
*cacheEntry = (NBNameCacheEntry *)HeapAlloc(GetProcessHeap(),
*cacheEntry = HeapAlloc(GetProcessHeap(),
0, sizeof(NBNameCacheEntry));
if (*cacheEntry)
{
@ -571,7 +571,7 @@ static UCHAR NetBTinetResolve(const UCHAR name[NCBNAMSZ],
;
if (host->h_addr_list && host->h_addr_list[0])
{
*cacheEntry = (NBNameCacheEntry *)HeapAlloc(
*cacheEntry = HeapAlloc(
GetProcessHeap(), 0, sizeof(NBNameCacheEntry) +
(i - 1) * sizeof(DWORD));
if (*cacheEntry)
@ -1043,7 +1043,7 @@ static UCHAR NetBTCall(void *adapt, PNCB ncb, void **sess)
closesocket(fd);
else
{
NetBTSession *session = (NetBTSession *)HeapAlloc(
NetBTSession *session = HeapAlloc(
GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(NetBTSession));
if (session)
@ -1279,8 +1279,7 @@ static UCHAR NetBTRegisterAdapter(PMIB_IPADDRROW ipRow)
if (!ipRow) return NRC_BADDR;
adapter = (NetBTAdapter *)HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY,
sizeof(NetBTAdapter));
adapter = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(NetBTAdapter));
if (adapter)
{
memcpy(&adapter->ipr, ipRow, sizeof(MIB_IPADDRROW));
@ -1357,10 +1356,9 @@ static UCHAR NetBTEnum(void)
DWORD numIPAddrs = (size - sizeof(MIB_IPADDRTABLE)) /
sizeof(MIB_IPADDRROW) + 1;
ipAddrs = (PMIB_IPADDRTABLE)HeapAlloc(GetProcessHeap(),
HEAP_ZERO_MEMORY, size);
ipAddrs = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, size);
if (ipAddrs)
coalesceTable = (PMIB_IPADDRTABLE)HeapAlloc(GetProcessHeap(),
coalesceTable = HeapAlloc(GetProcessHeap(),
HEAP_ZERO_MEMORY, sizeof(MIB_IPADDRTABLE) +
(min(numIPAddrs, MAX_LANA + 1) - 1) * sizeof(MIB_IPADDRROW));
if (ipAddrs && coalesceTable)

View File

@ -84,11 +84,11 @@ static UCHAR nbResizeAdapterTable(UCHAR newSize)
UCHAR ret;
if (gNBTable.table)
gNBTable.table = (NetBIOSAdapter *)HeapReAlloc(GetProcessHeap(),
gNBTable.table = HeapReAlloc(GetProcessHeap(),
HEAP_ZERO_MEMORY, gNBTable.table,
newSize * sizeof(NetBIOSAdapter));
else
gNBTable.table = (NetBIOSAdapter *)HeapAlloc(GetProcessHeap(),
gNBTable.table = HeapAlloc(GetProcessHeap(),
HEAP_ZERO_MEMORY, newSize * sizeof(NetBIOSAdapter));
if (gNBTable.table)
{
@ -430,11 +430,11 @@ static UCHAR nbResizeAdapter(NetBIOSAdapter *adapter, UCHAR sessionsLen)
NetBIOSSession *newSessions;
if (adapter->sessions)
newSessions = (NetBIOSSession *)HeapReAlloc(GetProcessHeap(),
newSessions = HeapReAlloc(GetProcessHeap(),
HEAP_ZERO_MEMORY, adapter->sessions, sessionsLen *
sizeof(NetBIOSSession));
else
newSessions = (NetBIOSSession *)HeapAlloc(GetProcessHeap(),
newSessions = HeapAlloc(GetProcessHeap(),
HEAP_ZERO_MEMORY, sessionsLen * sizeof(NetBIOSSession));
if (newSessions)
{

View File

@ -235,9 +235,8 @@ BSTR WINAPI SysAllocStringLen(const OLECHAR *str, unsigned int len)
* buffer for the character count and an extra character at the
* end for the NULL.
*/
newBuffer = (DWORD*)HeapAlloc(GetProcessHeap(),
0,
bufferSize + sizeof(WCHAR) + sizeof(DWORD));
newBuffer = HeapAlloc(GetProcessHeap(), 0,
bufferSize + sizeof(WCHAR) + sizeof(DWORD));
/*
* If the memory allocation failed, return a null pointer.
@ -350,9 +349,8 @@ BSTR WINAPI SysAllocStringByteLen(LPCSTR str, UINT len)
* buffer for the character count and an extra character at the
* end for the NULL.
*/
newBuffer = (DWORD*)HeapAlloc(GetProcessHeap(),
0,
len + sizeof(WCHAR) + sizeof(DWORD));
newBuffer = HeapAlloc(GetProcessHeap(), 0,
len + sizeof(WCHAR) + sizeof(DWORD));
/*
* If the memory allocation failed, return a null pointer.

View File

@ -1501,7 +1501,7 @@ static int serializeBMP(HBITMAP hBitmap, void ** ppBuffer, unsigned int * pLengt
BITMAPFILEHEADER * pFileHeader;
BITMAPINFO * pInfoHeader;
pInfoBitmap = (BITMAPINFO *)HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY,
pInfoBitmap = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY,
sizeof(BITMAPINFOHEADER) + 256 * sizeof(RGBQUAD));
/* Find out bitmap size and padded length */
@ -1511,8 +1511,7 @@ static int serializeBMP(HBITMAP hBitmap, void ** ppBuffer, unsigned int * pLengt
/* Fetch bitmap palette & pixel data */
pPixelData = (unsigned char *)HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY,
pInfoBitmap->bmiHeader.biSizeImage);
pPixelData = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, pInfoBitmap->bmiHeader.biSizeImage);
GetDIBits(hDC, hBitmap, 0, pInfoBitmap->bmiHeader.biHeight, pPixelData, pInfoBitmap, DIB_RGB_COLORS);
/* Calculate the total length required for the BMP data */
@ -1530,7 +1529,7 @@ static int serializeBMP(HBITMAP hBitmap, void ** ppBuffer, unsigned int * pLengt
sizeof(BITMAPINFOHEADER) +
iNumPaletteEntries * sizeof(RGBQUAD) +
pInfoBitmap->bmiHeader.biSizeImage;
*ppBuffer = (void *)HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, *pLength);
*ppBuffer = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, *pLength);
/* Fill the BITMAPFILEHEADER */
pFileHeader = (BITMAPFILEHEADER *)(*ppBuffer);
@ -1569,7 +1568,7 @@ static int serializeIcon(HICON hIcon, void ** ppBuffer, unsigned int * pLength)
unsigned char * pIconData = NULL;
unsigned int iDataSize = 0;
pInfoBitmap = (BITMAPINFO *)HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(BITMAPINFOHEADER) + 256 * sizeof(RGBQUAD));
pInfoBitmap = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(BITMAPINFOHEADER) + 256 * sizeof(RGBQUAD));
/* Find out icon size */
hDC = GetDC(0);
@ -1603,7 +1602,7 @@ static int serializeIcon(HICON hIcon, void ** ppBuffer, unsigned int * pLength)
*/
/* Let's start with one CURSORICONFILEDIR and one CURSORICONFILEDIRENTRY */
iDataSize += 3 * sizeof(WORD) + sizeof(CURSORICONFILEDIRENTRY) + sizeof(BITMAPINFOHEADER);
pIconData = (unsigned char *)HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, iDataSize);
pIconData = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, iDataSize);
/* Fill out the CURSORICONFILEDIR */
pIconDir = (CURSORICONFILEDIR *)pIconData;
@ -1651,7 +1650,7 @@ static int serializeIcon(HICON hIcon, void ** ppBuffer, unsigned int * pLength)
iDataSize += pIconBitmapHeader->biHeight * iLengthScanLineMask;
pIconBitmapHeader->biSizeImage += pIconBitmapHeader->biHeight * iLengthScanLineMask;
pIconBitmapHeader->biHeight *= 2;
pIconData = (unsigned char *)HeapReAlloc(GetProcessHeap(), 0, pIconData, iDataSize);
pIconData = HeapReAlloc(GetProcessHeap(), 0, pIconData, iDataSize);
pIconEntry = (CURSORICONFILEDIRENTRY *)(pIconData + 3 * sizeof(WORD));
pIconBitmapHeader = (BITMAPINFOHEADER *)(pIconData + 3 * sizeof(WORD) + sizeof(CURSORICONFILEDIRENTRY));
pIconEntry->dwDIBSize = iDataSize - (3 * sizeof(WORD) + sizeof(CURSORICONFILEDIRENTRY));

View File

@ -4687,7 +4687,7 @@ DispCallFunc(
dump_Variant(prgpvarg[i]);
argsize += _argsize(prgvt[i]);
}
args = (DWORD*)HeapAlloc(GetProcessHeap(),0,sizeof(DWORD)*argsize);
args = HeapAlloc(GetProcessHeap(),0,sizeof(DWORD)*argsize);
args[0] = (DWORD)pvInstance; /* this is the fake IDispatch interface pointer */
argspos = 1;
for (i=0;i<cActuals;i++) {
@ -4760,8 +4760,8 @@ static HRESULT WINAPI ITypeInfo_fnInvoke(
}
}
args = (DWORD*)HeapAlloc(GetProcessHeap(),0,sizeof(DWORD)*numargs);
args2 = (DWORD*)HeapAlloc(GetProcessHeap(),0,sizeof(DWORD)*numargs2);
args = HeapAlloc(GetProcessHeap(),0,sizeof(DWORD)*numargs);
args2 = HeapAlloc(GetProcessHeap(),0,sizeof(DWORD)*numargs2);
args[0] = (DWORD)pIUnk;
argspos = 1; args2pos = 0;

View File

@ -375,7 +375,7 @@ static BOOL UIINSERTOBJECTDLG_PopulateObjectTypes(InsertObjectDlgInfo* pdlgInfo)
len = MAX_PATH;
if (ERROR_SUCCESS == RegQueryValueA(hkey, NULL, keydesc, &len))
{
CLSID* lpclsid = (CLSID*) HeapAlloc(GetProcessHeap(), 0, sizeof(CLSID));
CLSID* lpclsid = HeapAlloc(GetProcessHeap(), 0, sizeof(CLSID));
memcpy(lpclsid, &clsid, sizeof(CLSID));
len = SendMessageA(pdlgInfo->hwndObjTypeLB, LB_ADDSTRING, 0, (LPARAM)keydesc);

View File

@ -3048,7 +3048,7 @@ HRESULT FILTERGRAPH_create(IUnknown *pUnkOuter, LPVOID *ppObj) {
if( pUnkOuter )
return CLASS_E_NOAGGREGATION;
fimpl = (IFilterGraphImpl *) HeapAlloc(GetProcessHeap(), 0, sizeof(*fimpl));
fimpl = HeapAlloc(GetProcessHeap(), 0, sizeof(*fimpl));
fimpl->IGraphBuilder_vtbl = &IGraphBuilder_VTable;
fimpl->IMediaControl_vtbl = &IMediaControl_VTable;
fimpl->IMediaSeeking_vtbl = &IMediaSeeking_VTable;

View File

@ -20,8 +20,8 @@
#include "editstr.h"
#define ALLOC_OBJ(type) (type *)HeapAlloc(me_heap, 0, sizeof(type))
#define ALLOC_N_OBJ(type, count) (type *)HeapAlloc(me_heap, 0, (count)*sizeof(type))
#define ALLOC_OBJ(type) HeapAlloc(me_heap, 0, sizeof(type))
#define ALLOC_N_OBJ(type, count) HeapAlloc(me_heap, 0, (count)*sizeof(type))
#define FREE_OBJ(ptr) HeapFree(me_heap, 0, ptr)
/* style.c */

View File

@ -330,11 +330,11 @@ static RPC_STATUS RPC_UuidGetNodeAddress(BYTE *address)
DWORD status = RPC_S_OK;
ULONG buflen = sizeof(IP_ADAPTER_INFO);
PIP_ADAPTER_INFO adapter = (PIP_ADAPTER_INFO)HeapAlloc(GetProcessHeap(), 0, buflen);
PIP_ADAPTER_INFO adapter = HeapAlloc(GetProcessHeap(), 0, buflen);
if (GetAdaptersInfo(adapter, &buflen) == ERROR_BUFFER_OVERFLOW) {
HeapFree(GetProcessHeap(), 0, adapter);
adapter = (IP_ADAPTER_INFO *)HeapAlloc(GetProcessHeap(), 0, buflen);
adapter = HeapAlloc(GetProcessHeap(), 0, buflen);
}
if (GetAdaptersInfo(adapter, &buflen) == NO_ERROR) {

View File

@ -197,8 +197,7 @@ static int grow_handle_table(HANDLETABLE *lpTable)
newIEntries = lpTable->iEntries + TABLE_SIZE_INCREMENT;
newEntries = (HANDLETABLEENTRY*)HeapAlloc(GetProcessHeap(), 0,
sizeof(HANDLETABLEENTRY)*newIEntries);
newEntries = HeapAlloc(GetProcessHeap(), 0, sizeof(HANDLETABLEENTRY)*newIEntries);
if (!newEntries)
return 0;
@ -435,7 +434,7 @@ unsigned int new_object(HANDLETABLE *lpTable, size_t cbSize, DWORD dwType, DESTR
if (ppObject)
*ppObject = NULL;
pObject = (OBJECTHDR*)HeapAlloc(GetProcessHeap(), 0, cbSize);
pObject = HeapAlloc(GetProcessHeap(), 0, cbSize);
if (!pObject)
return (unsigned int)INVALID_HANDLE_VALUE;

View File

@ -379,7 +379,7 @@ BOOL import_public_key_impl(CONST BYTE *pbSrc, KEY_CONTEXT *pKeyContext, DWORD d
return FALSE;
}
pbTemp = (BYTE*)HeapAlloc(GetProcessHeap(), 0, dwKeyLen);
pbTemp = HeapAlloc(GetProcessHeap(), 0, dwKeyLen);
if (!pbTemp) return FALSE;
memcpy(pbTemp, pbSrc, dwKeyLen);

View File

@ -426,7 +426,7 @@ static inline const PROV_ENUMALGS_EX* get_algid_info(HCRYPTPROV hProv, ALG_ID al
* Use free_data_blob to release resources occupied by copy_data_blob.
*/
static inline BOOL copy_data_blob(PCRYPT_DATA_BLOB dst, CONST PCRYPT_DATA_BLOB src) {
dst->pbData = (BYTE*)HeapAlloc(GetProcessHeap(), 0, src->cbData);
dst->pbData = HeapAlloc(GetProcessHeap(), 0, src->cbData);
if (!dst->pbData) {
SetLastError(NTE_NO_MEMORY);
return FALSE;
@ -457,7 +457,7 @@ static inline BOOL concat_data_blobs(PCRYPT_DATA_BLOB dst, CONST PCRYPT_DATA_BLO
CONST PCRYPT_DATA_BLOB src2)
{
dst->cbData = src1->cbData + src2->cbData;
dst->pbData = (BYTE*)HeapAlloc(GetProcessHeap(), 0, dst->cbData);
dst->pbData = HeapAlloc(GetProcessHeap(), 0, dst->cbData);
if (!dst->pbData) {
SetLastError(NTE_NO_MEMORY);
return FALSE;
@ -523,13 +523,13 @@ static inline void free_hmac_info(PHMAC_INFO hmac_info) {
*/
static BOOL copy_hmac_info(PHMAC_INFO *dst, PHMAC_INFO src) {
if (!src) return FALSE;
*dst = (PHMAC_INFO)HeapAlloc(GetProcessHeap(), 0, sizeof(HMAC_INFO));
*dst = HeapAlloc(GetProcessHeap(), 0, sizeof(HMAC_INFO));
if (!*dst) return FALSE;
memcpy(*dst, src, sizeof(HMAC_INFO));
(*dst)->pbInnerString = NULL;
(*dst)->pbOuterString = NULL;
if ((*dst)->cbInnerString == 0) (*dst)->cbInnerString = RSAENH_HMAC_DEF_PAD_LEN;
(*dst)->pbInnerString = (BYTE*)HeapAlloc(GetProcessHeap(), 0, (*dst)->cbInnerString);
(*dst)->pbInnerString = HeapAlloc(GetProcessHeap(), 0, (*dst)->cbInnerString);
if (!(*dst)->pbInnerString) {
free_hmac_info(*dst);
return FALSE;
@ -539,7 +539,7 @@ static BOOL copy_hmac_info(PHMAC_INFO *dst, PHMAC_INFO src) {
else
memset((*dst)->pbInnerString, RSAENH_HMAC_DEF_IPAD_CHAR, RSAENH_HMAC_DEF_PAD_LEN);
if ((*dst)->cbOuterString == 0) (*dst)->cbOuterString = RSAENH_HMAC_DEF_PAD_LEN;
(*dst)->pbOuterString = (BYTE*)HeapAlloc(GetProcessHeap(), 0, (*dst)->cbOuterString);
(*dst)->pbOuterString = HeapAlloc(GetProcessHeap(), 0, (*dst)->cbOuterString);
if (!(*dst)->pbOuterString) {
free_hmac_info(*dst);
return FALSE;
@ -631,7 +631,7 @@ static inline void update_hash(CRYPTHASH *pCryptHash, CONST BYTE *pbData, DWORD
break;
case CALG_MAC:
pbTemp = (BYTE*)HeapAlloc(GetProcessHeap(), 0, dwDataLen);
pbTemp = HeapAlloc(GetProcessHeap(), 0, dwDataLen);
if (!pbTemp) return;
memcpy(pbTemp, pbData, dwDataLen);
RSAENH_CPEncrypt(pCryptHash->hProv, pCryptHash->hKey, (HCRYPTHASH)NULL, FALSE, 0,
@ -893,7 +893,7 @@ static void destroy_key_container(OBJECTHDR *pObjectHdr)
if (RSAENH_CPExportKey(pKey->hProv, pKeyContainer->hKeyExchangeKeyPair, 0,
PRIVATEKEYBLOB, 0, 0, &dwLen))
{
pbKey = (BYTE*)HeapAlloc(GetProcessHeap(), 0, dwLen);
pbKey = HeapAlloc(GetProcessHeap(), 0, dwLen);
if (pbKey)
{
if (RSAENH_CPExportKey(pKey->hProv, pKeyContainer->hKeyExchangeKeyPair, 0,
@ -914,7 +914,7 @@ static void destroy_key_container(OBJECTHDR *pObjectHdr)
if (RSAENH_CPExportKey(pKey->hProv, pKeyContainer->hSignatureKeyPair, 0,
PRIVATEKEYBLOB, 0, 0, &dwLen))
{
pbKey = (BYTE*)HeapAlloc(GetProcessHeap(), 0, dwLen);
pbKey = HeapAlloc(GetProcessHeap(), 0, dwLen);
if (pbKey)
{
if (RSAENH_CPExportKey(pKey->hProv, pKeyContainer->hSignatureKeyPair, 0,
@ -1048,7 +1048,7 @@ static HCRYPTPROV read_key_container(PCHAR pszContainerName, DWORD dwFlags, PVTa
if (RegQueryValueExA(hKey, "KeyExchangeKeyPair", 0, &dwValueType, NULL, &dwLen) ==
ERROR_SUCCESS)
{
pbKey = (BYTE*)HeapAlloc(GetProcessHeap(), 0, dwLen);
pbKey = HeapAlloc(GetProcessHeap(), 0, dwLen);
if (pbKey)
{
if (RegQueryValueExA(hKey, "KeyExchangeKeyPair", 0, &dwValueType, pbKey, &dwLen) ==
@ -1064,7 +1064,7 @@ static HCRYPTPROV read_key_container(PCHAR pszContainerName, DWORD dwFlags, PVTa
if (RegQueryValueExA(hKey, "SignatureKeyPair", 0, &dwValueType, NULL, &dwLen) ==
ERROR_SUCCESS)
{
pbKey = (BYTE*)HeapAlloc(GetProcessHeap(), 0, dwLen);
pbKey = HeapAlloc(GetProcessHeap(), 0, dwLen);
if (pbKey)
{
if (RegQueryValueExA(hKey, "SignatureKeyPair", 0, &dwValueType, pbKey, &dwLen) ==
@ -2271,7 +2271,7 @@ BOOL WINAPI RSAENH_CPImportKey(HCRYPTPROV hProv, CONST BYTE *pbData, DWORD dwDat
return FALSE;
}
pbDecrypted = (BYTE*)HeapAlloc(GetProcessHeap(), 0, pPubKey->dwBlockLen);
pbDecrypted = HeapAlloc(GetProcessHeap(), 0, pPubKey->dwBlockLen);
if (!pbDecrypted) return FALSE;
encrypt_block_impl(pPubKey->aiAlgid, &pPubKey->context, pbKeyStream, pbDecrypted,
RSAENH_DECRYPT);

View File

@ -184,7 +184,7 @@ static SecurePackageTable *_resizePackageTable(SecurePackageTable *table,
{
if (table->numAllocated < howBig)
{
ret = (SecurePackageTable *)HeapReAlloc(GetProcessHeap(), 0, table,
ret = HeapReAlloc(GetProcessHeap(), 0, table,
sizeof(SecurePackageTable) + (howBig - 1) * sizeof(SecurePackage));
if (ret)
{
@ -199,7 +199,7 @@ static SecurePackageTable *_resizePackageTable(SecurePackageTable *table,
{
DWORD numAllocated = (howBig > 1 ? howBig : 1);
ret = (SecurePackageTable *)HeapAlloc(GetProcessHeap(), 0,
ret = HeapAlloc(GetProcessHeap(), 0,
sizeof(SecurePackageTable) +
(numAllocated - 1) * sizeof(SecurePackage));
if (ret)
@ -225,7 +225,7 @@ static SecureProviderTable *_resizeProviderTable(SecureProviderTable *table,
{
if (table->numAllocated < howBig)
{
ret = (SecureProviderTable *)HeapReAlloc(GetProcessHeap(), 0, table,
ret = HeapReAlloc(GetProcessHeap(), 0, table,
sizeof(SecureProviderTable) +
(howBig - 1) * sizeof(SecureProvider));
if (ret)
@ -241,7 +241,7 @@ static SecureProviderTable *_resizeProviderTable(SecureProviderTable *table,
{
DWORD numAllocated = (howBig > 1 ? howBig : 1);
ret = (SecureProviderTable *)HeapAlloc(GetProcessHeap(), 0,
ret = HeapAlloc(GetProcessHeap(), 0,
sizeof(SecureProviderTable) +
(numAllocated - 1) * sizeof(SecureProvider));
if (ret)

View File

@ -859,8 +859,7 @@ static HDEVINFO SETUP_CreateSerialDeviceList(void)
size *= 2;
if (devices != buf)
HeapFree(GetProcessHeap(), 0, devices);
devices = (LPWSTR)HeapAlloc(GetProcessHeap(), 0,
size * sizeof(WCHAR));
devices = HeapAlloc(GetProcessHeap(), 0, size * sizeof(WCHAR));
if (!devices)
failed = TRUE;
else

View File

@ -58,7 +58,7 @@ HDSKSPC WINAPI SetupCreateDiskSpaceListW(PVOID Reserved1, DWORD Reserved2, UINT
if (rc == 0)
return NULL;
list = (LPDISKSPACELIST)HeapAlloc(GetProcessHeap(),0,sizeof(DISKSPACELIST));
list = HeapAlloc(GetProcessHeap(),0,sizeof(DISKSPACELIST));
list->dwDriveCount = 0;

View File

@ -1601,7 +1601,7 @@ static HRESULT WINAPI IShellLinkA_fnResolve(IShellLinkA * iface, HWND hwnd, DWOR
hr = SHELL_GetPathFromIDListW(This->pPidl, buffer, MAX_PATH);
if (SUCCEEDED(hr) && *buffer) {
This->sPath = (LPWSTR) HeapAlloc(GetProcessHeap(), 0, (lstrlenW(buffer)+1)*sizeof(WCHAR));
This->sPath = HeapAlloc(GetProcessHeap(), 0, (lstrlenW(buffer)+1)*sizeof(WCHAR));
if (!This->sPath)
return E_OUTOFMEMORY;
@ -1613,7 +1613,7 @@ static HRESULT WINAPI IShellLinkA_fnResolve(IShellLinkA * iface, HWND hwnd, DWOR
}
if (!This->sIcoPath && This->sPath) {
This->sIcoPath = (LPWSTR) HeapAlloc(GetProcessHeap(), 0, (lstrlenW(This->sPath)+1)*sizeof(WCHAR));
This->sIcoPath = HeapAlloc(GetProcessHeap(), 0, (lstrlenW(This->sPath)+1)*sizeof(WCHAR));
if (!This->sIcoPath)
return E_OUTOFMEMORY;
@ -2021,7 +2021,7 @@ static HRESULT WINAPI IShellLinkW_fnResolve(IShellLinkW * iface, HWND hwnd, DWOR
hr = SHELL_GetPathFromIDListW(This->pPidl, buffer, MAX_PATH);
if (SUCCEEDED(hr) && *buffer) {
This->sPath = (LPWSTR) HeapAlloc(GetProcessHeap(), 0, (lstrlenW(buffer)+1)*sizeof(WCHAR));
This->sPath = HeapAlloc(GetProcessHeap(), 0, (lstrlenW(buffer)+1)*sizeof(WCHAR));
if (!This->sPath)
return E_OUTOFMEMORY;
@ -2033,7 +2033,7 @@ static HRESULT WINAPI IShellLinkW_fnResolve(IShellLinkW * iface, HWND hwnd, DWOR
}
if (!This->sIcoPath && This->sPath) {
This->sIcoPath = (LPWSTR) HeapAlloc(GetProcessHeap(), 0, (lstrlenW(This->sPath)+1)*sizeof(WCHAR));
This->sIcoPath = HeapAlloc(GetProcessHeap(), 0, (lstrlenW(This->sPath)+1)*sizeof(WCHAR));
if (!This->sIcoPath)
return E_OUTOFMEMORY;

View File

@ -352,7 +352,7 @@ static IStream *IStream_Create(LPCWSTR lpszPath, HANDLE hFile, DWORD dwMode)
{
ISHFileStream* fileStream;
fileStream = (ISHFileStream*)HeapAlloc(GetProcessHeap(), 0, sizeof(ISHFileStream));
fileStream = HeapAlloc(GetProcessHeap(), 0, sizeof(ISHFileStream));
if (fileStream)
{

View File

@ -133,7 +133,7 @@ LONG WINAPI SHRegOpenUSKeyW(LPCWSTR Path, REGSAM AccessType, HUSKEY hRelativeUSK
*phNewUSKey = NULL;
/* Create internal HUSKEY */
hKey = (LPSHUSKEY)HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*hKey));
hKey = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*hKey));
lstrcpynW(hKey->lpszPath, Path, sizeof(hKey->lpszPath));
if (hRelativeUSKey)

View File

@ -343,7 +343,7 @@ static IStream *IStream_Create(HKEY hKey, LPBYTE pbBuffer, DWORD dwLength)
{
ISHRegStream* regStream;
regStream = (ISHRegStream*)HeapAlloc(GetProcessHeap(), 0, sizeof(ISHRegStream));
regStream = HeapAlloc(GetProcessHeap(), 0, sizeof(ISHRegStream));
if (regStream)
{
@ -493,7 +493,7 @@ IStream * WINAPI SHCreateMemStream(LPBYTE lpbData, DWORD dwDataLen)
if (lpbData)
{
LPBYTE lpbDup = (LPBYTE)HeapAlloc(GetProcessHeap(), 0, dwDataLen);
LPBYTE lpbDup = HeapAlloc(GetProcessHeap(), 0, dwDataLen);
if (lpbDup)
{

View File

@ -2546,7 +2546,7 @@ INT WINAPI SHUnicodeToAnsiCP(UINT CodePage, LPCWSTR lpSrcStr, LPSTR lpDstStr,
if (nWideCharCount < len - 1)
{
mem = (LPSTR)HeapAlloc(GetProcessHeap(), 0, *lpiLen);
mem = HeapAlloc(GetProcessHeap(), 0, *lpiLen);
if (!mem)
return 0;
@ -2577,7 +2577,7 @@ INT WINAPI SHUnicodeToAnsiCP(UINT CodePage, LPCWSTR lpSrcStr, LPSTR lpDstStr,
reqLen = WideCharToMultiByte(CodePage, 0, lpSrcStr, len, NULL, 0, NULL, NULL);
if (reqLen)
{
mem = (LPSTR)HeapAlloc(GetProcessHeap(), 0, reqLen);
mem = HeapAlloc(GetProcessHeap(), 0, reqLen);
if (mem)
{
reqLen = WideCharToMultiByte(CodePage, 0, lpSrcStr, len, mem,

View File

@ -238,7 +238,7 @@ HRESULT WINAPI ParseURLW(LPCWSTR x, PARSEDURLW *y)
/* see if known scheme and return indicator number */
len = WideCharToMultiByte(0, 0, y->pszProtocol, y->cchProtocol, 0, 0, 0, 0);
cmpstr = (LPSTR)HeapAlloc(GetProcessHeap(), 0, len);
cmpstr = HeapAlloc(GetProcessHeap(), 0, len);
WideCharToMultiByte(0, 0, y->pszProtocol, y->cchProtocol, cmpstr, len, 0, 0);
y->nScheme = URL_SCHEME_UNKNOWN;
inet_pro = shlwapi_schemes;
@ -517,7 +517,7 @@ HRESULT WINAPI UrlCombineA(LPCSTR pszBase, LPCSTR pszRelative,
if(!pszBase || !pszRelative || !pcchCombined)
return E_INVALIDARG;
base = (LPWSTR) HeapAlloc(GetProcessHeap(), 0,
base = HeapAlloc(GetProcessHeap(), 0,
(3*INTERNET_MAX_URL_LENGTH) * sizeof(WCHAR));
relative = base + INTERNET_MAX_URL_LENGTH;
combined = relative + INTERNET_MAX_URL_LENGTH;

View File

@ -45,7 +45,7 @@ BOOL TTYDRV_PALETTE_Initialize(void)
TRACE("(void)\n");
COLOR_sysPal = (PALETTEENTRY *) HeapAlloc(GetProcessHeap(), 0, sizeof(PALETTEENTRY) * palette_size);
COLOR_sysPal = HeapAlloc(GetProcessHeap(), 0, sizeof(PALETTEENTRY) * palette_size);
if(COLOR_sysPal == NULL) {
WARN("No memory to create system palette!\n");
return FALSE;

View File

@ -362,7 +362,7 @@ UINT WDML_Initialize(LPDWORD pidInst, PFNCALLBACK pfnCallback,
/* grab enough heap for one control struct - not really necessary for re-initialise
* but allows us to use same validation routines */
pInstance = (WDML_INSTANCE*)HeapAlloc(GetProcessHeap(), 0, sizeof(WDML_INSTANCE));
pInstance = HeapAlloc(GetProcessHeap(), 0, sizeof(WDML_INSTANCE));
if (pInstance == NULL)
{
/* catastrophe !! warn user & abort */
@ -958,7 +958,7 @@ static void WDML_InsertHSZNode(WDML_INSTANCE* pInstance, HSZ hsz)
HSZNode* pNew = NULL;
/* Create a new node for this HSZ.
*/
pNew = (HSZNode*)HeapAlloc(GetProcessHeap(), 0, sizeof(HSZNode));
pNew = HeapAlloc(GetProcessHeap(), 0, sizeof(HSZNode));
if (pNew != NULL)
{
pNew->hsz = hsz;
@ -1622,7 +1622,7 @@ WDML_SERVER* WDML_AddServer(WDML_INSTANCE* pInstance, HSZ hszService, HSZ hszTop
WCHAR buf1[256];
WCHAR buf2[256];
pServer = (WDML_SERVER*)HeapAlloc(GetProcessHeap(), 0, sizeof(WDML_SERVER));
pServer = HeapAlloc(GetProcessHeap(), 0, sizeof(WDML_SERVER));
if (pServer == NULL) return NULL;
pServer->hszService = hszService;

View File

@ -215,7 +215,7 @@ static BYTE * ICO_GetIconDirectory( LPBYTE peimage, LPicoICONDIR* lplpiID, ULONG
/* allocate the phony ICONDIR structure */
*uSize = lpcid->idCount * sizeof(CURSORICONDIRENTRY) + HEADER_SIZE;
if( (lpID = (CURSORICONDIR*)HeapAlloc(GetProcessHeap(),0, *uSize) ))
if( (lpID = HeapAlloc(GetProcessHeap(),0, *uSize) ))
{
/* copy the header */
lpID->idReserved = lpcid->idReserved;

View File

@ -746,7 +746,7 @@ static BOOL LISTBOX_SetTabStops( LB_DESCR *descr, INT count, LPINT tabs, BOOL sh
return TRUE;
}
/* FIXME: count = 1 */
if (!(descr->tabs = (INT *)HeapAlloc( GetProcessHeap(), 0,
if (!(descr->tabs = HeapAlloc( GetProcessHeap(), 0,
descr->nb_tabs * sizeof(INT) )))
return FALSE;
if (short_ints)

View File

@ -647,7 +647,7 @@ DWORD WINAPI FormatMessage16(
#define ADD_TO_T(c) \
*t++=c;\
if (t-target == talloced) {\
target = (char*)HeapReAlloc(GetProcessHeap(),HEAP_ZERO_MEMORY,target,talloced*2);\
target = HeapReAlloc(GetProcessHeap(),HEAP_ZERO_MEMORY,target,talloced*2);\
t = target+talloced;\
talloced*=2;\
}
@ -752,7 +752,7 @@ DWORD WINAPI FormatMessage16(
}
talloced = strlen(target)+1;
if (nSize && talloced<nSize) {
target = (char*)HeapReAlloc(GetProcessHeap(),HEAP_ZERO_MEMORY,target,nSize);
target = HeapReAlloc(GetProcessHeap(),HEAP_ZERO_MEMORY,target,nSize);
}
TRACE("-- %s\n",debugstr_a(target));
if (dwFlags & FORMAT_MESSAGE_ALLOCATE_BUFFER) {

View File

@ -84,7 +84,7 @@ BOOL WINAPI VNBT_DeviceIoControl(DWORD dwIoControlCode,
error = GetNetworkParams(NULL, &size);
if (ERROR_BUFFER_OVERFLOW == error)
{
PFIXED_INFO fixedInfo = (PFIXED_INFO)HeapAlloc( GetProcessHeap(), 0, size);
PFIXED_INFO fixedInfo = HeapAlloc( GetProcessHeap(), 0, size);
error = GetNetworkParams(fixedInfo, &size);
if (NO_ERROR == error)

View File

@ -368,7 +368,7 @@ ASPI_ExecScsiCmd(SRB_ExecSCSICmd *lpPRB)
if (HOST_TO_TARGET(lpPRB)) {
/* send header, command, and then data */
in_len = SCSI_OFF + lpPRB->SRB_CDBLen + lpPRB->SRB_BufLen;
sg_hd = (struct sg_header *) HeapAlloc(GetProcessHeap(), 0, in_len);
sg_hd = HeapAlloc(GetProcessHeap(), 0, in_len);
memset(sg_hd, 0, SCSI_OFF);
memcpy(sg_hd + 1, &lpPRB->CDBByte[0], lpPRB->SRB_CDBLen);
if (lpPRB->SRB_BufLen) {
@ -378,20 +378,20 @@ ASPI_ExecScsiCmd(SRB_ExecSCSICmd *lpPRB)
else {
/* send header and command - no data */
in_len = SCSI_OFF + lpPRB->SRB_CDBLen;
sg_hd = (struct sg_header *) HeapAlloc(GetProcessHeap(), 0, in_len);
sg_hd = HeapAlloc(GetProcessHeap(), 0, in_len);
memset(sg_hd, 0, SCSI_OFF);
memcpy(sg_hd + 1, &lpPRB->CDBByte[0], lpPRB->SRB_CDBLen);
}
if (TARGET_TO_HOST(lpPRB)) {
out_len = SCSI_OFF + lpPRB->SRB_BufLen;
sg_reply_hdr = (struct sg_header *) HeapAlloc(GetProcessHeap(), 0, out_len);
sg_reply_hdr = HeapAlloc(GetProcessHeap(), 0, out_len);
memset(sg_reply_hdr, 0, SCSI_OFF);
sg_hd->reply_len = out_len;
}
else {
out_len = SCSI_OFF;
sg_reply_hdr = (struct sg_header *) HeapAlloc(GetProcessHeap(), 0, out_len);
sg_reply_hdr = HeapAlloc(GetProcessHeap(), 0, out_len);
memset(sg_reply_hdr, 0, SCSI_OFF);
sg_hd->reply_len = out_len;
}

View File

@ -590,7 +590,7 @@ HRESULT WINAPI IWineD3DSurfaceImpl_LoadTexture(IWineD3DSurface *iface, GLenum gl
*/
UINT i;
PALETTEENTRY* pal = This->resource.wineD3DDevice->palettes[This->resource.wineD3DDevice->currentPalette];
VOID* surface = (VOID*) HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, This->currentDesc.Width * This->currentDesc.Height * sizeof(DWORD));
VOID* surface = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, This->currentDesc.Width * This->currentDesc.Height * sizeof(DWORD));
BYTE* dst = (BYTE*) surface;
BYTE* src = (BYTE*) This->allocatedMemory;

View File

@ -57,8 +57,7 @@ INT PSDRV_GlyphListInit()
TRACE("glyphList will initially hold %i glyph names\n", i);
glyphList = (GLYPHNAME **) HeapAlloc(PSDRV_Heap, 0,
i * sizeof(GLYPHNAME *));
glyphList = HeapAlloc(PSDRV_Heap, 0, i * sizeof(GLYPHNAME *));
if (glyphList == NULL)
{
ERR("Failed to allocate %i bytes of memory\n", i * sizeof(GLYPHNAME *));
@ -98,7 +97,7 @@ inline static INT GlyphListInsert(LPCSTR szName, INT index)
{
GLYPHNAME **newGlyphList;
newGlyphList = (GLYPHNAME **) HeapReAlloc(PSDRV_Heap, 0, glyphList,
newGlyphList = HeapReAlloc(PSDRV_Heap, 0, glyphList,
(glyphListSize + GLYPHLIST_ALLOCSIZE) * sizeof(GLYPHNAME *));
if (newGlyphList == NULL)
{

View File

@ -322,16 +322,14 @@ BOOL PSDRV_CreateDC( HDC hdc, PSDRV_PDEVICE **pdev, LPCWSTR driver, LPCWSTR devi
return FALSE;
}
physDev = (PSDRV_PDEVICE *)HeapAlloc( PSDRV_Heap, HEAP_ZERO_MEMORY,
sizeof(*physDev) );
physDev = HeapAlloc( PSDRV_Heap, HEAP_ZERO_MEMORY, sizeof(*physDev) );
if (!physDev) return FALSE;
*pdev = physDev;
physDev->hdc = hdc;
physDev->pi = pi;
physDev->Devmode = (PSDRV_DEVMODEA *)HeapAlloc( PSDRV_Heap, 0,
sizeof(PSDRV_DEVMODEA) );
physDev->Devmode = HeapAlloc( PSDRV_Heap, 0, sizeof(PSDRV_DEVMODEA) );
if(!physDev->Devmode) {
HeapFree( PSDRV_Heap, 0, physDev );
return FALSE;

View File

@ -235,8 +235,8 @@ INT PSDRV_WriteFeature(HANDLE16 hJob, char *feature, char *value,
char *invocation)
{
char *buf = (char *)HeapAlloc( PSDRV_Heap, 0, sizeof(psbeginfeature) +
strlen(feature) + strlen(value));
char *buf = HeapAlloc( PSDRV_Heap, 0, sizeof(psbeginfeature) +
strlen(feature) + strlen(value));
sprintf(buf, psbeginfeature, feature, value);
@ -263,8 +263,8 @@ INT PSDRV_WriteHeader( PSDRV_PDEVICE *physDev, LPCSTR title )
TRACE("'%s'\n", debugstr_a(title));
buf = (char *)HeapAlloc( PSDRV_Heap, 0, sizeof(psheader) +
(title ? strlen(title) : 0) + 30 );
buf = HeapAlloc( PSDRV_Heap, 0, sizeof(psheader) +
(title ? strlen(title) : 0) + 30 );
if(!buf) {
WARN("HeapAlloc failed\n");
return 0;
@ -343,7 +343,7 @@ INT PSDRV_WriteFooter( PSDRV_PDEVICE *physDev )
{
char *buf;
buf = (char *)HeapAlloc( PSDRV_Heap, 0, sizeof(psfooter) + 100 );
buf = HeapAlloc( PSDRV_Heap, 0, sizeof(psfooter) + 100 );
if(!buf) {
WARN("HeapAlloc failed\n");
return 0;
@ -384,7 +384,7 @@ INT PSDRV_WriteNewPage( PSDRV_PDEVICE *physDev )
sprintf(name, "%d", physDev->job.PageNo);
buf = (char *)HeapAlloc( PSDRV_Heap, 0, sizeof(psnewpage) + 200 );
buf = HeapAlloc( PSDRV_Heap, 0, sizeof(psnewpage) + 200 );
if(!buf) {
WARN("HeapAlloc failed\n");
return 0;
@ -481,7 +481,7 @@ BOOL PSDRV_WriteSetFont(PSDRV_PDEVICE *physDev, const char *name, INT size, INT
{
char *buf;
buf = (char *)HeapAlloc( PSDRV_Heap, 0, sizeof(pssetfont) +
buf = HeapAlloc( PSDRV_Heap, 0, sizeof(pssetfont) +
strlen(name) + 40);
if(!buf) {

View File

@ -2316,7 +2316,7 @@ BOOL WINAPI InternetCheckConnectionW(LPCWSTR lpszUrl, DWORD dwFlags, DWORD dwRes
BOOL rc;
len = WideCharToMultiByte(CP_ACP, 0, lpszUrl, -1, NULL, 0, NULL, NULL);
if (!(szUrl = (CHAR *)HeapAlloc(GetProcessHeap(), 0, len*sizeof(CHAR))))
if (!(szUrl = HeapAlloc(GetProcessHeap(), 0, len*sizeof(CHAR))))
return FALSE;
WideCharToMultiByte(CP_ACP, 0, lpszUrl, -1, szUrl, len, NULL, NULL);
rc = InternetCheckConnectionA((LPCSTR)szUrl, dwFlags, dwReserved);

View File

@ -284,7 +284,7 @@ static BOOL URLCacheContainers_AddContainer(LPCWSTR cache_prefix, LPCWSTR path,
pContainer->hMapping = NULL;
pContainer->file_size = 0;
pContainer->path = (LPWSTR)HeapAlloc(GetProcessHeap(), 0, (path_len + 1) * sizeof(WCHAR));
pContainer->path = HeapAlloc(GetProcessHeap(), 0, (path_len + 1) * sizeof(WCHAR));
if (!pContainer->path)
{
HeapFree(GetProcessHeap(), 0, pContainer);
@ -2194,7 +2194,7 @@ HANDLE WINAPI RetrieveUrlCacheEntryStreamA(
return FALSE;
/* allocate handle storage space */
pStream = (STREAM_HANDLE *)HeapAlloc(GetProcessHeap(), 0, sizeof(STREAM_HANDLE) + strlen(lpszUrlName) * sizeof(CHAR));
pStream = HeapAlloc(GetProcessHeap(), 0, sizeof(STREAM_HANDLE) + strlen(lpszUrlName) * sizeof(CHAR));
if (!pStream)
{
CloseHandle(hFile);

View File

@ -1219,7 +1219,7 @@ static DWORD MIDI_mciRecord(UINT wDevID, DWORD dwFlags, LPMCI_RECORD_PARMS lpPar
end = lpParms->dwTo;
TRACE("MCI_TO=%d \n", end);
}
midiHdr.lpData = (LPSTR) HeapAlloc(GetProcessHeap(), 0, 1200);
midiHdr.lpData = HeapAlloc(GetProcessHeap(), 0, 1200);
if (!midiHdr.lpData)
return MCIERR_OUT_OF_MEMORY;
midiHdr.dwBufferLength = 1024;

View File

@ -2818,7 +2818,7 @@ static HRESULT WINAPI IDsDriverImpl_CreateSoundBuffer(PIDSDRIVER iface,
if (dwFlags & (DSBCAPS_CTRLFREQUENCY | DSBCAPS_CTRLPAN))
return DSERR_CONTROLUNAVAIL;
*ippdsdb = (IDsDriverBufferImpl*)HeapAlloc(GetProcessHeap(),0,sizeof(IDsDriverBufferImpl));
*ippdsdb = HeapAlloc(GetProcessHeap(),0,sizeof(IDsDriverBufferImpl));
if (*ippdsdb == NULL)
return DSERR_OUTOFMEMORY;
(*ippdsdb)->lpVtbl = &dsdbvt;
@ -2878,7 +2878,7 @@ static DWORD wodDsCreate(UINT wDevID, PIDSDRIVER* drv)
return MMSYSERR_NOTSUPPORTED;
}
*idrv = (IDsDriverImpl*)HeapAlloc(GetProcessHeap(),0,sizeof(IDsDriverImpl));
*idrv = HeapAlloc(GetProcessHeap(),0,sizeof(IDsDriverImpl));
if (!*idrv)
return MMSYSERR_NOMEM;
(*idrv)->lpVtbl = &dsdvt;

View File

@ -290,7 +290,7 @@ static DWORD WINAPI midRecThread(LPVOID arg)
while(!end_thread) {
TRACE("Thread loop\n");
npfd = snd_seq_poll_descriptors_count(midiSeq, POLLIN);
pfd = (struct pollfd *)HeapAlloc(GetProcessHeap(), 0, npfd * sizeof(struct pollfd));
pfd = HeapAlloc(GetProcessHeap(), 0, npfd * sizeof(struct pollfd));
snd_seq_poll_descriptors(midiSeq, pfd, npfd, POLLIN);
/* Check if an event is present */

View File

@ -1538,7 +1538,7 @@ static HRESULT WINAPI IDsDriverImpl_CreateSoundBuffer(PIDSDRIVER iface,
if (dwFlags & (DSBCAPS_CTRLFREQUENCY | DSBCAPS_CTRLPAN))
return DSERR_CONTROLUNAVAIL;
*ippdsdb = (IDsDriverBufferImpl*)HeapAlloc(GetProcessHeap(),0,sizeof(IDsDriverBufferImpl));
*ippdsdb = HeapAlloc(GetProcessHeap(),0,sizeof(IDsDriverBufferImpl));
if (*ippdsdb == NULL)
return DSERR_OUTOFMEMORY;
(*ippdsdb)->lpVtbl = &dsdbvt;
@ -1618,7 +1618,7 @@ static DWORD wodDsCreate(UINT wDevID, PIDSDRIVER* drv)
return MMSYSERR_NOTSUPPORTED;
}
*idrv = (IDsDriverImpl*)HeapAlloc(GetProcessHeap(),0,sizeof(IDsDriverImpl));
*idrv = HeapAlloc(GetProcessHeap(),0,sizeof(IDsDriverImpl));
if (!*idrv)
return MMSYSERR_NOMEM;
(*idrv)->lpVtbl = &dsdvt;

View File

@ -1239,7 +1239,7 @@ static HRESULT WINAPI IDsCaptureDriverPropertySetImpl_Create(
IDsCaptureDriverPropertySetImpl * dscdps;
TRACE("(%p,%p)\n",dscdb,pdscdps);
dscdps = (IDsCaptureDriverPropertySetImpl*)HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(dscdps));
dscdps = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(dscdps));
if (dscdps == NULL) {
WARN("out of memory\n");
return DSERR_OUTOFMEMORY;
@ -1262,7 +1262,7 @@ static HRESULT WINAPI IDsCaptureDriverNotifyImpl_Create(
IDsCaptureDriverNotifyImpl * dscdn;
TRACE("(%p,%p)\n",dscdb,pdscdn);
dscdn = (IDsCaptureDriverNotifyImpl*)HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(dscdn));
dscdn = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(dscdn));
if (dscdn == NULL) {
WARN("out of memory\n");
return DSERR_OUTOFMEMORY;
@ -1291,7 +1291,7 @@ DWORD widDsCreate(UINT wDevID, PIDSCDRIVER* drv)
return MMSYSERR_NOTSUPPORTED;
}
*idrv = (IDsCaptureDriverImpl*)HeapAlloc(GetProcessHeap(),HEAP_ZERO_MEMORY,sizeof(IDsCaptureDriverImpl));
*idrv = HeapAlloc(GetProcessHeap(),HEAP_ZERO_MEMORY,sizeof(IDsCaptureDriverImpl));
if (!*idrv)
return MMSYSERR_NOMEM;
(*idrv)->lpVtbl = &dscdvt;

View File

@ -786,7 +786,7 @@ static HRESULT WINAPI DSD_CreatePrimaryBuffer(PIDSDRIVER iface,
if (dwFlags & (DSBCAPS_CTRLFREQUENCY | DSBCAPS_CTRLPAN))
return DSERR_CONTROLUNAVAIL;
*ippdsdb = (IDsDriverBufferImpl*)HeapAlloc(GetProcessHeap(),HEAP_ZERO_MEMORY,sizeof(IDsDriverBufferImpl));
*ippdsdb = HeapAlloc(GetProcessHeap(),HEAP_ZERO_MEMORY,sizeof(IDsDriverBufferImpl));
if (*ippdsdb == NULL)
return DSERR_OUTOFMEMORY;
(*ippdsdb)->lpVtbl = &dsdbvt;
@ -894,7 +894,7 @@ static HRESULT WINAPI IDsDriverPropertySetImpl_Create(
IDsDriverPropertySetImpl * dsdps;
TRACE("(%p,%p)\n",dsdb,pdsdps);
dsdps = (IDsDriverPropertySetImpl*)HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(dsdps));
dsdps = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(dsdps));
if (dsdps == NULL) {
WARN("out of memory\n");
return DSERR_OUTOFMEMORY;
@ -917,7 +917,7 @@ static HRESULT WINAPI IDsDriverNotifyImpl_Create(
IDsDriverNotifyImpl * dsdn;
TRACE("(%p,%p)\n",dsdb,pdsdn);
dsdn = (IDsDriverNotifyImpl*)HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(dsdn));
dsdn = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(dsdn));
if (dsdn == NULL) {
WARN("out of memory\n");
@ -947,7 +947,7 @@ DWORD wodDsCreate(UINT wDevID, PIDSDRIVER* drv)
return MMSYSERR_NOTSUPPORTED;
}
*idrv = (IDsDriverImpl*)HeapAlloc(GetProcessHeap(),HEAP_ZERO_MEMORY,sizeof(IDsDriverImpl));
*idrv = HeapAlloc(GetProcessHeap(),HEAP_ZERO_MEMORY,sizeof(IDsDriverImpl));
if (!*idrv)
return MMSYSERR_NOMEM;
(*idrv)->lpVtbl = &dsdvt;

View File

@ -437,7 +437,7 @@ UINT WINAPI mixerGetControlDetailsA(HMIXEROBJ hmix, LPMIXERCONTROLDETAILS lpmcdA
if (lpmcdA->u.cMultipleItems != 0) {
size *= lpmcdA->u.cMultipleItems;
}
pDetailsW = (MIXERCONTROLDETAILS_LISTTEXTW *)HeapAlloc(GetProcessHeap(), 0, size);
pDetailsW = HeapAlloc(GetProcessHeap(), 0, size);
lpmcdA->paDetails = pDetailsW;
lpmcdA->cbDetails = sizeof(MIXERCONTROLDETAILS_LISTTEXTW);
/* set up lpmcd->paDetails */

View File

@ -1936,7 +1936,7 @@ INT WINAPI WSAIoctl(SOCKET s,
}
else if (apiReturn == ERROR_BUFFER_OVERFLOW)
{
PIP_ADAPTER_INFO table = (PIP_ADAPTER_INFO)HeapAlloc(GetProcessHeap(),0,size);
PIP_ADAPTER_INFO table = HeapAlloc(GetProcessHeap(),0,size);
if (table)
{

View File

@ -717,8 +717,8 @@ static void BITBLT_StretchImage( XImage *srcImage, XImage *dstImage,
widthDst = abs(widthDst);
heightDst = abs(heightDst);
if (!(rowSrc = (int *)HeapAlloc( GetProcessHeap(), 0,
(widthSrc+widthDst)*sizeof(int) ))) return;
if (!(rowSrc = HeapAlloc( GetProcessHeap(), 0,
(widthSrc+widthDst)*sizeof(int) ))) return;
rowDst = rowSrc + widthSrc;
/* When stretching, all modes are the same, and DELETESCANS is faster */

View File

@ -551,8 +551,7 @@ static WINE_CLIPFORMAT *X11DRV_CLIPBOARD_InsertClipboardFormat(LPCWSTR FormatNam
LPWINE_CLIPFORMAT lpNewFormat;
/* allocate storage for new format entry */
lpNewFormat = (LPWINE_CLIPFORMAT) HeapAlloc(GetProcessHeap(),
0, sizeof(WINE_CLIPFORMAT));
lpNewFormat = HeapAlloc(GetProcessHeap(), 0, sizeof(WINE_CLIPFORMAT));
if(lpNewFormat == NULL)
{
@ -673,8 +672,7 @@ static BOOL X11DRV_CLIPBOARD_InsertClipboardData(UINT wFormat, HANDLE16 hData16,
}
else
{
lpData = (LPWINE_CLIPDATA) HeapAlloc(GetProcessHeap(),
0, sizeof(WINE_CLIPDATA));
lpData = HeapAlloc(GetProcessHeap(), 0, sizeof(WINE_CLIPDATA));
lpData->wFormatID = wFormat;
lpData->hData16 = hData16; /* 0 is legal, see WM_RENDERFORMAT */
@ -1346,7 +1344,7 @@ HANDLE X11DRV_CLIPBOARD_ExportXAString(LPWINE_CLIPDATA lpData, LPDWORD lpBytes)
/* remove carriage returns */
lpstr = (char*)HeapAlloc( GetProcessHeap(), HEAP_ZERO_MEMORY, size-- );
lpstr = HeapAlloc( GetProcessHeap(), HEAP_ZERO_MEMORY, size-- );
if(lpstr == NULL) goto done;
for(i = 0,j = 0; i < size && text[i]; i++ )
@ -1867,7 +1865,7 @@ static BOOL X11DRV_CLIPBOARD_ReadSelection(LPWINE_CLIPFORMAT lpData, Window w, A
TRACE("Retrieving %ld bytes\n", reqlen);
val = (char*)HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, reqlen);
val = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, reqlen);
/* Read property in 4K blocks */
for (total = 0, val_cnt = 0; remain;)
@ -2664,7 +2662,7 @@ static Atom X11DRV_SelectionRequest_TARGETS( Display *display, Window requestor,
TRACE(" found %ld formats\n", cTargets);
/* Allocate temp buffer */
targets = (Atom*)HeapAlloc( GetProcessHeap(), 0, cTargets * sizeof(Atom));
targets = HeapAlloc( GetProcessHeap(), 0, cTargets * sizeof(Atom));
if(targets == NULL)
return None;

View File

@ -351,9 +351,8 @@ int *X11DRV_DIB_BuildColorMap( X11DRV_PDEVICE *physDev, WORD coloruse, WORD dept
/* just so CopyDIBSection doesn't have to create an identity palette */
if (coloruse == (WORD)-1) colorPtr = NULL;
if (!(colorMapping = (int *)HeapAlloc(GetProcessHeap(), 0,
colors * sizeof(int) )))
return NULL;
if (!(colorMapping = HeapAlloc(GetProcessHeap(), 0, colors * sizeof(int) )))
return NULL;
*nColors = colors;
return X11DRV_DIB_GenColorMap( physDev, colorMapping, coloruse, depth,

View File

@ -321,7 +321,7 @@ static BOOL X11DRV_PALETTE_BuildPrivateMap( const PALETTEENTRY *sys_pal_template
XColor color;
int i;
if((COLOR_sysPal = (PALETTEENTRY*)HeapAlloc(GetProcessHeap(), 0, sizeof(PALETTEENTRY)*palette_size)) == NULL) {
if((COLOR_sysPal = HeapAlloc(GetProcessHeap(), 0, sizeof(PALETTEENTRY)*palette_size)) == NULL) {
WARN("Can not allocate system palette\n");
return FALSE;
}
@ -507,7 +507,7 @@ static BOOL X11DRV_PALETTE_BuildSharedMap( const PALETTEENTRY *sys_pal_template
* X guidelines and does binary search...
*/
if((pixDynMapping = (unsigned long*)HeapAlloc(GetProcessHeap(), 0, sizeof(long)*palette_size)) == NULL) {
if((pixDynMapping = HeapAlloc(GetProcessHeap(), 0, sizeof(long)*palette_size)) == NULL) {
WARN("Out of memory while building system palette.\n");
return FALSE;
}
@ -576,7 +576,7 @@ static BOOL X11DRV_PALETTE_BuildSharedMap( const PALETTEENTRY *sys_pal_template
(X11DRV_PALETTE_PaletteFlags & X11DRV_PALETTE_VIRTUAL || !(X11DRV_PALETTE_PaletteFlags & X11DRV_PALETTE_FIXED)) )
? NB_RESERVED_COLORS/2 : -1;
COLOR_sysPal = (PALETTEENTRY*)HeapAlloc(GetProcessHeap(),0,sizeof(PALETTEENTRY)*256);
COLOR_sysPal = HeapAlloc(GetProcessHeap(),0,sizeof(PALETTEENTRY)*256);
if(COLOR_sysPal == NULL) {
ERR("Can not allocate system palette!\n");
HeapFree(GetProcessHeap(), 0, pixDynMapping);
@ -601,7 +601,7 @@ static BOOL X11DRV_PALETTE_BuildSharedMap( const PALETTEENTRY *sys_pal_template
* RGB->pixel calculation in X11DRV_PALETTE_ToPhysical().
*/
X11DRV_PALETTE_PaletteToXPixel = (int*)HeapAlloc(GetProcessHeap(),0,sizeof(int)*256);
X11DRV_PALETTE_PaletteToXPixel = HeapAlloc(GetProcessHeap(),0,sizeof(int)*256);
if(X11DRV_PALETTE_PaletteToXPixel == NULL) {
ERR("Out of memory: PaletteToXPixel!\n");
HeapFree(GetProcessHeap(), 0, pixDynMapping);

View File

@ -301,7 +301,7 @@ static void X11DRV_XDND_ResolveProperty(Display *display, Window xwin, Time tm,
*/
static void X11DRV_XDND_InsertXDNDData(int property, int format, void* data, unsigned int len)
{
LPXDNDDATA current = (LPXDNDDATA) HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(XDNDDATA));
LPXDNDDATA current = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(XDNDDATA));
if (current)
{
@ -520,8 +520,7 @@ static DROPFILES* X11DRV_XDND_BuildDropFiles(char* filename, unsigned int len, P
pathlen = GetLongPathNameA(filename, path, MAX_PATH);
if (pathlen)
{
lpDrop = (DROPFILES*) HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY,
sizeof(DROPFILES) + pathlen + 1);
lpDrop = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(DROPFILES) + pathlen + 1);
lpDrop->pFiles = sizeof(DROPFILES);
lpDrop->pt.x = pt.x;

View File

@ -2054,7 +2054,7 @@ static int XFONT_BuildMetrics(char** x_pattern, int res, unsigned x_checksum, in
pfr = fr;
}
if( !fi ) fi = (fontInfo*) HeapAlloc(GetProcessHeap(), 0, sizeof(fontInfo));
if( !fi ) fi = HeapAlloc(GetProcessHeap(), 0, sizeof(fontInfo));
if( !LFD_InitFontInfo( fi, &lfd, x_pattern[i]) )
goto nextfont;
@ -2062,12 +2062,12 @@ static int XFONT_BuildMetrics(char** x_pattern, int res, unsigned x_checksum, in
if( !fr ) /* add new family */
{
n_ff++;
fr = (fontResource*) HeapAlloc(GetProcessHeap(), 0, sizeof(fontResource));
fr = HeapAlloc(GetProcessHeap(), 0, sizeof(fontResource));
if (fr)
{
memset(fr, 0, sizeof(fontResource));
fr->resource = (LFD*) HeapAlloc(GetProcessHeap(), 0, sizeof(LFD));
fr->resource = HeapAlloc(GetProcessHeap(), 0, sizeof(LFD));
memset(fr->resource, 0, sizeof(LFD));
TRACE("family: -%s-%s-\n", lfd.foundry, lfd.family );
@ -2213,7 +2213,7 @@ static BOOL XFONT_ReadCachedMetrics( int fd, int res, unsigned x_checksum, int x
if( length == (i + offset) )
{
lseek( fd, offset, SEEK_SET );
fontList = (fontResource*)HeapAlloc( GetProcessHeap(), 0, i);
fontList = HeapAlloc( GetProcessHeap(), 0, i);
if( fontList )
{
fontResource* pfr = fontList;
@ -2838,8 +2838,7 @@ static fontObject* XFONT_GetCacheEntry(void)
TRACE("\tgrowing font cache from %i to %i\n", fontCacheSize, prev_i );
if( (newCache = (fontObject*)HeapReAlloc(GetProcessHeap(), 0,
fontCache, prev_i * sizeof(fontObject))) )
if( (newCache = HeapReAlloc(GetProcessHeap(), 0, fontCache, prev_i * sizeof(fontObject))) )
{
i = fontCacheSize;
fontCacheSize = prev_i;
@ -2982,7 +2981,7 @@ void X11DRV_FONT_InitX11Metrics( void )
/* fontList initialization is over, allocate X font cache */
fontCache = (fontObject*) HeapAlloc(GetProcessHeap(), 0, fontCacheSize * sizeof(fontObject));
fontCache = HeapAlloc(GetProcessHeap(), 0, fontCacheSize * sizeof(fontObject));
XFONT_GrowFreeList(0, fontCacheSize - 1);
TRACE("done!\n");

View File

@ -1286,8 +1286,7 @@ INT WINPROC_MapMsg16To32A( HWND hwnd, UINT16 msg16, WPARAM16 wParam16, UINT *pms
case WM_COMPAREITEM:
{
COMPAREITEMSTRUCT16* cis16 = MapSL(*plparam);
COMPAREITEMSTRUCT *cis = (COMPAREITEMSTRUCT *)
HeapAlloc(GetProcessHeap(), 0, sizeof(*cis));
COMPAREITEMSTRUCT *cis = HeapAlloc(GetProcessHeap(), 0, sizeof(*cis));
if (!cis) return -1;
cis->CtlType = cis16->CtlType;
cis->CtlID = cis16->CtlID;
@ -1303,8 +1302,7 @@ INT WINPROC_MapMsg16To32A( HWND hwnd, UINT16 msg16, WPARAM16 wParam16, UINT *pms
case WM_DELETEITEM:
{
DELETEITEMSTRUCT16* dis16 = MapSL(*plparam);
DELETEITEMSTRUCT *dis = (DELETEITEMSTRUCT *)
HeapAlloc(GetProcessHeap(), 0, sizeof(*dis));
DELETEITEMSTRUCT *dis = HeapAlloc(GetProcessHeap(), 0, sizeof(*dis));
if (!dis) return -1;
dis->CtlType = dis16->CtlType;
dis->CtlID = dis16->CtlID;
@ -1316,8 +1314,7 @@ INT WINPROC_MapMsg16To32A( HWND hwnd, UINT16 msg16, WPARAM16 wParam16, UINT *pms
case WM_MEASUREITEM:
{
MEASUREITEMSTRUCT16* mis16 = MapSL(*plparam);
MEASUREITEMSTRUCT *mis = (MEASUREITEMSTRUCT *)
HeapAlloc(GetProcessHeap(), 0,
MEASUREITEMSTRUCT *mis = HeapAlloc(GetProcessHeap(), 0,
sizeof(*mis) + sizeof(LPARAM));
if (!mis) return -1;
mis->CtlType = mis16->CtlType;