mirror of
https://github.com/veracrypt/VeraCrypt.git
synced 2025-11-11 19:08:26 -06:00
Windows EFI Bootloader: modifications to prepare EFI system encryption support (common files with DcsBoot)
This commit is contained in:
@@ -9,9 +9,13 @@
|
||||
contained in the file License.txt included in VeraCrypt binary and source
|
||||
code distribution packages.
|
||||
*/
|
||||
|
||||
#if !defined(_UEFI)
|
||||
#include <windows.h>
|
||||
#include <stdio.h>
|
||||
#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"<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<VeraCrypt>", file);
|
||||
@@ -267,3 +272,4 @@ int XmlWriteFooter (FILE *file)
|
||||
{
|
||||
return fputws (L"\n</VeraCrypt>", file);
|
||||
}
|
||||
#endif !defined(_UEFI)
|
||||
|
||||
Reference in New Issue
Block a user