Ejemplo n.º 1
0
        public int ReadFileProxy(
            IntPtr rawFileName,
            IntPtr rawBuffer,
            uint rawBufferLength,
            ref uint rawReadLength,
            long rawOffset,
            ref DOKAN_FILE_INFO rawFileInfo)
        {
            try
            {
                string file = GetFileName(rawFileName);

                byte[] buf = new Byte[rawBufferLength];

                uint readLength = 0;
                int  ret        = operations_.ReadFile(
                    file, buf, ref readLength, rawOffset, GetFileInfo(ref rawFileInfo));
                if (ret == 0)
                {
                    rawReadLength = readLength;
                    Marshal.Copy(buf, 0, rawBuffer, (int)rawBufferLength);
                }
                return(ret);
            }
            catch (Exception e)
            {
                Console.Error.WriteLine(e.ToString());
                return(-1);
            }
        }
Ejemplo n.º 2
0
 public int ReadFile(string filename, byte[] buffer,
                     ref uint readBytes, long offset, DokanFileInfo info)
 {
     return(ope_.ReadFile(filename, buffer, ref readBytes, offset, info));
 }