Alexandre Julliard : include: Fix data structures for processor affinity on 64-bit.
Alexandre Julliard
julliard at winehq.org
Sun Jan 4 09:09:07 CST 2009
Module: wine
Branch: master
Commit: 935a406b27a96d1f9e4bd7b07ece035024cb56c1
URL: http://source.winehq.org/git/wine.git/?a=commit;h=935a406b27a96d1f9e4bd7b07ece035024cb56c1
Author: Alexandre Julliard <julliard at winehq.org>
Date: Sun Jan 4 14:10:20 2009 +0100
include: Fix data structures for processor affinity on 64-bit.
---
dlls/kernel32/cpu.c | 6 +++---
include/winbase.h | 2 +-
include/winnt.h | 5 +++++
3 files changed, 9 insertions(+), 4 deletions(-)
diff --git a/dlls/kernel32/cpu.c b/dlls/kernel32/cpu.c
index 63ca277..bd3d74a 100644
--- a/dlls/kernel32/cpu.c
+++ b/dlls/kernel32/cpu.c
@@ -681,7 +681,7 @@ VOID WINAPI GetSystemInfo(
valSize = sizeof(int);
if (sysctlbyname ("hw.activecpu", &value, &valSize, NULL, 0) == 0)
- cachedsi.dwActiveProcessorMask = (1 << value) - 1;
+ cachedsi.dwActiveProcessorMask = ((ULONG_PTR)1 << value) - 1;
valSize = sizeof(int);
if (sysctlbyname ("hw.cputype", &cputype, &valSize, NULL, 0) == 0)
@@ -780,12 +780,12 @@ VOID WINAPI GetSystemInfo(
FIXME("not yet supported on this system\n");
#endif
if (!cachedsi.dwActiveProcessorMask)
- cachedsi.dwActiveProcessorMask = (1 << cachedsi.dwNumberOfProcessors) - 1;
+ cachedsi.dwActiveProcessorMask = ((ULONG_PTR)1 << cachedsi.dwNumberOfProcessors) - 1;
*si = cachedsi;
TRACE("<- CPU arch %d, res'd %d, pagesize %d, minappaddr %p, maxappaddr %p,"
- " act.cpumask %08x, numcpus %d, CPU type %d, allocgran. %d, CPU level %d, CPU rev %d\n",
+ " act.cpumask %lx, numcpus %d, CPU type %d, allocgran. %d, CPU level %d, CPU rev %d\n",
si->u.s.wProcessorArchitecture, si->u.s.wReserved, si->dwPageSize,
si->lpMinimumApplicationAddress, si->lpMaximumApplicationAddress,
si->dwActiveProcessorMask, si->dwNumberOfProcessors, si->dwProcessorType,
diff --git a/include/winbase.h b/include/winbase.h
index d3b392c..521bb16 100644
--- a/include/winbase.h
+++ b/include/winbase.h
@@ -776,7 +776,7 @@ typedef struct _SYSTEM_INFO
DWORD dwPageSize;
LPVOID lpMinimumApplicationAddress;
LPVOID lpMaximumApplicationAddress;
- DWORD dwActiveProcessorMask;
+ DWORD_PTR dwActiveProcessorMask;
DWORD dwNumberOfProcessors;
DWORD dwProcessorType;
DWORD dwAllocationGranularity;
diff --git a/include/winnt.h b/include/winnt.h
index 0c8e0a9..57f4c5c 100644
--- a/include/winnt.h
+++ b/include/winnt.h
@@ -540,7 +540,12 @@ typedef DWORD FLONG;
#define PROCESSOR_ARM920 2336 /* 0x920 */
#define PROCESSOR_ARM_7TDMI 70001
+#ifdef _WIN64
+#define MAXIMUM_PROCESSORS 64
+#else
#define MAXIMUM_PROCESSORS 32
+#endif
+
typedef struct _MEMORY_BASIC_INFORMATION
{
LPVOID BaseAddress;
More information about the wine-cvs
mailing list