emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: System calls without error checks in w32


From: Lennart Borgman
Subject: Re: System calls without error checks in w32
Date: Sat, 29 May 2010 20:42:40 +0200

On Sat, May 29, 2010 at 7:43 PM, Eli Zaretskii <address@hidden> wrote:
>> From: Lennart Borgman <address@hidden>
>> Date: Sat, 29 May 2010 04:38:24 +0200
>>
>> There is a lot of system calls in the w32 without error checking.
>
> ??? "A lot"?  Please give examples of those.


There is a lot of them in w32fns.c. I expect the same for other files
with w32 system calls.

Here are some I found:

CreateFontIndirect
DestroyCaret
ExtTextOut
GetForeGroundWindow
GetKeyboardState
GetKeyboardState
GetModuleHandle
GetProcAddress
GetTextExtentPoint32
GetWindowPlacement
GetWindowRect
KillTimer
LocalFree
PostMessage
PostThreadMessage
RegisterHotKey
ReleaseCapture
SelectObject
SetWindowLong

A few of them does not return errors, but return value may have to be
checked anyway. I probably missed some (and did I add the
GetWindowPlacement code?).


>> How about adding something like
>>
>>     DebPrint (("error w32_creatwindow.AjdustRectangle => %d\n",
>> GetLastError ()));
>>
>> to all of them? Is there anyone who has anything against this?
>
> What for?


I have for several years complained about frequent crashes. They are
quite irritating actually.

I have to reboot quite often too, maybe because of errors in the
system calls (some resource is leaking).

Menus often stops working. Difficult to track down, and even more so
without knowing if some bad system calls where involved.

Emacs can totally hang. Or it can loop without yeilding. At least the
first one can be a bad system call.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]