Make ZipSharp work on Windows
authorHenric Müller <hemuller@microsoft.com>
Wed, 5 Oct 2016 12:35:25 +0000 (14:35 +0200)
committerHenric Müller <hemuller@microsoft.com>
Tue, 11 Oct 2016 11:09:15 +0000 (13:09 +0200)
This patch adds the zlib functions needed by ZipSharp to the VS
MonoPosixHelper.def export file.

This patch also changes the ZipSharp code to use different code paths
depending on the size of the C long type on the underlying platform. On
gcc/clang the C long type follows the bitness of the targeted architecture,
it's 32-bit on 32-bit systems and 64-bit on 64-bit systems. With the VS
compiler however, the C long type is always 32-bit regardless of the target
architecture. zlib and minizip uses C long in a number of different function
signatures and structs.

14 files changed:
mcs/class/WindowsBase/WindowsBase.dll.sources
mcs/class/WindowsBase/ZipSharp/IOFunctions.cs
mcs/class/WindowsBase/ZipSharp/NativeUnzip.cs
mcs/class/WindowsBase/ZipSharp/NativeVersion.cs [new file with mode: 0755]
mcs/class/WindowsBase/ZipSharp/NativeZip.cs
mcs/class/WindowsBase/ZipSharp/UnzipArchive.cs
mcs/class/WindowsBase/ZipSharp/UnzipFileInfo.cs
mcs/class/WindowsBase/ZipSharp/UnzipReadStream.cs
mcs/class/WindowsBase/ZipSharp/ZipArchive.cs
mcs/class/WindowsBase/ZipSharp/ZipFileInfo.cs
mcs/class/WindowsBase/ZipSharp/ZipStream.cs
msvc/monoposixhelper.def
msvc/monoposixhelper.vcxproj
msvc/monoposixhelper.vcxproj.filters

index f0a6e5c2ab68e58364251c20accbd8f2784cb8ca..c36c7ce5608ab796e4a659abf9e57fae4d39ae48 100644 (file)
@@ -181,6 +181,7 @@ System.Windows.Threading/DispatcherUnhandledExceptionEventArgs.cs
 System.Windows.Threading/DispatcherUnhandledExceptionEventHandler.cs
 System.Windows.Threading/DispatcherUnhandledExceptionFilterEventArgs.cs
 System.Windows.Threading/DispatcherUnhandledExceptionFilterEventHandler.cs
+ZipSharp/NativeVersion.cs
 ZipSharp/IOFunctions.cs
 ZipSharp/ZipArchive.cs
 ZipSharp/UnzipArchive.cs
index 04e6a3e9ca79e7919b62d2e245dc17959a5f1be2..d339f84425e9fdd4e006e4c9384664170a678629 100644 (file)
@@ -21,16 +21,28 @@ namespace zipsharp
        internal delegate IntPtr OpenFileFunc (IntPtr opaque, string filename, int mode);
 
        [UnmanagedFunctionPointerAttribute (CallingConvention.Cdecl)]
-       internal delegate /* ulong */ IntPtr ReadFileFunc (IntPtr opaque, IntPtr stream, IntPtr buffer, /* ulong */ IntPtr size);
+       internal delegate /* uLong */ uint ReadFileFunc32 (IntPtr opaque, IntPtr stream, IntPtr buffer, /* uLong */ uint size);
 
        [UnmanagedFunctionPointerAttribute (CallingConvention.Cdecl)]
-       internal delegate /* ulong */ IntPtr WriteFileFunc (IntPtr opaque, IntPtr stream, IntPtr buffer, /* ulong */ IntPtr size);
+       internal delegate /* uLong */ uint WriteFileFunc32 (IntPtr opaque, IntPtr stream, IntPtr buffer, /* uLong */ uint size);
 
        [UnmanagedFunctionPointerAttribute (CallingConvention.Cdecl)]
-       internal delegate /* long */ IntPtr TellFileFunc (IntPtr opaque, IntPtr stream);
+       internal delegate /* long */ int TellFileFunc32 (IntPtr opaque, IntPtr stream);
 
        [UnmanagedFunctionPointerAttribute (CallingConvention.Cdecl)]
-       internal delegate /* long */ IntPtr SeekFileFunc (IntPtr opaque, IntPtr stream, /* ulong */ IntPtr offset, int origin);
+       internal delegate /* long */ int SeekFileFunc32 (IntPtr opaque, IntPtr stream, /* uLong */ uint offset, int origin);
+
+       [UnmanagedFunctionPointerAttribute (CallingConvention.Cdecl)]
+       internal delegate /* uLong */ ulong ReadFileFunc64 (IntPtr opaque, IntPtr stream, IntPtr buffer, /* uLong */ ulong size);
+
+       [UnmanagedFunctionPointerAttribute (CallingConvention.Cdecl)]
+       internal delegate /* uLong */ ulong WriteFileFunc64 (IntPtr opaque, IntPtr stream, IntPtr buffer, /* uLong */ ulong size);
+
+       [UnmanagedFunctionPointerAttribute (CallingConvention.Cdecl)]
+       internal delegate /* long */ long TellFileFunc64 (IntPtr opaque, IntPtr stream);
+
+       [UnmanagedFunctionPointerAttribute (CallingConvention.Cdecl)]
+       internal delegate /* long */ long SeekFileFunc64 (IntPtr opaque, IntPtr stream, /* uLong */ ulong offset, int origin);
 
        [UnmanagedFunctionPointerAttribute (CallingConvention.Cdecl)]
        internal delegate int CloseFileFunc (IntPtr opaque, IntPtr stream);
@@ -39,13 +51,26 @@ namespace zipsharp
        internal delegate int TestErrorFileFunc (IntPtr opaque, IntPtr stream);
 
        [StructLayout (LayoutKind.Sequential)]
-       internal struct ZlibFileFuncDef
+       internal struct ZlibFileFuncDef32
+       {
+               [MarshalAs (UnmanagedType.FunctionPtr)] public OpenFileFunc      zopen_file;
+               [MarshalAs (UnmanagedType.FunctionPtr)] public ReadFileFunc32    zread_file;
+               [MarshalAs (UnmanagedType.FunctionPtr)] public WriteFileFunc32   zwrite_file;
+               [MarshalAs (UnmanagedType.FunctionPtr)] public TellFileFunc32    ztell_file;
+               [MarshalAs (UnmanagedType.FunctionPtr)] public SeekFileFunc32    zseek_file;
+               [MarshalAs (UnmanagedType.FunctionPtr)] public CloseFileFunc     zclose_file;
+               [MarshalAs (UnmanagedType.FunctionPtr)] public TestErrorFileFunc zerror_file;
+               public IntPtr            opaque;
+       }
+
+       [StructLayout (LayoutKind.Sequential)]
+       internal struct ZlibFileFuncDef64
        {
                [MarshalAs (UnmanagedType.FunctionPtr)] public OpenFileFunc      zopen_file;
-               [MarshalAs (UnmanagedType.FunctionPtr)] public ReadFileFunc      zread_file;
-               [MarshalAs (UnmanagedType.FunctionPtr)] public WriteFileFunc     zwrite_file;
-               [MarshalAs (UnmanagedType.FunctionPtr)] public TellFileFunc      ztell_file;
-               [MarshalAs (UnmanagedType.FunctionPtr)] public SeekFileFunc      zseek_file;
+               [MarshalAs (UnmanagedType.FunctionPtr)] public ReadFileFunc64    zread_file;
+               [MarshalAs (UnmanagedType.FunctionPtr)] public WriteFileFunc64   zwrite_file;
+               [MarshalAs (UnmanagedType.FunctionPtr)] public TellFileFunc64    ztell_file;
+               [MarshalAs (UnmanagedType.FunctionPtr)] public SeekFileFunc64    zseek_file;
                [MarshalAs (UnmanagedType.FunctionPtr)] public CloseFileFunc     zclose_file;
                [MarshalAs (UnmanagedType.FunctionPtr)] public TestErrorFileFunc zerror_file;
                public IntPtr            opaque;
index 3b3c3dc5d87dcf92a442a238a6dd325c1de151fe..673a2c921ebe3f240d4e0110c503983553c10d34 100644 (file)
@@ -65,43 +65,58 @@ namespace zipsharp
                        return unztell(handle).ToInt64 ();
                }
 
-               public static long CurrentFileLength (UnzipHandle handle)
+               public static long CurrentFileLength32 (UnzipHandle handle)
                {
-                       UnzipFileInfo info;
-                       int result = unzGetCurrentFileInfo (handle, out info, null, IntPtr.Zero, IntPtr.Zero, IntPtr.Zero, null,  IntPtr.Zero);
-                       
-                       if (result != 0)
-                               return -1;
-                       else
-                               return (long)info.UncompressedSize;
+                       UnzipFileInfo32 info;
+                       int result = unzGetCurrentFileInfo_32 (handle, out info, null, 0, IntPtr.Zero, 0, null,  0);
+                       return result != 0 ? -1 : (long) info.uncompressed_size;
                }
-               
-               static string GetCurrentFileName (UnzipHandle handle)
+
+               public static long CurrentFileLength64 (UnzipHandle handle)
                {
-                       UnzipFileInfo info;
-                       int result = unzGetCurrentFileInfo (handle, out info, null, IntPtr.Zero, IntPtr.Zero, new IntPtr (0), null,  IntPtr.Zero);
+                       UnzipFileInfo64 info;
+                       int result = unzGetCurrentFileInfo_64 (handle, out info, null, 0, IntPtr.Zero, 0, null,  0);
+                       return result != 0 ? -1 : (long) info.uncompressed_size;
+               }
 
-                       if (result != 0)
+               static string GetCurrentFileName32 (UnzipHandle handle)
+               {
+                       UnzipFileInfo32 info;
+                       if (unzGetCurrentFileInfo_32 (handle, out info, null, 0, IntPtr.Zero, 0, null, 0) != 0)
                                return null;
-                       
-                       StringBuilder sbName = new StringBuilder ((int)info.SizeFilename+1); // +1 to account for extra \0 at the end
-                       result = unzGetCurrentFileInfo (handle, out info, sbName, new IntPtr (sbName.Capacity), IntPtr.Zero, new IntPtr (0), null,  IntPtr.Zero);
-                       
-                       if (result != 0)
+                       var sbName = new StringBuilder ((int) info.size_filename + 1); // +1 to account for extra \0 at the end
+                       if (unzGetCurrentFileInfo_32 (handle, out info, sbName, (uint) sbName.Capacity, IntPtr.Zero, 0, null, 0) != 0)
                                return null;
-                       else
-                               return sbName.ToString ();
+                       return sbName.ToString ();
                }
 
-               public static string[] GetFiles (UnzipHandle handle)
+               static string GetCurrentFileName64 (UnzipHandle handle)
                {
-                       List<string> files = new List<string> ();
+                       UnzipFileInfo64 info;
+                       if (unzGetCurrentFileInfo_64 (handle, out info, null, 0, IntPtr.Zero, 0, null, 0) != 0)
+                               return null;
+                       var sbName = new StringBuilder ((int) info.size_filename + 1); // +1 to account for extra \0 at the end
+                       if (unzGetCurrentFileInfo_64 (handle, out info, sbName, (uint) sbName.Capacity, IntPtr.Zero, 0, null, 0) != 0)
+                               return null;
+                       return sbName.ToString ();
+               }
 
-                       GoToFirstFile (handle);
+               public static string[] GetFiles32 (UnzipHandle handle)
+               {
+                       return GetFiles (handle, GetCurrentFileName32);
+               }
+
+               public static string[] GetFiles64 (UnzipHandle handle)
+               {
+                       return GetFiles (handle, GetCurrentFileName64);
+               }
 
+               private static string[] GetFiles (UnzipHandle handle, Func<UnzipHandle, string> getCurrentFileName)
+               {
+                       GoToFirstFile (handle);
+                       var files = new List<string> ();
                        string name;
-                       while ((name = GetCurrentFileName(handle)) != null)
-                       {
+                       while ((name = getCurrentFileName (handle)) != null) {
                                files.Add (name);
                                if (!NativeUnzip.GoToNextFile (handle))
                                        break;
@@ -121,9 +136,17 @@ namespace zipsharp
                        return unzGoToNextFile(handle) == 0;
                }
                
-               public static UnzipHandle OpenArchive (ZlibFileFuncDef fileFuncs)
+               public static UnzipHandle OpenArchive32 (ZlibFileFuncDef32 fileFuncs)
+               {
+                       UnzipHandle handle = unzOpen2_32 ("", ref fileFuncs);
+                       if (handle.IsInvalid)
+                               throw new Exception ("Could not open unzip archive");
+                       return handle;
+               }
+
+               public static UnzipHandle OpenArchive64 (ZlibFileFuncDef64 fileFuncs)
                {
-                       UnzipHandle handle = unzOpen2 ("", ref fileFuncs);
+                       UnzipHandle handle = unzOpen2_64 ("", ref fileFuncs);
                        if (handle.IsInvalid)
                                throw new Exception ("Could not open unzip archive");
                        return handle;
@@ -160,9 +183,13 @@ namespace zipsharp
                [DllImport ("MonoPosixHelper", CallingConvention=CallingConvention.Cdecl)]
                static extern int unzGoToFirstFile (UnzipHandle handle);
 
-               [DllImport ("MonoPosixHelper", CallingConvention=CallingConvention.Cdecl)]
-               static extern UnzipHandle unzOpen2 (string path,
-                                                           ref ZlibFileFuncDef pzlib_filefunc_def);
+               [DllImport ("MonoPosixHelper", EntryPoint="unzOpen2", CallingConvention=CallingConvention.Cdecl)]
+               static extern UnzipHandle unzOpen2_32 (string path,
+                                                      ref ZlibFileFuncDef32 pzlib_filefunc_def);
+
+               [DllImport ("MonoPosixHelper", EntryPoint="unzOpen2", CallingConvention=CallingConvention.Cdecl)]
+               static extern UnzipHandle unzOpen2_64 (string path,
+                                                      ref ZlibFileFuncDef64 pzlib_filefunc_def);
 
                [DllImport ("MonoPosixHelper", CallingConvention=CallingConvention.Cdecl)]
                static extern int unzGoToNextFile (UnzipHandle handle);
@@ -178,15 +205,25 @@ namespace zipsharp
                                                       out int level,
                                                       int raw);
 
-               [DllImport ("MonoPosixHelper", CallingConvention=CallingConvention.Cdecl)]
-               static extern int unzGetCurrentFileInfo (UnzipHandle handle,
-                                                                out UnzipFileInfo pfile_info,
-                                                                StringBuilder szFileName,
-                                                                IntPtr fileNameBufferSize,   // uLong
-                                                                IntPtr extraField,           // void *
-                                                                IntPtr extraFieldBufferSize, // uLong
-                                                                StringBuilder szComment,
-                                                                IntPtr commentBufferSize);   // uLong
+               [DllImport ("MonoPosixHelper", EntryPoint="unzGetCurrentFileInfo", CallingConvention=CallingConvention.Cdecl)]
+               static extern int unzGetCurrentFileInfo_32 (UnzipHandle handle,
+                                                           out UnzipFileInfo32 pfile_info,
+                                                           StringBuilder szFileName,
+                                                           uint fileNameBufferSize,   // uLong
+                                                           IntPtr extraField,         // void *
+                                                           uint extraFieldBufferSize, // uLong
+                                                           StringBuilder szComment,
+                                                           uint commentBufferSize);   // uLong
+
+               [DllImport ("MonoPosixHelper", EntryPoint="unzGetCurrentFileInfo", CallingConvention=CallingConvention.Cdecl)]
+               static extern int unzGetCurrentFileInfo_64 (UnzipHandle handle,
+                                                           out UnzipFileInfo64 pfile_info,
+                                                           StringBuilder szFileName,
+                                                           ulong fileNameBufferSize,   // uLong
+                                                           IntPtr extraField,          // void *
+                                                           ulong extraFieldBufferSize, // uLong
+                                                           StringBuilder szComment,
+                                                           ulong commentBufferSize);   // uLong
 
                [DllImport ("MonoPosixHelper", CallingConvention=CallingConvention.Cdecl)]
                static unsafe extern int unzReadCurrentFile (UnzipHandle handle,
diff --git a/mcs/class/WindowsBase/ZipSharp/NativeVersion.cs b/mcs/class/WindowsBase/ZipSharp/NativeVersion.cs
new file mode 100755 (executable)
index 0000000..ce7112e
--- /dev/null
@@ -0,0 +1,20 @@
+using System;
+
+namespace zipsharp {
+       static class NativeVersion {
+
+               /// <summary>
+               /// ZipSharp code needs different code paths
+               /// depending on the size of the C long type on the underlying platform. On
+               /// gcc/clang the C long type follows the bitness of the targeted architecture,
+               /// it's 32-bit on 32-bit systems and 64-bit on 64-bit systems. With the VS
+               /// compiler however, the C long type is always 32-bit regardless of the
+               /// target architecture. zlib and minizip uses C long in a number of 
+               /// different function signatures and structs. 
+               /// 
+               /// This field is used to easily determine if the 32 bit version of 
+               /// functions and structs should be used when interacting with zlib.
+               /// </summary>
+               public static readonly bool Use32Bit = IntPtr.Size == 4 || Environment.OSVersion.Platform != PlatformID.Unix;
+       }
+}
index 225fc1acaba49b94a58b6999f54388d202c154e1..b556a9052e661d40251b895a24648346f7413466 100644 (file)
@@ -31,24 +31,44 @@ namespace zipsharp
                        zipCloseFileInZip (handle);
                }
 
-               public static ZipHandle OpenArchive (ZlibFileFuncDef funcDef, Append append)
+               public static ZipHandle OpenArchive32 (ZlibFileFuncDef32 funcDef, Append append)
                {
-                       ZipHandle h = zipOpen2 ("", (int) append, IntPtr.Zero, ref funcDef);
+                       ZipHandle h = zipOpen2_32 ("", (int) append, IntPtr.Zero, ref funcDef);
                        if (h.IsInvalid)
                                throw new Exception ("Could not open the zip archive");
                        return h;
                }
-               
-               public static int OpenFile (ZipHandle handle, string filename)
+
+               public static ZipHandle OpenArchive64 (ZlibFileFuncDef64 funcDef, Append append)
+               {
+                       ZipHandle h = zipOpen2_64 ("", (int) append, IntPtr.Zero, ref funcDef);
+                       if (h.IsInvalid)
+                               throw new Exception ("Could not open the zip archive");
+                       return h;
+               }
+
+               public static int OpenFile32 (ZipHandle handle, string filename)
+               {
+                       return OpenFile32 (handle, filename, DEFAULT_COMPRESSION);
+               }
+
+               public static int OpenFile32 (ZipHandle handle, string filename, int compressionLevel)
+               {
+                       ZipFileInfo32 fileInfo = new ZipFileInfo32 (DateTime.Now);
+                       int method = compressionLevel == 0 ? 0 : Z_DEFLATED;
+                       return zipOpenNewFileInZip_32 (handle, filename, ref fileInfo, IntPtr.Zero, 0, IntPtr.Zero, 0, "", method, compressionLevel);
+               }
+
+               public static int OpenFile64 (ZipHandle handle, string filename)
                {
-                       return OpenFile (handle, filename, DEFAULT_COMPRESSION);
+                       return OpenFile64 (handle, filename, DEFAULT_COMPRESSION);
                }
 
-               public static int OpenFile (ZipHandle handle, string filename, int compressionLevel)
+               public static int OpenFile64 (ZipHandle handle, string filename, int compressionLevel)
                {
-                       ZipFileInfo fileInfo = new ZipFileInfo (DateTime.Now);
+                       ZipFileInfo64 fileInfo = new ZipFileInfo64 (DateTime.Now);
                        int method = compressionLevel == 0 ? 0 : Z_DEFLATED;
-                       return zipOpenNewFileInZip (handle, filename, ref fileInfo, IntPtr.Zero, 0, IntPtr.Zero, 0, "", method, compressionLevel);
+                       return zipOpenNewFileInZip_64 (handle, filename, ref fileInfo, IntPtr.Zero, 0, IntPtr.Zero, 0, "", method, compressionLevel);
                }
 
                public static unsafe void Write (ZipHandle handle, byte[] buffer, int offset, uint count)
@@ -65,26 +85,43 @@ namespace zipsharp
                [DllImport ("MonoPosixHelper")]
                static extern int zipCloseFileInZip (ZipHandle handle);
 
-               [DllImport ("MonoPosixHelper")]
-               static extern ZipHandle zipOpen2 (string pathname,
-                                                 int append,
-                                                 IntPtr globalcomment, // zipcharpc*
-                                                 ref ZlibFileFuncDef pzlib_filefunc_def); // zlib_filefunc_def*
+               [DllImport ("MonoPosixHelper", EntryPoint = "zipOpen2")]
+               static extern ZipHandle zipOpen2_32 (string pathname,
+                                                    int append,
+                                                    IntPtr globalcomment, // zipcharpc*
+                                                    ref ZlibFileFuncDef32 pzlib_filefunc_def); // zlib_filefunc_def*
+
+               [DllImport ("MonoPosixHelper", EntryPoint = "zipOpen2")]
+               static extern ZipHandle zipOpen2_64 (string pathname,
+                                                    int append,
+                                                    IntPtr globalcomment, // zipcharpc*
+                                                    ref ZlibFileFuncDef64 pzlib_filefunc_def); // zlib_filefunc_def*
 
-               
                [DllImport ("MonoPosixHelper")]
                static extern int zipClose (ZipHandle handle, string globalComment);
 
-               [DllImport ("MonoPosixHelper")]
-               static extern int zipOpenNewFileInZip (ZipHandle handle,
-                                                      string filename,
-                                                      ref ZipFileInfo zipfi,
-                                                      IntPtr extrafield_local,
-                                                      uint size_extrafield_local,
-                                                      IntPtr extrafield_global,
-                                                      uint size_extrafield_global,
-                                                      string comment,
-                                                      int method,
-                                                      int level);
+               [DllImport ("MonoPosixHelper", EntryPoint = "zipOpenNewFileInZip")]
+               static extern int zipOpenNewFileInZip_32 (ZipHandle handle,
+                                                         string filename,
+                                                         ref ZipFileInfo32 zipfi,
+                                                         IntPtr extrafield_local,
+                                                         uint size_extrafield_local,
+                                                         IntPtr extrafield_global,
+                                                         uint size_extrafield_global,
+                                                         string comment,
+                                                         int method,
+                                                         int level);
+
+               [DllImport ("MonoPosixHelper", EntryPoint = "zipOpenNewFileInZip")]
+               static extern int zipOpenNewFileInZip_64 (ZipHandle handle,
+                                                         string filename,
+                                                         ref ZipFileInfo64 zipfi,
+                                                         IntPtr extrafield_local,
+                                                         uint size_extrafield_local,
+                                                         IntPtr extrafield_global,
+                                                         uint size_extrafield_global,
+                                                         string comment,
+                                                         int method,
+                                                         int level);
        }
 }
index d3be55886bf8cb9ed2b646c8911db857cfb740a3..59a5935c1128bb07ad734a9d339ce6348763ff25 100644 (file)
@@ -38,7 +38,7 @@ namespace zipsharp
                string[] Files {
                        get {
                                if (files == null)
-                                       files = NativeUnzip.GetFiles (Handle);
+                                       files = NativeVersion.Use32Bit ? NativeUnzip.GetFiles32 (Handle) : NativeUnzip.GetFiles64 (Handle);
                                return files;
                        }
                }
@@ -66,7 +66,7 @@ namespace zipsharp
                public UnzipArchive (Stream stream, bool ownsStream)
                {
                        Stream = new ZipStream (stream, ownsStream);
-                       Handle = NativeUnzip.OpenArchive (Stream.IOFunctions);
+                       Handle = NativeVersion.Use32Bit ? NativeUnzip.OpenArchive32 (Stream.IOFunctions32) : NativeUnzip.OpenArchive64 (Stream.IOFunctions64);
                }
 
                public void Dispose ()
index 9316c0a1773d617a8c26b266ddec0dd51d764723..d69241d7fa50ef1dab26f4597b4a10b614a3672e 100644 (file)
@@ -10,103 +10,46 @@ using System.Runtime.InteropServices;
 namespace zipsharp
 {
        [StructLayout (LayoutKind.Sequential)]
-       struct UnzipFileInfo
+       struct UnzipFileInfo32
        {
-           IntPtr version;              /* version made by                 2 bytes */
-           IntPtr version_needed;       /* version needed to extract       2 bytes */
-           IntPtr flag;                 /* general purpose bit flag        2 bytes */
-           IntPtr compression_method;   /* compression method              2 bytes */
-           IntPtr dosDate;              /* last mod file date in Dos fmt   4 bytes */
-           IntPtr crc;                  /* crc-32                          4 bytes */
-           IntPtr compressed_size;      /* compressed size                 4 bytes */
-           IntPtr uncompressed_size;    /* uncompressed size               4 bytes */
-           IntPtr size_filename;        /* filename length                 2 bytes */
-           IntPtr size_file_extra;      /* extra field length              2 bytes */
-           IntPtr size_file_comment;    /* file comment length             2 bytes */
+               public uint version;              /* version made by                 2 bytes */
+               public uint version_needed;       /* version needed to extract       2 bytes */
+               public uint flag;                 /* general purpose bit flag        2 bytes */
+               public uint compression_method;   /* compression method              2 bytes */
+               public uint dosDate;              /* last mod file date in Dos fmt   4 bytes */
+               public uint crc;                  /* crc-32                          4 bytes */
+               public uint compressed_size;      /* compressed size                 4 bytes */
+               public uint uncompressed_size;    /* uncompressed size               4 bytes */
+               public uint size_filename;        /* filename length                 2 bytes */
+               public uint size_file_extra;      /* extra field length              2 bytes */
+               public uint size_file_comment;    /* file comment length             2 bytes */
        
-           IntPtr disk_num_start;       /* disk number start               2 bytes */
-           IntPtr internal_fa;          /* internal file attributes        2 bytes */
-           IntPtr external_fa;          /* external file attributes        4 bytes */
+               public uint disk_num_start;       /* disk number start               2 bytes */
+               public uint internal_fa;          /* internal file attributes        2 bytes */
+               public uint external_fa;          /* external file attributes        4 bytes */
        
            ZipTime tmu_date;
-           
-           public ulong VersionNeeded {
-               get { return (ulong)version_needed.ToInt64 (); }
-               set { version_needed = new IntPtr ((int)value); }
-           }
-           
-           public ulong Version {
-               get { return (ulong)version.ToInt64 (); }
-               set { version = new IntPtr ((int)value); }
-           }
-           
-           public ulong UncompressedSize {
-               get { return (ulong)uncompressed_size.ToInt64 (); }
-                       set { uncompressed_size = new IntPtr ((int)value); }
-           }
-           
-           public ZipTime TmuDate {
-               get { return tmu_date; }
-               set { tmu_date = value; }
-           }
-           
-           public ulong SizeFilename {
-               get { return (ulong)size_filename.ToInt64 (); }
-               set { size_filename = new IntPtr ((int)value); }
-           }
-           
-           public ulong SizeFileExtra {
-               get { return (ulong)size_file_extra.ToInt64 (); }
-               set { size_file_extra = new IntPtr ((int)value); }
-           }
-           
-           public ulong SizeFileComment {
-               get {
-                       return (ulong)size_file_comment.ToInt64 ();
-               }
-               set {
-                       size_file_comment = new IntPtr ((int)value);
-               }
-           }
-           
-           public ulong InternalFa {
-               get { return (ulong)internal_fa.ToInt64 (); }
-               set { internal_fa = new IntPtr ((int)value); }
-           }
-           
-           public ulong Flag {
-               get { return (ulong)flag.ToInt64 (); }
-               set { flag = new IntPtr ((int)value); }
-           }
-           
-           public ulong ExternalFa {
-               get { return (ulong)external_fa.ToInt64 (); }
-               set { external_fa = new IntPtr ((int)value); }
-           }
-           
-           public ulong DosDate {
-               get { return (ulong)dosDate.ToInt64 (); }
-               set { dosDate = new IntPtr ((int)value); }
-           }
-           
-           public ulong DiskNumStart {
-               get { return (ulong)disk_num_start.ToInt64 (); }
-               set { disk_num_start = new IntPtr ((int)value); }
-           }
-           
-           public ulong Crc {
-               get { return (ulong)crc.ToInt64 (); }
-               set { crc = new IntPtr ((int)value); }
-           }
-           
-           public ulong CompressionMethod {
-               get { return (ulong)compression_method.ToInt64 (); }
-               set { compression_method = new IntPtr ((int)value); }
-           }
-           
-           public ulong CompressedSize {
-               get { return (ulong)compressed_size.ToInt64 (); }
-               set { compressed_size = new IntPtr ((int)value); }
-           }
+       }
+
+       [StructLayout (LayoutKind.Sequential)]
+       struct UnzipFileInfo64
+       {
+               public ulong version;              /* version made by                 2 bytes */
+               public ulong version_needed;       /* version needed to extract       2 bytes */
+               public ulong flag;                 /* general purpose bit flag        2 bytes */
+               public ulong compression_method;   /* compression method              2 bytes */
+               public ulong dosDate;              /* last mod file date in Dos fmt   4 bytes */
+               public ulong crc;                  /* crc-32                          4 bytes */
+               public ulong compressed_size;      /* compressed size                 4 bytes */
+               public ulong uncompressed_size;    /* uncompressed size               4 bytes */
+               public ulong size_filename;        /* filename length                 2 bytes */
+               public ulong size_file_extra;      /* extra field length              2 bytes */
+               public ulong size_file_comment;    /* file comment length             2 bytes */
+
+               public ulong disk_num_start;       /* disk number start               2 bytes */
+               public ulong internal_fa;          /* internal file attributes        2 bytes */
+               public ulong external_fa;          /* external file attributes        4 bytes */
+
+               ZipTime tmu_date;
        }
 }
index 39c793e8e0b2146ab808b62350689aa6453e9377..71cc129006d23f0581d3aae3a3e0c933d1d6e325 100644 (file)
@@ -70,7 +70,7 @@ namespace zipsharp
                        Archive = archive;
                        Archive.FileActive = true;
                        CompressionLevel = compressionLevel;
-                       length = NativeUnzip.CurrentFileLength (Archive.Handle);
+                       length = NativeVersion.Use32Bit ? NativeUnzip.CurrentFileLength32 (Archive.Handle) : NativeUnzip.CurrentFileLength64 (Archive.Handle);
                }
 
                public override void Close()
index 8f60aab4e9eedc97a8f48be7ffadc1e8e50e56b4..598d163991c8821d2540e28ee9b65d9f4c2565a6 100644 (file)
@@ -31,7 +31,7 @@ namespace zipsharp
                public ZipArchive (Stream stream, Append append, bool ownsStream)
                {
                        Stream = new ZipStream (stream, ownsStream);
-                       Handle = NativeZip.OpenArchive (Stream.IOFunctions, append);
+                       Handle = NativeVersion.Use32Bit ? NativeZip.OpenArchive32 (Stream.IOFunctions32, append) : NativeZip.OpenArchive64 (Stream.IOFunctions64, append);
                }
 
                
@@ -61,8 +61,11 @@ namespace zipsharp
                {
                        if (FileActive)
                                throw new InvalidOperationException ("A file is already open");
-                       
-                       NativeZip.OpenFile (Handle, filename, ConvertCompression (option));
+
+                       if (NativeVersion.Use32Bit)
+                               NativeZip.OpenFile32 (Handle, filename, ConvertCompression (option));
+                       else
+                               NativeZip.OpenFile64 (Handle, filename, ConvertCompression (option));
                        return new ZipWriteStream (this);
                }
 
index 2a81a73959bba6ddcf3595874bb9651989261160..0c3f0eeb7f98fefaa786a2c47db873fe1392acd9 100644 (file)
@@ -10,40 +10,36 @@ using System.Runtime.InteropServices;
 namespace zipsharp
 {
        [StructLayoutAttribute (LayoutKind.Sequential)]
-       struct ZipFileInfo
+       struct ZipFileInfo32
        {
                ZipTime date;
-               IntPtr dosDate;
-               IntPtr internalFileAttributes;
-               IntPtr externalFileAttributes;
+               uint dosDate;
+               uint internalFileAttributes;
+               uint externalFileAttributes;
 
-               public DateTime FileTime
+               public ZipFileInfo32 (DateTime fileTime)
                {
-                       get { return date.Date; }
+                       date = new ZipTime (fileTime);
+                       dosDate = 0;
+                       internalFileAttributes = 0;
+                       externalFileAttributes = 0;
                }
+       }
 
-               public long DosDate
-               {
-                       get { return dosDate.ToInt64 (); }
-               }
-               
-               internal long InternalFileAttributes
-               {
-                       get { return internalFileAttributes.ToInt64 (); }
-               }
+       [StructLayoutAttribute (LayoutKind.Sequential)]
+       struct ZipFileInfo64
+       {
+               ZipTime date;
+               ulong dosDate;
+               ulong internalFileAttributes;
+               ulong externalFileAttributes;
 
-               internal long ExternalFileAttributes
-               {
-                       get { return externalFileAttributes.ToInt64 (); }
-               }
-               
-               public ZipFileInfo (DateTime fileTime)
+               public ZipFileInfo64 (DateTime fileTime)
                {
                        date = new ZipTime (fileTime);
-                       dosDate = IntPtr.Zero;
-                       internalFileAttributes = IntPtr.Zero;
-                       externalFileAttributes = IntPtr.Zero;
+                       dosDate = 0;
+                       internalFileAttributes = 0;
+                       externalFileAttributes = 0;
                }
-
        }
 }
index 51d15c56c12dfa67691c08f2019edcedbd9c4851..f0007dfb8a244c059a0f511be0fb900b6fdda0cf 100644 (file)
@@ -40,7 +40,11 @@ namespace zipsharp
                        get; set;
                }
 
-               public ZlibFileFuncDef IOFunctions {
+               public ZlibFileFuncDef32 IOFunctions32 {
+                       get; set;
+               }
+
+               public ZlibFileFuncDef64 IOFunctions64 {
                        get; set;
                }
 
@@ -67,18 +71,27 @@ namespace zipsharp
                        DataStream = dataStream;
                        OwnsStream = ownsStream;
                        
-                       ZlibFileFuncDef f = new ZlibFileFuncDef();
-                       
-                       f.opaque = IntPtr.Zero;
-                       f.zclose_file = CloseFile_Native;
-                       f.zerror_file = TestError_Native;
-                       f.zopen_file = OpenFile_Native;
-                       f.zread_file = ReadFile_Native;
-                       f.zseek_file = SeekFile_Native;
-                       f.ztell_file = TellFile_Native;
-                       f.zwrite_file = WriteFile_Native;
-
-                       IOFunctions = f;
+                       ZlibFileFuncDef32 f32 = new ZlibFileFuncDef32 ();
+                       f32.opaque = IntPtr.Zero;
+                       f32.zclose_file = CloseFile_Native;
+                       f32.zerror_file = TestError_Native;
+                       f32.zopen_file = OpenFile_Native;
+                       f32.zread_file = ReadFile_Native32;
+                       f32.zseek_file = SeekFile_Native32;
+                       f32.ztell_file = TellFile_Native32;
+                       f32.zwrite_file = WriteFile_Native32;
+                       IOFunctions32 = f32;
+
+                       ZlibFileFuncDef64 f64 = new ZlibFileFuncDef64 ();
+                       f64.opaque = IntPtr.Zero;
+                       f64.zclose_file = CloseFile_Native;
+                       f64.zerror_file = TestError_Native;
+                       f64.zopen_file = OpenFile_Native;
+                       f64.zread_file = ReadFile_Native64;
+                       f64.zseek_file = SeekFile_Native64;
+                       f64.ztell_file = TellFile_Native64;
+                       f64.zwrite_file = WriteFile_Native64;
+                       IOFunctions64 = f64;
                }
 
                protected override void Dispose(bool disposing)
@@ -130,9 +143,14 @@ namespace zipsharp
                        return new IntPtr (1);
                }
 
-               unsafe IntPtr ReadFile_Native (IntPtr opaque, IntPtr stream, IntPtr buffer, IntPtr size)
+               unsafe uint ReadFile_Native32 (IntPtr opaque, IntPtr stream, IntPtr buffer, uint size)
                {
-                       int count = size.ToInt32 ();
+                       return (uint) ReadFile_Native64 (opaque, stream, buffer, size);
+               }
+
+               unsafe ulong ReadFile_Native64 (IntPtr opaque, IntPtr stream, IntPtr buffer, ulong size)
+               {
+                       int count = (int) size;
                        byte[] b = new byte[count];
                        int read;
                        
@@ -145,10 +163,15 @@ namespace zipsharp
                                read = -1;
                        }
 
-                       return new IntPtr (read);
+                       return (ulong) read;
                }
 
-               IntPtr SeekFile_Native (IntPtr opaque, IntPtr stream, IntPtr offset, int origin)
+               int SeekFile_Native32 (IntPtr opaque, IntPtr stream, uint offset, int origin)
+               {
+                       return (int) SeekFile_Native64 (opaque, stream, offset, origin);
+               }
+
+               long SeekFile_Native64 (IntPtr opaque, IntPtr stream, ulong offset, int origin)
                {
                        SeekOrigin seek;
                        if (origin == ZipStream.ZLIB_FILEFUNC_SEEK_CUR)
@@ -158,21 +181,21 @@ namespace zipsharp
                        else if (origin == ZLIB_FILEFUNC_SEEK_SET)
                                seek = SeekOrigin.Begin;
                        else
-                               return new IntPtr (-1);
+                               return -1;
 
-                       Seek (offset.ToInt64 (), seek);
+                       Seek ((long) offset, seek);
                        
-                       return new IntPtr (0);
+                       return 0;
                }
 
-               IntPtr TellFile_Native (IntPtr opaque, IntPtr stream)
+               int TellFile_Native32 (IntPtr opaque, IntPtr stream)
                {
-                       if (IntPtr.Size == 4)
-                               return new IntPtr ((int)Position);
-                       else if (IntPtr.Size == 8)
-                               return new IntPtr (Position);
-                       else
-                               return new IntPtr (-1);
+                       return (int) TellFile_Native64 (opaque, stream);
+               }
+
+               long TellFile_Native64 (IntPtr opaque, IntPtr stream)
+               {
+                       return Position;
                }
 
                int TestError_Native (IntPtr opaque, IntPtr stream)
@@ -181,9 +204,14 @@ namespace zipsharp
                        return 0;
                }
 
-               unsafe IntPtr WriteFile_Native (IntPtr opaque, IntPtr stream, IntPtr buffer, /* ulong */ IntPtr size)
+               unsafe uint WriteFile_Native32 (IntPtr opaque, IntPtr stream, IntPtr buffer, /* ulong */ uint size)
+               {
+                       return (uint) WriteFile_Native64 (opaque, stream, buffer, size);
+               }
+
+               unsafe ulong WriteFile_Native64 (IntPtr opaque, IntPtr stream, IntPtr buffer, /* ulong */ ulong size)
                {
-                       int count = size.ToInt32 ();
+                       int count = (int) size;
                        byte[] b = new byte[count];
 
                        byte* ptrBuffer = (byte*) buffer.ToPointer ();
@@ -196,7 +224,7 @@ namespace zipsharp
                                
                        }
 
-                       return new IntPtr (count);
+                       return (ulong) count;
                }
        }
 }
index fca1c3d1d9c09cfb2b76a2fac8804126d102934a..611e4c7035cc49ff71830dfce29f6a8eabeb4c0f 100644 (file)
@@ -97,4 +97,18 @@ CloseZStream
 ReadZStream\r
 WriteZStream\r
 Flush\r
-\r
+zipWriteInFileInZip\r
+zipCloseFileInZip\r
+zipOpen2\r
+zipClose\r
+zipOpenNewFileInZip\r
+unzOpen2\r
+unzCloseCurrentFile\r
+unztell\r
+unzGoToFirstFile\r
+unzGoToNextFile\r
+unzLocateFile\r
+unzOpenCurrentFile2\r
+unzGetCurrentFileInfo\r
+unzReadCurrentFile\r
+unzClose\r
index 83304969ab20ec2f93929d747146fd03db64a965..de0276892fa51410ace9318b026d559401d2cdc4 100644 (file)
@@ -87,7 +87,6 @@
   <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">\r
     <ClCompile>\r
       <Optimization>Disabled</Optimization>\r
-      <AdditionalIncludeDirectories>$(MONO_DIR);$(MONO_EGLIB_SOURCE_DIR);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
       <PreprocessorDefinitions>_DEBUG;__i386__;TARGET_X86;_WIN32_WINNT=0x0600;WIN32;_WIN32;__WIN32__;_WINDOWS;WINDOWS;HOST_WIN32;TARGET_WIN32;_CRT_SECURE_NO_DEPRECATE;HAVE_CONFIG_H;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
       <MinimalRebuild>true</MinimalRebuild>\r
       <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>\r
@@ -96,6 +95,7 @@
       <WarningLevel>Level3</WarningLevel>\r
       <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>\r
       <CompileAs>CompileAsC</CompileAs>\r
+      <AdditionalIncludeDirectories>$(MONO_DIR);$(MONO_EGLIB_SOURCE_DIR);$(MONO_DIR)/support;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
     </ClCompile>\r
     <Link>\r
       <AdditionalDependencies>eglib.lib;%(AdditionalDependencies)</AdditionalDependencies>\r
     </Midl>\r
     <ClCompile>\r
       <Optimization>Disabled</Optimization>\r
-      <AdditionalIncludeDirectories>$(MONO_DIR);$(MONO_EGLIB_SOURCE_DIR);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
       <PreprocessorDefinitions>_DEBUG;__x86_64__;_WIN32_WINNT=0x0600;WIN64;_WIN64;WIN32;_WIN32;__WIN32__;_WINDOWS;WINDOWS;HOST_WIN32;TARGET_WIN32;_CRT_SECURE_NO_DEPRECATE;HAVE_CONFIG_H;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
       <MinimalRebuild>true</MinimalRebuild>\r
       <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>\r
       <WarningLevel>Level3</WarningLevel>\r
       <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>\r
       <CompileAs>CompileAsC</CompileAs>\r
+      <AdditionalIncludeDirectories>$(MONO_DIR);$(MONO_EGLIB_SOURCE_DIR);$(MONO_DIR)/support;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
     </ClCompile>\r
     <Link>\r
       <OutputFile>$(OutDir)$(TargetName)$(TargetExt)</OutputFile>\r
   <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">\r
     <ClCompile>\r
       <Optimization>MinSpace</Optimization>\r
-      <AdditionalIncludeDirectories>$(MONO_DIR);$(MONO_EGLIB_SOURCE_DIR);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
       <PreprocessorDefinitions>NDEBUG;__i386__;TARGET_X86;i386;_WIN32_WINNT=0x0600;WIN32;_WIN32;__WIN32__;_WINDOWS;WINDOWS;HOST_WIN32;TARGET_WIN32;_CRT_SECURE_NO_DEPRECATE;HAVE_CONFIG_H;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
       <PrecompiledHeader>\r
       </PrecompiledHeader>\r
       <WarningLevel>Level3</WarningLevel>\r
       <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>\r
       <CompileAs>CompileAsC</CompileAs>\r
+      <AdditionalIncludeDirectories>$(MONO_DIR);$(MONO_EGLIB_SOURCE_DIR);$(MONO_DIR)/support;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
     </ClCompile>\r
     <Link>\r
       <AdditionalDependencies>eglib.lib;%(AdditionalDependencies)</AdditionalDependencies>\r
     </Midl>\r
     <ClCompile>\r
       <Optimization>MinSpace</Optimization>\r
-      <AdditionalIncludeDirectories>$(MONO_DIR);$(MONO_EGLIB_SOURCE_DIR);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
       <PreprocessorDefinitions>NDEBUG;__x86_64__;_WIN32_WINNT=0x0600;WIN64;_WIN64;WIN32;_WIN32;__WIN32__;_WINDOWS;WINDOWS;HOST_WIN32;TARGET_WIN32;_CRT_SECURE_NO_DEPRECATE;HAVE_CONFIG_H;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
       <PrecompiledHeader>\r
       </PrecompiledHeader>\r
       <WarningLevel>Level3</WarningLevel>\r
       <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>\r
       <CompileAs>CompileAsC</CompileAs>\r
+      <AdditionalIncludeDirectories>$(MONO_DIR);$(MONO_EGLIB_SOURCE_DIR);$(MONO_DIR)/support;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
     </ClCompile>\r
     <Link>\r
       <OutputFile>$(OutDir)$(TargetName)$(TargetExt)</OutputFile>\r
     <ClCompile Include="..\support\inflate.c" />\r
     <ClCompile Include="..\support\inftrees.c" />\r
     <ClCompile Include="..\support\map.c" />\r
+    <ClCompile Include="..\support\minizip\ioapi.c" />\r
+    <ClCompile Include="..\support\minizip\iowin32.c" />\r
+    <ClCompile Include="..\support\minizip\minizip.c" />\r
+    <ClCompile Include="..\support\minizip\unzip.c" />\r
+    <ClCompile Include="..\support\minizip\zip.c" />\r
     <ClCompile Include="..\support\signal.c" />\r
     <ClCompile Include="..\support\stdio.c" />\r
     <ClCompile Include="..\support\stdlib.c" />\r
     <ClInclude Include="..\support\inflate.h" />\r
     <ClInclude Include="..\support\inftrees.h" />\r
     <ClInclude Include="..\support\map.h" />\r
+    <ClInclude Include="..\support\minizip\crypt.h" />\r
+    <ClInclude Include="..\support\minizip\ioapi.h" />\r
+    <ClInclude Include="..\support\minizip\iowin32.h" />\r
+    <ClInclude Include="..\support\minizip\unzip.h" />\r
+    <ClInclude Include="..\support\minizip\zip.h" />\r
     <ClInclude Include="..\support\mph.h" />\r
     <ClInclude Include="..\support\trees.h" />\r
     <ClInclude Include="..\support\zconf.h" />\r
+    <ClInclude Include="..\support\zlib.h" />\r
     <ClInclude Include="..\support\zutil.h" />\r
   </ItemGroup>\r
   <ItemGroup>\r
index 9df33f5e0d4580e92a5ec3325a5827f1df5a95d1..1cd4d6b86659f977351c9e9a6ab4f309af855c4f 100644 (file)
     <ClCompile Include="..\support\zutil.c">\r
       <Filter>Source Files</Filter>\r
     </ClCompile>\r
+    <ClCompile Include="..\support\minizip\iowin32.c">\r
+      <Filter>Source Files</Filter>\r
+    </ClCompile>\r
+    <ClCompile Include="..\support\minizip\minizip.c">\r
+      <Filter>Source Files</Filter>\r
+    </ClCompile>\r
+    <ClCompile Include="..\support\minizip\unzip.c">\r
+      <Filter>Source Files</Filter>\r
+    </ClCompile>\r
+    <ClCompile Include="..\support\minizip\zip.c">\r
+      <Filter>Source Files</Filter>\r
+    </ClCompile>\r
+    <ClCompile Include="..\support\minizip\ioapi.c">\r
+      <Filter>Source Files</Filter>\r
+    </ClCompile>\r
   </ItemGroup>\r
   <ItemGroup>\r
     <ClInclude Include="..\support\crc32.h">\r
     <ClInclude Include="..\support\zutil.h">\r
       <Filter>Header Files</Filter>\r
     </ClInclude>\r
+    <ClInclude Include="..\support\minizip\crypt.h">\r
+      <Filter>Header Files</Filter>\r
+    </ClInclude>\r
+    <ClInclude Include="..\support\minizip\unzip.h">\r
+      <Filter>Header Files</Filter>\r
+    </ClInclude>\r
+    <ClInclude Include="..\support\minizip\iowin32.h">\r
+      <Filter>Header Files</Filter>\r
+    </ClInclude>\r
+    <ClInclude Include="..\support\minizip\zip.h">\r
+      <Filter>Header Files</Filter>\r
+    </ClInclude>\r
+    <ClInclude Include="..\support\zlib.h">\r
+      <Filter>Header Files</Filter>\r
+    </ClInclude>\r
+    <ClInclude Include="..\support\minizip\ioapi.h">\r
+      <Filter>Header Files</Filter>\r
+    </ClInclude>\r
   </ItemGroup>\r
   <ItemGroup>\r
     <Filter Include="Header Files">\r