Beispiel #1
0
        /// <summary>
        /// Receives decryption callback requests from the File Decompression Interface (FDI)
        /// </summary>
        /// <param name="fdid">A <see cref="FdiDecrypt"/> structure containing decrypt information.</param>
        /// <returns>Returns -1 on error.  Any other value indicates success.</returns>
        /// <remarks>The File Decompression Interface (FDI) calls this function during decompression so that
        /// clients can decrypt encrypted data.  There are three notification types:  Decrypt, NewCabinet, and NewFolder.
        /// Clients that wish to receive these notifications must handle the <see cref="DecryptDataBlock"/>, <see cref="DecryptNewCabinet"/>,
        /// and <see cref="DecryptNewFolder"/> events.</remarks>
        protected virtual int DecryptCallback(ref FdiDecrypt fdid)
        {
            Trace.WriteLine("DecryptCallback");
            FdiDecryptEventArgs e = new FdiDecryptEventArgs(fdid);

            // fire the proper event
            switch (fdid.DecryptType)
            {
                case FdiDecryptType.Decrypt:
                    OnDecryptDataBlock(e);
                    break;
                case FdiDecryptType.NewCabinet:
                    OnDecryptNewCabinet(e);
                    break;
                case FdiDecryptType.NewFolder:
                    OnDecryptNewFolder(e);
                    break;
            }
            return 0;
        }
Beispiel #2
0
 /// <summary>
 /// Initializes a new instance of the FdiDecryptEventArgs class.
 /// </summary>
 /// <param name="f">An FdiDecrypt structure that contains information about the decryption operation.</param>
 public FdiDecryptEventArgs(FdiDecrypt f)
 {
     fdid = f;
     result = 0;
 }