msi: Consistently use the allocation macros.

oldstable
Hans Leidekker 2010-05-20 12:01:50 +02:00 committed by Alexandre Julliard
parent 57a6b6fb38
commit 7a370c8d7b
6 changed files with 19 additions and 19 deletions

View File

@ -167,7 +167,7 @@ static HRESULT create_automation_object(MSIHANDLE msiHandle, IUnknown *pUnkOuter
if( pUnkOuter )
return CLASS_E_NOAGGREGATION;
object = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(AutomationObject)+sizetPrivateData);
object = msi_alloc_zero( sizeof(AutomationObject) + sizetPrivateData );
/* Set all the VTable references */
object->lpVtbl = &AutomationObject_Vtbl;
@ -184,7 +184,7 @@ static HRESULT create_automation_object(MSIHANDLE msiHandle, IUnknown *pUnkOuter
object->iTypeInfo = NULL;
hr = load_type_info((IDispatch *)object, &object->iTypeInfo, clsid, 0x0);
if (FAILED(hr)) {
HeapFree(GetProcessHeap(), 0, object);
msi_free( object );
return hr;
}
@ -203,7 +203,7 @@ static HRESULT create_list_enumerator(IUnknown *pUnkOuter, LPVOID *ppObj, Automa
if( pUnkOuter )
return CLASS_E_NOAGGREGATION;
object = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(ListEnumerator));
object = msi_alloc_zero( sizeof(ListEnumerator) );
/* Set all the VTable references */
object->lpVtbl = &ListEnumerator_Vtbl;
@ -288,7 +288,7 @@ static ULONG WINAPI AutomationObject_Release(IDispatch* iface)
if (This->funcFree) This->funcFree(This);
ITypeInfo_Release(This->iTypeInfo);
MsiCloseHandle(This->msiHandle);
HeapFree(GetProcessHeap(), 0, This);
msi_free(This);
}
return ref;
@ -607,7 +607,7 @@ static ULONG WINAPI ListEnumerator_Release(IEnumVARIANT* iface)
if (!ref)
{
if (This->pObj) IDispatch_Release((IDispatch *)This->pObj);
HeapFree(GetProcessHeap(), 0, This);
msi_free(This);
}
return ref;
@ -1043,7 +1043,7 @@ static void WINAPI ListImpl_Free(AutomationObject *This)
for (idx=0; idx<data->ulCount; idx++)
VariantClear(&data->pVars[idx]);
HeapFree(GetProcessHeap(), 0, data->pVars);
msi_free(data->pVars);
}
static HRESULT WINAPI ViewImpl_Invoke(

View File

@ -1417,7 +1417,7 @@ void ACTION_FinishCustomActions(const MSIPACKAGE* package)
EnterCriticalSection( &msi_custom_action_cs );
handle_count = list_count( &msi_pending_custom_actions );
wait_handles = HeapAlloc( GetProcessHeap(), 0, handle_count * sizeof(HANDLE) );
wait_handles = msi_alloc( handle_count * sizeof(HANDLE) );
handle_count = 0;
LIST_FOR_EACH_ENTRY_SAFE( info, cursor, &msi_pending_custom_actions, msi_custom_action_info, entry )
@ -1437,7 +1437,7 @@ void ACTION_FinishCustomActions(const MSIPACKAGE* package)
CloseHandle( wait_handles[i] );
}
HeapFree( GetProcessHeap(), 0, wait_handles );
msi_free( wait_handles );
}
typedef struct _msi_custom_remote_impl {

View File

@ -148,7 +148,7 @@ static UINT copy_install_file(MSIPACKAGE *package, MSIFILE *file, LPWSTR source)
GetTempFileNameW(szBackSlash, szMsi, 0, tmpfileW);
len = strlenW(file->TargetPath) + strlenW(tmpfileW) + 1;
if (!(pathW = HeapAlloc(GetProcessHeap(), 0, len * sizeof(WCHAR))))
if (!(pathW = msi_alloc(len * sizeof(WCHAR))))
return ERROR_OUTOFMEMORY;
strcpyW(pathW, file->TargetPath);
@ -168,7 +168,7 @@ static UINT copy_install_file(MSIPACKAGE *package, MSIFILE *file, LPWSTR source)
gle = GetLastError();
WARN("failed to schedule rename operation: %d)\n", gle);
}
HeapFree(GetProcessHeap(), 0, pathW);
msi_free(pathW);
}
return gle;

View File

@ -411,7 +411,7 @@ static INT_PTR cabinet_copy_file(FDINOTIFICATIONTYPE fdint,
GetTempFileNameW(szBackSlash, szMsi, 0, tmpfileW);
len = strlenW(path) + strlenW(tmpfileW) + 1;
if (!(tmppathW = HeapAlloc(GetProcessHeap(), 0, len * sizeof(WCHAR))))
if (!(tmppathW = msi_alloc(len * sizeof(WCHAR))))
return ERROR_OUTOFMEMORY;
strcpyW(tmppathW, path);
@ -429,7 +429,7 @@ static INT_PTR cabinet_copy_file(FDINOTIFICATIONTYPE fdint,
else
WARN("failed to schedule rename operation %s (error %d)\n", debugstr_w(path), GetLastError());
HeapFree(GetProcessHeap(), 0, tmppathW);
msi_free(tmppathW);
}
else
WARN("failed to create %s (error %d)\n", debugstr_w(path), err);

View File

@ -893,11 +893,11 @@ static VOID set_installer_properties(MSIPACKAGE *package)
if (!GetUserNameW( NULL, &len ) && GetLastError() == ERROR_MORE_DATA)
{
WCHAR *username;
if ((username = HeapAlloc( GetProcessHeap(), 0, len * sizeof(WCHAR) )))
if ((username = msi_alloc( len * sizeof(WCHAR) )))
{
if (GetUserNameW( username, &len ))
msi_set_property( package->db, szLogonUser, username );
HeapFree( GetProcessHeap(), 0, username );
msi_free( username );
}
}
}
@ -1113,16 +1113,16 @@ UINT msi_download_file( LPCWSTR szUrl, LPWSTR filename )
GetUrlCacheEntryInfoW( szUrl, NULL, &size );
if ( GetLastError() != ERROR_FILE_NOT_FOUND )
{
cache_entry = HeapAlloc( GetProcessHeap(), 0, size );
cache_entry = msi_alloc( size );
if ( !GetUrlCacheEntryInfoW( szUrl, cache_entry, &size ) )
{
UINT error = GetLastError();
HeapFree( GetProcessHeap(), 0, cache_entry );
msi_free( cache_entry );
return error;
}
lstrcpyW( filename, cache_entry->lpszLocalFileName );
HeapFree( GetProcessHeap(), 0, cache_entry );
msi_free( cache_entry );
return ERROR_SUCCESS;
}

View File

@ -62,7 +62,7 @@ static HRESULT create_ActiveScriptSite(IUnknown *pUnkOuter, LPVOID *ppObj)
if( pUnkOuter )
return CLASS_E_NOAGGREGATION;
object = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(MsiActiveScriptSite));
object = msi_alloc_zero( sizeof(MsiActiveScriptSite) );
object->lpVtbl.lpVtbl = &ASS_Vtbl;
object->ref = 1;
@ -236,7 +236,7 @@ static ULONG WINAPI MsiActiveScriptSite_Release(IActiveScriptSite* iface)
TRACE("(%p/%p)\n", iface, This);
if (!ref)
HeapFree(GetProcessHeap(), 0, This);
msi_free(This);
return ref;
}