hlink: Rename the wrappers around HeapAlloc() &Co to use the standard names.

This commit is contained in:
Michael Stefaniuc 2007-12-09 16:29:51 +01:00 committed by Alexandre Julliard
parent 39c260e9fa
commit e3bd2d5090
4 changed files with 28 additions and 28 deletions

View File

@ -46,7 +46,7 @@ HRESULT WINAPI HLinkBrowseContext_Constructor(IUnknown *pUnkOuter, REFIID riid,
if (pUnkOuter)
return CLASS_E_NOAGGREGATION;
hl = hlink_alloc_zero(sizeof(HlinkBCImpl));
hl = heap_alloc_zero(sizeof(HlinkBCImpl));
if (!hl)
return E_OUTOFMEMORY;
@ -95,10 +95,10 @@ static ULONG WINAPI IHlinkBC_fnRelease (IHlinkBrowseContext* iface)
return refCount;
TRACE("-- destroying IHlinkBrowseContext (%p)\n", This);
hlink_free(This->BrowseWindowInfo);
heap_free(This->BrowseWindowInfo);
if (This->CurrentPage)
IHlink_Release(This->CurrentPage);
hlink_free(This);
heap_free(This);
return 0;
}
@ -155,8 +155,8 @@ static HRESULT WINAPI IHlinkBC_SetBrowseWindowInfo(IHlinkBrowseContext* iface,
HlinkBCImpl *This = (HlinkBCImpl*)iface;
TRACE("(%p)->(%p)\n", This, phlbwi);
hlink_free(This->BrowseWindowInfo);
This->BrowseWindowInfo = hlink_alloc(phlbwi->cbSize);
heap_free(This->BrowseWindowInfo);
This->BrowseWindowInfo = heap_alloc(phlbwi->cbSize);
memcpy(This->BrowseWindowInfo, phlbwi, phlbwi->cbSize);
return S_OK;

View File

@ -89,9 +89,9 @@ static ULONG WINAPI ExtServUnk_Release(IUnknown *iface)
TRACE("(%p) ref=%d\n", This, ref);
if(!ref) {
hlink_free(This->username);
hlink_free(This->password);
hlink_free(This);
heap_free(This->username);
heap_free(This->password);
heap_free(This);
}
return ref;
@ -220,7 +220,7 @@ HRESULT WINAPI HlinkCreateExtensionServices(LPCWSTR pwzAdditionalHeaders,
phwnd, debugstr_w(pszUsername), debugstr_w(pszPassword),
punkOuter, debugstr_guid(riid), ppv);
ret = hlink_alloc(sizeof(*ret));
ret = heap_alloc(sizeof(*ret));
ret->lpIUnknownVtbl = &ExtServUnkVtbl;
ret->lpIAuthenticateVtbl = &AuthenticateVtbl;
@ -235,7 +235,7 @@ HRESULT WINAPI HlinkCreateExtensionServices(LPCWSTR pwzAdditionalHeaders,
if(len && pwzAdditionalHeaders[len-1] != '\n' && pwzAdditionalHeaders[len-1] != '\r') {
static const WCHAR endlW[] = {'\r','\n',0};
ret->headers = hlink_alloc(len*sizeof(WCHAR) + sizeof(endlW));
ret->headers = heap_alloc(len*sizeof(WCHAR) + sizeof(endlW));
memcpy(ret->headers, pwzAdditionalHeaders, len*sizeof(WCHAR));
memcpy(ret->headers+len, endlW, sizeof(endlW));
}else {

View File

@ -32,17 +32,17 @@
extern HRESULT WINAPI HLink_Constructor(IUnknown*,REFIID,void**);
extern HRESULT WINAPI HLinkBrowseContext_Constructor(IUnknown*,REFIID,void**);
static inline void *hlink_alloc(size_t len)
static inline void *heap_alloc(size_t len)
{
return HeapAlloc(GetProcessHeap(), 0, len);
}
static inline void *hlink_alloc_zero(size_t len)
static inline void *heap_alloc_zero(size_t len)
{
return HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, len);
}
static inline BOOL hlink_free(void *mem)
static inline BOOL heap_free(void *mem)
{
return HeapFree(GetProcessHeap(), 0, mem);
}
@ -55,7 +55,7 @@ static inline LPWSTR hlink_strdupW(LPCWSTR str)
DWORD size;
size = (strlenW(str)+1)*sizeof(WCHAR);
ret = hlink_alloc(size);
ret = heap_alloc(size);
memcpy(ret, str, size);
}

View File

@ -98,7 +98,7 @@ HRESULT WINAPI HLink_Constructor(IUnknown *pUnkOuter, REFIID riid,
if (pUnkOuter)
return CLASS_E_NOAGGREGATION;
hl = hlink_alloc_zero(sizeof(HlinkImpl));
hl = heap_alloc_zero(sizeof(HlinkImpl));
if (!hl)
return E_OUTOFMEMORY;
@ -155,15 +155,15 @@ static ULONG WINAPI IHlink_fnRelease (IHlink* iface)
return refCount;
TRACE("-- destroying IHlink (%p)\n", This);
hlink_free(This->FriendlyName);
hlink_free(This->Target);
hlink_free(This->TargetFrameName);
hlink_free(This->Location);
heap_free(This->FriendlyName);
heap_free(This->Target);
heap_free(This->TargetFrameName);
heap_free(This->Location);
if (This->Moniker)
IMoniker_Release(This->Moniker);
if (This->Site)
IHlinkSite_Release(This->Site);
hlink_free(This);
heap_free(This);
return 0;
}
@ -223,7 +223,7 @@ static HRESULT WINAPI IHlink_fnSetMonikerReference( IHlink* iface,
CoTaskMemFree(display_name);
}
hlink_free(This->Location);
heap_free(This->Location);
This->Location = hlink_strdupW( pwzLocation );
return S_OK;
@ -239,12 +239,12 @@ static HRESULT WINAPI IHlink_fnSetStringReference(IHlink* iface,
if (grfHLSETF & HLINKSETF_TARGET)
{
hlink_free(This->Target);
heap_free(This->Target);
This->Target = hlink_strdupW( pwzTarget );
}
if (grfHLSETF & HLINKSETF_LOCATION)
{
hlink_free(This->Location);
heap_free(This->Location);
This->Location = hlink_strdupW( pwzLocation );
}
@ -313,7 +313,7 @@ static HRESULT WINAPI IHlink_fnSetFriendlyName (IHlink *iface,
TRACE("(%p) -> (%s)\n", This, debugstr_w(pwzFriendlyName));
hlink_free(This->FriendlyName);
heap_free(This->FriendlyName);
This->FriendlyName = hlink_strdupW( pwzFriendlyName );
return S_OK;
@ -356,7 +356,7 @@ static HRESULT WINAPI IHlink_fnSetTargetFrameName(IHlink* iface,
HlinkImpl *This = (HlinkImpl*)iface;
TRACE("(%p)->(%s)\n", This, debugstr_w(pwzTargetFramename));
hlink_free(This->TargetFrameName);
heap_free(This->TargetFrameName);
This->TargetFrameName = hlink_strdupW( pwzTargetFramename );
return S_OK;
@ -648,18 +648,18 @@ static HRESULT read_hlink_string(IStream *pStm, LPWSTR *out_str)
TRACE("read len %d\n", len);
str = hlink_alloc(len * sizeof(WCHAR));
str = heap_alloc(len * sizeof(WCHAR));
if (!str) return E_OUTOFMEMORY;
hr = IStream_Read(pStm, str, len * sizeof(WCHAR), &read);
if (FAILED(hr))
{
hlink_free(str);
heap_free(str);
return hr;
}
if (read != len * sizeof(WCHAR))
{
hlink_free(str);
heap_free(str);
return STG_E_READFAULT;
}
TRACE("read string %s\n", debugstr_w(str));