More fhandler_serial fixes.

Christopher Faylor
Tue Nov 5 17:47:00 GMT 2002

On Tue, Nov 05, 2002 at 07:36:42PM -0500, Sergey Okhapkin wrote:
>> I could see changing this to size_t but not adding the extra vmin_.
>> >@@ -423,20 +426,21 @@ fhandler_serial::ioctl (unsigned int cmd
>> >                                               0, &mcr, 4, &cb, 0);
>> >                if (!result)
>> >                  {
>> >-                   __seterrno ();
>> >-                   res = -1;
>> >-                   goto out;
>> >+                   modem_status |= rts | dtr;
>> This is saying that if a function (DeviceIoControl) fails we fallback to
>> Win95 behavior.  Why wouldn't we want to reflect the failure of the
>> function?  Otherwise we could be masking an actual failure.
>> Anyway, I've checked in a variation of this change minus the
>> DeviceIoControl part.
>The call to DeviceIoCtl is
>     BOOL result = DeviceIoControl (get_handle (), 0x001B0078, NULL,
>                           0, &mcr, 4, &cb, 0);
>I heve no ideas what does this call means, it's undocumented.

I never noticed the raw hex value there.  How ugly.

It took some digging but this seems to be where it is documented:

However, if it is failing for you, we might as well do away with the
wincap test and just always try to use it and then fill in the default
values if it fails.

I'll check something in to do that.


The call
>always fails on my W2k when
>attempting to get the status of laptop's built-in modem. It seems to me it's
>better to ignore the error and to fall back to Win95 behavior rather than
>return the error.
>Sergey Okhapkin
>Somerset, NJ

More information about the Cygwin-patches mailing list