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
2716e215
Commit
2716e215
authored
May 22, 2020
by
Paul Gofman
Committed by
Alexandre Julliard
May 25, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ntoskrnl.exe: Add KeQueryActiveProcessorCountEx() function.
Signed-off-by:
Paul Gofman
<
pgofman@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
e3c0474b
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
41 additions
and
0 deletions
+41
-0
ntoskrnl.c
dlls/ntoskrnl.exe/ntoskrnl.c
+6
-0
ntoskrnl.exe.spec
dlls/ntoskrnl.exe/ntoskrnl.exe.spec
+1
-0
driver.c
dlls/ntoskrnl.exe/tests/driver.c
+31
-0
wdm.h
include/ddk/wdm.h
+1
-0
winnt.h
include/winnt.h
+2
-0
No files found.
dlls/ntoskrnl.exe/ntoskrnl.c
View file @
2716e215
...
...
@@ -2385,6 +2385,12 @@ KAFFINITY WINAPI KeQueryActiveProcessors( void )
return
AffinityMask
;
}
ULONG
WINAPI
KeQueryActiveProcessorCountEx
(
USHORT
group_number
)
{
TRACE
(
"group_number %u.
\n
"
,
group_number
);
return
GetActiveProcessorCount
(
group_number
);
}
/**********************************************************************
* KeQueryInterruptTime (NTOSKRNL.EXE.@)
...
...
dlls/ntoskrnl.exe/ntoskrnl.exe.spec
View file @
2716e215
...
...
@@ -587,6 +587,7 @@
@ stub KeProfileInterruptWithSource
@ stub KePulseEvent
@ stdcall KeQueryActiveProcessors()
@ stdcall KeQueryActiveProcessorCountEx(long)
@ stdcall KeQueryInterruptTime()
@ stub KeQueryPriorityThread
@ stub KeQueryRuntimeThread
...
...
dlls/ntoskrnl.exe/tests/driver.c
View file @
2716e215
...
...
@@ -1710,6 +1710,36 @@ static void test_executable_pool(void)
}
#endif
static
void
test_affinity
(
void
)
{
ULONG
(
WINAPI
*
pKeQueryActiveProcessorCountEx
)(
USHORT
);
KAFFINITY
(
WINAPI
*
pKeQueryActiveProcessors
)(
void
);
ULONG
cpu_count
,
count
;
KAFFINITY
mask
;
pKeQueryActiveProcessorCountEx
=
get_proc_address
(
"KeQueryActiveProcessorCountEx"
);
if
(
!
pKeQueryActiveProcessorCountEx
)
{
win_skip
(
"KeQueryActiveProcessorCountEx is not available.
\n
"
);
return
;
}
pKeQueryActiveProcessors
=
get_proc_address
(
"KeQueryActiveProcessors"
);
ok
(
!!
pKeQueryActiveProcessors
,
"KeQueryActiveProcessors is not available.
\n
"
);
count
=
pKeQueryActiveProcessorCountEx
(
1
);
todo_wine
ok
(
!
count
,
"Got unexpected count %u.
\n
"
,
count
);
cpu_count
=
pKeQueryActiveProcessorCountEx
(
0
);
ok
(
cpu_count
,
"Got unexpected cpu_count %u.
\n
"
,
cpu_count
);
count
=
pKeQueryActiveProcessorCountEx
(
ALL_PROCESSOR_GROUPS
);
ok
(
count
==
cpu_count
,
"Got unexpected count %u.
\n
"
,
count
);
mask
=
pKeQueryActiveProcessors
();
ok
(
mask
==
~
((
~
0u
)
<<
cpu_count
),
"Got unexpected mask %#lx.
\n
"
,
mask
);
}
static
NTSTATUS
main_test
(
DEVICE_OBJECT
*
device
,
IRP
*
irp
,
IO_STACK_LOCATION
*
stack
)
{
ULONG
length
=
stack
->
Parameters
.
DeviceIoControl
.
OutputBufferLength
;
...
...
@@ -1763,6 +1793,7 @@ static NTSTATUS main_test(DEVICE_OBJECT *device, IRP *irp, IO_STACK_LOCATION *st
#if defined(__i386__) || defined(__x86_64__)
test_executable_pool
();
#endif
test_affinity
();
if
(
main_test_work_item
)
return
STATUS_UNEXPECTED_IO_ERROR
;
...
...
include/ddk/wdm.h
View file @
2716e215
...
...
@@ -1696,6 +1696,7 @@ void WINAPI KeInitializeSpinLock(KSPIN_LOCK*);
void
WINAPI
KeInitializeTimerEx
(
PKTIMER
,
TIMER_TYPE
);
void
WINAPI
KeInitializeTimer
(
KTIMER
*
);
void
WINAPI
KeLeaveCriticalRegion
(
void
);
ULONG
WINAPI
KeQueryActiveProcessorCountEx
(
USHORT
);
KAFFINITY
WINAPI
KeQueryActiveProcessors
(
void
);
void
WINAPI
KeQuerySystemTime
(
LARGE_INTEGER
*
);
void
WINAPI
KeQueryTickCount
(
LARGE_INTEGER
*
);
...
...
include/winnt.h
View file @
2716e215
...
...
@@ -6501,6 +6501,8 @@ typedef struct _GROUP_AFFINITY
WORD
Reserved
[
3
];
}
GROUP_AFFINITY
,
*
PGROUP_AFFINITY
;
#define ALL_PROCESSOR_GROUPS 0xffff
typedef
struct
_PROCESSOR_NUMBER
{
WORD
Group
;
...
...
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