mirror of
https://github.com/reactos/reactos.git
synced 2025-05-27 21:18:15 +00:00
[MSXML3]
- Make a copy of the data type information instead of writing to the (read-only) .rsrc section. Already applied upstream. CORE-6645 #comment Should be fixed. Can you retest with HEAD please? svn path=/trunk/; revision=57298
This commit is contained in:
parent
ba83a0794e
commit
3c636c565e
1 changed files with 7 additions and 7 deletions
|
@ -68,7 +68,7 @@ static const xmlChar XDR_schema[] = "Schema";
|
||||||
static const xmlChar XDR_nsURI[] = "urn:schemas-microsoft-com:xml-data";
|
static const xmlChar XDR_nsURI[] = "urn:schemas-microsoft-com:xml-data";
|
||||||
static const xmlChar DT_nsURI[] = "urn:schemas-microsoft-com:datatypes";
|
static const xmlChar DT_nsURI[] = "urn:schemas-microsoft-com:datatypes";
|
||||||
|
|
||||||
static xmlChar const* datatypes_src;
|
static xmlChar * datatypes_src;
|
||||||
static int datatypes_len;
|
static int datatypes_len;
|
||||||
static HGLOBAL datatypes_handle;
|
static HGLOBAL datatypes_handle;
|
||||||
static HRSRC datatypes_rsrc;
|
static HRSRC datatypes_rsrc;
|
||||||
|
@ -728,7 +728,6 @@ static xmlParserInputPtr external_entity_loader(const char *URL, const char *ID,
|
||||||
|
|
||||||
void schemasInit(void)
|
void schemasInit(void)
|
||||||
{
|
{
|
||||||
int len;
|
|
||||||
xmlChar* buf;
|
xmlChar* buf;
|
||||||
if (!(datatypes_rsrc = FindResourceA(MSXML_hInstance, "DATATYPES", "XML")))
|
if (!(datatypes_rsrc = FindResourceA(MSXML_hInstance, "DATATYPES", "XML")))
|
||||||
{
|
{
|
||||||
|
@ -742,14 +741,14 @@ void schemasInit(void)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
buf = LockResource(datatypes_handle);
|
buf = LockResource(datatypes_handle);
|
||||||
len = SizeofResource(MSXML_hInstance, datatypes_rsrc) - 1;
|
datatypes_len = SizeofResource(MSXML_hInstance, datatypes_rsrc) - 1;
|
||||||
|
|
||||||
/* Resource is loaded as raw data,
|
/* Resource is loaded as raw data,
|
||||||
* need a null-terminated string */
|
* need a null-terminated string */
|
||||||
while (buf[len] != '>')
|
while (buf[datatypes_len - 1] != '>') datatypes_len--;
|
||||||
buf[len--] = 0;
|
datatypes_src = HeapAlloc(GetProcessHeap(), 0, datatypes_len + 1);
|
||||||
datatypes_src = buf;
|
memcpy(datatypes_src, buf, datatypes_len);
|
||||||
datatypes_len = len + 1;
|
datatypes_src[datatypes_len] = 0;
|
||||||
|
|
||||||
if (xmlGetExternalEntityLoader() != external_entity_loader)
|
if (xmlGetExternalEntityLoader() != external_entity_loader)
|
||||||
{
|
{
|
||||||
|
@ -761,6 +760,7 @@ void schemasInit(void)
|
||||||
void schemasCleanup(void)
|
void schemasCleanup(void)
|
||||||
{
|
{
|
||||||
xmlSchemaFree(datatypes_schema);
|
xmlSchemaFree(datatypes_schema);
|
||||||
|
HeapFree(GetProcessHeap(), 0, datatypes_src);
|
||||||
xmlSetExternalEntityLoader(_external_entity_loader);
|
xmlSetExternalEntityLoader(_external_entity_loader);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue