public virtual NT_STATUS ReadDirectory(UserContext userContext, MTPFileContext fileContext) { foreach (FSItem child in Children) { fileContext.Items.Add(child.GetDirectoryContext()); } return(NT_STATUS.OK); }
public virtual NT_STATUS Create(UserContext userContext, string name, SearchFlag searchFlag, FileMode fileMode, FileAccess fileAccess, FileShare fileShare, FileAttributes attributes, out MTPFileContext fileContext) { if (IsDirectory) { fileContext = new MTPFileContext(this); return(NT_STATUS.OK); } fileContext = null; return(NT_STATUS.NOT_IMPLEMENTED); }
public override NT_STATUS Create(UserContext userContext, string name, SearchFlag searchFlag, FileMode fileMode, FileAccess fileAccess, FileShare fileShare, FileAttributes attributes, out MTPFileContext fileContext) { if (!IsDirectory) { if (fileMode == FileMode.Open) { fileContext = new MTPFileContext(this); using (BinaryReader reader = new BinaryReader(_content.OpenRead())) { _data = reader.ReadBytes((int)_content.Size); } return(NT_STATUS.OK); } else { fileContext = null; return(NT_STATUS.NOT_IMPLEMENTED); } } return(base.Create(userContext, name, searchFlag, fileMode, fileAccess, fileShare, attributes, out fileContext)); }