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