<div dir="ltr"><div>I've created a test case that shows, that Wine indeed behaves incorrectly when the highest bit of the requested mask is set.</div><div>With the (obvious) exception of ~0u, Wine returns STATUS_INVALID_PARAMETER while Windows returns 0 (SUCCESS).</div><div><br></div><div>You're right. Casting to LONG is probably wrong here.<br></div></div><br><div class="gmail_quote"><div dir="ltr">Am So., 9. Sep. 2018 um 10:31 Uhr schrieb Chris Robinson <<a href="mailto:chris.kcat@gmail.com">chris.kcat@gmail.com</a>>:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">On 09/08/2018 06:26 AM, Roger Zoellner wrote:<br>
>               if ((ULONG)req_aff == ~0u) req_aff = affinity_mask;<br>
> +            else if ((LONG) req_aff < 0) req_aff = affinity_mask & req_aff;<br>
<br>
In addition to Dmitry's comment, it's notable that these two cases <br>
basically become the same thing. ~0u is -1, which would make req_aff a <br>
full mask. Though it may also be worth a test if the sign check actually <br>
applies to LONG_PTR instead of LONG, since LONG_PTR is 64-bit on 64-bit <br>
targets while LONG is 32-bit even on 64-bit targets.<br>
<br>
<br>
</blockquote></div>