20#define C_ASSERT(expr) extern char (*c_assert(void)) [(expr) ? 1 : -1]
54 for (
size_t n = 0;
n <
sizeof(
GUID); ++
n)
62 const char* txt = txtNode ? txtNode->
Value() :
NULL;
64 return std::string(txt);
72 const char* txt = raw ? raw->
Value() :
NULL;
74 return std::string(txt);
84 const char* rawVal =
elem->Attribute(nodeName);
86 return std::string(rawVal);
125 const char *lpszGUID =
str.c_str();
128 bool expectBrace =
true;
134 if (*lpszGUID !=
'{')
146 if (*lpszGUID !=
'-')
151 return expectBrace == (*lpszGUID ==
'}');
155 CHAR ch = *lpszGUID, ch2 = lpszGUID[1];
157 bool converted =
true;
165#ifndef WORDS_BIGENDIAN
270 while (
node.ToNode())
273 if (
object.fromXml(
node))
276 node =
node.NextSiblingElement(nodeName);
283 for (
typename std::list<T>::iterator it =
data.begin(); it !=
data.end(); ++it)
285 if (!it->toSdb(
pdb, db))
302 return !
Name.empty();
326 return !
Name.empty();
384 return !
Name.empty();
421 return !
Name.empty();
427 return !
Name.empty();
433 return !
Name.empty();
436 SHIM_ERR(
"Data node (%s) without value!\n",
Name.c_str());
528 SHIM_ERR(
"TAG_BIN_FILE_VERSION Unimplemented\n");
531 SHIM_ERR(
"TAG_VER_LANGUAGE Unimplemented\n");
535 SHIM_ERR(
"TAG_UPTO_BIN_FILE_VERSION Unimplemented\n");
558 return !
Name.empty();
597 if (always || !
data.empty())
603 if (always || !
str.empty())
643 if (NodeName ==
"SHIM")
649 else if (NodeName ==
"FLAG")
652 if (
flag.fromXml(libChild))
655 else if (NodeName ==
"INCLUDE" || NodeName ==
"EXCLUDE")
714 std::transform(nameLower.begin(), nameLower.end(), nameLower.begin(),
::tolower);
717 std::string nameA(
name.begin(),
name.end());
721 lookup[nameLower] = tagid;
727 std::transform(nameLower.begin(), nameLower.end(), nameLower.begin(),
::tolower);
728 std::map<sdbstring, TAGID>::const_iterator it =
lookup.find(nameLower);
UINT32 strtoul(const char *String, char **Terminator, UINT32 Base)
int memcmp(void *Buffer1, void *Buffer2, ACPI_SIZE Count)
XMLError LoadFile(const char *filename)
XMLHandle FirstChild()
Get the first child of this handle.
XMLNode * ToNode()
Safe cast to XMLNode. This can return null.
XMLHandle FirstChildElement(const char *name=0)
Get the first child element of this handle.
XMLHandle NextSibling()
Get the next sibling of this handle.
XMLElement * ToElement()
Safe cast to XMLElement. This can return null.
const char * Value() const
#define TAG_MATCHING_FILE
#define TAG_COMPILER_VERSION
GLuint GLuint GLsizei GLenum type
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
GLuint GLsizei GLsizei * length
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean flag
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
_Check_return_ int __cdecl rand(void)
#define TAG_ORIGINAL_FILENAME
#define TAG_LINKER_VERSION
#define TAG_FILE_DESCRIPTION
#define TAG_INTERNAL_NAME
#define TAG_PRODUCT_VERSION
static PLARGE_INTEGER Time
NTSYSAPI VOID NTAPI RtlSecondsSince1970ToTime(_In_ ULONG SecondsSince1970, _Out_ PLARGE_INTEGER Time)
#define SHIM_WARN(fmt,...)
#define SHIM_ERR(fmt,...)
#define TAG_FLAG_PROCESSPARAM
#define TAG_DATA_VALUETYPE
#define TAG_FLAG_MASK_KERNEL
#define TAG_FLAG_MASK_USER
BOOL WINAPI SdbWriteNULLTag(PDB pdb, TAG tag)
TAGID WINAPI SdbBeginWriteListTag(PDB pdb, TAG tag)
BOOL WINAPI SdbWriteQWORDTag(PDB pdb, TAG tag, QWORD data)
BOOL WINAPI SdbWriteStringTag(PDB pdb, TAG tag, LPCWSTR string)
BOOL WINAPI SdbWriteDWORDTag(PDB pdb, TAG tag, DWORD data)
BOOL WINAPI SdbEndWriteListTag(PDB pdb, TAGID tagid)
BOOL WINAPI SdbWriteBinaryTag(PDB pdb, TAG tag, const BYTE *data, DWORD size)
PDB WINAPI SdbCreateDatabase(LPCWSTR path, PATH_TYPE type)
void WINAPI SdbCloseDatabaseWrite(PDB pdb)
bool toSdb(PDB pdb, Database &db)
bool fromXml(XMLHandle dbNode)
void InsertShimTagid(const sdbstring &name, TAGID tagid)
TAGID FindShimTagid(const sdbstring &name)
void WriteDWord(PDB pdb, TAG tag, DWORD value, bool always=false)
TAGID FindPatchTagid(const sdbstring &name)
void WriteBinary(PDB pdb, TAG tag, const GUID &guid, bool always=false)
BOOL EndWriteListTag(PDB pdb, TAGID tagid)
TAGID FindFlagTagid(const sdbstring &name)
void WriteQWord(PDB pdb, TAG tag, QWORD value, bool always=false)
std::map< sdbstring, TAGID > KnownPatches
TAGID BeginWriteListTag(PDB pdb, TAG tag)
std::map< sdbstring, TAGID > KnownFlags
void InsertPatchTagid(const sdbstring &name, TAGID tagid)
void WriteString(PDB pdb, TAG tag, const sdbstring &str, bool always=false)
void InsertFlagTagid(const sdbstring &name, TAGID tagid)
std::map< sdbstring, TAGID > KnownShims
std::list< Layer > Layers
bool fromXml(const char *fileName)
std::list< MatchingFile > MatchingFiles
bool fromXml(XMLHandle dbNode)
bool toSdb(PDB pdb, Database &db)
std::list< ShimRef > ShimRefs
std::list< FlagRef > FlagRefs
bool fromXml(XMLHandle dbNode)
bool toSdb(PDB pdb, Database &db)
bool fromXml(XMLHandle dbNode)
bool toSdb(PDB pdb, Database &db)
bool toSdb(PDB pdb, Database &db)
bool fromXml(XMLHandle dbNode)
bool fromXml(XMLHandle dbNode)
std::list< FlagRef > FlagRefs
std::list< ShimRef > ShimRefs
bool toSdb(PDB pdb, Database &db)
std::list< InExclude > InExcludes
std::string OriginalFilename
bool toSdb(PDB pdb, Database &db)
std::string ProductVersion
std::string FileDescription
std::string BinFileVersion
std::string UptoBinFileVersion
bool fromXml(XMLHandle dbNode)
bool fromXml(XMLHandle dbNode)
bool toSdb(PDB pdb, Database &db)
std::list< InExclude > InExcludes
std::list< InExclude > InExcludes
bool fromXml(XMLHandle dbNode)
bool toSdb(PDB pdb, Database &db)
_Must_inspect_result_ _In_ WDFDEVICE _In_ PWDF_DEVICE_PROPERTY_DATA _In_ DEVPROPTYPE _In_ ULONG Size
#define success(from, fromstr, to, tostr)
static const GUID GUID_NULL
static TAGID FindTagid(const sdbstring &name, const std::map< sdbstring, TAGID > &lookup)
bool ReadGuidNode(XMLHandle dbNode, const char *nodeName, GUID &guid)
static bool StringToGuid(const std::string &str, GUID &guid)
static const char szCompilerVersion[]
std::string ToString(XMLHandle node)
VOID NTAPI RtlSecondsSince1970ToTime(IN ULONG SecondsSince1970, OUT PLARGE_INTEGER Time)
unsigned char char2byte(char hexChar, bool *success=NULL)
DWORD ReadDWordNode(XMLHandle dbNode, const char *nodeName)
bool WriteGeneric(PDB pdb, std::list< T > &data, Database &db)
bool xml_2_db(const char *xml, const WCHAR *sdb)
DWORD ReadQWordNode(XMLHandle dbNode, const char *nodeName)
static void InsertTagid(const sdbstring &name, TAGID tagid, std::map< sdbstring, TAGID > &lookup, const char *type)
void ReadGeneric(XMLHandle dbNode, std::list< T > &result, const char *nodeName)
std::string ToNodeName(XMLHandle node)
std::string ReadStringNode(XMLHandle dbNode, const char *nodeName)
bool ReadBinaryNode(XMLHandle dbNode, const char *nodeName, std::vector< BYTE > &data)
bool IsEmptyGuid(const GUID &g)
std::basic_string< WCHAR > sdbstring