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

Daniel Berger djberg96 at gmail.com
Tue Aug 25 19:34:04 EDT 2009


On Fri, Aug 21, 2009 at 7:35 PM, Daniel Berger<djberg96 at gmail.com> wrote:
> 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

Most of these were changed in windows-pr 1.0.8. A couple of them were
not modified, e.g. THREAD_PRIORITY_BELOW_NORMAL since it's a valid
input value.

Regards,

Dan


More information about the win32utils-devel mailing list