Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

WaitForSingleObject() error codes??

1,654 views
Skip to first unread message

Willy Mene

unread,
Sep 12, 1996, 3:00:00 AM9/12/96
to

I'm using WaitForSingleObject(), and at times in my program it
returns the value WAIT_FAILED. Looking at the reference page for the
function, it says to call GetLastErr() to get extended error
information. My questions is, where can I find information about the
values GetLastErr() returns when WaitForSingleObject() fails? If it
helps, I get the value 0x6 from GetLastErr().

Any help is appreciated.

Willy

Valery Barer

unread,
Sep 13, 1996, 3:00:00 AM9/13/96
to

ERROR_INVALID_HANDLE.
Look into WINERROR.H in your MSDEV\INCLUDE directory.

Valery Barer <val...@netmanage.co.il>

Willy Mene <wbm...@abondigas.engr.ucdavis.edu> wrote in article
<51a3l3$m...@mark.ucdavis.edu>...

Lucian Wischik

unread,
Sep 13, 1996, 3:00:00 AM9/13/96
to

Willy Mene <wbm...@abondigas.engr.ucdavis.edu> wrote:
> I'm using WaitForSingleObject(), and at times in my program it
>returns the value WAIT_FAILED. Looking at the reference page for the
>function, it says to call GetLastErr() to get extended error
>information. My questions is, where can I find information about the
>values GetLastErr() returns when WaitForSingleObject() fails? If it
>helps, I get the value 0x6 from GetLastErr().

Look at the file 'winerr.h' or something like that.
It has three 'cracker' macros to extract the various parts of the error
code: severity, subsystem and code. Then you can look at the massive list
of error codes, subsystems and severities in that file to figure out what
it is.

--
Lucian

Raymond Chen

unread,
Sep 13, 1996, 3:00:00 AM9/13/96
to

The return values for GetLastError() are in winerror.h

Error 6 is ERROR_INVALID_HANDLE.

--
(Note that my return address is intentionally invalid in order
to foil electronic mailing list generation software.)

Jerry Coffin

unread,
Sep 13, 1996, 3:00:00 AM9/13/96
to

In article <51a3l3$m...@mark.ucdavis.edu>,
wbm...@abondigas.engr.ucdavis.edu says...

>
> I'm using WaitForSingleObject(), and at times in my program it
> returns the value WAIT_FAILED. Looking at the reference page for
> the function, it says to call GetLastErr() to get extended error
> information. My questions is, where can I find information about
> the values GetLastErr() returns when WaitForSingleObject() fails?

Take a look at FormatMessage, which will give you a printable text
error message for the normal error codes.

> If it helps, I get the value 0x6 from GetLastErr().

That's the code for an invalid handle.

--
Later,
Jerry.

Joe Mueller

unread,
Sep 16, 1996, 3:00:00 AM9/16/96
to

You have given an invalid handle to the function. See
%MSDEV%/include/winerror.h
(where %MSDEV% is the location you installed visual C++).

Joe

Willy Mene <wbm...@abondigas.engr.ucdavis.edu> wrote in article
<51a3l3$m...@mark.ucdavis.edu>...
>

>My questions is, where can I find information about the

> values GetLastErr() returns when WaitForSingleObject() fails? If it

Mohamed RAMZI

unread,
Sep 19, 1996, 3:00:00 AM9/19/96
to

Errors are listed in the SDK ( if you have MSDEV, the path is
SDKs/Win32 programmer's Reference/Appendix/Error Codes). You can also
edit the file winerror.h. 0x6L is ERROR_INVALID_HANDLE.

Willy Mene <wbm...@abondigas.engr.ucdavis.edu> wrote in article
<51a3l3$m...@mark.ucdavis.edu>...
>

> I'm using WaitForSingleObject(), and at times in my program it
> returns the value WAIT_FAILED. Looking at the reference page for the
> function, it says to call GetLastErr() to get extended error

> information. My questions is, where can I find information about the

> values GetLastErr() returns when WaitForSingleObject() fails? If it

0 new messages