private int SetFilePointerHook(IntPtr hfile, int ldistancetomove, IntPtr lpdistancetomovehigh,
                                       EMoveMethod dwmovemethod)
        {
            VirtualHandle handle;

            if (_virtualHandles.TryGetValue(hfile, out handle))
            {
#if TRACE
                Console.WriteLine("Seeking in virtual file " + handle.Filename + " Dir: " + dwmovemethod + " Dist: " + ldistancetomove + " High: " + lpdistancetomovehigh);
#endif

                switch (dwmovemethod)
                {
                case EMoveMethod.Begin:
                    handle.Stream.Seek(ldistancetomove, SeekOrigin.Begin);
                    break;

                case EMoveMethod.Current:
                    handle.Stream.Seek(ldistancetomove, SeekOrigin.Current);
                    break;

                case EMoveMethod.End:
                    handle.Stream.Seek(ldistancetomove, SeekOrigin.End);
                    break;

                default:
                    throw new ArgumentOutOfRangeException("dwmovemethod");
                }

                return((int)handle.Stream.Position);
            }

            return(Win32Api.SetFilePointer(hfile, ldistancetomove, lpdistancetomovehigh, dwmovemethod));
        }
示例#2
0
 public static extern uint SetFilePointerEx(
     [In] SafeFileHandle hFile,
     [In] long lDistanceToMove,
     [In, Out] IntPtr lpDistanceToMoveHigh,
     [In] EMoveMethod dwMoveMethod);
示例#3
0
文件: notdd.cs 项目: ryanries/notdd
 public static extern bool SetFilePointerEx(
     SafeFileHandle hFile,
     long liDistanceToMove,
     IntPtr lpNewFilePointer,
     EMoveMethod dwMoveMethod);
 public static extern bool SetFilePointerEx(
     SafeFileHandle hFile,
     Int64 liDistanceToMove,
     out Int64 lpNewFilePointer,
     EMoveMethod dwMoveMethod);
示例#5
0
 static internal extern unsafe int SetFilePointer(
     [In] IntPtr hFile,
     [In] int lDistanceToMove,
     [In] IntPtr lpDistanceToMoveHigh,
     [In] EMoveMethod dwMoveMethod);
示例#6
0
 static extern uint SetFilePointer([In] SafeFileHandle hFile, [In] int lDistanceToMove, [Out] out int lpDistanceToMoveHigh, [In] EMoveMethod dwMoveMethod);
 static extern uint SetFilePointer(
     [In] SafeFileHandle hFile,
     [In] uint lDistanceToMove,
     [In] IntPtr lpDistanceToMoveHigh,
     [In] EMoveMethod dwMoveMethod);
示例#8
0
 public static extern Boolean SetFilePointerEx(
     [In] SafeFileHandle hFile,
     [In] Int64 liDistanceToMove,
     [Out] out Int64 lpNewFilePointer,
     [In] EMoveMethod dwMoveMethod);
示例#9
0
 public unsafe static extern int SetFilePointer(
     IntPtr hFile,
     int lDistanceToMove,
     int *lpDistanceToMoveHigh,
     EMoveMethod dwMoveMethod
     );
示例#10
0
文件: Device.cs 项目: Ala-Buy/CHIMP
 private static extern int SetFilePointer(SafeFileHandle hDevice, int lDistanceToMove,
                                          [In, Out] int lpDistanceToMoveHigh, EMoveMethod dwMoveMethod);
示例#11
0
 public static extern bool SetFilePointerEx(
     [In] SafeFileHandle hFile,
     [In] long liDistanceToMove,
     [Out, Optional][MarshalAs(UnmanagedType.I8)] out long lpNewFilePointer,
     [In][MarshalAs(UnmanagedType.U4)] EMoveMethod dwMoveMethod);
示例#12
0
 public static extern int SetFilePointer(SafeFileHandle handle, int lDistanceToMove, out int lpDistanceToMoveHigh, EMoveMethod dwMoveMethod);
示例#13
0
 internal static extern UInt32 SetFilePointer(
     SafeFileHandle hFile,
     Int32 cbDistanceToMove,
     IntPtr pDistanceToMoveHigh,
     EMoveMethod fMoveMethod);
示例#14
0
 static extern long SetFilePointer(
     [In] SafeFileHandle hFile,
     [In] long lDistanceToMove,
     [Out] out long lpDistanceToMoveHigh,
     [In] EMoveMethod dwMoveMethod);
示例#15
0
 internal static extern uint SetFilePointer(
     [In] IntPtr hFile,
     [In] int lDistanceToMove,
     [Out] out int lpDistanceToMoveHigh,
     [In] EMoveMethod dwMoveMethod);
示例#16
0
 internal static extern UInt32 SetFilePointer(
     SafeFileHandle hFile,
     Int32 cbDistanceToMove,
     IntPtr pDistanceToMoveHigh,
     EMoveMethod fMoveMethod);
示例#17
0
 static extern internal int SetFilePointer([In] SafeFileHandle hFile, [In] int lDistanceToMove, ref int lpDistanceToMoveHigh, [In] EMoveMethod dwMoveMethod);
示例#18
0
 public static extern int SetFilePointer(SafeFileHandle handle, int lDistanceToMove,
                                         out int lpDistanceToMoveHigh, EMoveMethod dwMoveMethod);
示例#19
0
 public static unsafe extern bool SetFilePointerEx(
     SafeFileHandle hFile,      // HANDLE
     Int64 distanceToMove,      // LARGE_INTEGER
     Int64 *newFilePointer,     // PLARGE_INTEGER
     EMoveMethod dwMoveMethod); // DWORD
示例#20
0
 public static extern uint SetFilePointer(
     [In] Microsoft.Win32.SafeHandles.SafeFileHandle hFile,
     [In] int lDistanceToMove,
     [In, Out] ref int lpDistanceToMoveHigh,
     [In] EMoveMethod dwMoveMethod);