* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
+#include <stdarg.h>
+#include <stdio.h>
+
+#define COBJMACROS
+
+#include "windef.h"
+#include "winbase.h"
+#include "winuser.h"
+#include "winver.h"
+#include "wincrypt.h"
+#include "winreg.h"
+#include "shlwapi.h"
+#include "dbghelp.h"
+#include "ole2.h"
+#include "fusion.h"
+#include "corerror.h"
+
#include "fusionpriv.h"
+#include "wine/debug.h"
+#include "wine/unicode.h"
+
+WINE_DEFAULT_DEBUG_CHANNEL(fusion);
typedef struct {
IAssemblyCache IAssemblyCache_iface;
BOOL ret = TRUE;
int len;
- new_path = HeapAlloc(GetProcessHeap(), 0, (strlenW(path) + 1) * sizeof(WCHAR));
- if (!new_path)
- return FALSE;
+ if (!(new_path = heap_alloc((strlenW(path) + 1) * sizeof(WCHAR)))) return FALSE;
strcpyW(new_path, path);
new_path[len] = '\\';
}
- HeapFree(GetProcessHeap(), 0, new_path);
+ heap_free(new_path);
return ret;
}
if (!refCount)
{
CloseHandle( cache->lock );
- HeapFree( GetProcessHeap(), 0, cache );
+ heap_free( cache );
}
return refCount;
}
if (hr != HRESULT_FROM_WIN32( ERROR_INSUFFICIENT_BUFFER ))
goto done;
- if (!(path = HeapAlloc( GetProcessHeap(), 0, len * sizeof(WCHAR) )))
+ if (!(path = heap_alloc( len * sizeof(WCHAR) )))
{
hr = E_OUTOFMEMORY;
goto done;
IAssemblyName_Release( asmname );
if (next) IAssemblyName_Release( next );
if (asmenum) IAssemblyEnum_Release( asmenum );
- HeapFree( GetProcessHeap(), 0, path );
+ heap_free( path );
cache_unlock( cache );
return hr;
}
*ppAsmItem = NULL;
- item = HeapAlloc(GetProcessHeap(), 0, sizeof(IAssemblyCacheItemImpl));
- if (!item)
- return E_OUTOFMEMORY;
+ if (!(item = heap_alloc(sizeof(*item)))) return E_OUTOFMEMORY;
item->IAssemblyCacheItem_iface.lpVtbl = &AssemblyCacheItemVtbl;
item->ref = 1;
DWORD len = strlenW( filename );
HRESULT hr = S_OK;
- if (!(src_file = HeapAlloc( GetProcessHeap(), 0, (src_len + len + 1) * sizeof(WCHAR) )))
+ if (!(src_file = heap_alloc( (src_len + len + 1) * sizeof(WCHAR) )))
return E_OUTOFMEMORY;
memcpy( src_file, src_dir, src_len * sizeof(WCHAR) );
strcpyW( src_file + src_len, filename );
- if (!(dst_file = HeapAlloc( GetProcessHeap(), 0, (dst_len + len + 1) * sizeof(WCHAR) )))
+ if (!(dst_file = heap_alloc( (dst_len + len + 1) * sizeof(WCHAR) )))
{
- HeapFree( GetProcessHeap(), 0, src_file );
+ heap_free( src_file );
return E_OUTOFMEMORY;
}
memcpy( dst_file, dst_dir, dst_len * sizeof(WCHAR) );
strcpyW( dst_file + dst_len, filename );
if (!CopyFileW( src_file, dst_file, FALSE )) hr = HRESULT_FROM_WIN32( GetLastError() );
- HeapFree( GetProcessHeap(), 0, src_file );
- HeapFree( GetProcessHeap(), 0, dst_file );
+ heap_free( src_file );
+ heap_free( dst_file );
return hr;
}
get_assembly_directory(asmdir, MAX_PATH, clr_version, architecture);
dst_len += strlenW(asmdir) + strlenW(name) + strlenW(version) + strlenW(token);
- if (!(dst_dir = HeapAlloc(GetProcessHeap(), 0, dst_len * sizeof(WCHAR))))
+ if (!(dst_dir = heap_alloc(dst_len * sizeof(WCHAR))))
{
hr = E_OUTOFMEMORY;
goto done;
}
done:
- HeapFree(GetProcessHeap(), 0, name);
- HeapFree(GetProcessHeap(), 0, token);
- HeapFree(GetProcessHeap(), 0, version);
- HeapFree(GetProcessHeap(), 0, asmpath);
- HeapFree(GetProcessHeap(), 0, dst_dir);
- for (i = 0; i < count; i++) HeapFree(GetProcessHeap(), 0, external_files[i]);
- HeapFree(GetProcessHeap(), 0, external_files);
+ heap_free(name);
+ heap_free(token);
+ heap_free(version);
+ heap_free(asmpath);
+ heap_free(dst_dir);
+ for (i = 0; i < count; i++) heap_free(external_files[i]);
+ heap_free(external_files);
assembly_release(assembly);
cache_unlock( cache );
return hr;
*ppAsmCache = NULL;
- cache = HeapAlloc(GetProcessHeap(), 0, sizeof(IAssemblyCacheImpl));
- if (!cache)
- return E_OUTOFMEMORY;
+ if (!(cache = heap_alloc(sizeof(*cache)))) return E_OUTOFMEMORY;
cache->IAssemblyCache_iface.lpVtbl = &AssemblyCacheVtbl;
cache->ref = 1;
cache->lock = CreateMutexW( NULL, FALSE, cache_mutex_nameW );
if (!cache->lock)
{
- HeapFree( GetProcessHeap(), 0, cache );
+ heap_free( cache );
return HRESULT_FROM_WIN32( GetLastError() );
}
*ppAsmCache = &cache->IAssemblyCache_iface;
TRACE("(%p)->(ref before = %u)\n", This, refCount + 1);
if (!refCount)
- HeapFree(GetProcessHeap(), 0, This);
+ heap_free(This);
return refCount;
}