Alexandre Julliard : ntdll: Fix a couple of system information structures for 64-bit.
Alexandre Julliard
julliard at winehq.org
Fri Aug 28 10:17:35 CDT 2009
Module: wine
Branch: master
Commit: 2be006e497ab67d6a625e93049397e128fff370d
URL: http://source.winehq.org/git/wine.git/?a=commit;h=2be006e497ab67d6a625e93049397e128fff370d
Author: Alexandre Julliard <julliard at winehq.org>
Date: Thu Aug 27 19:30:50 2009 +0200
ntdll: Fix a couple of system information structures for 64-bit.
---
dlls/kernel32/cpu.c | 10 +++++-----
dlls/ntdll/nt.c | 24 ++++++++++++------------
dlls/ntdll/virtual.c | 22 +++++++++++-----------
include/winternl.h | 31 +++++++++++--------------------
4 files changed, 39 insertions(+), 48 deletions(-)
diff --git a/dlls/kernel32/cpu.c b/dlls/kernel32/cpu.c
index bc890c6..6648dc4 100644
--- a/dlls/kernel32/cpu.c
+++ b/dlls/kernel32/cpu.c
@@ -379,11 +379,11 @@ VOID WINAPI GetSystemInfo(
memset(PF,0,sizeof(PF));
NtQuerySystemInformation( SystemBasicInformation, &sbi, sizeof(sbi), NULL );
- cachedsi.dwPageSize = sbi.uPageSize;
- cachedsi.lpMinimumApplicationAddress = sbi.pLowestUserAddress;
- cachedsi.lpMaximumApplicationAddress = sbi.pMmHighestUserAddress;
- cachedsi.dwNumberOfProcessors = sbi.uKeActiveProcessors;
- cachedsi.dwAllocationGranularity = sbi.uAllocationGranularity;
+ cachedsi.dwPageSize = sbi.PageSize;
+ cachedsi.lpMinimumApplicationAddress = sbi.LowestUserAddress;
+ cachedsi.lpMaximumApplicationAddress = sbi.HighestUserAddress;
+ cachedsi.dwNumberOfProcessors = sbi.ActiveProcessors;
+ cachedsi.dwAllocationGranularity = sbi.AllocationGranularity;
/* choose sensible defaults ...
* FIXME: perhaps overridable with precompiler flags?
diff --git a/dlls/ntdll/nt.c b/dlls/ntdll/nt.c
index 8679da5..279a525 100644
--- a/dlls/ntdll/nt.c
+++ b/dlls/ntdll/nt.c
@@ -1038,9 +1038,9 @@ NTSTATUS WINAPI NtQuerySystemInformation(
{
sppi = RtlAllocateHeap(GetProcessHeap(), 0,
sizeof(SYSTEM_PROCESSOR_PERFORMANCE_INFORMATION));
- sppi->liIdleTime.QuadPart = idle;
- sppi->liKernelTime.QuadPart = sys;
- sppi->liUserTime.QuadPart = usr;
+ sppi->IdleTime.QuadPart = idle;
+ sppi->KernelTime.QuadPart = sys;
+ sppi->UserTime.QuadPart = usr;
cpus = 1;
len = sizeof(SYSTEM_PROCESSOR_PERFORMANCE_INFORMATION);
}
@@ -1057,17 +1057,17 @@ NTSTATUS WINAPI NtQuerySystemInformation(
out_cpus --;
if (name[3]=='0') /* first cpu */
{
- sppi->liIdleTime.QuadPart = idle;
- sppi->liKernelTime.QuadPart = sys;
- sppi->liUserTime.QuadPart = usr;
+ sppi->IdleTime.QuadPart = idle;
+ sppi->KernelTime.QuadPart = sys;
+ sppi->UserTime.QuadPart = usr;
}
else /* new cpu */
{
len = sizeof(SYSTEM_PROCESSOR_PERFORMANCE_INFORMATION) * (cpus+1);
sppi = RtlReAllocateHeap(GetProcessHeap(), 0, sppi, len);
- sppi[cpus].liIdleTime.QuadPart = idle;
- sppi[cpus].liKernelTime.QuadPart = sys;
- sppi[cpus].liUserTime.QuadPart = usr;
+ sppi[cpus].IdleTime.QuadPart = idle;
+ sppi[cpus].KernelTime.QuadPart = sys;
+ sppi[cpus].UserTime.QuadPart = usr;
cpus++;
}
}
@@ -1090,9 +1090,9 @@ NTSTATUS WINAPI NtQuerySystemInformation(
/* many programs expect these values to change so fake change */
len = sizeof(SYSTEM_PROCESSOR_PERFORMANCE_INFORMATION);
- sppi->liKernelTime.QuadPart = 1 * i;
- sppi->liUserTime.QuadPart = 2 * i;
- sppi->liIdleTime.QuadPart = 3 * i;
+ sppi->KernelTime.QuadPart = 1 * i;
+ sppi->UserTime.QuadPart = 2 * i;
+ sppi->IdleTime.QuadPart = 3 * i;
i++;
}
diff --git a/dlls/ntdll/virtual.c b/dlls/ntdll/virtual.c
index 62176e4..77e880a 100644
--- a/dlls/ntdll/virtual.c
+++ b/dlls/ntdll/virtual.c
@@ -1364,17 +1364,17 @@ void virtual_init_threading(void)
*/
void virtual_get_system_info( SYSTEM_BASIC_INFORMATION *info )
{
- info->dwUnknown1 = 0;
- info->uKeMaximumIncrement = 0; /* FIXME */
- info->uPageSize = page_size;
- info->uMmLowestPhysicalPage = 1;
- info->uMmHighestPhysicalPage = 0x7fffffff / page_size;
- info->uMmNumberOfPhysicalPages = info->uMmHighestPhysicalPage - info->uMmLowestPhysicalPage;
- info->uAllocationGranularity = get_mask(0) + 1;
- info->pLowestUserAddress = (void *)0x10000;
- info->pMmHighestUserAddress = (char *)user_space_limit - 1;
- info->uKeActiveProcessors = NtCurrentTeb()->Peb->NumberOfProcessors;
- info->bKeNumberProcessors = info->uKeActiveProcessors;
+ info->unknown = 0;
+ info->KeMaximumIncrement = 0; /* FIXME */
+ info->PageSize = page_size;
+ info->MmLowestPhysicalPage = 1;
+ info->MmHighestPhysicalPage = 0x7fffffff / page_size;
+ info->MmNumberOfPhysicalPages = info->MmHighestPhysicalPage - info->MmLowestPhysicalPage;
+ info->AllocationGranularity = get_mask(0) + 1;
+ info->LowestUserAddress = (void *)0x10000;
+ info->HighestUserAddress = (char *)user_space_limit - 1;
+ info->ActiveProcessors = NtCurrentTeb()->Peb->NumberOfProcessors;
+ info->NumberOfProcessors = NtCurrentTeb()->Peb->NumberOfProcessors;
}
diff --git a/include/winternl.h b/include/winternl.h
index e4d8055..aca74e5 100644
--- a/include/winternl.h
+++ b/include/winternl.h
@@ -1187,19 +1187,17 @@ typedef struct _RTL_RWLOCK {
typedef struct _SYSTEM_BASIC_INFORMATION {
#ifdef __WINESRC__
- DWORD dwUnknown1;
- ULONG uKeMaximumIncrement;
- ULONG uPageSize;
- ULONG uMmNumberOfPhysicalPages;
- ULONG uMmLowestPhysicalPage;
- ULONG uMmHighestPhysicalPage;
- ULONG uAllocationGranularity;
- PVOID pLowestUserAddress;
- PVOID pMmHighestUserAddress;
- ULONG uKeActiveProcessors;
- BYTE bKeNumberProcessors;
- BYTE bUnknown2;
- WORD wUnknown3;
+ DWORD unknown;
+ ULONG KeMaximumIncrement;
+ ULONG PageSize;
+ ULONG MmNumberOfPhysicalPages;
+ ULONG MmLowestPhysicalPage;
+ ULONG MmHighestPhysicalPage;
+ ULONG_PTR AllocationGranularity;
+ PVOID LowestUserAddress;
+ PVOID HighestUserAddress;
+ ULONG_PTR ActiveProcessors;
+ BYTE NumberOfProcessors;
#else
BYTE Reserved1[24];
PVOID Reserved2[4];
@@ -1260,18 +1258,11 @@ typedef struct _SYSTEM_TIMEOFDAY_INFORMATION {
/* System Information Class 0x08 */
typedef struct _SYSTEM_PROCESSOR_PERFORMANCE_INFORMATION {
-#ifdef __WINESRC__
- LARGE_INTEGER liIdleTime;
- LARGE_INTEGER liKernelTime;
- LARGE_INTEGER liUserTime;
- DWORD dwSpare[5];
-#else
LARGE_INTEGER IdleTime;
LARGE_INTEGER KernelTime;
LARGE_INTEGER UserTime;
LARGE_INTEGER Reserved1[2];
ULONG Reserved2;
-#endif
} SYSTEM_PROCESSOR_PERFORMANCE_INFORMATION, *PSYSTEM_PROCESSOR_PERFORMANCE_INFORMATION;
/* System Information Class 0x0b */
More information about the wine-cvs
mailing list