Ejemplo n.º 1
0
        public static long GetFileSize(IntPtr hFile)
        {
            var li = new LARGE_INTEGER();

            li.LowPart = m_fileSystemIo.GetFileSize(hFile, out li.HighPart);

            if (li.LowPart == INVALID_FILE_SIZE)
            {
                throw new System.IO.IOException("Invalid file size");
            }

            return(li.QuadPart);
        }
Ejemplo n.º 2
0
        public static int SeekFile(IntPtr hFile, long lDistanceToMove, MoveMethod dwMoveMethod)
        {
            var li = new LARGE_INTEGER();

            li.QuadPart = lDistanceToMove;
            var ret = m_fileSystemIo.SeekFile(hFile, li.LowPart, ref li.HighPart, (int)dwMoveMethod);

            if (ret == INVALID_SET_FILE_POINTER)
            {
                throw new Exception("Invalid seek");
            }

            return(ret);
        }
Ejemplo n.º 3
0
        public static long GetFileSize(IntPtr hFile)
        {
            var li = new LARGE_INTEGER();
            li.LowPart = m_fileSystemIo.GetFileSize(hFile, out li.HighPart);

            if (li.LowPart == INVALID_FILE_SIZE)
                throw new System.IO.IOException("Invalid file size");

            return li.QuadPart;
        }
Ejemplo n.º 4
0
        public static int SeekFile(IntPtr hFile, long lDistanceToMove, MoveMethod dwMoveMethod)
        {
            var li = new LARGE_INTEGER();

            li.QuadPart = lDistanceToMove;
            var ret = m_fileSystemIo.SeekFile(hFile, li.LowPart, ref li.HighPart, (int)dwMoveMethod);

            if (ret == INVALID_SET_FILE_POINTER)
                throw new Exception("Invalid seek");

            return ret;
        }