[Win32utils-devel] [Fwd: Re: FW: win32-api, unsigned long vs long in api_call]

Daniel Berger djberg96 at gmail.com
Fri Aug 21 21:35:20 EDT 2009


Hi,

<snip>

>> If a function returns DWORD type, the return value cannot be -1. -1 is
>> human readable value. It is actually 0xFFFFFFFF.
>
> Alright, then I should probably change INVALID_HANDLE_VALUE to
> 0xFFFFFFFF, and revert 'L' to an unsigned long. I think there are a
> handful of other -1 values that should be changed then, too, in
> windows-pr.

FYI, here are the current values set to -1 in windows-pr that may need
to be changed:

C:\Documents and
Settings\djberge\workspace\windows-pr\lib\windows>findstr /s /c:"-1$"
/r *.rb
com\variant.rb:         VARIANT_TRUE  = -1
com.rb:      DISPID_UNKNOWN     = -1
file.rb:      MAILSLOT_NO_MESSAGE            = -1
file.rb:      MAILSLOT_WAIT_FOREVER          = -1
file.rb:      INVALID_FILE_ATTRIBUTES  = -1
file.rb:      INVALID_HANDLE_VALUE     = -1
file.rb:      INVALID_SET_FILE_POINTER = -1
handle.rb:      INVALID_HANDLE_VALUE           = -1
mailslot.rb:      MAILSLOT_WAIT_FOREVER = -1
mailslot.rb:      MAILSLOT_NO_MESSAGE   = -1
network\management.rb:         MAX_PREFERRED_LENGTH = -1
thread.rb:      THREAD_PRIORITY_BELOW_NORMAL  = -1

Regards,

Dan


More information about the win32utils-devel mailing list