public StoreOperationSetDeploymentMetadata(IDefinitionAppId Deployment, StoreApplicationReference Reference, StoreOperationMetadataProperty[] SetProperties, StoreOperationMetadataProperty[] TestProperties)
 {
     this.Size = (uint) Marshal.SizeOf(typeof(StoreOperationSetDeploymentMetadata));
     this.Flags = OpFlags.Nothing;
     this.Deployment = Deployment;
     if (SetProperties != null)
     {
         this.PropertiesToSet = MarshalProperties(SetProperties);
         this.cPropertiesToSet = new IntPtr(SetProperties.Length);
     }
     else
     {
         this.PropertiesToSet = IntPtr.Zero;
         this.cPropertiesToSet = IntPtr.Zero;
     }
     if (TestProperties != null)
     {
         this.PropertiesToTest = MarshalProperties(TestProperties);
         this.cPropertiesToTest = new IntPtr(TestProperties.Length);
     }
     else
     {
         this.PropertiesToTest = IntPtr.Zero;
         this.cPropertiesToTest = IntPtr.Zero;
     }
     this.InstallerReference = Reference.ToIntPtr();
 }
 public bool MoveNext()
 {
     StoreOperationMetadataProperty[] appIds = new StoreOperationMetadataProperty[1];
     uint num = this._enum.Next(1, appIds);
     if (num == 1)
     {
         this._current = appIds[0];
     }
     return (this._fValid = num == 1);
 }
Esempio n. 3
0
        public bool MoveNext()
        {
            StoreOperationMetadataProperty[] AppIds = new StoreOperationMetadataProperty[1];
            uint num = this._enum.Next(1U, AppIds);

            if ((int)num == 1)
            {
                this._current = AppIds[0];
            }
            return(this._fValid = (int)num == 1);
        }
Esempio n. 4
0
        public bool MoveNext()
        {
            StoreOperationMetadataProperty[] array = new StoreOperationMetadataProperty[1];
            uint num = this._enum.Next(1U, array);

            if (num == 1U)
            {
                this._current = array[0];
            }
            return(this._fValid = (num == 1U));
        }
Esempio n. 5
0
        private void CommitApplicationTrust(ApplicationIdentity applicationIdentity, string trustXml) { 
            StoreOperationMetadataProperty[] properties = new StoreOperationMetadataProperty[] {
                    new StoreOperationMetadataProperty(ClrPropertySet, ApplicationTrustProperty, trustXml) 
                }; 

            IEnumDefinitionIdentity idenum = applicationIdentity.Identity.EnumAppPath(); 
            IDefinitionIdentity[] asbId = new IDefinitionIdentity[1];
            IDefinitionIdentity deplId = null;
            if (idenum.Next(1, asbId) == 1)
                deplId = asbId[0]; 

            IDefinitionAppId defAppId = IsolationInterop.AppIdAuthority.CreateDefinition(); 
            defAppId.SetAppPath(1, new IDefinitionIdentity[] {deplId}); 
            defAppId.put_Codebase(applicationIdentity.CodeBase);
 
            using (StoreTransaction storeTxn = new StoreTransaction()) {
                storeTxn.Add(new StoreOperationSetDeploymentMetadata(defAppId, InstallReference, properties));
                RefreshStorePointer();
                m_pStore.Transact(storeTxn.Operations); 
            }
 
            m_appTrusts = null; // reset the app trusts in the collection. 
        }
 public bool MoveNext()
 {
     StoreOperationMetadataProperty[] next = new StoreOperationMetadataProperty[1];
     UInt32 fetched;
     fetched=_enum.Next(1, next);
     if (fetched == 1)
         _current = next[0];
     return (_fValid = (fetched == 1));
 }
        [System.Security.SecurityCritical]  // auto-generated
        private static IntPtr MarshalProperties(StoreOperationMetadataProperty[] Props)
        {
            if ((Props == null) || (Props.Length == 0))
                return IntPtr.Zero;

            int iSlotSize = Marshal.SizeOf(typeof(StoreOperationMetadataProperty));
            IntPtr retval = Marshal.AllocCoTaskMem(iSlotSize * Props.Length);

            for (int i = 0; i != Props.Length; i++)
            {
                Marshal.StructureToPtr(
                    Props[i],
                    new IntPtr((i * iSlotSize) + retval.ToInt64()),
                    false);
            }

            return retval;
        }
 public StoreOperationSetDeploymentMetadata(IDefinitionAppId Deployment, StoreApplicationReference Reference, StoreOperationMetadataProperty[] SetProperties)
     : this(Deployment, Reference, SetProperties, null)
 {
 }
 private static IntPtr MarshalProperties(StoreOperationMetadataProperty[] Props)
 {
     if ((Props == null) || (Props.Length == 0))
     {
         return IntPtr.Zero;
     }
     int num = Marshal.SizeOf(typeof(StoreOperationMetadataProperty));
     IntPtr ptr = Marshal.AllocCoTaskMem(num * Props.Length);
     for (int i = 0; i != Props.Length; i++)
     {
         Marshal.StructureToPtr(Props[i], new IntPtr((i * num) + ptr.ToInt64()), false);
     }
     return ptr;
 }
Esempio n. 10
0
 public StoreOperationMetadataProperty(Guid PropertySet, string Name)
 {
     this = new StoreOperationMetadataProperty(PropertySet, Name, (string)null);
 }
 private void CommitApplicationTrust(ApplicationIdentity applicationIdentity, string trustXml)
 {
     StoreOperationMetadataProperty[] setProperties = new StoreOperationMetadataProperty[] { new StoreOperationMetadataProperty(ClrPropertySet, "ApplicationTrust", trustXml) };
     IEnumDefinitionIdentity identity = applicationIdentity.Identity.EnumAppPath();
     IDefinitionIdentity[] definitionIdentity = new IDefinitionIdentity[1];
     IDefinitionIdentity identity2 = null;
     if (identity.Next(1, definitionIdentity) == 1)
     {
         identity2 = definitionIdentity[0];
     }
     IDefinitionAppId deployment = IsolationInterop.AppIdAuthority.CreateDefinition();
     deployment.SetAppPath(1, new IDefinitionIdentity[] { identity2 });
     deployment.put_Codebase(applicationIdentity.CodeBase);
     using (StoreTransaction transaction = new StoreTransaction())
     {
         transaction.Add(new StoreOperationSetDeploymentMetadata(deployment, InstallReference, setProperties));
         this.RefreshStorePointer();
         this.m_pStore.Transact(transaction.Operations);
     }
     this.m_appTrusts = null;
 }
 private void PrepareSetDeploymentProperties(StoreTransactionContext storeTxn, System.Deployment.Application.DefinitionAppId appId, CommitApplicationParams commitParams)
 {
     string str = null;
     string str2 = null;
     string str3 = null;
     if (commitParams != null)
     {
         str = ToPropertyString(commitParams.DeploySourceUri);
         str2 = ToPropertyString(commitParams.AppSourceUri);
         if ((commitParams.IsUpdateInPKTGroup && (commitParams.Trust == null)) && commitParams.IsFullTrustRequested)
         {
             str3 = ToPropertyString(commitParams.IsFullTrustRequested);
         }
         else if (commitParams.IsUpdate && (commitParams.Trust == null))
         {
             str3 = null;
         }
         else if (commitParams.appType == AppType.CustomHostSpecified)
         {
             str3 = null;
         }
         else
         {
             str3 = ToPropertyString(commitParams.Trust.DefaultGrantSet.PermissionSet.IsUnrestricted());
         }
     }
     System.Deployment.Internal.Isolation.StoreOperationMetadataProperty[] setProperties = new System.Deployment.Internal.Isolation.StoreOperationMetadataProperty[] { new System.Deployment.Internal.Isolation.StoreOperationMetadataProperty(Constants.DeploymentPropertySet, "DeploymentSourceUri", str), new System.Deployment.Internal.Isolation.StoreOperationMetadataProperty(Constants.DeploymentPropertySet, "ApplicationSourceUri", str2), new System.Deployment.Internal.Isolation.StoreOperationMetadataProperty(Constants.DeploymentPropertySet, "IsFullTrust", str3) };
     storeTxn.Add(new System.Deployment.Internal.Isolation.StoreOperationSetDeploymentMetadata(appId.ComPointer, this.InstallReference, setProperties));
 }