kernel32: Revise SetThreadIdealProcessor to return success.
This commit is contained in:
parent
e306b91392
commit
20276d0b38
@ -812,22 +812,24 @@ static VOID test_thread_processor(void)
|
|||||||
"SetThreadAffinityMask passed for an illegal processor\n");
|
"SetThreadAffinityMask passed for an illegal processor\n");
|
||||||
/* NOTE: This only works on WinNT/2000/XP) */
|
/* NOTE: This only works on WinNT/2000/XP) */
|
||||||
if (pSetThreadIdealProcessor) {
|
if (pSetThreadIdealProcessor) {
|
||||||
todo_wine {
|
SetLastError(0xdeadbeef);
|
||||||
SetLastError(0);
|
error=pSetThreadIdealProcessor(curthread,0);
|
||||||
error=pSetThreadIdealProcessor(curthread,0);
|
if (GetLastError()==ERROR_CALL_NOT_IMPLEMENTED)
|
||||||
if (GetLastError()!=ERROR_CALL_NOT_IMPLEMENTED) {
|
{
|
||||||
ok(error!=-1, "SetThreadIdealProcessor failed\n");
|
win_skip("SetThreadIdealProcessor is not implemented\n");
|
||||||
}
|
return;
|
||||||
}
|
|
||||||
if (GetLastError()!=ERROR_CALL_NOT_IMPLEMENTED) {
|
|
||||||
error=pSetThreadIdealProcessor(curthread,MAXIMUM_PROCESSORS+1);
|
|
||||||
ok(error==-1,
|
|
||||||
"SetThreadIdealProcessor succeeded with an illegal processor #\n");
|
|
||||||
todo_wine {
|
|
||||||
error=pSetThreadIdealProcessor(curthread,MAXIMUM_PROCESSORS);
|
|
||||||
ok(error==0, "SetThreadIdealProcessor returned an incorrect value\n");
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
ok(error!=-1, "SetThreadIdealProcessor failed\n");
|
||||||
|
|
||||||
|
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);
|
||||||
|
ok(error==0, "SetThreadIdealProcessor returned an incorrect value\n");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -413,8 +413,12 @@ DWORD WINAPI SetThreadIdealProcessor(
|
|||||||
DWORD dwIdealProcessor) /* [in] Specifies the new preferred processor */
|
DWORD dwIdealProcessor) /* [in] Specifies the new preferred processor */
|
||||||
{
|
{
|
||||||
FIXME("(%p): stub\n",hThread);
|
FIXME("(%p): stub\n",hThread);
|
||||||
SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
|
if (dwIdealProcessor > MAXIMUM_PROCESSORS)
|
||||||
return -1L;
|
{
|
||||||
|
SetLastError(ERROR_INVALID_PARAMETER);
|
||||||
|
return ~0u;
|
||||||
|
}
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user