ddraw: Partially revert a struct copy change to fix a regression.

Commit 3871329872 caused the regression.
This commit is contained in:
Dylan Smith 2011-06-28 12:41:21 -04:00 committed by Alexandre Julliard
parent ed3a276591
commit ced4c38324
1 changed files with 3 additions and 2 deletions

View File

@ -585,10 +585,11 @@ typedef struct
#define DD_STRUCT_COPY_BYSIZE_(to,from,from_size) \ #define DD_STRUCT_COPY_BYSIZE_(to,from,from_size) \
do { \ do { \
DWORD __size = (to)->dwSize; \ 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); \ assert(to != from); \
memcpy(to, from, __copysize); \ memcpy(to, from, __copysize); \
memset((char*)(to) + __copysize, 0, __size - __copysize); \ memset((char*)(to) + __copysize, 0, __resetsize - __copysize); \
(to)->dwSize = __size; /* restore size */ \ (to)->dwSize = __size; /* restore size */ \
} while (0) } while (0)