Hello all!
i have a question regarding a messagebox that looks weird (see mbox.gif).
the code before the MessageBox call reads the com-port, fetching a number then putting it into a buffer:


.data
...
tmpbuf db 30 dup(0)
tmp db 'Det h?r talet togs emot! %i',0
...
.code
...
mov dx,3f8h
in al,dx
invoke wsprintf,addr tmpbuf,addr tmp,al
invoke MessageBox,NULL,addr tmpbuf,addr DNamn,MB_OK
...

ive written a driver that changes the IOPM so this process can access the comport (thank you Four-F =).
Posted on 2004-02-16 17:36:50 by sluggo
wsprintf takes DWORD parameters, you are passing a byte. The message box is not being displayed properly because the stack is corrupt.
Posted on 2004-02-16 21:28:12 by donkey
this kind of message box and dialogboxes can also be seen in nt systems when you dont have the xor eax,eax, ret (mov eax,FALSE) (mov eax,TRUE) statements at the end of your dlg proc when you return to system

and if you open up task mgr youll see that it has hogged 100%cpu and all other functions will be noticeably slower
Posted on 2004-02-17 00:04:39 by bluffer
thanks donkey. and i promise to read the reference more properly before posting any more dumb questions!
Posted on 2004-02-17 03:36:02 by sluggo
there are no dumb questions. If it is, it's no longer a question but a statement. :grin:
Posted on 2004-02-17 03:43:44 by arkane