Module: wine Branch: master Commit: ea50d41b3f5f9b3565bfa2831f8f37aeb1824424 URL: https://source.winehq.org/git/wine.git/?a=commit;h=ea50d41b3f5f9b3565bfa2831...
Author: Alexandre Julliard julliard@winehq.org Date: Fri Apr 30 23:12:16 2021 +0200
kernelbase: Fix alignment of compatibility context elements.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=51080 Signed-off-by: Alexandre Julliard julliard@winehq.org
---
dlls/kernelbase/version.c | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-)
diff --git a/dlls/kernelbase/version.c b/dlls/kernelbase/version.c index 66bd619e394..96349708989 100644 --- a/dlls/kernelbase/version.c +++ b/dlls/kernelbase/version.c @@ -168,7 +168,11 @@ static RTL_OSVERSIONINFOEXW current_version;
static BOOL CALLBACK init_current_version(PINIT_ONCE init_once, PVOID parameter, PVOID *context) { - /*ACTIVATION_CONTEXT_COMPATIBILITY_INFORMATION*/DWORD *acci; + struct acci + { + DWORD ElementCount; + COMPATIBILITY_CONTEXT_ELEMENT Elements[1]; + } *acci; const struct version_info *ver; SIZE_T req; int idx; @@ -201,13 +205,12 @@ static BOOL CALLBACK init_current_version(PINIT_ONCE init_once, PVOID parameter, { do { - COMPATIBILITY_CONTEXT_ELEMENT *elements = (COMPATIBILITY_CONTEXT_ELEMENT*)(acci + 1); - DWORD i, count = *acci; + DWORD i;
- for (i = 0; i < count; i++) + for (i = 0; i < acci->ElementCount; i++) { - if (elements[i].Type == ACTCTX_COMPATIBILITY_ELEMENT_TYPE_OS && - IsEqualGUID(&elements[i].Id, &version_data[idx].guid)) + if (acci->Elements[i].Type == ACTCTX_COMPATIBILITY_ELEMENT_TYPE_OS && + IsEqualGUID(&acci->Elements[i].Id, &version_data[idx].guid)) { ver = &version_data[idx].info;