Commit 04d07d65 authored by Huw Davies's avatar Huw Davies Committed by Alexandre Julliard

wow64: Report the correct size for SystemLogicalProcessorInformationEx.

Spotted by Brendan Shanks. Signed-off-by: 's avatarHuw Davies <huw@codeweavers.com>
parent f815c264
......@@ -1168,7 +1168,7 @@ static void test_query_logicalprocex(void)
{
SYSTEM_LOGICAL_PROCESSOR_INFORMATION_EX *infoex, *infoex_public, *infoex_core, *infoex_numa,
*infoex_cache, *infoex_package, *infoex_group, *ex;
DWORD relationship, len, len_public, len_core, len_numa, len_cache, len_package, len_group, len_union;
DWORD relationship, len, len_public, len_core, len_numa, len_cache, len_package, len_group, len_union, ret_len;
unsigned int i, j;
NTSTATUS status;
BOOL ret;
......@@ -1226,8 +1226,9 @@ static void test_query_logicalprocex(void)
infoex_group = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, len_group);
relationship = RelationAll;
status = pNtQuerySystemInformationEx(SystemLogicalProcessorInformationEx, &relationship, sizeof(relationship), infoex, len, &len);
status = pNtQuerySystemInformationEx(SystemLogicalProcessorInformationEx, &relationship, sizeof(relationship), infoex, len, &ret_len);
ok(status == STATUS_SUCCESS, "got 0x%08lx\n", status);
ok(ret_len == len, "got %08lx expected %08lx\n", ret_len, len);
ret = pGetLogicalProcessorInformationEx(RelationAll, infoex_public, &len_public);
ok(ret, "got %d, error %ld\n", ret, GetLastError());
......
......@@ -617,7 +617,7 @@ NTSTATUS WINAPI wow64_NtQuerySystemInformationEx( UINT *args )
status = NtQuerySystemInformationEx( class, &handle, sizeof(handle), info, size, &size );
if (!status)
{
for (pos = pos32 = 0; pos < size && pos32 < len; pos += ex->Size, pos32 += size32)
for (pos = pos32 = 0; pos < size; pos += ex->Size, pos32 += size32)
{
ex = (SYSTEM_LOGICAL_PROCESSOR_INFORMATION_EX *)((char *)info + pos);
ex32 = (SYSTEM_LOGICAL_PROCESSOR_INFORMATION_EX32 *)((char *)info32 + pos32);
......@@ -645,8 +645,8 @@ NTSTATUS WINAPI wow64_NtQuerySystemInformationEx( UINT *args )
}
if (pos32 + size32 <= len) put_logical_proc_info_ex( ex32, ex );
}
if (pos < size) status = STATUS_INFO_LENGTH_MISMATCH;
else size = pos32;
if (pos32 > len) status = STATUS_INFO_LENGTH_MISMATCH;
size = pos32;
}
if (retlen) *retlen = size;
return status;
......
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