From db6a901bf45d439e0d09a9df19eecd71d3def07b Mon Sep 17 00:00:00 2001 From: Andrew Talbot Date: Thu, 13 Mar 2008 20:52:48 +0000 Subject: [PATCH] rpcrt4: Assign to structs instead of using memcpy. --- dlls/rpcrt4/ndr_contexthandle.c | 2 +- dlls/rpcrt4/rpc_binding.c | 6 +++--- dlls/rpcrt4/rpc_message.c | 6 +++--- dlls/rpcrt4/rpc_server.c | 6 +++--- 4 files changed, 10 insertions(+), 10 deletions(-) diff --git a/dlls/rpcrt4/ndr_contexthandle.c b/dlls/rpcrt4/ndr_contexthandle.c index 8ed8f669dc1..054bba38165 100644 --- a/dlls/rpcrt4/ndr_contexthandle.c +++ b/dlls/rpcrt4/ndr_contexthandle.c @@ -183,7 +183,7 @@ static UINT ndr_update_context_handle(NDR_CCONTEXT *CContext, che->magic = NDR_CONTEXT_HANDLE_MAGIC; RpcBindingCopy(hBinding, &che->handle); list_add_tail(&context_handle_list, &che->entry); - memcpy(&che->wire_data, chi, sizeof *chi); + che->wire_data = *chi; } *CContext = che; diff --git a/dlls/rpcrt4/rpc_binding.c b/dlls/rpcrt4/rpc_binding.c index d86add33ee1..72930323d7d 100644 --- a/dlls/rpcrt4/rpc_binding.c +++ b/dlls/rpcrt4/rpc_binding.c @@ -227,7 +227,7 @@ RPC_STATUS RPCRT4_ResolveBinding(RpcBinding* Binding, LPCSTR Endpoint) RPC_STATUS RPCRT4_SetBindingObject(RpcBinding* Binding, const UUID* ObjectUuid) { TRACE("(*RpcBinding == ^%p, UUID == %s)\n", Binding, debugstr_guid(ObjectUuid)); - if (ObjectUuid) memcpy(&Binding->ObjectUuid, ObjectUuid, sizeof(UUID)); + if (ObjectUuid) Binding->ObjectUuid = *ObjectUuid; else UuidCreateNil(&Binding->ObjectUuid); return RPC_S_OK; } @@ -691,10 +691,10 @@ RPC_STATUS WINAPI RpcBindingInqObject( RPC_BINDING_HANDLE Binding, UUID* ObjectU RpcBinding* bind = (RpcBinding*)Binding; TRACE("(%p,%p) = %s\n", Binding, ObjectUuid, debugstr_guid(&bind->ObjectUuid)); - memcpy(ObjectUuid, &bind->ObjectUuid, sizeof(UUID)); + *ObjectUuid = bind->ObjectUuid; return RPC_S_OK; } - + /*********************************************************************** * RpcBindingSetObject (RPCRT4.@) */ diff --git a/dlls/rpcrt4/rpc_message.c b/dlls/rpcrt4/rpc_message.c index fda8867a9ec..bc33c87ac70 100644 --- a/dlls/rpcrt4/rpc_message.c +++ b/dlls/rpcrt4/rpc_message.c @@ -196,8 +196,8 @@ RpcPktHdr *RPCRT4_BuildBindHeader(unsigned long DataRepresentation, header->bind.assoc_gid = AssocGroupId; header->bind.num_elements = 1; header->bind.num_syntaxes = 1; - memcpy(&header->bind.abstract, AbstractId, sizeof(RPC_SYNTAX_IDENTIFIER)); - memcpy(&header->bind.transfer, TransferId, sizeof(RPC_SYNTAX_IDENTIFIER)); + header->bind.abstract = *AbstractId; + header->bind.transfer = *TransferId; return header; } @@ -278,7 +278,7 @@ RpcPktHdr *RPCRT4_BuildBindAckHeader(unsigned long DataRepresentation, results->results[0].result = Result; results->results[0].reason = Reason; transfer_id = (RPC_SYNTAX_IDENTIFIER*)(results + 1); - memcpy(transfer_id, TransferId, sizeof(RPC_SYNTAX_IDENTIFIER)); + *transfer_id = *TransferId; return header; } diff --git a/dlls/rpcrt4/rpc_server.c b/dlls/rpcrt4/rpc_server.c index 7849e4efb60..40e9e7e4e62 100644 --- a/dlls/rpcrt4/rpc_server.c +++ b/dlls/rpcrt4/rpc_server.c @@ -845,7 +845,7 @@ RPC_STATUS WINAPI RpcServerRegisterIf2( RPC_IF_HANDLE IfSpec, UUID* MgrTypeUuid, sif = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(RpcServerInterface)); sif->If = If; if (MgrTypeUuid) { - memcpy(&sif->MgrTypeUuid, MgrTypeUuid, sizeof(UUID)); + sif->MgrTypeUuid = *MgrTypeUuid; sif->MgrEpv = MgrEpv; } else { memset(&sif->MgrTypeUuid, 0, sizeof(UUID)); @@ -977,8 +977,8 @@ RPC_STATUS WINAPI RpcObjectSetType( UUID* ObjUuid, UUID* TypeUuid ) return RPC_S_ALREADY_REGISTERED; /* ... otherwise create a new one and add it in. */ map = HeapAlloc(GetProcessHeap(), 0, sizeof(RpcObjTypeMap)); - memcpy(&map->Object, ObjUuid, sizeof(UUID)); - memcpy(&map->Type, TypeUuid, sizeof(UUID)); + map->Object = *ObjUuid; + map->Type = *TypeUuid; map->next = NULL; if (prev) prev->next = map; /* prev is the last map in the linklist */