Commit 9885b0ac authored by Anastasios Simeonidis's avatar Anastasios Simeonidis Committed by Alexandre Julliard

ntdll: Move relationship filtering to create_logical_proc_info.

parent 93f683eb
...@@ -1693,7 +1693,7 @@ static BOOL sysfs_count_list_elements(const char *filename, DWORD *result) ...@@ -1693,7 +1693,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 */ /* 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, 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 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"; static const char cache_info[] = "/sys/devices/system/cpu/cpu%u/cache/index%u/%s";
...@@ -1704,6 +1704,9 @@ static NTSTATUS create_logical_proc_info(SYSTEM_LOGICAL_PROCESSOR_INFORMATION ** ...@@ -1704,6 +1704,9 @@ static NTSTATUS create_logical_proc_info(SYSTEM_LOGICAL_PROCESSOR_INFORMATION **
char op, name[MAX_PATH]; char op, name[MAX_PATH];
ULONG_PTR all_cpus_mask = 0; 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), /* 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: * we have issues parsing processor information:
* - ULONG_PTR masks as used in data structures can't hold all cores. Requires splitting * - ULONG_PTR masks as used in data structures can't hold all cores. Requires splitting
...@@ -1913,7 +1916,7 @@ static NTSTATUS create_logical_proc_info(SYSTEM_LOGICAL_PROCESSOR_INFORMATION ** ...@@ -1913,7 +1916,7 @@ static NTSTATUS create_logical_proc_info(SYSTEM_LOGICAL_PROCESSOR_INFORMATION **
#elif defined(__APPLE__) #elif defined(__APPLE__)
/* for 'data', max_len is the array count. for 'dataex', max_len is in bytes */ /* 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, 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 pkgs_no, cores_no, lcpu_no, lcpu_per_core, cores_per_package, assoc, len = 0;
DWORD cache_ctrs[10] = {0}; DWORD cache_ctrs[10] = {0};
...@@ -1923,6 +1926,9 @@ static NTSTATUS create_logical_proc_info(SYSTEM_LOGICAL_PROCESSOR_INFORMATION ** ...@@ -1923,6 +1926,9 @@ static NTSTATUS create_logical_proc_info(SYSTEM_LOGICAL_PROCESSOR_INFORMATION **
size_t size; size_t size;
DWORD p,i,j,k; DWORD p,i,j,k;
if (relation != RelationAll)
FIXME("Relationship filtering not implemented: 0x%x\n", relation);
lcpu_no = NtCurrentTeb()->Peb->NumberOfProcessors; lcpu_no = NtCurrentTeb()->Peb->NumberOfProcessors;
size = sizeof(pkgs_no); size = sizeof(pkgs_no);
...@@ -2048,7 +2054,7 @@ static NTSTATUS create_logical_proc_info(SYSTEM_LOGICAL_PROCESSOR_INFORMATION ** ...@@ -2048,7 +2054,7 @@ static NTSTATUS create_logical_proc_info(SYSTEM_LOGICAL_PROCESSOR_INFORMATION **
} }
#else #else
static NTSTATUS create_logical_proc_info(SYSTEM_LOGICAL_PROCESSOR_INFORMATION **data, 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"); FIXME("stub\n");
return STATUS_NOT_IMPLEMENTED; return STATUS_NOT_IMPLEMENTED;
...@@ -2970,7 +2976,7 @@ NTSTATUS WINAPI NtQuerySystemInformation( ...@@ -2970,7 +2976,7 @@ NTSTATUS WINAPI NtQuerySystemInformation(
break; break;
} }
ret = create_logical_proc_info(&buf, NULL, &len); ret = create_logical_proc_info(&buf, NULL, &len, RelationAll);
if( ret != STATUS_SUCCESS ) if( ret != STATUS_SUCCESS )
{ {
RtlFreeHeap(GetProcessHeap(), 0, buf); RtlFreeHeap(GetProcessHeap(), 0, buf);
...@@ -3059,9 +3065,6 @@ NTSTATUS WINAPI NtQuerySystemInformationEx(SYSTEM_INFORMATION_CLASS SystemInform ...@@ -3059,9 +3065,6 @@ NTSTATUS WINAPI NtQuerySystemInformationEx(SYSTEM_INFORMATION_CLASS SystemInform
break; break;
} }
if (*(DWORD*)Query != RelationAll)
FIXME("Relationship filtering not implemented: 0x%x\n", *(DWORD*)Query);
len = 3 * sizeof(*buf); len = 3 * sizeof(*buf);
buf = RtlAllocateHeap(GetProcessHeap(), 0, len); buf = RtlAllocateHeap(GetProcessHeap(), 0, len);
if (!buf) if (!buf)
...@@ -3070,7 +3073,7 @@ NTSTATUS WINAPI NtQuerySystemInformationEx(SYSTEM_INFORMATION_CLASS SystemInform ...@@ -3070,7 +3073,7 @@ NTSTATUS WINAPI NtQuerySystemInformationEx(SYSTEM_INFORMATION_CLASS SystemInform
break; break;
} }
ret = create_logical_proc_info(NULL, &buf, &len); ret = create_logical_proc_info(NULL, &buf, &len, *(DWORD*)Query);
if (ret != STATUS_SUCCESS) if (ret != STATUS_SUCCESS)
{ {
RtlFreeHeap(GetProcessHeap(), 0, buf); RtlFreeHeap(GetProcessHeap(), 0, buf);
...@@ -3082,7 +3085,7 @@ NTSTATUS WINAPI NtQuerySystemInformationEx(SYSTEM_INFORMATION_CLASS SystemInform ...@@ -3082,7 +3085,7 @@ NTSTATUS WINAPI NtQuerySystemInformationEx(SYSTEM_INFORMATION_CLASS SystemInform
if (!SystemInformation) if (!SystemInformation)
ret = STATUS_ACCESS_VIOLATION; ret = STATUS_ACCESS_VIOLATION;
else else
memcpy( SystemInformation, buf, len); memcpy(SystemInformation, buf, len);
} }
else else
ret = STATUS_INFO_LENGTH_MISMATCH; ret = STATUS_INFO_LENGTH_MISMATCH;
......
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