예제 #1
0
        public void SetFileInformation(NtHandle handle, FileInformation information)
        {
            SetInfoRequest request = new SetInfoRequest
            {
                InfoType             = InfoType.File,
                FileInformationClass = information.FileInformationClass,
                FileId = (FileID)handle
            };

            request.SetFileInformation(information);

            SendCommand(request);
            SMB2Command response = WaitForCommand(request.MessageID);

            response.IsSuccessElseThrow();
        }
예제 #2
0
        public NTStatus SetFileInformation(object handle, FileInformation information)
        {
            SetInfoRequest request = new SetInfoRequest();

            request.InfoType             = InfoType.File;
            request.FileInformationClass = information.FileInformationClass;
            request.FileId = (FileID)handle;
            request.SetFileInformation(information);

            ulong       messageId = TrySendCommand(request);
            SMB2Command response  = m_client.WaitForCommand(SMB2CommandName.SetInfo, messageId);

            if (response != null)
            {
                return(response.Header.Status);
            }

            return(NTStatus.STATUS_INVALID_SMB);
        }
예제 #3
0
        public async Task <NTStatus> SetFileInformationAsync(object handle, FileInformation information, CancellationToken cancellationToken)
        {
            SetInfoRequest request = new SetInfoRequest();

            request.InfoType             = InfoType.File;
            request.FileInformationClass = information.FileInformationClass;
            request.FileId = (FileID)handle;
            request.SetFileInformation(information);

            await TrySendCommandAsync(request, cancellationToken);

            SMB2Command response = m_client.WaitForCommand(SMB2CommandName.SetInfo);

            if (response != null)
            {
                return(response.Header.Status);
            }

            return(NTStatus.STATUS_INVALID_SMB);
        }