Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
f2ac82b8
Commit
f2ac82b8
authored
Mar 30, 2021
by
Paul Gofman
Committed by
Alexandre Julliard
Mar 30, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
kernel32: Implement GetSystemCpuSetInformation().
Signed-off-by:
Paul Gofman
<
pgofman@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
084519a8
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
86 additions
and
2 deletions
+86
-2
api-ms-win-core-processthreads-l1-1-3.spec
...threads-l1-1-3/api-ms-win-core-processthreads-l1-1-3.spec
+1
-1
kernel32.spec
dlls/kernel32/kernel32.spec
+1
-0
process.c
dlls/kernel32/tests/process.c
+66
-0
kernelbase.spec
dlls/kernelbase/kernelbase.spec
+1
-1
memory.c
dlls/kernelbase/memory.c
+16
-0
winbase.h
include/winbase.h
+1
-0
No files found.
dlls/api-ms-win-core-processthreads-l1-1-3/api-ms-win-core-processthreads-l1-1-3.spec
View file @
f2ac82b8
@ stub GetProcessDefaultCpuSets
@ stub GetProcessDefaultCpuSets
@ stub GetProcessInformation
@ stub GetProcessInformation
@ st
ub
GetSystemCpuSetInformation
@ st
dcall GetSystemCpuSetInformation(ptr long ptr ptr long) kernel32.
GetSystemCpuSetInformation
@ stdcall GetThreadDescription(long ptr) kernel32.GetThreadDescription
@ stdcall GetThreadDescription(long ptr) kernel32.GetThreadDescription
@ stub GetThreadSelectedCpuSets
@ stub GetThreadSelectedCpuSets
@ stub SetProcessDefaultCpuSets
@ stub SetProcessDefaultCpuSets
...
...
dlls/kernel32/kernel32.spec
View file @
f2ac82b8
...
@@ -822,6 +822,7 @@
...
@@ -822,6 +822,7 @@
@ stdcall GetStringTypeExA(long long str long ptr)
@ stdcall GetStringTypeExA(long long str long ptr)
@ stdcall -import GetStringTypeExW(long long wstr long ptr)
@ stdcall -import GetStringTypeExW(long long wstr long ptr)
@ stdcall -import GetStringTypeW(long wstr long ptr)
@ stdcall -import GetStringTypeW(long wstr long ptr)
@ stdcall -import GetSystemCpuSetInformation(ptr long ptr ptr long)
@ stdcall -import GetSystemFileCacheSize(ptr ptr ptr)
@ stdcall -import GetSystemFileCacheSize(ptr ptr ptr)
@ stdcall -import GetSystemDefaultLCID()
@ stdcall -import GetSystemDefaultLCID()
@ stdcall -import GetSystemDefaultLangID()
@ stdcall -import GetSystemDefaultLangID()
...
...
dlls/kernel32/tests/process.c
View file @
f2ac82b8
...
@@ -79,6 +79,7 @@ static BOOL (WINAPI *pSetInformationJobObject)(HANDLE job, JOBOBJECTINFOCLASS
...
@@ -79,6 +79,7 @@ static BOOL (WINAPI *pSetInformationJobObject)(HANDLE job, JOBOBJECTINFOCLASS
static
HANDLE
(
WINAPI
*
pCreateIoCompletionPort
)(
HANDLE
file
,
HANDLE
existing_port
,
ULONG_PTR
key
,
DWORD
threads
);
static
HANDLE
(
WINAPI
*
pCreateIoCompletionPort
)(
HANDLE
file
,
HANDLE
existing_port
,
ULONG_PTR
key
,
DWORD
threads
);
static
BOOL
(
WINAPI
*
pGetNumaProcessorNode
)(
UCHAR
,
PUCHAR
);
static
BOOL
(
WINAPI
*
pGetNumaProcessorNode
)(
UCHAR
,
PUCHAR
);
static
NTSTATUS
(
WINAPI
*
pNtQueryInformationProcess
)(
HANDLE
,
PROCESSINFOCLASS
,
PVOID
,
ULONG
,
PULONG
);
static
NTSTATUS
(
WINAPI
*
pNtQueryInformationProcess
)(
HANDLE
,
PROCESSINFOCLASS
,
PVOID
,
ULONG
,
PULONG
);
static
NTSTATUS
(
WINAPI
*
pNtQuerySystemInformationEx
)(
SYSTEM_INFORMATION_CLASS
,
void
*
,
ULONG
,
void
*
,
ULONG
,
ULONG
*
);
static
DWORD
(
WINAPI
*
pWTSGetActiveConsoleSessionId
)(
void
);
static
DWORD
(
WINAPI
*
pWTSGetActiveConsoleSessionId
)(
void
);
static
HANDLE
(
WINAPI
*
pCreateToolhelp32Snapshot
)(
DWORD
,
DWORD
);
static
HANDLE
(
WINAPI
*
pCreateToolhelp32Snapshot
)(
DWORD
,
DWORD
);
static
BOOL
(
WINAPI
*
pProcess32First
)(
HANDLE
,
PROCESSENTRY32
*
);
static
BOOL
(
WINAPI
*
pProcess32First
)(
HANDLE
,
PROCESSENTRY32
*
);
...
@@ -87,6 +88,7 @@ static BOOL (WINAPI *pThread32First)(HANDLE, THREADENTRY32*);
...
@@ -87,6 +88,7 @@ static BOOL (WINAPI *pThread32First)(HANDLE, THREADENTRY32*);
static
BOOL
(
WINAPI
*
pThread32Next
)(
HANDLE
,
THREADENTRY32
*
);
static
BOOL
(
WINAPI
*
pThread32Next
)(
HANDLE
,
THREADENTRY32
*
);
static
BOOL
(
WINAPI
*
pGetLogicalProcessorInformationEx
)(
LOGICAL_PROCESSOR_RELATIONSHIP
,
SYSTEM_LOGICAL_PROCESSOR_INFORMATION_EX
*
,
DWORD
*
);
static
BOOL
(
WINAPI
*
pGetLogicalProcessorInformationEx
)(
LOGICAL_PROCESSOR_RELATIONSHIP
,
SYSTEM_LOGICAL_PROCESSOR_INFORMATION_EX
*
,
DWORD
*
);
static
SIZE_T
(
WINAPI
*
pGetLargePageMinimum
)(
void
);
static
SIZE_T
(
WINAPI
*
pGetLargePageMinimum
)(
void
);
static
BOOL
(
WINAPI
*
pGetSystemCpuSetInformation
)(
SYSTEM_CPU_SET_INFORMATION
*
,
ULONG
,
ULONG
*
,
HANDLE
,
ULONG
);
static
BOOL
(
WINAPI
*
pInitializeProcThreadAttributeList
)(
struct
_PROC_THREAD_ATTRIBUTE_LIST
*
,
DWORD
,
DWORD
,
SIZE_T
*
);
static
BOOL
(
WINAPI
*
pInitializeProcThreadAttributeList
)(
struct
_PROC_THREAD_ATTRIBUTE_LIST
*
,
DWORD
,
DWORD
,
SIZE_T
*
);
static
BOOL
(
WINAPI
*
pUpdateProcThreadAttribute
)(
struct
_PROC_THREAD_ATTRIBUTE_LIST
*
,
DWORD
,
DWORD_PTR
,
void
*
,
SIZE_T
,
void
*
,
SIZE_T
*
);
static
BOOL
(
WINAPI
*
pUpdateProcThreadAttribute
)(
struct
_PROC_THREAD_ATTRIBUTE_LIST
*
,
DWORD
,
DWORD_PTR
,
void
*
,
SIZE_T
,
void
*
,
SIZE_T
*
);
static
void
(
WINAPI
*
pDeleteProcThreadAttributeList
)(
struct
_PROC_THREAD_ATTRIBUTE_LIST
*
);
static
void
(
WINAPI
*
pDeleteProcThreadAttributeList
)(
struct
_PROC_THREAD_ATTRIBUTE_LIST
*
);
...
@@ -245,6 +247,7 @@ static BOOL init(void)
...
@@ -245,6 +247,7 @@ static BOOL init(void)
hntdll
=
GetModuleHandleA
(
"ntdll.dll"
);
hntdll
=
GetModuleHandleA
(
"ntdll.dll"
);
pNtQueryInformationProcess
=
(
void
*
)
GetProcAddress
(
hntdll
,
"NtQueryInformationProcess"
);
pNtQueryInformationProcess
=
(
void
*
)
GetProcAddress
(
hntdll
,
"NtQueryInformationProcess"
);
pNtQuerySystemInformationEx
=
(
void
*
)
GetProcAddress
(
hntdll
,
"NtQuerySystemInformationEx"
);
pGetNativeSystemInfo
=
(
void
*
)
GetProcAddress
(
hkernel32
,
"GetNativeSystemInfo"
);
pGetNativeSystemInfo
=
(
void
*
)
GetProcAddress
(
hkernel32
,
"GetNativeSystemInfo"
);
pGetSystemRegistryQuota
=
(
void
*
)
GetProcAddress
(
hkernel32
,
"GetSystemRegistryQuota"
);
pGetSystemRegistryQuota
=
(
void
*
)
GetProcAddress
(
hkernel32
,
"GetSystemRegistryQuota"
);
...
@@ -269,6 +272,7 @@ static BOOL init(void)
...
@@ -269,6 +272,7 @@ static BOOL init(void)
pThread32Next
=
(
void
*
)
GetProcAddress
(
hkernel32
,
"Thread32Next"
);
pThread32Next
=
(
void
*
)
GetProcAddress
(
hkernel32
,
"Thread32Next"
);
pGetLogicalProcessorInformationEx
=
(
void
*
)
GetProcAddress
(
hkernel32
,
"GetLogicalProcessorInformationEx"
);
pGetLogicalProcessorInformationEx
=
(
void
*
)
GetProcAddress
(
hkernel32
,
"GetLogicalProcessorInformationEx"
);
pGetLargePageMinimum
=
(
void
*
)
GetProcAddress
(
hkernel32
,
"GetLargePageMinimum"
);
pGetLargePageMinimum
=
(
void
*
)
GetProcAddress
(
hkernel32
,
"GetLargePageMinimum"
);
pGetSystemCpuSetInformation
=
(
void
*
)
GetProcAddress
(
hkernel32
,
"GetSystemCpuSetInformation"
);
pInitializeProcThreadAttributeList
=
(
void
*
)
GetProcAddress
(
hkernel32
,
"InitializeProcThreadAttributeList"
);
pInitializeProcThreadAttributeList
=
(
void
*
)
GetProcAddress
(
hkernel32
,
"InitializeProcThreadAttributeList"
);
pUpdateProcThreadAttribute
=
(
void
*
)
GetProcAddress
(
hkernel32
,
"UpdateProcThreadAttribute"
);
pUpdateProcThreadAttribute
=
(
void
*
)
GetProcAddress
(
hkernel32
,
"UpdateProcThreadAttribute"
);
pDeleteProcThreadAttributeList
=
(
void
*
)
GetProcAddress
(
hkernel32
,
"DeleteProcThreadAttributeList"
);
pDeleteProcThreadAttributeList
=
(
void
*
)
GetProcAddress
(
hkernel32
,
"DeleteProcThreadAttributeList"
);
...
@@ -3786,6 +3790,67 @@ static void test_GetLogicalProcessorInformationEx(void)
...
@@ -3786,6 +3790,67 @@ static void test_GetLogicalProcessorInformationEx(void)
HeapFree
(
GetProcessHeap
(),
0
,
info
);
HeapFree
(
GetProcessHeap
(),
0
,
info
);
}
}
static
void
test_GetSystemCpuSetInformation
(
void
)
{
SYSTEM_CPU_SET_INFORMATION
*
info
,
*
info_nt
;
HANDLE
process
=
GetCurrentProcess
();
ULONG
size
,
expected_size
;
NTSTATUS
status
;
SYSTEM_INFO
si
;
BOOL
ret
;
if
(
!
pGetSystemCpuSetInformation
)
{
win_skip
(
"GetSystemCpuSetInformation() is not supported.
\n
"
);
return
;
}
GetSystemInfo
(
&
si
);
expected_size
=
sizeof
(
*
info
)
*
si
.
dwNumberOfProcessors
;
if
(
0
)
{
/* Crashes on Windows with NULL return length. */
pGetSystemCpuSetInformation
(
NULL
,
0
,
NULL
,
process
,
0
);
}
size
=
0xdeadbeef
;
SetLastError
(
0xdeadbeef
);
ret
=
pGetSystemCpuSetInformation
(
NULL
,
size
,
&
size
,
process
,
0
);
ok
(
!
ret
&&
GetLastError
()
==
ERROR_NOACCESS
,
"Got unexpected ret %#x, GetLastError() %u.
\n
"
,
ret
,
GetLastError
());
ok
(
!
size
,
"Got unexpected size %u.
\n
"
,
size
);
size
=
0xdeadbeef
;
SetLastError
(
0xdeadbeef
);
ret
=
pGetSystemCpuSetInformation
(
NULL
,
0
,
&
size
,
(
HANDLE
)
0xdeadbeef
,
0
);
ok
(
!
ret
&&
GetLastError
()
==
ERROR_INVALID_HANDLE
,
"Got unexpected ret %#x, GetLastError() %u.
\n
"
,
ret
,
GetLastError
());
ok
(
!
size
,
"Got unexpected size %u.
\n
"
,
size
);
size
=
0xdeadbeef
;
SetLastError
(
0xdeadbeef
);
ret
=
pGetSystemCpuSetInformation
(
NULL
,
0
,
&
size
,
process
,
0
);
ok
(
!
ret
&&
GetLastError
()
==
ERROR_INSUFFICIENT_BUFFER
,
"Got unexpected ret %#x, GetLastError() %u.
\n
"
,
ret
,
GetLastError
());
ok
(
size
==
expected_size
,
"Got unexpected size %u.
\n
"
,
size
);
info
=
heap_alloc
(
size
);
info_nt
=
heap_alloc
(
size
);
status
=
pNtQuerySystemInformationEx
(
SystemCpuSetInformation
,
&
process
,
sizeof
(
process
),
info_nt
,
expected_size
,
NULL
);
ok
(
!
status
,
"Got unexpected status %#x.
\n
"
,
status
);
size
=
0xdeadbeef
;
SetLastError
(
0xdeadbeef
);
ret
=
pGetSystemCpuSetInformation
(
info
,
expected_size
,
&
size
,
process
,
0
);
ok
(
ret
&&
GetLastError
()
==
0xdeadbeef
,
"Got unexpected ret %#x, GetLastError() %u.
\n
"
,
ret
,
GetLastError
());
ok
(
size
==
expected_size
,
"Got unexpected size %u.
\n
"
,
size
);
ok
(
!
memcmp
(
info
,
info_nt
,
expected_size
),
"Info does not match NtQuerySystemInformationEx()."
);
heap_free
(
info_nt
);
heap_free
(
info
);
}
static
void
test_largepages
(
void
)
static
void
test_largepages
(
void
)
{
{
SIZE_T
size
;
SIZE_T
size
;
...
@@ -4348,6 +4413,7 @@ START_TEST(process)
...
@@ -4348,6 +4413,7 @@ START_TEST(process)
test_GetNumaProcessorNode
();
test_GetNumaProcessorNode
();
test_session_info
();
test_session_info
();
test_GetLogicalProcessorInformationEx
();
test_GetLogicalProcessorInformationEx
();
test_GetSystemCpuSetInformation
();
test_largepages
();
test_largepages
();
test_ProcThreadAttributeList
();
test_ProcThreadAttributeList
();
test_SuspendProcessState
();
test_SuspendProcessState
();
...
...
dlls/kernelbase/kernelbase.spec
View file @
f2ac82b8
...
@@ -681,7 +681,7 @@
...
@@ -681,7 +681,7 @@
@ stdcall GetStringTypeW(long wstr long ptr)
@ stdcall GetStringTypeW(long wstr long ptr)
# @ stub GetSystemAppDataFolder
# @ stub GetSystemAppDataFolder
# @ stub GetSystemAppDataKey
# @ stub GetSystemAppDataKey
# @ stub GetSystemCpuSetInformation
@ stdcall GetSystemCpuSetInformation(ptr long ptr ptr long)
@ stdcall GetSystemDefaultLCID()
@ stdcall GetSystemDefaultLCID()
@ stdcall GetSystemDefaultLangID()
@ stdcall GetSystemDefaultLangID()
@ stdcall GetSystemDefaultLocaleName(ptr long)
@ stdcall GetSystemDefaultLocaleName(ptr long)
...
...
dlls/kernelbase/memory.c
View file @
f2ac82b8
...
@@ -1130,6 +1130,22 @@ BOOL WINAPI DECLSPEC_HOTPATCH GetLogicalProcessorInformationEx( LOGICAL_PROCESSO
...
@@ -1130,6 +1130,22 @@ BOOL WINAPI DECLSPEC_HOTPATCH GetLogicalProcessorInformationEx( LOGICAL_PROCESSO
}
}
/***********************************************************************
* GetSystemCpuSetInformation (kernelbase.@)
*/
BOOL
WINAPI
GetSystemCpuSetInformation
(
SYSTEM_CPU_SET_INFORMATION
*
info
,
ULONG
buffer_length
,
ULONG
*
return_length
,
HANDLE
process
,
ULONG
flags
)
{
if
(
flags
)
FIXME
(
"Unsupported flags %#x.
\n
"
,
flags
);
*
return_length
=
0
;
return
set_ntstatus
(
NtQuerySystemInformationEx
(
SystemCpuSetInformation
,
&
process
,
sizeof
(
process
),
info
,
buffer_length
,
return_length
));
}
/**********************************************************************
/**********************************************************************
* GetNumaHighestNodeNumber (kernelbase.@)
* GetNumaHighestNodeNumber (kernelbase.@)
*/
*/
...
...
include/winbase.h
View file @
f2ac82b8
...
@@ -2274,6 +2274,7 @@ WINBASEAPI VOID WINAPI GetStartupInfoA(LPSTARTUPINFOA);
...
@@ -2274,6 +2274,7 @@ WINBASEAPI VOID WINAPI GetStartupInfoA(LPSTARTUPINFOA);
WINBASEAPI
VOID
WINAPI
GetStartupInfoW
(
LPSTARTUPINFOW
);
WINBASEAPI
VOID
WINAPI
GetStartupInfoW
(
LPSTARTUPINFOW
);
#define GetStartupInfo WINELIB_NAME_AW(GetStartupInfo)
#define GetStartupInfo WINELIB_NAME_AW(GetStartupInfo)
WINBASEAPI
HANDLE
WINAPI
GetStdHandle
(
DWORD
);
WINBASEAPI
HANDLE
WINAPI
GetStdHandle
(
DWORD
);
WINBASEAPI
BOOL
WINAPI
GetSystemCpuSetInformation
(
SYSTEM_CPU_SET_INFORMATION
*
,
ULONG
,
ULONG
*
,
HANDLE
,
ULONG
);
WINBASEAPI
UINT
WINAPI
GetSystemDirectoryA
(
LPSTR
,
UINT
);
WINBASEAPI
UINT
WINAPI
GetSystemDirectoryA
(
LPSTR
,
UINT
);
WINBASEAPI
UINT
WINAPI
GetSystemDirectoryW
(
LPWSTR
,
UINT
);
WINBASEAPI
UINT
WINAPI
GetSystemDirectoryW
(
LPWSTR
,
UINT
);
#define GetSystemDirectory WINELIB_NAME_AW(GetSystemDirectory)
#define GetSystemDirectory WINELIB_NAME_AW(GetSystemDirectory)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment