kernel32/tests: Add test for 'all processors' flag on Vista and newer.
authorErich Hoover <ehoover@mines.edu>
Sat, 20 Feb 2010 02:07:57 +0000 (19:07 -0700)
committerAlexandre Julliard <julliard@winehq.org>
Mon, 22 Feb 2010 10:57:12 +0000 (11:57 +0100)
dlls/kernel32/tests/thread.c

index 69203fea0500fbf677331e8fb1f23032e04fc38c..83d13c56e1e75fd69fc077c194eb70ce35f97624 100644 (file)
@@ -780,7 +780,7 @@ static VOID test_GetThreadTimes(void)
 static VOID test_thread_processor(void)
 {
    HANDLE curthread,curproc;
-   DWORD_PTR processMask,systemMask;
+   DWORD_PTR processMask,systemMask,retMask;
    SYSTEM_INFO sysInfo;
    int error=0;
    BOOL is_wow64;
@@ -803,6 +803,10 @@ static VOID test_thread_processor(void)
       "SetThreadAffinityMask failed\n");
    ok(SetThreadAffinityMask(curthread,processMask+1)==0,
       "SetThreadAffinityMask passed for an illegal processor\n");
+/* NOTE: Pre-Vista does not recognize the "all processors" flag (all bits set) */
+   retMask = SetThreadAffinityMask(curthread,~0UL);
+   ok(broken(retMask==0) || retMask==processMask,
+      "SetThreadAffinityMask(thread,-1) failed to request all processors.\n");
 /* NOTE: This only works on WinNT/2000/XP) */
    if (pSetThreadIdealProcessor) {
      SetLastError(0xdeadbeef);