Exemplo n.º 1
0
 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);
 }
Exemplo n.º 2
0
        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);
        }
Exemplo n.º 3
0
        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);
        }
Exemplo n.º 4
0
        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);
            }
        }
Exemplo n.º 5
0
        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);
            }
        }
Exemplo n.º 6
0
        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);
        }