Problem: STD before invoke inside .IF .ENDIF causes crash (win7 ultimate 32bit, latest easy code 1.06, masm32v10)
Behavior: setting the direction flag then a call or invoke to SetDlgItemText will crash the program.
Reproducing: looks like a blank project with a STD followed by an invoke SetDlgItemText will not crash it..but putting it inside a .IF .ENDIF statement does crash it..
Notes: Moving the CLD *after* the invoke SetDlgItemText does not fix crash...it crashes at SetDlgItemText
Minimal code needed:
Visual style form with one Edit1 or static1 plus a button
Code:
.Const
.Data?
.Data
blah DB "Oh look...Im gonna crash!", 0
.Code
Window1Procedure Proc hWnd:HWND, uMsg:ULONG, wParam:WPARAM, lParam:LPARAM
.If uMsg == WM_CREATE
.ElseIf uMsg == WM_COMMAND
;LoWord wParam
;.If Ax == IDC_BASEDIT_BUTTON2
;HiWord wParam
Mov Eax, wParam
Shr Eax, 16
;.If Ax == BN_CLICKED
Std
Cld ;REMOVE ME TO CRASH!!!
Invoke SetDlgItemText, hWnd, IDC_WINDOW1_STATIC1, Addr blah
;.EndIf
;.EndIf
.ElseIf uMsg == WM_CLOSE
Invoke IsModal, hWnd
.If Eax
Invoke EndModal, hWnd, IDCANCEL
Mov Eax, TRUE ;Return TRUE
Ret
.EndIf
.EndIf
Xor Eax, Eax ;Return FALSE
Ret
Window1Procedure EndP