kernel32: Revise SetThreadIdealProcessor to return success.

This commit is contained in:
Andrew Nguyen 2009-08-07 06:39:47 -05:00 committed by Alexandre Julliard
parent e306b91392
commit 20276d0b38
2 changed files with 23 additions and 17 deletions

View File

@ -812,24 +812,26 @@ static VOID test_thread_processor(void)
"SetThreadAffinityMask passed for an illegal processor\n");
/* NOTE: This only works on WinNT/2000/XP) */
if (pSetThreadIdealProcessor) {
todo_wine {
SetLastError(0);
SetLastError(0xdeadbeef);
error=pSetThreadIdealProcessor(curthread,0);
if (GetLastError()!=ERROR_CALL_NOT_IMPLEMENTED) {
if (GetLastError()==ERROR_CALL_NOT_IMPLEMENTED)
{
win_skip("SetThreadIdealProcessor is not implemented\n");
return;
}
ok(error!=-1, "SetThreadIdealProcessor failed\n");
}
}
if (GetLastError()!=ERROR_CALL_NOT_IMPLEMENTED) {
SetLastError(0xdeadbeef);
error=pSetThreadIdealProcessor(curthread,MAXIMUM_PROCESSORS+1);
ok(error==-1,
"SetThreadIdealProcessor succeeded with an illegal processor #\n");
todo_wine {
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");
}
}
}
}
static VOID test_GetThreadExitCode(void)
{

View File

@ -413,8 +413,12 @@ DWORD WINAPI SetThreadIdealProcessor(
DWORD dwIdealProcessor) /* [in] Specifies the new preferred processor */
{
FIXME("(%p): stub\n",hThread);
SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
return -1L;
if (dwIdealProcessor > MAXIMUM_PROCESSORS)
{
SetLastError(ERROR_INVALID_PARAMETER);
return ~0u;
}
return 0;
}