Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
c3bc7689
Commit
c3bc7689
authored
May 26, 2020
by
Paul Gofman
Committed by
Alexandre Julliard
May 27, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ntoskrnl.exe: Add KeSetSystemAffinityThreadEx() function.
Signed-off-by:
Paul Gofman
<
pgofman@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
25f4da66
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
38 additions
and
2 deletions
+38
-2
ntoskrnl.c
dlls/ntoskrnl.exe/ntoskrnl.c
+19
-0
ntoskrnl.exe.spec
dlls/ntoskrnl.exe/ntoskrnl.exe.spec
+1
-0
driver.c
dlls/ntoskrnl.exe/tests/driver.c
+17
-2
wdm.h
include/ddk/wdm.h
+1
-0
No files found.
dlls/ntoskrnl.exe/ntoskrnl.c
View file @
c3bc7689
...
...
@@ -2455,6 +2455,25 @@ VOID WINAPI KeSetSystemAffinityThread(KAFFINITY Affinity)
FIXME
(
"(%lx) stub
\n
"
,
Affinity
);
}
KAFFINITY
WINAPI
KeSetSystemAffinityThreadEx
(
KAFFINITY
affinity
)
{
DWORD_PTR
system_affinity
=
KeQueryActiveProcessors
();
GROUP_AFFINITY
old
,
new
;
TRACE
(
"affinity %#lx.
\n
"
,
affinity
);
affinity
&=
system_affinity
;
NtQueryInformationThread
(
GetCurrentThread
(),
ThreadGroupInformation
,
&
old
,
sizeof
(
old
),
NULL
);
memset
(
&
new
,
0
,
sizeof
(
new
));
new
.
Mask
=
affinity
;
return
NtSetInformationThread
(
GetCurrentThread
(),
ThreadGroupInformation
,
&
new
,
sizeof
(
new
))
?
0
:
old
.
Mask
;
}
/***********************************************************************
* KeRevertToUserAffinityThread (NTOSKRNL.EXE.@)
...
...
dlls/ntoskrnl.exe/ntoskrnl.exe.spec
View file @
c3bc7689
...
...
@@ -634,6 +634,7 @@
@ stdcall KeSetPriorityThread(ptr long)
@ stub KeSetProfileIrql
@ stdcall KeSetSystemAffinityThread(long)
@ stdcall KeSetSystemAffinityThreadEx(long)
@ stdcall KeSetTargetProcessorDpc(ptr long)
@ stub KeSetTimeIncrement
@ stub KeSetTimer
...
...
dlls/ntoskrnl.exe/tests/driver.c
View file @
c3bc7689
...
...
@@ -1712,10 +1712,11 @@ static void test_executable_pool(void)
static
void
test_affinity
(
void
)
{
KAFFINITY
(
WINAPI
*
pKeSetSystemAffinityThreadEx
)(
KAFFINITY
affinity
);
ULONG
(
WINAPI
*
pKeQueryActiveProcessorCountEx
)(
USHORT
);
KAFFINITY
(
WINAPI
*
pKeQueryActiveProcessors
)(
void
);
KAFFINITY
mask
,
mask_all_cpus
;
ULONG
cpu_count
,
count
;
KAFFINITY
mask
;
pKeQueryActiveProcessorCountEx
=
get_proc_address
(
"KeQueryActiveProcessorCountEx"
);
if
(
!
pKeQueryActiveProcessorCountEx
)
...
...
@@ -1727,6 +1728,9 @@ static void test_affinity(void)
pKeQueryActiveProcessors
=
get_proc_address
(
"KeQueryActiveProcessors"
);
ok
(
!!
pKeQueryActiveProcessors
,
"KeQueryActiveProcessors is not available.
\n
"
);
pKeSetSystemAffinityThreadEx
=
get_proc_address
(
"KeSetSystemAffinityThreadEx"
);
ok
(
!!
pKeSetSystemAffinityThreadEx
,
"KeSetSystemAffinityThreadEx is not available.
\n
"
);
count
=
pKeQueryActiveProcessorCountEx
(
1
);
todo_wine
ok
(
!
count
,
"Got unexpected count %u.
\n
"
,
count
);
...
...
@@ -1736,8 +1740,19 @@ static void test_affinity(void)
count
=
pKeQueryActiveProcessorCountEx
(
ALL_PROCESSOR_GROUPS
);
ok
(
count
==
cpu_count
,
"Got unexpected count %u.
\n
"
,
count
);
mask_all_cpus
=
~
((
~
0u
)
<<
cpu_count
);
mask
=
pKeQueryActiveProcessors
();
ok
(
mask
==
~
((
~
0u
)
<<
cpu_count
),
"Got unexpected mask %#lx.
\n
"
,
mask
);
ok
(
mask
==
mask_all_cpus
,
"Got unexpected mask %#lx.
\n
"
,
mask
);
mask
=
pKeSetSystemAffinityThreadEx
(
0
);
ok
(
!
mask
,
"Got unexpected mask %#lx.
\n
"
,
mask
);
mask
=
pKeSetSystemAffinityThreadEx
(
0x1
);
ok
(
mask
==
mask_all_cpus
,
"Got unexpected mask %#lx.
\n
"
,
mask
);
mask
=
pKeSetSystemAffinityThreadEx
(
~
(
KAFFINITY
)
0
);
ok
(
mask
==
0x1
,
"Got unexpected mask %#lx.
\n
"
,
mask
);
}
static
NTSTATUS
main_test
(
DEVICE_OBJECT
*
device
,
IRP
*
irp
,
IO_STACK_LOCATION
*
stack
)
...
...
include/ddk/wdm.h
View file @
c3bc7689
...
...
@@ -1709,6 +1709,7 @@ void WINAPI KeRevertToUserAffinityThread(void);
LONG
WINAPI
KeSetEvent
(
PRKEVENT
,
KPRIORITY
,
BOOLEAN
);
KPRIORITY
WINAPI
KeSetPriorityThread
(
PKTHREAD
,
KPRIORITY
);
void
WINAPI
KeSetSystemAffinityThread
(
KAFFINITY
);
KAFFINITY
WINAPI
KeSetSystemAffinityThreadEx
(
KAFFINITY
affinity
);
BOOLEAN
WINAPI
KeSetTimerEx
(
KTIMER
*
,
LARGE_INTEGER
,
LONG
,
KDPC
*
);
NTSTATUS
WINAPI
KeWaitForMultipleObjects
(
ULONG
,
void
*
[],
WAIT_TYPE
,
KWAIT_REASON
,
KPROCESSOR_MODE
,
BOOLEAN
,
LARGE_INTEGER
*
,
KWAIT_BLOCK
*
);
NTSTATUS
WINAPI
KeWaitForSingleObject
(
void
*
,
KWAIT_REASON
,
KPROCESSOR_MODE
,
BOOLEAN
,
LARGE_INTEGER
*
);
...
...
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