Dylan Smith : ddraw: Partially revert a struct copy change to fix a regression.
Module: wine Branch: master Commit: ced4c383241a1069eca094408d288fbc3784c094 URL: http://source.winehq.org/git/wine.git/?a=commit;h=ced4c383241a1069eca094408d... Author: Dylan Smith <dylan.ah.smith(a)gmail.com> Date: Tue Jun 28 12:41:21 2011 -0400 ddraw: Partially revert a struct copy change to fix a regression. Commit 3871329872afe3976e0b2b85330e3a7c47301658 caused the regression. --- dlls/ddraw/ddraw_private.h | 5 +++-- 1 files changed, 3 insertions(+), 2 deletions(-) diff --git a/dlls/ddraw/ddraw_private.h b/dlls/ddraw/ddraw_private.h index c73743a..0f3864a 100644 --- a/dlls/ddraw/ddraw_private.h +++ b/dlls/ddraw/ddraw_private.h @@ -585,10 +585,11 @@ typedef struct #define DD_STRUCT_COPY_BYSIZE_(to,from,from_size) \ do { \ DWORD __size = (to)->dwSize; \ - DWORD __copysize = min(__size, from_size); \ + DWORD __resetsize = min(__size, sizeof(*to)); \ + DWORD __copysize = min(__resetsize, from_size); \ assert(to != from); \ memcpy(to, from, __copysize); \ - memset((char*)(to) + __copysize, 0, __size - __copysize); \ + memset((char*)(to) + __copysize, 0, __resetsize - __copysize); \ (to)->dwSize = __size; /* restore size */ \ } while (0)
participants (1)
-
Alexandre Julliard