Andrew Talbot : ntdll: Assign to structs instead of using memcpy.
Alexandre Julliard
julliard at winehq.org
Mon Mar 10 07:16:51 CDT 2008
Module: wine
Branch: master
Commit: 5ecd33e2f9910090a3ecebcb354e62f246e60de7
URL: http://source.winehq.org/git/wine.git/?a=commit;h=5ecd33e2f9910090a3ecebcb354e62f246e60de7
Author: Andrew Talbot <andrew.talbot at talbotville.com>
Date: Sat Mar 8 15:37:05 2008 +0000
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 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, ®_tzi))
{
- memcpy(tzi, ®_tzi, sizeof(*tzi));
+ *tzi = reg_tzi;
NtClose(hkey);
return;
}
More information about the wine-cvs
mailing list