internal static MessageStatus WorkaroundFsctlSisCopy(BufferSize bufferSize, InputBufferFSCTL_SIS_COPYFILE inputBuffer, bool isCOPYFILE_SIS_LINKTrue, bool isIsEncryptedTrue, MessageStatus returnedStatus, ITestSite site)
 {
     if (bufferSize == BufferSize.BufferSizeSuccess &&
         inputBuffer == InputBufferFSCTL_SIS_COPYFILE.Initial &&
         isCOPYFILE_SIS_LINKTrue == false &&
         isIsEncryptedTrue == false)
     {
         returnedStatus = FsaUtility.TransferExpectedResult <MessageStatus>(4773, MessageStatus.SUCCESS, returnedStatus, site);
     }
     else if ((bufferSize == BufferSize.LessThanSI_COPYFILE) ||
              (inputBuffer == InputBufferFSCTL_SIS_COPYFILE.FlagsNotContainCOPYFILE_SIS_LINKAndCOPYFILE_SIS_REPLACE) ||
              (inputBuffer == InputBufferFSCTL_SIS_COPYFILE.DestinationFileNameLengthLessThanZero) ||
              (inputBuffer == InputBufferFSCTL_SIS_COPYFILE.DestinationFileNameLengthLargeThanMAXUSHORT) ||
              (inputBuffer == InputBufferFSCTL_SIS_COPYFILE.InputBufferSizeLessThanOtherPlus))
     {
         returnedStatus = FsaUtility.TransferExpectedResult <MessageStatus>(4734, MessageStatus.INVALID_PARAMETER, returnedStatus, site);
     }
     else if (isCOPYFILE_SIS_LINKTrue || isIsEncryptedTrue)
     {
         returnedStatus = FsaUtility.TransferExpectedResult <MessageStatus>(4755, MessageStatus.OBJECT_TYPE_MISMATCH, returnedStatus, site);
     }
     return(returnedStatus);
 }
        public static MessageStatus FsctlSisCopyFile(
            BufferSize bufferSize,
            InputBufferFSCTL_SIS_COPYFILE inputBuffer,
            bool isCOPYFILE_SIS_LINKTrue,
            bool isIsEncryptedTrue
            )
        {
            Condition.IsTrue(bufferSize == BufferSize.LessThanSI_COPYFILE || bufferSize == BufferSize.BufferSizeSuccess);
            if (!isObjectImplementedFunctionality)
            {
                Helper.CaptureRequirement(4732, @"[In FSCTL_SIS_COPYFILE] If the object store does not implement this functionality,
                    the operation MUST be failed with STATUS_INVALID_DEVICE_REQUEST.");
                return MessageStatus.INVALID_DEVICE_REQUEST;
            }

            if (!isIsAdministratorTrue)
            {
                Helper.CaptureRequirement(4733, @"[In FSCTL_SIS_COPYFILE] Pseudocode for the operation is as follows:
                    If Open.IsAdministrator is FALSE, the operation MUST be failed with STATUS_ACCESS_DEFINED");
                return MessageStatus.ACCESS_DENIED;
            }

            if (isCOPYFILE_SIS_LINKTrue)
            {
                Helper.CaptureRequirement(4755, @"In FSCTL_SIS_COPYFILE,Pseudocode for the operation is as follows:
                    The operation MUST be failed with STATUS_OBJECT_TYPE_MISMATCH under any of the following conditions:]
                    If SourceOpen.File.ReparseTag is empty and InputBuffer.Flags.COPYFILE_SIS_LINK is TRUE.");
                return MessageStatus.OBJECT_TYPE_MISMATCH;
            }

            if (bufferSize == BufferSize.LessThanSI_COPYFILE)
            {
                Helper.CaptureRequirement(4734, @"[In FSCTL_SIS_COPYFILE,Pseudocode for the operation is as follows:]
                    If InputBufferSizes is less than sizeof( SI_COPYFILE ), the operation MUST be failed with STATUS_INVALID_PARAMETER_1.");
                return MessageStatus.INVALID_PARAMETER;
            }

            if (inputBuffer == InputBufferFSCTL_SIS_COPYFILE.FlagsNotContainCOPYFILE_SIS_LINKAndCOPYFILE_SIS_REPLACE)
            {
                Helper.CaptureRequirement(4735, @"[In FSCTL_SIS_COPYFILE,Pseudocode for the operation is as follows:]
                    If InputBuffer.Flags contains any flags besides COPYFILE_SIS_LINK and COPYFILE_SIS_REPLACE,
                    the operation MUST be failed with STATUS_INVALID_PARAMETER_2.");
                return MessageStatus.INVALID_PARAMETER;
            }

            if (inputBuffer == InputBufferFSCTL_SIS_COPYFILE.DestinationFileNameLengthLessThanZero)
            {
                Helper.CaptureRequirement(4737, @"[In FSCTL_SIS_COPYFILE,Pseudocode for the operation is as follows:]
                    If  InputBuffer.DestinationFileNameLength is <= zero, the operation MUST be failed with STATUS_INVALID_PARAMETER_3.");
                return MessageStatus.INVALID_PARAMETER;
            }

            if (inputBuffer == InputBufferFSCTL_SIS_COPYFILE.DestinationFileNameLengthLargeThanMAXUSHORT)
            {
                Helper.CaptureRequirement(4739, @"[In FSCTL_SIS_COPYFILE,Pseudocode for the operation is as follows:]
                    If InputBuffer.DestinationFileNameLength is > MAXUSHORT (0xffff), the operation MUST be failed with STATUS_INVALID_PARAMETER.");
                return MessageStatus.INVALID_PARAMETER;
            }

            if (inputBuffer == InputBufferFSCTL_SIS_COPYFILE.InputBufferSizeLessThanOtherPlus)
            {
                Helper.CaptureRequirement(4740, @"[In FSCTL_SIS_COPYFILE,Pseudocode for the operation is as follows:]
                    If FieldOffset( InputBuffer.SourceFileName ) + InputBuffer.SourceFileNameLength + InputBuffer.DestinationFileNameLength
                    is > InputBufferSize, the operation MUST be failed with STATUS_INVALID_PARAMETER_4.");
                return MessageStatus.INVALID_PARAMETER;
            }

            if (isIsEncryptedTrue)
            {
                return MessageStatus.OBJECT_TYPE_MISMATCH;
            }

            Helper.CaptureRequirement(4726, @"[In FSCTL_SIS_COPYFILE] On completion, the object store MUST return:Status:
                An NTSTATUS code that specifies the result.");
            Helper.CaptureRequirement(4752, @"[In FSCTL_SIS_COPYFILE,Pseudocode for the operation is as follows:]
                If the request fails, this operation MUST be failed with the returned STATUS.");
            Helper.CaptureRequirement(4769, @"[In FSCTL_SIS_COPYFILE,Pseudocode for the operation is as follows:]
                If the request fails, this operation MUST be failed with the returned STATUS.");
            Helper.CaptureRequirement(4773, @"[In FSCTL_SIS_COPYFILE,Pseudocode for the operation is as follows:
                The operation MUST be failed with STATUS_OBJECT_TYPE_MISMATCH under any of the following conditions:]
                If SourceOpen.Stream.IsEncrypted is TRUE.");
            return MessageStatus.SUCCESS;
        }
 internal static MessageStatus WorkaroundFsctlSisCopy(BufferSize bufferSize, InputBufferFSCTL_SIS_COPYFILE inputBuffer, bool isCOPYFILE_SIS_LINKTrue, bool isIsEncryptedTrue, MessageStatus returnedStatus, ITestSite site)
 {
     if (bufferSize == BufferSize.BufferSizeSuccess &&
         inputBuffer == InputBufferFSCTL_SIS_COPYFILE.Initial &&
         isCOPYFILE_SIS_LINKTrue == false &&
         isIsEncryptedTrue == false)
     {
         returnedStatus = FsaUtility.TransferExpectedResult<MessageStatus>(4773, MessageStatus.SUCCESS, returnedStatus, site);
     }
     else if ((bufferSize == BufferSize.LessThanSI_COPYFILE) ||
         (inputBuffer == InputBufferFSCTL_SIS_COPYFILE.FlagsNotContainCOPYFILE_SIS_LINKAndCOPYFILE_SIS_REPLACE) ||
         (inputBuffer == InputBufferFSCTL_SIS_COPYFILE.DestinationFileNameLengthLessThanZero) ||
         (inputBuffer == InputBufferFSCTL_SIS_COPYFILE.DestinationFileNameLengthLargeThanMAXUSHORT) ||
         (inputBuffer == InputBufferFSCTL_SIS_COPYFILE.InputBufferSizeLessThanOtherPlus))
     {
         returnedStatus = FsaUtility.TransferExpectedResult<MessageStatus>(4734, MessageStatus.INVALID_PARAMETER, returnedStatus, site);
     }
     else if (isCOPYFILE_SIS_LINKTrue || isIsEncryptedTrue)
     {
         returnedStatus = FsaUtility.TransferExpectedResult<MessageStatus>(4755, MessageStatus.OBJECT_TYPE_MISMATCH, returnedStatus, site);
     }
     return returnedStatus;
 }