http://bugs.winehq.org/show_bug.cgi?id=30491
Bug #: 30491 Summary: Microsoft Office Communicator 2007 R2 Trial fails to parse rule XML from resource file (BSTR/UTF-16 passed to SAXXMLReader) Product: Wine Version: 1.5.2 Platform: x86 OS/Version: Linux Status: NEW Severity: normal Priority: P2 Component: msxml3 AssignedTo: wine-bugs@winehq.org ReportedBy: focht@gmx.net Classification: Unclassified
Hello,
with bug 30313 fixed, it now runs into bug 29392
--- snip --- fixme:actctx:parse_depend_manifests Could not find dependent assembly L"UccApi" (2.0.0.0) fixme:activeds:ADsOpenObject (L"LDAP://rootDSE",(null),1,{fd8256d0-fd15-11ce-abc4-02608c9e7553},0x32e7f0)!stub wine: Call from 0x7b839357 to unimplemented function msvcp90.dll.??0?$basic_ostringstream@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QAE@H@Z, aborting --- snip ---
After working around (VC++ 2008 runtime), it fails while trying to parse rule XML from embedded resource file:
--- snip --- ... 0028:Call KERNEL32.MultiByteToWideChar(0000fde9,00000008,0018ddb0 "<categoryPublicationManifest\r\n xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance%5C%22%5Cr%5Cn xmlns:xsd="http://www.w3.org/2001/XMLSchema%5C%22%5Cr%5Cn xmlns="http://schemas.microsoft.com/2008/09/sip/categoryPublicationManifest%5C%22%5... minSupportedClientVersion="2.0.0.0">\r\n <publicationList>\r\n <"...,00007a01,001957f8,00007a01) ret=21fbb99c 0028:Ret KERNEL32.MultiByteToWideChar() retval=00007a01 ret=21fbb99c 0028:Call oleaut32.SysAllocStringLen(001957f8 L"<categoryPublicationManifest\r\n xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance%5C%22%5Cr%5Cn xmlns:xsd="http://www.w3.org/2001/XMLSchema%5C%22%5Cr%5Cn xmlns="http://schemas.microsoft.com/2008/09/sip/categoryPublicationManifest%5C%22%5... minSupportedClientVersion="2.0.0.0">\r\n <publicationList>\r\n <"...,00007a01) ret=21fbcb0c 0028:Call ntdll.RtlAllocateHeap(00110000,00000000,0000f408) ret=7e92b022 0028:Ret ntdll.RtlAllocateHeap() retval=001a4c80 ret=7e92b022 0028:Ret oleaut32.SysAllocStringLen() retval=001a4c84 ret=21fbcb0c ... 0028:trace:msxml:internal_parse (0x15a098)->({VT_BSTR: L"<categoryPublicationManifest\r\n xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance%5C%22%5Cr%5Cn xmlns:xsd="http://www.w3.org/2001/XMLSchema%5C%22%5Cr%5Cn xmlns="http://schemas.microsoft.com/200) 0028:Call ntdll.RtlFreeHeap(00110000,00000000,00000000) ret=7d77632a 0028:Ret ntdll.RtlFreeHeap() retval=00000001 ret=7d77632a 0028:Call oleaut32.SysStringByteLen(001a4c84) ret=7d77b2f1 0028:Ret oleaut32.SysStringByteLen() retval=0000f402 ret=7d77b2f1 0028:Call ntdll.RtlAllocateHeap(00110000,00000000,0000004c) ret=7d7759c5 0028:Ret ntdll.RtlAllocateHeap() retval=001b41b8 ret=7d7759c5 0028:trace:msxml:saxxmlreader_AddRef 0x15a098 0028:Call oleaut32.SysAllocString(7d7a3300 L"http://www.w3.org/2000/xmlns/") ret=7d77a640 0028:Call ntdll.RtlAllocateHeap(00110000,00000000,00000040) ret=7e92b022 0028:Ret ntdll.RtlAllocateHeap() retval=001b4210 ret=7e92b022 0028:Ret oleaut32.SysAllocString() retval=001b4214 ret=7d77a640 0028:Call ntdll.RtlAllocateHeap(00110000,00000000,00000080) ret=7d7759c5 0028:Ret ntdll.RtlAllocateHeap() retval=001b4258 ret=7d7759c5 0028:trace:msxml:SAXLocator_create returning 0x1b41b8 0028:trace:msxml:internal_parseBuffer detected encoding: (null) 0028:trace:msxml:isaxlocator_AddRef (0x1b41b8)->(2) 0028:Call KERNEL32.MultiByteToWideChar(0000fdf2,00000000,0032dfd0 "Char 0x0 out of allowed range\n",ffffffff,00000000,00000000) ret=7d7792f4 0028:Ret KERNEL32.MultiByteToWideChar() retval=0000001f ret=7d7792f4 0028:Call ntdll.RtlAllocateHeap(00110000,00000000,0000003e) ret=7d7759c5 0028:Ret ntdll.RtlAllocateHeap() retval=001b42e0 ret=7d7759c5 0028:Call KERNEL32.MultiByteToWideChar(0000fdf2,00000000,0032dfd0 "Char 0x0 out of allowed range\n",ffffffff,001b42e0,0000001f) ret=7d779348 0028:Ret KERNEL32.MultiByteToWideChar() retval=0000001f ret=7d779348 0028:trace:msxml:libxmlFatalError fatal error for 0x1b41b8: L"Char 0x0 out of allowed range\n" 0028:fixme:msxml:libxmlFatalError Error handling is not compatible. ... --- snip ---
The data is passed as BSTR/UTF-16.
Debugging session:
--- snip --- Wine-dbg>bt Backtrace: =>0 0x7d723880 internal_parseBuffer+0x101(This=0x139278, buffer="<", size=0xf402, vbInterface=0) [/home/focht/projects/wine/wine-git/dlls/msxml3/saxreader.c:2162] in msxml3 (0x0033e7c4) 1 0x7d724313 internal_parse+0xfa(This=0x139278, varInput={n1={n2={vt=0x8, wReserved1=0x11, wReserved2=0xd338, wReserved3=0x15, n3={cVal=-116, uiVal=0x398c, ulVal=0x18398c, intVal=0x18398c, uintVal=0x18398c, bVal=-116, iVal=0x398c, lVal=0x18398c, ... bstrVal="<categoryPublicationManifest xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://schemas.microsoft.com/2008/09/sip/categoryPublicationManifest" minSupportedClientVersion="2.0.0.0"> <publicationList> <publicationRule ruleType="transformation" categoryName="state" containerId="2" preferredSelfConsumption="true" /> <publicationRule ruleType="transformation" categoryName="state" containerId="3"> <categoryData> <![CDATA[ ... 2 0x7d7261c2 isaxxmlreader_parse+0x5a(iface=0x13928c, varInput={n1={n2={vt=0x8, wReserved1=0x11, wReserved2=0xd338, wReserved3=0x15, n3={cVal=-116, uiVal=0x398c, ulVal=0x18398c, intVal=0x18398c, uintVal=0x18398c, bVal=-116, iVal=0x398c, lVal=0x18398c, ... bstrVal="<categoryPublicationManifest ... gn=0}, signscale=0x11}, Hi32=0x15d338, ={={Lo32=0x18398c, Mid32=0x7bcbf544}, Lo64=0x7bcbf5440018398c}}}}) [/home/focht/projects/wine/wine-git/dlls/msxml3/saxreader.c:3194] in msxml3 (0x0033e894) 3 0x21fbe64e in ocapi (+0x33e64d) (0x0033f978) 4 0x21fbf5d6 in ocapi (+0x33f5d5) (0x0033f9a0) 5 0x221ab486 in ocapi (+0x52b485) (0x0033faac) 6 0x221abdce in ocapi (+0x52bdcd) (0x0033faf0) 7 0x221a7992 in ocapi (+0x527991) (0x0033fb44) 8 0x21ecb949 in ocapi (+0x24b948) (0x0033fb94) 9 0x21ecd5f2 in ocapi (+0x24d5f1) (0x0033fbe8) 10 0x21ecddba in ocapi (+0x24ddb9) (0x0033fc20) 11 0x21ea490d in ocapi (+0x22490c) (0x0033fc8c) 12 0x004213a2 in communicator (+0x213a1) (0x0033fcbc) --- snip ---
Code: http://source.winehq.org/git/wine.git/blob/4fb5872bd233c924cadbf3a4011dcd622...
--- snip --- 2139 static HRESULT internal_parseBuffer(saxreader *This, const char *buffer, int size, BOOL vbInterface) 2140 { 2141 xmlCharEncoding encoding = XML_CHAR_ENCODING_NONE; 2142 xmlChar *enc_name = NULL; 2143 saxlocator *locator; 2144 HRESULT hr; 2145 2146 hr = SAXLocator_create(This, &locator, vbInterface); 2147 if(FAILED(hr)) 2148 return hr; 2149 2150 if (size >= 4) 2151 { 2152 const unsigned char *buff = (unsigned char*)buffer; 2153 2154 encoding = xmlDetectCharEncoding((xmlChar*)buffer, 4); 2155 enc_name = (xmlChar*)xmlGetCharEncodingName(encoding); 2156 TRACE("detected encoding: %s\n", enc_name); 2157 /* skip BOM, parser won't switch encodings and so won't skip it on its own */ 2158 if ((encoding == XML_CHAR_ENCODING_UTF8) && 2159 buff[0] == 0xEF && buff[1] == 0xBB && buff[2] == 0xBF) 2160 { 2161 buffer += 3; 2162 size -= 3; 2163 } 2164 } 2165 2166 locator->pParserCtxt = xmlCreateMemoryParserCtxt(buffer, size); 2167 if(!locator->pParserCtxt) 2168 { 2169 ISAXLocator_Release(&locator->ISAXLocator_iface); 2170 return E_FAIL; 2171 } 2172 2173 if (encoding == XML_CHAR_ENCODING_UTF8) 2174 locator->pParserCtxt->encoding = xmlStrdup(enc_name); 2175 2176 xmlFree(locator->pParserCtxt->sax); 2177 locator->pParserCtxt->sax = &locator->saxreader->sax; 2178 locator->pParserCtxt->userData = locator; 2179 2180 This->isParsing = TRUE; 2181 if(xmlParseDocument(locator->pParserCtxt)==-1 && locator->ret==S_OK) 2182 hr = E_FAIL; 2183 else 2184 hr = locator->ret; 2185 This->isParsing = FALSE; 2186 2187 if(locator->pParserCtxt) 2188 { 2189 locator->pParserCtxt->sax = NULL; 2190 xmlFreeParserCtxt(locator->pParserCtxt); 2191 locator->pParserCtxt = NULL; 2192 } 2193 2194 ISAXLocator_Release(&locator->ISAXLocator_iface); 2195 return hr; 2196 } --- snip ---
Regards