Commit 5423c35d authored by Andrew Talbot's avatar Andrew Talbot Committed by Alexandre Julliard

dplayx: Assign to structs instead of using CopyMemory.

parent 05ea03c0
......@@ -2303,7 +2303,7 @@ static HRESULT WINAPI DP_IF_EnumSessions
/* FIXME: need to kill the thread on object deletion */
lpData->lpSpData = &This->dp2->spData;
CopyMemory( &lpData->requestGuid, &lpsd->guidApplication, sizeof(GUID) );
lpData->requestGuid = lpsd->guidApplication;
lpData->dwEnumSessionFlags = dwFlags;
lpData->dwTimeout = dwTimeout;
......
......@@ -662,7 +662,7 @@ void DPLAYX_CopyConnStructA( LPDPLCONNECTION dest, const DPLCONNECTION *src )
{
BYTE* lpStartOfFreeSpace;
CopyMemory( dest, src, sizeof( DPLCONNECTION ) );
*dest = *src;
lpStartOfFreeSpace = ((BYTE*)dest) + sizeof( DPLCONNECTION );
......@@ -671,7 +671,7 @@ void DPLAYX_CopyConnStructA( LPDPLCONNECTION dest, const DPLCONNECTION *src )
{
dest->lpSessionDesc = (LPDPSESSIONDESC2)lpStartOfFreeSpace;
lpStartOfFreeSpace += sizeof( DPSESSIONDESC2 );
CopyMemory( dest->lpSessionDesc, src->lpSessionDesc, sizeof( DPSESSIONDESC2 ) );
*dest->lpSessionDesc = *src->lpSessionDesc;
/* Session names may or may not exist */
if( src->lpSessionDesc->u1.lpszSessionNameA )
......@@ -696,7 +696,7 @@ void DPLAYX_CopyConnStructA( LPDPLCONNECTION dest, const DPLCONNECTION *src )
{
dest->lpPlayerName = (LPDPNAME)lpStartOfFreeSpace;
lpStartOfFreeSpace += sizeof( DPNAME );
CopyMemory( dest->lpPlayerName, src->lpPlayerName, sizeof( DPNAME ) );
*dest->lpPlayerName = *src->lpPlayerName;
if( src->lpPlayerName->u1.lpszShortNameA )
{
......@@ -784,7 +784,7 @@ void DPLAYX_CopyConnStructW( LPDPLCONNECTION dest, const DPLCONNECTION *src )
{
BYTE* lpStartOfFreeSpace;
CopyMemory( dest, src, sizeof( DPLCONNECTION ) );
*dest = *src;
lpStartOfFreeSpace = ( (BYTE*)dest) + sizeof( DPLCONNECTION );
......@@ -793,7 +793,7 @@ void DPLAYX_CopyConnStructW( LPDPLCONNECTION dest, const DPLCONNECTION *src )
{
dest->lpSessionDesc = (LPDPSESSIONDESC2)lpStartOfFreeSpace;
lpStartOfFreeSpace += sizeof( DPSESSIONDESC2 );
CopyMemory( dest->lpSessionDesc, src->lpSessionDesc, sizeof( DPSESSIONDESC2 ) );
*dest->lpSessionDesc = *src->lpSessionDesc;
/* Session names may or may not exist */
if( src->lpSessionDesc->u1.lpszSessionName )
......@@ -818,7 +818,7 @@ void DPLAYX_CopyConnStructW( LPDPLCONNECTION dest, const DPLCONNECTION *src )
{
dest->lpPlayerName = (LPDPNAME)lpStartOfFreeSpace;
lpStartOfFreeSpace += sizeof( DPNAME );
CopyMemory( dest->lpPlayerName, src->lpPlayerName, sizeof( DPNAME ) );
*dest->lpPlayerName = *src->lpPlayerName;
if( src->lpPlayerName->u1.lpszShortName )
{
......
......@@ -1574,7 +1574,7 @@ HRESULT DPL_CreateCompoundAddress
{
LPDPADDRESS lpdpAddress = (LPDPADDRESS)lpAddress;
CopyMemory( &lpdpAddress->guidDataType, &DPAID_TotalSize, sizeof( GUID ) );
lpdpAddress->guidDataType = DPAID_TotalSize;
lpdpAddress->dwDataSize = sizeof( DWORD );
lpAddress = (char *) lpAddress + sizeof( DPADDRESS );
......@@ -1593,8 +1593,7 @@ HRESULT DPL_CreateCompoundAddress
{
LPDPADDRESS lpdpAddress = (LPDPADDRESS)lpAddress;
CopyMemory( &lpdpAddress->guidDataType, &lpElements->guidDataType,
sizeof( GUID ) );
lpdpAddress->guidDataType = lpElements->guidDataType;
lpdpAddress->dwDataSize = sizeof( GUID );
lpAddress = (char *) lpAddress + sizeof( DPADDRESS );
......@@ -1608,8 +1607,7 @@ HRESULT DPL_CreateCompoundAddress
{
LPDPADDRESS lpdpAddress = (LPDPADDRESS)lpAddress;
CopyMemory( &lpdpAddress->guidDataType, &lpElements->guidDataType,
sizeof( GUID ) );
lpdpAddress->guidDataType = lpElements->guidDataType;
lpdpAddress->dwDataSize = lpElements->dwDataSize;
lpAddress = (char *) lpAddress + sizeof( DPADDRESS );
......@@ -1625,8 +1623,7 @@ HRESULT DPL_CreateCompoundAddress
{
LPDPADDRESS lpdpAddress = (LPDPADDRESS)lpAddress;
CopyMemory( &lpdpAddress->guidDataType, &lpElements->guidDataType,
sizeof( GUID ) );
lpdpAddress->guidDataType = lpElements->guidDataType;
lpdpAddress->dwDataSize = lpElements->dwDataSize;
lpAddress = (char *) lpAddress + sizeof( DPADDRESS );
......@@ -1639,8 +1636,7 @@ HRESULT DPL_CreateCompoundAddress
{
LPDPADDRESS lpdpAddress = (LPDPADDRESS)lpAddress;
CopyMemory( &lpdpAddress->guidDataType, &lpElements->guidDataType,
sizeof( GUID ) );
lpdpAddress->guidDataType = lpElements->guidDataType;
lpdpAddress->dwDataSize = lpElements->dwDataSize;
lpAddress = (char *) lpAddress + sizeof( DPADDRESS );
......@@ -1651,8 +1647,7 @@ HRESULT DPL_CreateCompoundAddress
{
LPDPADDRESS lpdpAddress = (LPDPADDRESS)lpAddress;
CopyMemory( &lpdpAddress->guidDataType, &lpElements->guidDataType,
sizeof( GUID ) );
lpdpAddress->guidDataType = lpElements->guidDataType;
lpdpAddress->dwDataSize = lpElements->dwDataSize;
lpAddress = (char *) lpAddress + sizeof( DPADDRESS );
......
......@@ -140,7 +140,7 @@ void NS_AddRemoteComputerAsNameServer( LPCVOID lpcNSAddrHdr
return;
}
CopyMemory( lpCacheNode->data, &lpcMsg->sd, sizeof( *lpCacheNode->data ) );
*lpCacheNode->data = lpcMsg->sd;
len = WideCharToMultiByte( CP_ACP, 0, (LPCWSTR)(lpcMsg+1), -1, NULL, 0, NULL, NULL );
if ((lpCacheNode->data->u1.lpszSessionNameA = HeapAlloc( GetProcessHeap(), 0, len )))
{
......@@ -240,7 +240,7 @@ HRESULT NS_SendSessionRequestBroadcast( LPCGUID lpcGuid,
lpMsg->dwPasswordSize = 0; /* FIXME: If enumerating passwords..? */
lpMsg->dwFlags = dwFlags;
CopyMemory( &lpMsg->guidApplication, lpcGuid, sizeof( *lpcGuid ) );
lpMsg->guidApplication = *lpcGuid;
return (lpSpData->lpCB->EnumSessions)( &data );
}
......
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