mirror of
git://source.winehq.org/git/wine.git
synced 2024-11-01 09:50:52 +00:00
dpnet: Use standard C functions for memory allocation in peer.c.
This commit is contained in:
parent
a407ba9fe1
commit
8ef070b6c2
1 changed files with 8 additions and 8 deletions
|
@ -92,10 +92,10 @@ static ULONG WINAPI IDirectPlay8PeerImpl_Release(IDirectPlay8Peer *iface)
|
||||||
|
|
||||||
if(!RefCount)
|
if(!RefCount)
|
||||||
{
|
{
|
||||||
heap_free(This->username);
|
free(This->username);
|
||||||
heap_free(This->data);
|
free(This->data);
|
||||||
|
|
||||||
heap_free(This);
|
free(This);
|
||||||
}
|
}
|
||||||
|
|
||||||
return RefCount;
|
return RefCount;
|
||||||
|
@ -389,12 +389,12 @@ static HRESULT WINAPI IDirectPlay8PeerImpl_SetPeerInfo(IDirectPlay8Peer *iface,
|
||||||
|
|
||||||
if (pdpnPlayerInfo->dwInfoFlags & DPNINFO_NAME)
|
if (pdpnPlayerInfo->dwInfoFlags & DPNINFO_NAME)
|
||||||
{
|
{
|
||||||
heap_free(This->username);
|
free(This->username);
|
||||||
This->username = NULL;
|
This->username = NULL;
|
||||||
|
|
||||||
if(pdpnPlayerInfo->pwszName)
|
if(pdpnPlayerInfo->pwszName)
|
||||||
{
|
{
|
||||||
This->username = heap_strdupW(pdpnPlayerInfo->pwszName);
|
This->username = wcsdup(pdpnPlayerInfo->pwszName);
|
||||||
if (!This->username)
|
if (!This->username)
|
||||||
return E_OUTOFMEMORY;
|
return E_OUTOFMEMORY;
|
||||||
}
|
}
|
||||||
|
@ -402,10 +402,10 @@ static HRESULT WINAPI IDirectPlay8PeerImpl_SetPeerInfo(IDirectPlay8Peer *iface,
|
||||||
|
|
||||||
if (pdpnPlayerInfo->dwInfoFlags & DPNINFO_DATA)
|
if (pdpnPlayerInfo->dwInfoFlags & DPNINFO_DATA)
|
||||||
{
|
{
|
||||||
heap_free(This->data);
|
free(This->data);
|
||||||
|
|
||||||
This->datasize = pdpnPlayerInfo->dwDataSize;
|
This->datasize = pdpnPlayerInfo->dwDataSize;
|
||||||
This->data = heap_alloc(pdpnPlayerInfo->dwDataSize);
|
This->data = malloc(pdpnPlayerInfo->dwDataSize);
|
||||||
if (!This->data)
|
if (!This->data)
|
||||||
return E_OUTOFMEMORY;
|
return E_OUTOFMEMORY;
|
||||||
|
|
||||||
|
@ -638,7 +638,7 @@ HRESULT DPNET_CreateDirectPlay8Peer(IClassFactory *iface, IUnknown *pUnkOuter, R
|
||||||
IDirectPlay8PeerImpl* Client;
|
IDirectPlay8PeerImpl* Client;
|
||||||
HRESULT ret;
|
HRESULT ret;
|
||||||
|
|
||||||
Client = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(IDirectPlay8PeerImpl));
|
Client = calloc(1, sizeof(IDirectPlay8PeerImpl));
|
||||||
|
|
||||||
*ppobj = NULL;
|
*ppobj = NULL;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue