DWORD help

Andrew Fenn andrewfenn at gmail.com
Sat Oct 25 11:43:24 CDT 2008


Thanks Juan. It's fixed now.

On Sat, Oct 25, 2008 at 5:13 PM, Juan Lang <juan.lang at gmail.com> wrote:
> Hi Andrew,
>
>> I have written the following but when I have dwUserIndex as 0,1,2,3 or
>> any number, doesn't really matter, it always returns
>> ERROR_BAD_ARGUMENTS.
>
> Not sure why it's not returning ERROR_DEVICE_NOT_CONNECTED for you.
> I'll just point out:
>
>> DWORD XInputGetState(DWORD dwUserIndex, XINPUT_STATE* pState)
>> {
>>    FIXME("Stub - Controller: %d \n", dwUserIndex);
>>
>>    if (dwUserIndex >= 0 && dwUserIndex < 4) {
>>        return ERROR_DEVICE_NOT_CONNECTED;
>
> The first part of this is always true, since DWORD is unsigned.  You
> can write this more simply as:
>  if (dwUserIndex < 4) { ... }
>
> --Juan
>



More information about the wine-devel mailing list