Tpm2Lib.TpmPolicyNV.Execute C# (CSharp) Method

Execute() private method

private Execute ( Tpm2 tpm, AuthSession authSession, PolicyTree policy ) : TpmRc
tpm Tpm2
authSession AuthSession
policy PolicyTree
return TpmRc
        internal override TpmRc Execute(Tpm2 tpm, AuthSession authSession, PolicyTree policy)
        {
            TpmRc res;

            if (AuthorizationHandle == null)
            {
                TpmHandle nvHandle, authHandle;
                SessionBase nvAuth;
                AssociatedPolicy.ExecutePolicyNvCallback(this, out authHandle, out nvHandle, out nvAuth);
                tpm[nvAuth].PolicyNV(authHandle, nvHandle, authSession,
                                     OperandB, Offset, Operation);
                res = tpm._GetLastResponseCode();

                if (!(nvAuth is Pwap))
                {
                    tpm.FlushContext(nvAuth);
                }
            }
            else
            {
                tpm[NvAccessAuth].PolicyNV(AuthorizationHandle, NvIndex, authSession,
                    OperandB, Offset, Operation);
                res = tpm._GetLastResponseCode();
            }
            return res;
        }