Beispiel #1
0
        public void CreateDelta(string oldFilePath, string newFilePath, string deltaFilePath)
        {
            DeltaInput globalOptions = new DeltaInput();

            if (!NativeMethods.CreateDelta(FileTypeSet.Executables, 0L, 0L, oldFilePath, newFilePath, null, null, globalOptions, IntPtr.Zero, HashAlgId.Crc32, deltaFilePath))
            {
                throw new Win32Exception();
            }
        }
 public static extern bool CreateDelta([MarshalAs(UnmanagedType.I8)] FileTypeSet fileTypeSet,
                                       long setFlags,
                                       long resetFlags,
                                       string sourceName,
                                       string targetName,
                                       string sourceOptionsName,
                                       string targetOptionsName,
                                       DeltaInput globalOptions,
                                       IntPtr targetFileTime,
                                       [MarshalAs(UnmanagedType.U4)] HashAlgId hashAlgId,
                                       string deltaName);
 public static extern bool CreateDelta([MarshalAs(UnmanagedType.I8)] FileTypeSet fileTypeSet,
                                       long setFlags,
                                       long resetFlags,
                                       string sourceName,
                                       string targetName,
                                       string sourceOptionsName,
                                       string targetOptionsName,
                                       DeltaInput globalOptions,
                                       IntPtr targetFileTime,
                                       [MarshalAs(UnmanagedType.U4)] HashAlgId hashAlgId,
                                       string deltaName);
        public void CreateDelta(string oldFilePath, string newFilePath, string deltaFilePath)
        {
            const string sourceOptionsName = null;
            const string targetOptionsName = null;
            var          globalOptions     = new DeltaInput();
            var          targetFileTime    = IntPtr.Zero;

            if (!NativeMethods.CreateDelta(
                    FileTypeSet.Executables, CreateFlags.IgnoreFileSizeLimit, CreateFlags.None, oldFilePath, newFilePath,
                    sourceOptionsName, targetOptionsName, globalOptions, targetFileTime, HashAlgId.Crc32, deltaFilePath))
            {
                throw new Win32Exception();
            }
        }
        public void CreateDelta(string oldFilePath, string newFilePath, string deltaFilePath)
        {
            const int setFlags = 0;
            const int resetFlags = 0;
            const string sourceOptionsName = null;
            const string targetOptionsName = null;
            var globalOptions = new DeltaInput();
            var targetFileTime = IntPtr.Zero;

            if (!NativeMethods.CreateDelta(FileTypeSet.Executables, setFlags, resetFlags, oldFilePath, newFilePath,
                sourceOptionsName, targetOptionsName, globalOptions, targetFileTime, HashAlgId.Crc32, deltaFilePath))
            {
                throw new Win32Exception();
            }
        }