Esempio n. 1
0
        /// <summary>
        /// Creates an mfupdate object.
        /// </summary>
        /// <param name="provider">The name of the update provider that will service this update.</param>
        /// <param name="updateID">The unique identification number of the update.</param>
        /// <param name="version">The version of the update.</param>
        /// <param name="updateType">The update type.</param>
        /// <param name="updateSubType">The update subtype.</param>
        /// <param name="updateSize">The total update size (in bytes).</param>
        /// <param name="pktSize">The size (in bytes) of each packet.</param>
        public MFUpdate(string provider, uint updateID, Version version, MFUpdateType updateType, MFUpdateSubType updateSubType, int updateSize, int pktSize)
        {
            m_maxPkt    = (updateSize + pktSize - 1) / pktSize;
            m_pktBitChk = new uint[(m_maxPkt + 31) >> 5];

            for (int i = 0; i < m_pktBitChk.Length; i++)
            {
                m_pktBitChk[i] = 0xFFFFFFFF;
            }

            m_provider      = provider;
            m_updateID      = updateID;
            m_updateType    = updateType;
            m_updateSubType = updateSubType;
            m_updateVersion = version;
            m_updateSize    = updateSize;
            m_packetSize    = pktSize;
            m_authenticated = false;

            m_updateHandle = MFNativeUpdate.Initialize(this);

            if (m_updateHandle == -1)
            {
                throw new Exception();
            }
        }
 /// <summary>
 /// Creates an assembly update package.
 /// </summary>
 /// <param name="provider">The update provider name that will process this update.</param>
 /// <param name="updateID">The unique update identification number.</param>
 /// <param name="version">The assembly update version.</param>
 /// <param name="assemblyType">The assembly update subtype.</param>
 /// <param name="updateSize">The size (in bytes) of the entire update.</param>
 /// <param name="pktSize">The size (in bytes) of each packet.</param>
 public MFAssemblyUpdate(
     string provider,
     uint updateID,
     Version version,
     MFUpdateSubType assemblyType,
     int updateSize,
     int pktSize
     )
     : base(provider, updateID, version, MFUpdateType.AssemblyUpdate, assemblyType, updateSize, pktSize)
 {
 }
Esempio n. 3
0
 /// <summary>
 /// Creates an assembly update package.
 /// </summary>
 /// <param name="provider">The update provider name that will process this update.</param>
 /// <param name="updateID">The unique update identification number.</param>
 /// <param name="version">The assembly update version.</param>
 /// <param name="assemblyType">The assembly update subtype.</param>
 /// <param name="updateSize">The size (in bytes) of the entire update.</param>
 /// <param name="pktSize">The size (in bytes) of each packet.</param>
 public MFAssemblyUpdate(
     string provider,
     uint updateID,
     Version version,
     MFUpdateSubType assemblyType,
     int updateSize,
     int pktSize
     )
     : base(provider, updateID, version, MFUpdateType.AssemblyUpdate, assemblyType, updateSize, pktSize)
 {
 }
Esempio n. 4
0
 /// <summary>
 /// Creates a firmware update package.
 /// </summary>
 /// <param name="provider">The update package provider name.</param>
 /// <param name="updateID">The unique identification number for the update.</param>
 /// <param name="version">The version of the update.</param>
 /// <param name="firmwareType">The firmware subtype for the udpate.</param>
 /// <param name="updateSize">The amount of space (in bytes) to store the update.</param>
 /// <param name="pktSize">The size (in bytes) of each packet.</param>
 public MFFirmwareUpdate(
     string provider,
     uint updateID,
     Version version,
     MFUpdateSubType firmwareType,
     int updateSize,
     int pktSize
     )
     : base(provider, updateID, version, MFUpdateType.FirmwareUpdate, firmwareType, updateSize, pktSize)
 {
 }
Esempio n. 5
0
 /// <summary>
 /// Creates a device key update package.
 /// </summary>
 /// <param name="provider">The update provider name that will handle this update.</param>
 /// <param name="updateID">The unique identification number for this update.</param>
 /// <param name="version">The version of the update.</param>
 /// <param name="keyType">The key subtype for the update.</param>
 /// <param name="keySize">The key size (in bytes).</param>
 /// <param name="wrappedKey">The wrapped key data (handle, name, etc.) used to unwrap the update.</param>
 public MFKeyUpdate(
     string provider,
     uint updateID,
     Version version,
     MFUpdateSubType keyType,
     int keySize,
     byte[] wrappedKey
     )
     : base(provider, updateID, version, MFUpdateType.KeyUpdate, keyType, keySize, keySize)
 {
     base.AddPacket(new MFUpdatePkt(0, wrappedKey, null));
 }
Esempio n. 6
0
 /// <summary>
 /// Creates a device key update package.
 /// </summary>
 /// <param name="provider">The update provider name that will handle this update.</param>
 /// <param name="updateID">The unique identification number for this update.</param>
 /// <param name="version">The version of the update.</param>
 /// <param name="keyType">The key subtype for the update.</param>
 /// <param name="keySize">The key size (in bytes).</param>
 /// <param name="wrappedKey">The wrapped key data (handle, name, etc.) used to unwrap the update.</param>
 public MFKeyUpdate(
     string provider,
     uint updateID,
     Version version,
     MFUpdateSubType keyType,
     int keySize,
     byte[] wrappedKey
     )
     : base(provider, updateID, version, MFUpdateType.KeyUpdate, keyType, keySize, keySize)
 {
     base.AddPacket(new MFUpdatePkt(0, wrappedKey, null));
 }
Esempio n. 7
0
        /// <summary>
        /// Creates an mfupdate object.
        /// </summary>
        /// <param name="provider">The name of the update provider that will service this update.</param>
        /// <param name="updateID">The unique identification number of the update.</param>
        /// <param name="version">The version of the update.</param>
        /// <param name="updateType">The update type.</param>
        /// <param name="updateSubType">The update subtype.</param>
        /// <param name="updateSize">The total update size (in bytes).</param>
        /// <param name="pktSize">The size (in bytes) of each packet.</param>
        public MFUpdate(string provider, uint updateID, Version version, MFUpdateType updateType, MFUpdateSubType updateSubType, int updateSize, int pktSize)
        {
            m_maxPkt = (updateSize + pktSize - 1) / pktSize;
            m_pktBitChk = new uint[(m_maxPkt + 31) >> 5];

            for (int i = 0; i < m_pktBitChk.Length; i++)
            {
                m_pktBitChk[i] = 0xFFFFFFFF;
            }

            m_provider      = provider;
            m_updateID      = updateID;
            m_updateType    = updateType;
            m_updateSubType = updateSubType;
            m_updateVersion = version;
            m_updateSize    = updateSize;
            m_packetSize    = pktSize;
            m_authenticated = false;

            m_updateHandle = MFNativeUpdate.Initialize(this);

            if (m_updateHandle == -1) throw new Exception();
        }
 /// <summary>
 /// Creates a firmware update package.
 /// </summary>
 /// <param name="provider">The update package provider name.</param>
 /// <param name="updateID">The unique identification number for the update.</param>
 /// <param name="version">The version of the update.</param>
 /// <param name="firmwareType">The firmware subtype for the udpate.</param>
 /// <param name="updateSize">The amount of space (in bytes) to store the update.</param>
 /// <param name="pktSize">The size (in bytes) of each packet.</param>
 public MFFirmwareUpdate(
     string provider,
     uint updateID,
     Version version,
     MFUpdateSubType firmwareType,
     int updateSize,
     int pktSize
     )
     : base(provider, updateID, version, MFUpdateType.FirmwareUpdate, firmwareType, updateSize, pktSize)
 {
 }