コード例 #1
0
        public static void OplockBreakAcknowledgementRequest(OplockVolatilePortion volatilePortion, OplockPersistentPortion persistentPortion, OplockLevel_Values oplockLevel)
        {
            Combination.Isolated(volatilePortion == OplockVolatilePortion.VolatilePortionNotFound);
            Combination.Isolated(persistentPortion == OplockPersistentPortion.PersistentNotMatchesDurableFileId);

            // Isolate the values that are not allowed
            Combination.Isolated(oplockLevel == OplockLevel_Values.OPLOCK_LEVEL_BATCH);
            Combination.Isolated(oplockLevel == OplockLevel_Values.OPLOCK_LEVEL_EXCLUSIVE);
            Combination.Isolated(oplockLevel == OplockLevel_Values.OPLOCK_LEVEL_LEASE);

            Condition.IsTrue(State == ModelState.Connected);
            Condition.IsNull(Request);

            bool volatilePortionFound = volatilePortion == OplockVolatilePortion.VolatilePortionFound;
            bool persistentMatchesDurableFileId = persistentPortion == OplockPersistentPortion.PersistentMatchesDurableFileId;

            Request = new ModelOplockBreakAcknowledgementRequest(volatilePortionFound, persistentMatchesDurableFileId, oplockLevel);
        }
コード例 #2
0
        public void OplockBreakAcknowledgementRequest(OplockVolatilePortion volatilePortion, OplockPersistentPortion persistentPortion, OplockLevel_Values oplockLevel)
        {
            bool volatilePortionFound = volatilePortion == OplockVolatilePortion.VolatilePortionFound;
            bool persistentMatchesDurableFileId = persistentPortion == OplockPersistentPortion.PersistentMatchesDurableFileId;
            FILEID fileIdRequest = fileId;

            if(!volatilePortionFound)
            {
                fileIdRequest.Volatile = FILEID.Invalid.Volatile;
            }

            if(!persistentMatchesDurableFileId)
            {
                fileIdRequest.Persistent = FILEID.Invalid.Persistent;
            }

            OPLOCK_BREAK_Response? oplockBreakResponse = null;
            uint status = testClient.OplockAcknowledgement(treeId, fileIdRequest, (OPLOCK_BREAK_Acknowledgment_OplockLevel_Values)oplockLevel, (header, response) => { oplockBreakResponse = response; });

            OplockBreakResponse((ModelSmb2Status)status, oplockBreakResponse.Value.OplockLevel, oplockLevelOnOpen);
        }
コード例 #3
0
        public static void OplockBreakAcknowledgementRequest(OplockVolatilePortion volatilePortion, OplockPersistentPortion persistentPortion, OplockLevel_Values oplockLevel)
        {
            Combination.Isolated(volatilePortion == OplockVolatilePortion.VolatilePortionNotFound);
            Combination.Isolated(persistentPortion == OplockPersistentPortion.PersistentNotMatchesDurableFileId);

            // Isolate the values that are not allowed
            Combination.Isolated(oplockLevel == OplockLevel_Values.OPLOCK_LEVEL_BATCH);
            Combination.Isolated(oplockLevel == OplockLevel_Values.OPLOCK_LEVEL_EXCLUSIVE);
            Combination.Isolated(oplockLevel == OplockLevel_Values.OPLOCK_LEVEL_LEASE);

            Condition.IsTrue(State == ModelState.Connected);
            Condition.IsNull(Request);

            bool volatilePortionFound           = volatilePortion == OplockVolatilePortion.VolatilePortionFound;
            bool persistentMatchesDurableFileId = persistentPortion == OplockPersistentPortion.PersistentMatchesDurableFileId;

            Request = new ModelOplockBreakAcknowledgementRequest(volatilePortionFound, persistentMatchesDurableFileId, oplockLevel);
        }
コード例 #4
0
        public void OplockBreakAcknowledgementRequest(OplockVolatilePortion volatilePortion, OplockPersistentPortion persistentPortion, OplockLevel_Values oplockLevel)
        {
            bool   volatilePortionFound           = volatilePortion == OplockVolatilePortion.VolatilePortionFound;
            bool   persistentMatchesDurableFileId = persistentPortion == OplockPersistentPortion.PersistentMatchesDurableFileId;
            FILEID fileIdRequest = fileId;

            if (!volatilePortionFound)
            {
                fileIdRequest.Volatile = FILEID.Invalid.Volatile;
            }

            if (!persistentMatchesDurableFileId)
            {
                fileIdRequest.Persistent = FILEID.Invalid.Persistent;
            }

            OPLOCK_BREAK_Response?oplockBreakResponse = null;
            uint status = testClient.OplockAcknowledgement(treeId, fileIdRequest, (OPLOCK_BREAK_Acknowledgment_OplockLevel_Values)oplockLevel, (header, response) => { oplockBreakResponse = response; });

            OplockBreakResponse((ModelSmb2Status)status, oplockBreakResponse.Value.OplockLevel, oplockLevelOnOpen);
        }