flat assembler
Message board for the users of flat assembler.
Index
> Windows > Confusing jne... Goto page Previous 1, 2 |
Author |
|
LocoDelAssembly 29 Feb 2012, 15:10
http://msdn.microsoft.com/en-us/library/aa383751%28v=vs.85%29.aspx
Quote: BOOL JohnFound, I think that the documentation leaves the possibility for other kinds of errors open: Quote: If there is an error, the return value is -1. *For example, the function fails if hWnd is an invalid window handle or lpMsg is an invalid pointer. To get extended error information, call GetLastError. |
|||
29 Feb 2012, 15:10 |
|
Alphonso 29 Feb 2012, 17:59
revolution wrote: Since we are wasting time trying to optimise this, then let's do it properly. What if you just test for -1, ignore eax = 0 and process WM_QUIT outside the loop? |
|||
29 Feb 2012, 17:59 |
|
shutdownall 29 Feb 2012, 21:58
mindcooler wrote: @shutdownall Yes possibly exit. It depends on the error. It is not fine if a program autocloses (possibly exit = WM_QUIT in your example) with no hint at all. In this case there is no difference between a crash. At least program should give a MessageBox to alert the autoclose due to an error. Maybe give someone the chance to save some modified data. Or maybe program could stop and cleanup some other processes which may cause data loss or something. |
|||
29 Feb 2012, 21:58 |
|
mindcooler 29 Feb 2012, 22:46
Well, as I don't know what could possibly cause a such an error in my program, I don't have a strategy for recovery, so I just make it quit. It is as good indication as anything else for my purposes. As the others are saying, the most probably cause for getting an error like this is errors in the parameters, and I don't have any programs that deal with savable data yet
|
|||
29 Feb 2012, 22:46 |
|
shutdownall 01 Mar 2012, 01:20
mindcooler wrote: and I don't have any programs that deal with savable data yet When you have, you should take care of data. Maybe an editor is crashing, would be nice to have at least a copy of the contents before quitting program. This could be done in a temporary file and let the user decide after, if content seems to be valid or not. One example is the firefox browser with tabbed browsing. Not long time ago I closed accidently a tab with some well typed text in a window on a website (forum). That was at least half an hour of work. The function "restore closed tab" saved my ass in this way. |
|||
01 Mar 2012, 01:20 |
|
JohnFound 01 Mar 2012, 06:11
Code: xor eax, eax jz continue ; what if the CPU have bug in the ALU? ; Handle the error and exit! call [ExitProcess] continue: |
|||
01 Mar 2012, 06:11 |
|
revolution 01 Mar 2012, 06:47
JohnFound wrote:
|
|||
01 Mar 2012, 06:47 |
|
mindcooler 01 Mar 2012, 12:49
shutdownall wrote:
When I have data, it's easy to change to jmp dumpandquit, which is a call save and ret. And/or use autosave. Still, I'm unsure if I'm ever going to see the error in my lifetime _________________ This is a block of text that can be added to posts you make. |
|||
01 Mar 2012, 12:49 |
|
shutdownall 01 Mar 2012, 15:57
mindcooler wrote:
I wouldn't bet on it. We are talking about MS software. |
|||
01 Mar 2012, 15:57 |
|
Goto page Previous 1, 2 < Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.