summaryrefslogtreecommitdiff
path: root/plugins/Db3x_mmap/src/dbtool/eventchain.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/Db3x_mmap/src/dbtool/eventchain.cpp')
-rw-r--r--plugins/Db3x_mmap/src/dbtool/eventchain.cpp18
1 files changed, 9 insertions, 9 deletions
diff --git a/plugins/Db3x_mmap/src/dbtool/eventchain.cpp b/plugins/Db3x_mmap/src/dbtool/eventchain.cpp
index 1b0ea041be..67a9a613ac 100644
--- a/plugins/Db3x_mmap/src/dbtool/eventchain.cpp
+++ b/plugins/Db3x_mmap/src/dbtool/eventchain.cpp
@@ -102,19 +102,19 @@ void CDb3Mmap::FinishUp(DWORD ofsLast, DBContact *dbc)
}
}
-DWORD CDb3Mmap::PeekEvent(DWORD ofs, DWORD dwContactID, DBEvent *dbe)
+DWORD CDb3Mmap::PeekEvent(DWORD ofs, DWORD dwContactID, DBEvent &dbe)
{
- if (m_dbHeader.version == DB_095_1_VERSION)
- return PeekSegment(ofs, dbe, sizeof(DBEvent));
+ if (m_dbHeader.version >= DB_095_1_VERSION)
+ return PeekSegment(ofs, &dbe, sizeof(DBEvent));
DBEvent_094 oldEvent;
DWORD ret = PeekSegment(ofs, &oldEvent, sizeof(oldEvent));
if (ret != ERROR_SUCCESS)
return ret;
- dbe->signature = oldEvent.signature;
- dbe->contactID = dwContactID;
- memcpy(&dbe->ofsPrev, &oldEvent.ofsPrev, sizeof(oldEvent) - sizeof(DWORD));
+ dbe.signature = oldEvent.signature;
+ dbe.contactID = dwContactID;
+ memcpy(&dbe.ofsPrev, &oldEvent.ofsPrev, sizeof(oldEvent) - sizeof(DWORD));
return ERROR_SUCCESS;
}
@@ -166,7 +166,7 @@ int CDb3Mmap::WorkEventChain(DWORD ofsContact, DBContact *dbc, int firstTime)
if (!backLookup && ofsTmp) {
backLookup = 1;
while (SignatureValid(ofsTmp, DBEVENT_SIGNATURE)) {
- if (PeekEvent(ofsTmp, dbc->dwContactID, &dbeOld) != ERROR_SUCCESS)
+ if (PeekEvent(ofsTmp, dbc->dwContactID, dbeOld) != ERROR_SUCCESS)
break;
ofsNew = ofsTmp;
ofsTmp = dbeOld.ofsPrev;
@@ -183,7 +183,7 @@ int CDb3Mmap::WorkEventChain(DWORD ofsContact, DBContact *dbc, int firstTime)
}
}
- if (PeekEvent(ofsThisEvent, dbc->dwContactID, &dbeOld) != ERROR_SUCCESS) {
+ if (PeekEvent(ofsThisEvent, dbc->dwContactID, dbeOld) != ERROR_SUCCESS) {
FinishUp(ofsDestPrevEvent, dbc);
return ERROR_NO_MORE_ITEMS;
}
@@ -292,7 +292,7 @@ int CDb3Mmap::WorkEventChain(DWORD ofsContact, DBContact *dbc, int firstTime)
if (cb->bCheckOnly) {
if (!cb->bAggressive) {
ofsTmp = dbeOld.ofsPrev;
- while (PeekEvent(ofsTmp, dbc->dwContactID, &dbeTmp) == ERROR_SUCCESS) {
+ while (PeekEvent(ofsTmp, dbc->dwContactID, dbeTmp) == ERROR_SUCCESS) {
if (dbeTmp.ofsPrev == ofsContact) {
found = 1;
break;