Commit a31b1079 authored by Nikolay Sivov's avatar Nikolay Sivov Committed by Alexandre Julliard

sxs: Use CRT memory allocation functions.

parent d3fe9faf
......@@ -88,12 +88,12 @@ static ULONG WINAPI name_Release( IAssemblyName *iface )
if (!refs)
{
TRACE("destroying %p\n", name);
HeapFree( GetProcessHeap(), 0, name->name );
HeapFree( GetProcessHeap(), 0, name->arch );
HeapFree( GetProcessHeap(), 0, name->token );
HeapFree( GetProcessHeap(), 0, name->type );
HeapFree( GetProcessHeap(), 0, name->version );
HeapFree( GetProcessHeap(), 0, name );
free( name->name );
free( name->arch );
free( name->token );
free( name->type );
free( name->version );
free( name );
}
return refs;
}
......@@ -251,9 +251,9 @@ static HRESULT WINAPI name_GetVersion(
TRACE("%p, %p, %p\n", iface, high, low);
if (!name->version) return HRESULT_FROM_WIN32( ERROR_NOT_FOUND );
if (!(version = strdupW( name->version ))) return E_OUTOFMEMORY;
if (!(version = wcsdup( name->version ))) return E_OUTOFMEMORY;
hr = parse_version( version, high, low );
HeapFree( GetProcessHeap(), 0, version );
free( version );
return hr;
}
......@@ -300,7 +300,7 @@ static WCHAR *parse_value( const WCHAR *str, unsigned int *len )
if (!*p) return NULL;
*len = p - str;
if (!(ret = HeapAlloc( GetProcessHeap(), 0, *len * sizeof(WCHAR) ))) return NULL;
if (!(ret = malloc( *len * sizeof(WCHAR) ))) return NULL;
memcpy( ret, str + 1, (*len - 1) * sizeof(WCHAR) );
ret[*len - 1] = 0;
return ret;
......@@ -314,7 +314,7 @@ static HRESULT parse_displayname( struct name *name, const WCHAR *displayname )
p = q = displayname;
while (*q && *q != ',') q++;
len = q - p;
if (!(name->name = HeapAlloc( GetProcessHeap(), 0, (len + 1) * sizeof(WCHAR) ))) return E_OUTOFMEMORY;
if (!(name->name = malloc( (len + 1) * sizeof(WCHAR) ))) return E_OUTOFMEMORY;
memcpy( name->name, p, len * sizeof(WCHAR) );
name->name[len] = 0;
if (!*q) return S_OK;
......@@ -376,7 +376,7 @@ HRESULT WINAPI CreateAssemblyNameObject(
if (!assembly || !assembly[0] || flags != CANOF_PARSE_DISPLAY_NAME)
return E_INVALIDARG;
if (!(name = HeapAlloc( GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*name) )))
if (!(name = calloc(1, sizeof(*name) )))
return E_OUTOFMEMORY;
name->IAssemblyName_iface.lpVtbl = &name_vtbl;
......@@ -385,12 +385,12 @@ HRESULT WINAPI CreateAssemblyNameObject(
hr = parse_displayname( name, assembly );
if (hr != S_OK)
{
HeapFree( GetProcessHeap(), 0, name->name );
HeapFree( GetProcessHeap(), 0, name->arch );
HeapFree( GetProcessHeap(), 0, name->token );
HeapFree( GetProcessHeap(), 0, name->type );
HeapFree( GetProcessHeap(), 0, name->version );
HeapFree( GetProcessHeap(), 0, name );
free( name->name );
free( name->arch );
free( name->token );
free( name->type );
free( name->version );
free( name );
return hr;
}
*obj = &name->IAssemblyName_iface;
......
......@@ -19,11 +19,11 @@
*/
#include <stdarg.h>
#include <stdlib.h>
#include "windef.h"
#include "winbase.h"
#include "wine/heap.h"
#include "wine/debug.h"
WINE_DEFAULT_DEBUG_CHANNEL(sxs);
......@@ -147,7 +147,7 @@ BOOL WINAPI SxsLookupClrGuid(DWORD flags, GUID *clsid, HANDLE actctx, void *buff
goto out;
}
assembly_info = heap_alloc(bytes_assembly_info);
assembly_info = malloc(bytes_assembly_info);
if (!(retval = QueryActCtxW(0, guid_info.hActCtx, &guid_info.ulAssemblyRosterIndex,
AssemblyDetailedInformationInActivationContext, assembly_info,
bytes_assembly_info, &bytes_assembly_info)))
......@@ -219,6 +219,6 @@ out:
if (flags & SXS_LOOKUP_CLR_GUID_USE_ACTCTX)
DeactivateActCtx(0, cookie);
heap_free(assembly_info);
free(assembly_info);
return retval;
}
......@@ -26,13 +26,3 @@ enum name_attr_id
};
const WCHAR *get_name_attribute( IAssemblyName *, enum name_attr_id ) DECLSPEC_HIDDEN;
static inline WCHAR *strdupW( const WCHAR *src )
{
WCHAR *dst;
if (!src) return NULL;
dst = HeapAlloc( GetProcessHeap(), 0, (lstrlenW( src ) + 1) * sizeof(WCHAR) );
if (dst) lstrcpyW( dst, src );
return dst;
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment