http://bugs.winehq.org/show_bug.cgi?id=27332
Summary: richedit EM_STREAMIN handler needs to return the number of characters read (Dirt3 installer shows error instead of EULA text) Product: Wine Version: 1.3.21 Platform: x86 OS/Version: Linux Status: NEW Severity: normal Priority: P2 Component: richedit AssignedTo: wine-bugs@winehq.org ReportedBy: focht@gmx.net
Hello,
another bug while looking at "Dirt 3" game installer ...
When the installer is about to display the EULA, the whole EULA text can be seen a very short time only to be immediately replaced by the message "Could not read the EULA file <path>\EULA\English\EULA.txt."
The EULA is a plain text file.
--- snip --- 0009:Call KERNEL32.CreateFileW(004bfa40 L"Z:\mnt\iso\EULA\English\EULA.txt",80000000,00000001,00000000,00000003,00000000,00000000) ret=00403177 0009:Ret KERNEL32.CreateFileW() retval=00000078 ret=00403177 ... 0009:Call user32.SendMessageW(0003006a,00000449,00000001,0032f90c) ret=004031b9 0009:Call window proc 0x20027d11 (hwnd=0x3006a,msg=WM_USER+73,wp=00000001,lp=0032f90c) 0009:trace:richedit:RichEditWndProc_common enter hwnd 0x3006a msg 0449 (EM_STREAMIN) 1 32f90c, unicode 1 ... 0009:trace:richedit:ME_StreamIn stream==0x32f90c editor==0x5ca8e8 format==0x1 0009:trace:richedit:ME_StreamInText 00000001 0x32e0a0 0009:Call KERNEL32.ReadFile(00000078,0032e0ac,00001000,0032e0a4,00000000) ret=0040225c 0009:Ret KERNEL32.ReadFile() retval=00000001 ret=0040225c 0009:Call KERNEL32.MultiByteToWideChar(00000000,00000000,0032e0ac "THE CODEMASTERS SOFTWARE COMPANY LIMITED SOFTWARE LICENSE AGREEMENT\r\n\r\nIMPORTANT - READ CAREFULLY: THE ACCOMPANYING PROGRAM (WHICH INCLUDES COMPUTER SOFTWARE PROGRAM, THE MEDIA AND RELATED DOCUMENTATION IN PRINTED OR ELECTRONIC FORM) IS LICENSED TO YOU ON THE TERMS SET FORTH BELOW, WHICH CONSTIT"...,00001000,00329c8e,00001000) ret=2001ba68 0009:Ret KERNEL32.MultiByteToWideChar() retval=00001000 ret=2001ba68 ... 0009:trace:richedit:RichEditWndProc_common exit hwnd 0x3006a msg 0449 (EM_STREAMIN) 1 32f90c, unicode 1 -> 0 0009:Ret window proc 0x20027d11 (hwnd=0x3006a,msg=WM_USER+73,wp=00000001,lp=0032f90c) retval=00000000 0009:Ret user32.SendMessageW() retval=00000000 ret=004031b9 ... 0009:Call user32.SetWindowTextW(0003006a,004bfaf0 L"Could not read the EULA file Z:\mnt\iso\EULA\English\EULA.txt.") ret=00403219 0009:Call window proc 0x20027d11 (hwnd=0x3006a,msg=WM_SETTEXT,wp=00000000,lp=004bfaf0) 0009:trace:richedit:RichEditWndProc_common enter hwnd 0x3006a msg 000c () 0 4bfaf0, unicode 1 ... --- snip ---
Upon return of EM_STREAMIN message handler, the installer checks the return value and if zero it assumes the text file (EULA) wasn't properly read.
http://msdn.microsoft.com/en-us/library/bb774302.aspx
--- quote --- Return Value
This message returns the number of characters read. --- quote ---
If this is done, the EULA is correctly displayed in richedit control.
Currently ME_StreamIn -> ME_StreamInText unconditionally return zero, relying on the caller to look at inStream.editstream->dwError value.
Regards