mirror of
https://github.com/reactos/reactos.git
synced 2025-08-06 06:53:37 +00:00
[XML2SDB] Parse Flags.
This commit is contained in:
parent
06d7926e27
commit
1d0e7bddea
2 changed files with 131 additions and 7 deletions
|
@ -1,8 +1,8 @@
|
|||
/*
|
||||
* PROJECT: xml2sdb
|
||||
* LICENSE: GPL-2.0+ (https://spdx.org/licenses/GPL-2.0+)
|
||||
* PURPOSE: .
|
||||
* COPYRIGHT: Copyright 2016,2017 Mark Jansen (mark.jansen@reactos.org)
|
||||
* PURPOSE: Define mapping of all shim database types to xml
|
||||
* COPYRIGHT: Copyright 2016-2018 Mark Jansen (mark.jansen@reactos.org)
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
@ -51,6 +51,17 @@ struct ShimRef
|
|||
std::list<InExclude> InExcludes;
|
||||
};
|
||||
|
||||
struct FlagRef
|
||||
{
|
||||
FlagRef() : FlagTagid(0) { ; }
|
||||
|
||||
bool fromXml(XMLHandle dbNode);
|
||||
bool toSdb(PDB pdb, Database& db);
|
||||
|
||||
std::string Name;
|
||||
TAGID FlagTagid;
|
||||
};
|
||||
|
||||
struct Shim
|
||||
{
|
||||
Shim() : Tagid(0) { ; }
|
||||
|
@ -65,6 +76,21 @@ struct Shim
|
|||
std::list<InExclude> InExcludes;
|
||||
};
|
||||
|
||||
struct Flag
|
||||
{
|
||||
Flag() : Tagid(0), KernelFlags(0), UserFlags(0), ProcessParamFlags(0) { ; }
|
||||
|
||||
bool fromXml(XMLHandle dbNode);
|
||||
bool toSdb(PDB pdb, Database& db);
|
||||
|
||||
std::string Name;
|
||||
TAGID Tagid;
|
||||
QWORD KernelFlags;
|
||||
QWORD UserFlags;
|
||||
QWORD ProcessParamFlags;
|
||||
};
|
||||
|
||||
|
||||
struct Layer
|
||||
{
|
||||
Layer() : Tagid(0) { ; }
|
||||
|
@ -75,6 +101,7 @@ struct Layer
|
|||
std::string Name;
|
||||
TAGID Tagid;
|
||||
std::list<ShimRef> ShimRefs;
|
||||
std::list<FlagRef> FlagRefs;
|
||||
};
|
||||
|
||||
struct MatchingFile
|
||||
|
@ -115,12 +142,14 @@ struct Exe
|
|||
TAGID Tagid;
|
||||
std::list<MatchingFile> MatchingFiles;
|
||||
std::list<ShimRef> ShimRefs;
|
||||
std::list<FlagRef> FlagRefs;
|
||||
};
|
||||
|
||||
struct Library
|
||||
{
|
||||
std::list<InExclude> InExcludes;
|
||||
std::list<Shim> Shims;
|
||||
std::list<Flag> Flags;
|
||||
};
|
||||
|
||||
struct Database
|
||||
|
@ -135,6 +164,7 @@ struct Database
|
|||
void WriteBinary(PDB pdb, TAG tag, const GUID& guid, bool always = false);
|
||||
void WriteBinary(PDB pdb, TAG tag, const std::vector<BYTE>& data, bool always = false);
|
||||
void WriteDWord(PDB pdb, TAG tag, DWORD value, bool always = false);
|
||||
void WriteQWord(PDB pdb, TAG tag, QWORD value, bool always = false);
|
||||
TAGID BeginWriteListTag(PDB pdb, TAG tag);
|
||||
BOOL EndWriteListTag(PDB pdb, TAGID tagid);
|
||||
|
||||
|
@ -161,6 +191,17 @@ struct Database
|
|||
return FindPatchTagid(sdbstring(name.begin(), name.end()));
|
||||
}
|
||||
|
||||
void InsertFlagTagid(const sdbstring& name, TAGID tagid);
|
||||
inline void InsertFlagTagid(const std::string& name, TAGID tagid)
|
||||
{
|
||||
InsertFlagTagid(sdbstring(name.begin(), name.end()), tagid);
|
||||
}
|
||||
TAGID FindFlagTagid(const sdbstring& name);
|
||||
inline TAGID FindFlagTagid(const std::string& name)
|
||||
{
|
||||
return FindFlagTagid(sdbstring(name.begin(), name.end()));
|
||||
}
|
||||
|
||||
std::string Name;
|
||||
GUID ID;
|
||||
|
||||
|
@ -171,5 +212,6 @@ struct Database
|
|||
private:
|
||||
std::map<sdbstring, TAGID> KnownShims;
|
||||
std::map<sdbstring, TAGID> KnownPatches;
|
||||
std::map<sdbstring, TAGID> KnownFlags;
|
||||
};
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue