diff options
Diffstat (limited to 'plugins/HistoryPlusPlus/hpp_events.pas')
-rw-r--r-- | plugins/HistoryPlusPlus/hpp_events.pas | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/plugins/HistoryPlusPlus/hpp_events.pas b/plugins/HistoryPlusPlus/hpp_events.pas index 2996009325..004095c98f 100644 --- a/plugins/HistoryPlusPlus/hpp_events.pas +++ b/plugins/HistoryPlusPlus/hpp_events.pas @@ -101,6 +101,7 @@ function TimestampToDateTime(const Timestamp: DWord): TDateTime; function TimestampToString(const Timestamp: DWord): String;
// general routine
function ReadEvent(hDBEvent: THandle; UseCP: Cardinal = CP_ACP): THistoryItem;
+function GetOldEventInfo(hDBEvent: THANDLE): TOldDBEventInfo;
function GetEventInfo(hDBEvent: THANDLE): TDBEventInfo;
function GetEventTimestamp(hDBEvent: THandle): DWord;
function GetEventMessageType(hDBEvent: THandle): TMessageTypes;
@@ -405,6 +406,40 @@ begin Result.cbBlob := 0;
end;
+function GetOldEventInfo(hDBEvent: THANDLE): TOldDBEventInfo;
+var
+ BlobSize: integer;
+ dbei: TDBEventInfo;
+begin
+ ZeroMemory(@Result, SizeOf(Result));
+ BlobSize := db_event_getBlobSize(hDBEvent);
+ if BlobSize > 0 then
+ begin
+ EventBuffer.Allocate(BlobSize+2); // cheat, for possible crash avoid
+ Result.pBlob := EventBuffer.Buffer;
+ end
+ else
+ BlobSize := 0;
+
+ dbei.cbBlob := BlobSize;
+ dbei.pBlob := Result.pBlob;
+ if db_event_get(hDBEvent, @dbei) = 0 then
+ begin
+ Result.cbBlob := BlobSize;
+ if BlobSize > 0 then
+ begin
+ PAnsiChar(Result.pBlob)[BlobSize ]:=#0;
+ PAnsiChar(Result.pBlob)[BlobSize+1]:=#0;
+ end;
+ end
+ else
+ Result.cbBlob := 0;
+
+ Result.flags := dbei.flags;
+ Result.timestamp := dbei.timestamp;
+ Result.eventType := dbei.eventType;
+end;
+
function GetMessageType(EventInfo: TDBEventInfo; var EventIndex: Integer): TMessageTypes;
var
i: Integer;
|