From 5ecd33e2f9910090a3ecebcb354e62f246e60de7 Mon Sep 17 00:00:00 2001 From: Andrew Talbot Date: Sat, 8 Mar 2008 15:37:05 +0000 Subject: [PATCH] ntdll: Assign to structs instead of using memcpy. --- dlls/ntdll/reg.c | 2 +- dlls/ntdll/sec.c | 4 ++-- dlls/ntdll/time.c | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/dlls/ntdll/reg.c b/dlls/ntdll/reg.c index 9c9509daadc..9d9de0e4eed 100644 --- a/dlls/ntdll/reg.c +++ b/dlls/ntdll/reg.c @@ -96,7 +96,7 @@ NTSTATUS WINAPI RtlpNtCreateKey( PHANDLE retkey, ACCESS_MASK access, const OBJEC if (attr) { - memcpy( &oa, attr, sizeof oa ); + oa = *attr; oa.Attributes &= ~(OBJ_PERMANENT|OBJ_EXCLUSIVE); attr = &oa; } diff --git a/dlls/ntdll/sec.c b/dlls/ntdll/sec.c index ea24414882a..79a356bc29c 100644 --- a/dlls/ntdll/sec.c +++ b/dlls/ntdll/sec.c @@ -158,7 +158,7 @@ NTSTATUS WINAPI RtlAllocateAndInitializeSid ( tmp_sid->Revision = SID_REVISION; if (pIdentifierAuthority) - memcpy(&tmp_sid->IdentifierAuthority, pIdentifierAuthority, sizeof(SID_IDENTIFIER_AUTHORITY)); + tmp_sid->IdentifierAuthority = *pIdentifierAuthority; tmp_sid->SubAuthorityCount = nSubAuthorityCount; switch( nSubAuthorityCount ) @@ -302,7 +302,7 @@ BOOL WINAPI RtlInitializeSid( pisid->Revision = SID_REVISION; pisid->SubAuthorityCount = nSubAuthorityCount; if (pIdentifierAuthority) - memcpy(&pisid->IdentifierAuthority, pIdentifierAuthority, sizeof (SID_IDENTIFIER_AUTHORITY)); + pisid->IdentifierAuthority = *pIdentifierAuthority; for (i = 0; i < nSubAuthorityCount; i++) *RtlSubAuthoritySid(pSid, i) = 0; diff --git a/dlls/ntdll/time.c b/dlls/ntdll/time.c index cd239580f56..e6e4ed2ac6f 100644 --- a/dlls/ntdll/time.c +++ b/dlls/ntdll/time.c @@ -684,7 +684,7 @@ static void find_reg_tz_info(RTL_TIME_ZONE_INFORMATION *tzi) if (match_tz_info(tzi, ®_tzi)) { - memcpy(tzi, ®_tzi, sizeof(*tzi)); + *tzi = reg_tzi; NtClose(hkey); return; }