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
89c0b87f
Commit
89c0b87f
authored
Dec 23, 2009
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
kernel32/tests: Fix the SetThreadIdealProcessor for WoW64.
parent
221925dd
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
26 additions
and
6 deletions
+26
-6
thread.c
dlls/kernel32/tests/thread.c
+26
-6
No files found.
dlls/kernel32/tests/thread.c
View file @
89c0b87f
...
@@ -61,6 +61,7 @@ static DWORD (WINAPI *pSetThreadIdealProcessor)(HANDLE,DWORD);
...
@@ -61,6 +61,7 @@ static DWORD (WINAPI *pSetThreadIdealProcessor)(HANDLE,DWORD);
static
BOOL
(
WINAPI
*
pSetThreadPriorityBoost
)(
HANDLE
,
BOOL
);
static
BOOL
(
WINAPI
*
pSetThreadPriorityBoost
)(
HANDLE
,
BOOL
);
static
BOOL
(
WINAPI
*
pRegisterWaitForSingleObject
)(
PHANDLE
,
HANDLE
,
WAITORTIMERCALLBACK
,
PVOID
,
ULONG
,
ULONG
);
static
BOOL
(
WINAPI
*
pRegisterWaitForSingleObject
)(
PHANDLE
,
HANDLE
,
WAITORTIMERCALLBACK
,
PVOID
,
ULONG
,
ULONG
);
static
BOOL
(
WINAPI
*
pUnregisterWait
)(
HANDLE
);
static
BOOL
(
WINAPI
*
pUnregisterWait
)(
HANDLE
);
static
BOOL
(
WINAPI
*
pIsWow64Process
)(
HANDLE
,
PBOOL
);
static
HANDLE
create_target_process
(
const
char
*
arg
)
static
HANDLE
create_target_process
(
const
char
*
arg
)
{
{
...
@@ -779,6 +780,9 @@ static VOID test_thread_processor(void)
...
@@ -779,6 +780,9 @@ static VOID test_thread_processor(void)
DWORD_PTR
processMask
,
systemMask
;
DWORD_PTR
processMask
,
systemMask
;
SYSTEM_INFO
sysInfo
;
SYSTEM_INFO
sysInfo
;
int
error
=
0
;
int
error
=
0
;
BOOL
is_wow64
;
if
(
!
pIsWow64Process
||
!
pIsWow64Process
(
GetCurrentProcess
(),
&
is_wow64
))
is_wow64
=
FALSE
;
sysInfo
.
dwNumberOfProcessors
=
0
;
sysInfo
.
dwNumberOfProcessors
=
0
;
GetSystemInfo
(
&
sysInfo
);
GetSystemInfo
(
&
sysInfo
);
...
@@ -807,12 +811,27 @@ static VOID test_thread_processor(void)
...
@@ -807,12 +811,27 @@ static VOID test_thread_processor(void)
}
}
ok
(
error
!=-
1
,
"SetThreadIdealProcessor failed
\n
"
);
ok
(
error
!=-
1
,
"SetThreadIdealProcessor failed
\n
"
);
SetLastError
(
0xdeadbeef
);
if
(
is_wow64
)
error
=
pSetThreadIdealProcessor
(
curthread
,
MAXIMUM_PROCESSORS
+
1
);
{
ok
(
error
==-
1
,
SetLastError
(
0xdeadbeef
);
"SetThreadIdealProcessor succeeded with an illegal processor #
\n
"
);
error
=
pSetThreadIdealProcessor
(
curthread
,
MAXIMUM_PROCESSORS
+
1
);
ok
(
GetLastError
()
==
ERROR_INVALID_PARAMETER
,
todo_wine
"Expected ERROR_INVALID_PARAMETER, got %d
\n
"
,
GetLastError
());
ok
(
error
!=-
1
,
"SetThreadIdealProcessor failed for %u on Wow64
\n
"
,
MAXIMUM_PROCESSORS
+
1
);
SetLastError
(
0xdeadbeef
);
error
=
pSetThreadIdealProcessor
(
curthread
,
65
);
ok
(
error
==-
1
,
"SetThreadIdealProcessor succeeded with an illegal processor #
\n
"
);
ok
(
GetLastError
()
==
ERROR_INVALID_PARAMETER
,
"Expected ERROR_INVALID_PARAMETER, got %d
\n
"
,
GetLastError
());
}
else
{
SetLastError
(
0xdeadbeef
);
error
=
pSetThreadIdealProcessor
(
curthread
,
MAXIMUM_PROCESSORS
+
1
);
ok
(
error
==-
1
,
"SetThreadIdealProcessor succeeded with an illegal processor #
\n
"
);
ok
(
GetLastError
()
==
ERROR_INVALID_PARAMETER
,
"Expected ERROR_INVALID_PARAMETER, got %d
\n
"
,
GetLastError
());
}
error
=
pSetThreadIdealProcessor
(
curthread
,
MAXIMUM_PROCESSORS
);
error
=
pSetThreadIdealProcessor
(
curthread
,
MAXIMUM_PROCESSORS
);
ok
(
error
==
0
,
"SetThreadIdealProcessor returned an incorrect value
\n
"
);
ok
(
error
==
0
,
"SetThreadIdealProcessor returned an incorrect value
\n
"
);
...
@@ -1208,6 +1227,7 @@ START_TEST(thread)
...
@@ -1208,6 +1227,7 @@ START_TEST(thread)
pSetThreadPriorityBoost
=
(
void
*
)
GetProcAddress
(
lib
,
"SetThreadPriorityBoost"
);
pSetThreadPriorityBoost
=
(
void
*
)
GetProcAddress
(
lib
,
"SetThreadPriorityBoost"
);
pRegisterWaitForSingleObject
=
(
void
*
)
GetProcAddress
(
lib
,
"RegisterWaitForSingleObject"
);
pRegisterWaitForSingleObject
=
(
void
*
)
GetProcAddress
(
lib
,
"RegisterWaitForSingleObject"
);
pUnregisterWait
=
(
void
*
)
GetProcAddress
(
lib
,
"UnregisterWait"
);
pUnregisterWait
=
(
void
*
)
GetProcAddress
(
lib
,
"UnregisterWait"
);
pIsWow64Process
=
(
void
*
)
GetProcAddress
(
lib
,
"IsWow64Process"
);
if
(
argc
>=
3
)
if
(
argc
>=
3
)
{
{
...
...
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