http://bugs.winehq.org/show_bug.cgi?id=19759
Summary: SLTG_ReadString does not null terminate Product: Wine Version: 1.1.27 Platform: PC OS/Version: Linux Status: UNCONFIRMED Severity: normal Priority: P2 Component: oleaut32 AssignedTo: wine-bugs@winehq.org ReportedBy: sunilmohan@fsf.org.in
Created an attachment (id=23133) --> (http://bugs.winehq.org/attachment.cgi?id=23133) Patch to properly null terminate
According to MSDN http://msdn.microsoft.com/en-us/library/ms221069.aspx the BSTR string should be null terminated. SLTG_ReadString is not doing so as the strings being read are not themselves null terminated and are read based on the length. It causes the string length somehow to be misunderstood by applications.
The attached screenshots show OLE Viewer from Visual Studio 6 showing a TypeInfo header: one in Wine and the other on Windows.
The attached patch (against latest git) fixed the problem for me. It also fixes another chunk of similar code.