memory xml bugfix related to valid attribute of the Offsets tag

develop
Petr Mrázek 2011-02-14 21:25:02 +01:00
parent 3835ba0f75
commit 6c9652258d
3 changed files with 59 additions and 50 deletions

@ -2329,6 +2329,12 @@
</Group> </Group>
</Offsets> </Offsets>
</Version> </Version>
<Version name="v0.31.18 linux" os="linux" base="faek">
<MD5 value="884f794d8e89e7d764057c15617c20b1" />
<Offsets valid="false">
</Offsets>
</Version>
</DFHack> </DFHack>

@ -172,8 +172,6 @@ void VersionInfoFactory::ParseOffsets(TiXmlElement * parent, VersionInfo* target
TiXmlElement* pEntry; TiXmlElement* pEntry;
// we get the <Offsets>, look at the children // we get the <Offsets>, look at the children
pEntry = parent->FirstChildElement(); pEntry = parent->FirstChildElement();
if(!pEntry)
return;
const char *cstr_invalid = parent->Attribute("valid"); const char *cstr_invalid = parent->Attribute("valid");
INVAL_TYPE parent_inval = NOT_SET; INVAL_TYPE parent_inval = NOT_SET;
if(cstr_invalid) if(cstr_invalid)
@ -185,6 +183,11 @@ void VersionInfoFactory::ParseOffsets(TiXmlElement * parent, VersionInfo* target
} }
OffsetGroup * currentGroup = reinterpret_cast<OffsetGroup *> (target); OffsetGroup * currentGroup = reinterpret_cast<OffsetGroup *> (target);
currentGroup->setInvalid(parent_inval); currentGroup->setInvalid(parent_inval);
// we end here if there are no child tags.
if(!pEntry)
return;
breadcrumbs.push_back(groupTriple(pEntry,currentGroup, parent_inval)); breadcrumbs.push_back(groupTriple(pEntry,currentGroup, parent_inval));
} }

@ -82,12 +82,12 @@ using namespace std;
#include <psapi.h> #include <psapi.h>
#include <tlhelp32.h> #include <tlhelp32.h>
#include <Dbghelp.h> #include <Dbghelp.h>
#pragma comment(lib,"ntdll.lib")
#pragma comment(lib,"psapi.lib")
typedef LONG NTSTATUS; typedef LONG NTSTATUS;
#define STATUS_SUCCESS ((NTSTATUS)0x00000000L) #define STATUS_SUCCESS ((NTSTATUS)0x00000000L)
typedef struct _DEBUG_BUFFER { // FIXME: it is uncertain how these map to 64bit
typedef struct _DEBUG_BUFFER
{
HANDLE SectionHandle; HANDLE SectionHandle;
PVOID SectionBase; PVOID SectionBase;
PVOID RemoteSectionBase; PVOID RemoteSectionBase;