secur32: Use offsetof() instead of pointer substraction.

Signed-off-by: Michael Stefaniuc <mstefani@winehq.org>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Michael Stefaniuc 2019-02-19 20:44:31 +01:00 committed by Alexandre Julliard
parent 8dade1bc86
commit 8b343fd55b
1 changed files with 4 additions and 4 deletions

View File

@ -247,8 +247,8 @@ static void _makeFnTableA(PSecurityFunctionTableA fnTableA,
* implemented (yikes)
*/
size_t tableSize = inFnTableA->dwVersion == 1 ?
(const BYTE *)&inFnTableA->SetContextAttributesA -
(const BYTE *)inFnTableA : sizeof(SecurityFunctionTableA);
offsetof(SecurityFunctionTableA, SetContextAttributesA) :
sizeof(SecurityFunctionTableA);
memcpy(fnTableA, inFnTableA, tableSize);
/* override this, since we can do it internally anyway */
@ -318,8 +318,8 @@ static void _makeFnTableW(PSecurityFunctionTableW fnTableW,
* implemented (yikes)
*/
size_t tableSize = inFnTableW->dwVersion == 1 ?
(const BYTE *)&inFnTableW->SetContextAttributesW -
(const BYTE *)inFnTableW : sizeof(SecurityFunctionTableW);
offsetof(SecurityFunctionTableW, SetContextAttributesW) :
sizeof(SecurityFunctionTableW);
memcpy(fnTableW, inFnTableW, tableSize);
/* override this, since we can do it internally anyway */