public int Read(object FileNode, object FileDesc0, IntPtr Buffer, ulong Offset, uint Length, out uint pBytesTransferred) { try { var r = HandleResult(Storage.Read((IFSEntryPointer)FileDesc0, out var buffer, (long)Offset, (int)Length, out var BytesTransfered)).GetNtStatus(); pBytesTransferred = (uint)BytesTransfered; Marshal.Copy(buffer, 0, Buffer, buffer.Length); return(r); } catch (Win32Exception ex) { throw WindowsExceptionGenerator.GetIOException(ex); } catch (NTException ex) { throw WindowsExceptionGenerator.GetIOException(ex); } }