[PATCH 1/2] ntdll: Allow 'all processors' flag used in Vista and newer (try 4).

Erich Hoover ehoover at mines.edu
Sat Feb 20 11:19:16 CST 2010

Real Name:
    Erich Hoover
    The attached patch adds support for
SetThreadAffinityMask(thread,~0UL), and the NtSetInformationThread
equivalent, which succeeds on Windows Vista and newer.  This version
is updated to use ~0UL instead of (-1) to represent "all bits set,"
and no-longer throws away the constant type when typecasting to obtain
the value of the pointer containing the affinity mask.

    This patch also includes a test in ntdll demonstrating the "set
all processors" functionality.  The first part of the test looks for
success/failure in the call itself and is applicable even for single
processor systems (tested against many Windows versions using the
wonderful Wine Test Bot).  The second part of the test confirms that
the intended behavior of passing a mask with all bits set is to enable
all processors, this test is skipped on single processor systems (so
this was tested on a multi-processor Windows 7 box, as the Wine Test
Bot only has one processor for each VM).

   Note that this "all processors" flag is not documented, but was
discovered tracking down another issue.  Please see the wine-devel
thread for more information:
   ntdll: Allow 'all processors' flag used in Vista and newer.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-ntdll-Allow-all-processors-flag-used-in-Vista-and-ne.patch
Type: text/x-patch
Size: 3323 bytes
Desc: not available
URL: <http://www.winehq.org/pipermail/wine-patches/attachments/20100220/285c24c9/attachment.bin>

More information about the wine-patches mailing list