Commit ea50d41b authored by Alexandre Julliard's avatar Alexandre Julliard

kernelbase: Fix alignment of compatibility context elements.

parent 2deb8c28
...@@ -168,7 +168,11 @@ static RTL_OSVERSIONINFOEXW current_version; ...@@ -168,7 +168,11 @@ static RTL_OSVERSIONINFOEXW current_version;
static BOOL CALLBACK init_current_version(PINIT_ONCE init_once, PVOID parameter, PVOID *context) 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; const struct version_info *ver;
SIZE_T req; SIZE_T req;
int idx; int idx;
...@@ -201,13 +205,12 @@ static BOOL CALLBACK init_current_version(PINIT_ONCE init_once, PVOID parameter, ...@@ -201,13 +205,12 @@ static BOOL CALLBACK init_current_version(PINIT_ONCE init_once, PVOID parameter,
{ {
do do
{ {
COMPATIBILITY_CONTEXT_ELEMENT *elements = (COMPATIBILITY_CONTEXT_ELEMENT*)(acci + 1); DWORD i;
DWORD i, count = *acci;
for (i = 0; i < count; i++) for (i = 0; i < acci->ElementCount; i++)
{ {
if (elements[i].Type == ACTCTX_COMPATIBILITY_ELEMENT_TYPE_OS && if (acci->Elements[i].Type == ACTCTX_COMPATIBILITY_ELEMENT_TYPE_OS &&
IsEqualGUID(&elements[i].Id, &version_data[idx].guid)) IsEqualGUID(&acci->Elements[i].Id, &version_data[idx].guid))
{ {
ver = &version_data[idx].info; ver = &version_data[idx].info;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment