Example #1
0
        public static long Seek(
            SafeFileHandle handle,
            long distance,
            FileSeekOrigin origin)
        {
            long result;
            var flag = PInvokeHelper.Seek(handle, distance, out result, origin);

            var lastWin32Error = Marshal.GetLastWin32Error();
            if (!flag)
            {
                throw new Win32Exception(
                    lastWin32Error,
                    string.Format(
                        Resources.ErrorSeek,
                        lastWin32Error,
                        CheckAddDotEnd(new Win32Exception(lastWin32Error).Message)));
            }

            return result;
        }
Example #2
0
 public static extern bool Seek(
     SafeFileHandle hFile,
     long distance,
     out long newFilePointer,
     FileSeekOrigin origin);
Example #3
0
 public static extern bool Seek(
     SafeFileHandle hFile, 
     long distance, 
     out long newFilePointer, 
     FileSeekOrigin origin);