From 246233c40262c5be2edfa916cf841dd4bce6598e Mon Sep 17 00:00:00 2001 From: Alex Date: Tue, 9 Aug 2016 22:08:47 +0200 Subject: Windows EFI Bootloader: modifications to prepare EFI system encryption support (common files with DcsBoot) --- src/Common/Xml.c | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) (limited to 'src/Common/Xml.c') diff --git a/src/Common/Xml.c b/src/Common/Xml.c index 6e6f8724..6abbed6d 100644 --- a/src/Common/Xml.c +++ b/src/Common/Xml.c @@ -9,9 +9,13 @@ contained in the file License.txt included in VeraCrypt binary and source code distribution packages. */ - +#if !defined(_UEFI) #include #include +#else +#include "Tcdefs.h" +#pragma warning( disable : 4706 ) // assignment within conditional expression +#endif #include "Xml.h" @@ -59,7 +63,7 @@ char *XmlFindElement (char *xmlNode, char *nodeName) } -char *XmlFindElementByAttributeValue (char *xml, char *nodeName, char *attrName, char *attrValue) +char *XmlFindElementByAttributeValue (char *xml, char *nodeName, const char *attrName, const char *attrValue) { char attr[2048]; @@ -76,7 +80,7 @@ char *XmlFindElementByAttributeValue (char *xml, char *nodeName, char *attrName, } -char *XmlGetAttributeText (char *xmlNode, char *xmlAttrName, char *xmlAttrValue, int xmlAttrValueSize) +char *XmlGetAttributeText (char *xmlNode, const char *xmlAttrName, char *xmlAttrValue, int xmlAttrValueSize) { char *t = xmlNode; char *e = xmlNode; @@ -105,7 +109,7 @@ char *XmlGetAttributeText (char *xmlNode, char *xmlAttrName, char *xmlAttrValue, if (t == NULL || t > e) return NULL; - t = strchr (t, '"') + 1; + t = ((char*)strchr (t, '"')) + 1; e = strchr (t, '"'); l = (int)(e - t); if (e == NULL || l > xmlAttrValueSize) return NULL; @@ -128,7 +132,7 @@ char *XmlGetNodeText (char *xmlNode, char *xmlText, int xmlTextSize) if (t[0] != '<') return NULL; - t = strchr (t, '>'); + t = (char*) strchr (t, '>'); if (t == NULL) return NULL; t++; @@ -256,7 +260,8 @@ wchar_t *XmlQuoteTextW (const wchar_t *textSrc, wchar_t *textDst, int textDstMax return textDst; } - +#if !defined(_UEFI) +#pragma warning( default : 4706 ) int XmlWriteHeader (FILE *file) { return fputws (L"\n", file); @@ -267,3 +272,4 @@ int XmlWriteFooter (FILE *file) { return fputws (L"\n", file); } +#endif !defined(_UEFI) -- cgit v1.2.3