private TseEntry(TseEntryContext context, TseAccess tseAccess) { this.tseAccess = tseAccess; id = worm_entry_id(context.ptr); IsSystemLog = worm_entry_type(context.ptr) == WormEntryType.SystemLog; ProcessDataLength = worm_entry_processDataLength(context.ptr); Console.WriteLine("Created WormEntry #" + id); }
internal TseEntry next() { TseEntryContext context = createWormEntryContextForId(id); int err = worm_entry_iterate_next(context.ptr); if (err != 0) { throw new Exception("Failed to read WormEntry, error: " + err); } return(worm_entry_isValid(context.ptr) != 0 ? new TseEntry(context, tseAccess) : null); }
static internal TseEntry first(TseAccess tseAccess) { TseEntryContext context = new TseEntryContext(tseAccess.tse_context); int err = worm_entry_iterate_first(context.ptr); if (err != 0) { throw new Exception("Failed to read WormEntry, error: " + err); } return(worm_entry_isValid(context.ptr) != 0 ? new TseEntry(context, tseAccess) : null); }
private void readLogMessage() { TseEntryContext context = createWormEntryContextForId(id); LogMessageBuffer = new byte[worm_entry_logMessageLength(context.ptr)]; int err = worm_entry_readLogMessage(context.ptr, LogMessageBuffer, (UInt64)LogMessageBuffer.Length); if (err != 0) { throw new Exception("Failed to read log message, error: " + err); } }
private void readProcessData() { TseEntryContext context = createWormEntryContextForId(id); ProcessDataBuffer = new byte[ProcessDataLength]; int err = worm_entry_readProcessData(context.ptr, 0, ProcessDataBuffer, (UInt64)ProcessDataBuffer.Length); if (err != 0) { throw new Exception("Failed to read process data, error: " + err); } }
private TseEntryContext createWormEntryContextForId(UInt32 id) { TseEntryContext context = new TseEntryContext(tseAccess.tse_context); Console.WriteLine("creating context for " + id); int err = worm_entry_iterate_id(context.ptr, id); if (err != 0) { throw new Exception("Failed to read WormEntry, error: " + err); } if (worm_entry_isValid(context.ptr) == 0) { throw new Exception("WormEntry for id " + id + " is not valid!"); } return(context); }