Ejemplo n.º 1
0
        public bool IsCabinetFile(out CabinetInfo cabinfo)
        {
            if (_disposed)
            {
                throw new ObjectDisposedException("CabExtract");
            }

            MemoryStream stream = new MemoryStream(_inputData);
            GCHandle     gch    = GCHandle.Alloc(stream);

            try
            {
                CabinetInfo info = new CabinetInfo();
                bool        ret  = FdiIsCabinet(FdiContext, (IntPtr)gch, info);
                cabinfo = info;
                return(ret);
            } finally
            {
                stream.Close();
                gch.Free();
            }
        }
Ejemplo n.º 2
0
 public static bool IsCabinetFile(byte[] inputData, out CabinetInfo cabinfo)
 {
     using (CabExtract decomp = new CabExtract(inputData))
         return(decomp.IsCabinetFile(out cabinfo));
 }
Ejemplo n.º 3
0
 private static extern bool FdiIsCabinet(
     IntPtr hfdi,
     IntPtr hf,
     [MarshalAs(UnmanagedType.LPStruct)] CabinetInfo cabInfo);