Tpm2Lib.Tbs.ContextSaveEverything C# (CSharp) Method

ContextSaveEverything() private method

private ContextSaveEverything ( ) : void
return void
        private void ContextSaveEverything()
        {
            // SaveContext all loaded contexts
            foreach (ObjectContext c in ContextManager.ObjectContexts)
            {
                // See if this context is a candidate for eviction
                if (!c.Loaded)
                {
                    continue;
                }
                c.Context = Tpm.ContextSave(c.TheTpmHandle);
                // Object slots are not auto-evicted on ContextSave
                if (SlotTypeFromHandle(c.Context.savedHandle) == SlotType.ObjectSlot)
                {
                    Tpm.FlushContext(c.TheTpmHandle);

                }
                c.TheTpmHandle = null;
                c.Loaded = false;
            }
        }