News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

More then GetLastError info

Started by Adamanteus, January 11, 2008, 05:38:06 PM

Previous topic - Next topic

Adamanteus

Trying to port DOS error dialog system to Windows, found that GetLastError and FormatMessage excellent working in pair - recommending !
But DOS INT 21h function #59 /Get Extended Error Information/ - supplayed error class, suggested action and locus. So somebody know where's it to obtain in WinAPI, or stays only extended error code and other somebody eaten  ::)

Tedd

Windows doesn't have the extended error codes - the code returned by GetLastError effectively is the extended error code. The extra information should be obvious from the function call (and its parameters) that caused the error and set the error code.
No snowflake in an avalanche feels responsible.

Adamanteus

 Effectively is VDM that returning the extended information  to DOS programs and showing that it's the same system functionality present. But in GetLastError this information must be got from parameters of calling function, that is not known in error dialog module.
Except possibility to make as you said, difficult case structure and trying to guess all cases of parameters - that's not useful and a little lazy.  :dazzled:

Tight_Coder_Ex

Here's a snippet I put together awhile ago.  It's done in NASM

http://www.daniweb.com/code/snippet239.html

It will show error code, address of call that caused problem, extended error message and your own epilogue.
It uses MessageBox so you can customize how you want the condition to be handled.

MASM version @ http://www.masm32.com/board/index.php?topic=8212.0

Adamanteus

#4
 That's well done, but if you look to my example (run traser not_exist_file.txt /866 and under DOS) you understand what about was question. By this good style from DOS - giving recommendations to user, possible improve and you code.  :clap:

[attachment deleted by admin]