Signed-off-by: Anastasios Simeonidis symeonidis@csd.auth.gr --- dlls/ntdll/nt.c | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-)
diff --git a/dlls/ntdll/nt.c b/dlls/ntdll/nt.c index b6daa226b3..8c652a0615 100644 --- a/dlls/ntdll/nt.c +++ b/dlls/ntdll/nt.c @@ -1675,7 +1675,7 @@ static BOOL sysfs_count_list_elements(const char *filename, DWORD *result)
/* for 'data', max_len is the array count. for 'dataex', max_len is in bytes */ static NTSTATUS create_logical_proc_info(SYSTEM_LOGICAL_PROCESSOR_INFORMATION **data, - SYSTEM_LOGICAL_PROCESSOR_INFORMATION_EX **dataex, DWORD *max_len) + SYSTEM_LOGICAL_PROCESSOR_INFORMATION_EX **dataex, DWORD *max_len, DWORD relation) { static const char core_info[] = "/sys/devices/system/cpu/cpu%u/topology/%s"; static const char cache_info[] = "/sys/devices/system/cpu/cpu%u/cache/index%u/%s"; @@ -1686,6 +1686,9 @@ static NTSTATUS create_logical_proc_info(SYSTEM_LOGICAL_PROCESSOR_INFORMATION ** char op, name[MAX_PATH]; ULONG_PTR all_cpus_mask = 0;
+ if (relation != RelationAll) + FIXME("Relationship filtering not implemented: 0x%x\n", relation); + /* On systems with a large number of CPU cores (32 or 64 depending on 32-bit or 64-bit), * we have issues parsing processor information: * - ULONG_PTR masks as used in data structures can't hold all cores. Requires splitting @@ -1895,7 +1898,7 @@ static NTSTATUS create_logical_proc_info(SYSTEM_LOGICAL_PROCESSOR_INFORMATION ** #elif defined(__APPLE__) /* for 'data', max_len is the array count. for 'dataex', max_len is in bytes */ static NTSTATUS create_logical_proc_info(SYSTEM_LOGICAL_PROCESSOR_INFORMATION **data, - SYSTEM_LOGICAL_PROCESSOR_INFORMATION_EX **dataex, DWORD *max_len) + SYSTEM_LOGICAL_PROCESSOR_INFORMATION_EX **dataex, DWORD *max_len, DWORD relation) { DWORD pkgs_no, cores_no, lcpu_no, lcpu_per_core, cores_per_package, assoc, len = 0; DWORD cache_ctrs[10] = {0}; @@ -1905,6 +1908,9 @@ static NTSTATUS create_logical_proc_info(SYSTEM_LOGICAL_PROCESSOR_INFORMATION ** size_t size; DWORD p,i,j,k;
+ if (relation != RelationAll) + FIXME("Relationship filtering not implemented: 0x%x\n", relation); + lcpu_no = NtCurrentTeb()->Peb->NumberOfProcessors;
size = sizeof(pkgs_no); @@ -2030,7 +2036,7 @@ static NTSTATUS create_logical_proc_info(SYSTEM_LOGICAL_PROCESSOR_INFORMATION ** } #else static NTSTATUS create_logical_proc_info(SYSTEM_LOGICAL_PROCESSOR_INFORMATION **data, - SYSTEM_LOGICAL_PROCESSOR_INFORMATION_EX **dataex, DWORD *max_len) + SYSTEM_LOGICAL_PROCESSOR_INFORMATION_EX **dataex, DWORD *max_len, DWORD relation) { FIXME("stub\n"); return STATUS_NOT_IMPLEMENTED; @@ -2868,7 +2874,7 @@ NTSTATUS WINAPI NtQuerySystemInformation( break; }
- ret = create_logical_proc_info(&buf, NULL, &len); + ret = create_logical_proc_info(&buf, NULL, &len, RelationAll); if( ret != STATUS_SUCCESS ) { RtlFreeHeap(GetProcessHeap(), 0, buf); @@ -2957,9 +2963,6 @@ NTSTATUS WINAPI NtQuerySystemInformationEx(SYSTEM_INFORMATION_CLASS SystemInform break; }
- if (*(DWORD*)Query != RelationAll) - FIXME("Relationship filtering not implemented: 0x%x\n", *(DWORD*)Query); - len = 3 * sizeof(*buf); buf = RtlAllocateHeap(GetProcessHeap(), 0, len); if (!buf) @@ -2968,7 +2971,7 @@ NTSTATUS WINAPI NtQuerySystemInformationEx(SYSTEM_INFORMATION_CLASS SystemInform break; }
- ret = create_logical_proc_info(NULL, &buf, &len); + ret = create_logical_proc_info(NULL, &buf, &len, *(DWORD*)Query); if (ret != STATUS_SUCCESS) { RtlFreeHeap(GetProcessHeap(), 0, buf); @@ -2980,7 +2983,7 @@ NTSTATUS WINAPI NtQuerySystemInformationEx(SYSTEM_INFORMATION_CLASS SystemInform if (!SystemInformation) ret = STATUS_ACCESS_VIOLATION; else - memcpy( SystemInformation, buf, len); + memcpy(SystemInformation, buf, len); } else ret = STATUS_INFO_LENGTH_MISMATCH;