The return length is unlikely to change between the two NtQuerySystemInformationEx calls, but it's possible, and it's more correct to parse the entries with the length from the call where the data was returned.
From: Brendan Shanks bshanks@codeweavers.com
--- dlls/wbemprox/builtin.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/dlls/wbemprox/builtin.c b/dlls/wbemprox/builtin.c index 725f3816ad9..4ac52918f6f 100644 --- a/dlls/wbemprox/builtin.c +++ b/dlls/wbemprox/builtin.c @@ -1533,7 +1533,7 @@ static UINT get_logical_processor_count( UINT *num_physical, UINT *num_packages if (status != STATUS_INFO_LENGTH_MISMATCH) return get_processor_count();
if (!(buf = malloc( len ))) return get_processor_count(); - status = NtQuerySystemInformationEx( SystemLogicalProcessorInformationEx, &all, sizeof(all), buf, len, NULL ); + status = NtQuerySystemInformationEx( SystemLogicalProcessorInformationEx, &all, sizeof(all), buf, len, &len ); if (status != STATUS_SUCCESS) { free( buf );
This merge request was approved by Hans Leidekker.