Tpm2Lib.Tbs.GetLoadedEntities C# (CSharp) Method

GetLoadedEntities() private method

private GetLoadedEntities ( Tpm2 tpm, Ht rangeToQuery ) : Tpm2Lib.TpmHandle[]
tpm Tpm2
rangeToQuery Ht
return Tpm2Lib.TpmHandle[]
        private TpmHandle[] GetLoadedEntities(Tpm2 tpm, Ht rangeToQuery)
        {
            const uint maxHandles = UInt32.MaxValue;
            ICapabilitiesUnion h;
            byte moreData = tpm.GetCapability(Cap.Handles, ((uint)rangeToQuery) << 24, maxHandles, out h);
            if (moreData != 0)
            {
                throw new NotImplementedException("Too much data returned");
            }
            if (h.GetType() != typeof (HandleArray))
            {
                throw new Exception("Incorrect type");
            }
            var handles = (HandleArray)h;
            return handles.handle;
        }