ntdll: Assign to structs instead of using memcpy

Andrew Talbot andrew.talbot at talbotville.com
Sat Mar 8 09:37:05 CST 2008


Changelog:
    ntdll: Assign to structs instead of using memcpy.

diff --git a/dlls/ntdll/reg.c b/dlls/ntdll/reg.c
index 9c9509d..9d9de0e 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 ea24414..79a356b 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 cd23958..e6e4ed2 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, &reg_tzi))
         {
-            memcpy(tzi, &reg_tzi, sizeof(*tzi));
+            *tzi = reg_tzi;
             NtClose(hkey);
             return;
         }



More information about the wine-patches mailing list