http://bugs.winehq.org/show_bug.cgi?id=13319
--- Comment #8 from Lei Zhang thestig@google.com 2008-05-29 12:23:10 --- I compiled and ran your test program under wine. (Just change EditWndProcW to EditWndProc) and it doesn't look like strl ever becomes greater than strlenW(lpsz_replace).