private void CommitApplicationTrust(ApplicationIdentity applicationIdentity, string trustXml)
        {
            StoreOperationMetadataProperty[] SetProperties = new StoreOperationMetadataProperty[1] {
                new StoreOperationMetadataProperty(ApplicationTrustCollection.ClrPropertySet, "ApplicationTrust", trustXml)
            };
            IEnumDefinitionIdentity definitionIdentity1 = applicationIdentity.Identity.EnumAppPath();

            IDefinitionIdentity[] definitionIdentityArray = new IDefinitionIdentity[1];
            IDefinitionIdentity   definitionIdentity2     = (IDefinitionIdentity)null;
            int num = 1;

            IDefinitionIdentity[] DefinitionIdentity = definitionIdentityArray;
            if ((int)definitionIdentity1.Next((uint)num, DefinitionIdentity) == 1)
            {
                definitionIdentity2 = definitionIdentityArray[0];
            }
            IDefinitionAppId definition = IsolationInterop.AppIdAuthority.CreateDefinition();

            definition.SetAppPath(1U, new IDefinitionIdentity[1]
            {
                definitionIdentity2
            });
            definition.put_Codebase(applicationIdentity.CodeBase);
            using (StoreTransaction storeTransaction = new StoreTransaction())
            {
                storeTransaction.Add(new StoreOperationSetDeploymentMetadata(definition, ApplicationTrustCollection.InstallReference, SetProperties));
                this.RefreshStorePointer();
                this.m_pStore.Transact(storeTransaction.Operations);
            }
            this.m_appTrusts = (object)null;
        }
Beispiel #2
0
        public IDefinitionIdentity GetAssemblyIdentity(uint Flags, IDefinitionIdentity DefinitionIdentity)
        {
            Guid   iid_IDefinitionIdentity = IsolationInterop.IID_IDefinitionIdentity;
            object assemblyInformation     = this._pStore.GetAssemblyInformation(Flags, DefinitionIdentity, ref iid_IDefinitionIdentity);

            return((IDefinitionIdentity)assemblyInformation);
        }
Beispiel #3
0
        internal ICMS GetComponentManifest(IDefinitionIdentity component)
        {
            object ManifestInteface;

            this._actContext.GetComponentManifest(0U, component, ref IsolationInterop.IID_ICMS, out ManifestInteface);
            return(ManifestInteface as ICMS);
        }
Beispiel #4
0
        public Store.IPathLock LockAssemblyPath(IDefinitionIdentity asm)
        {
            IntPtr c;
            string path = this._pStore.LockAssemblyPath(0U, asm, out c);

            return(new Store.AssemblyPathLock(this._pStore, c, path));
        }
 private void CreateFromName(ApplicationIdentity applicationIdentity)
 {
     if (applicationIdentity == null)
     {
         throw new ArgumentNullException("applicationIdentity");
     }
     this._applicationIdentity = applicationIdentity;
     IEnumDefinitionIdentity identity = this._applicationIdentity.Identity.EnumAppPath();
     this._definitionIdentities = new ArrayList(2);
     IDefinitionIdentity[] definitionIdentity = new IDefinitionIdentity[1];
     while (identity.Next(1, definitionIdentity) == 1)
     {
         this._definitionIdentities.Add(definitionIdentity[0]);
     }
     this._definitionIdentities.TrimToSize();
     if (this._definitionIdentities.Count <= 1)
     {
         throw new ArgumentException(Environment.GetResourceString("Argument_InvalidAppId"));
     }
     this._manifestPaths = null;
     this._manifests = null;
     this._actContext = IsolationInterop.CreateActContext(this._applicationIdentity.Identity);
     this._form = ContextForm.StoreBounded;
     this._appRunState = ApplicationStateDisposition.Undefined;
 }
        internal ICMS GetComponentManifest(IDefinitionIdentity component)
        {
            object obj2;

            this._actContext.GetComponentManifest(0, component, ref IsolationInterop.IID_ICMS, out obj2);
            return(obj2 as ICMS);
        }
        private void CreateFromName(ApplicationIdentity applicationIdentity)
        {
            if (applicationIdentity == null)
            {
                throw new ArgumentNullException("applicationIdentity");
            }
            this._applicationIdentity = applicationIdentity;
            IEnumDefinitionIdentity identity = this._applicationIdentity.Identity.EnumAppPath();

            this._definitionIdentities = new ArrayList(2);
            IDefinitionIdentity[] definitionIdentity = new IDefinitionIdentity[1];
            while (identity.Next(1, definitionIdentity) == 1)
            {
                this._definitionIdentities.Add(definitionIdentity[0]);
            }
            this._definitionIdentities.TrimToSize();
            if (this._definitionIdentities.Count <= 1)
            {
                throw new ArgumentException(Environment.GetResourceString("Argument_InvalidAppId"));
            }
            this._manifestPaths = null;
            this._manifests     = null;
            this._actContext    = IsolationInterop.CreateActContext(this._applicationIdentity.Identity);
            this._form          = ContextForm.StoreBounded;
            this._appRunState   = ApplicationStateDisposition.Undefined;
        }
Beispiel #8
0
        public ICMS GetAssemblyManifest(uint Flags, IDefinitionIdentity DefinitionIdentity)
        {
            Guid   iid_ICMS            = IsolationInterop.IID_ICMS;
            object assemblyInformation = this._pStore.GetAssemblyInformation(Flags, DefinitionIdentity, ref iid_ICMS);

            return((ICMS)assemblyInformation);
        }
		private void CommitApplicationTrust(ApplicationIdentity applicationIdentity, string trustXml)
		{
			StoreOperationMetadataProperty[] setProperties = new StoreOperationMetadataProperty[]
			{
				new StoreOperationMetadataProperty(ApplicationTrustCollection.ClrPropertySet, "ApplicationTrust", trustXml)
			};
			IEnumDefinitionIdentity enumDefinitionIdentity = applicationIdentity.Identity.EnumAppPath();
			IDefinitionIdentity[] array = new IDefinitionIdentity[1];
			IDefinitionIdentity definitionIdentity = null;
			if (enumDefinitionIdentity.Next(1U, array) == 1U)
			{
				definitionIdentity = array[0];
			}
			IDefinitionAppId definitionAppId = IsolationInterop.AppIdAuthority.CreateDefinition();
			definitionAppId.SetAppPath(1U, new IDefinitionIdentity[]
			{
				definitionIdentity
			});
			definitionAppId.put_Codebase(applicationIdentity.CodeBase);
			using (StoreTransaction storeTransaction = new StoreTransaction())
			{
				storeTransaction.Add(new StoreOperationSetDeploymentMetadata(definitionAppId, ApplicationTrustCollection.InstallReference, setProperties));
				this.RefreshStorePointer();
				this.m_pStore.Transact(storeTransaction.Operations);
			}
			this.m_appTrusts = null;
		}
Beispiel #10
0
        [System.Security.SecurityCritical]  // auto-generated
        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 Store.IPathLock LockAssemblyPath(IDefinitionIdentity asm)
        {
            IntPtr Cookie;
            string path = this._pStore.LockAssemblyPath(0U, asm, out Cookie);

            return((Store.IPathLock) new Store.AssemblyPathLock(this._pStore, Cookie, path));
        }
Beispiel #12
0
 public DefinitionIdentity(ReferenceIdentity refId)
 {
     this._idComPtr = IsolationInterop.IdentityAuthority.CreateDefinition();
     foreach (IDENTITY_ATTRIBUTE attribute in refId.Attributes)
     {
         this[attribute.Namespace, attribute.Name] = attribute.Value;
     }
 }
Beispiel #13
0
 // Token: 0x06004EA5 RID: 20133 RVA: 0x00117D6D File Offset: 0x00115F6D
 public StoreOperationStageComponent(IDefinitionAppId app, IDefinitionIdentity comp, string Manifest)
 {
     this.Size         = (uint)Marshal.SizeOf(typeof(StoreOperationStageComponent));
     this.Flags        = StoreOperationStageComponent.OpFlags.Nothing;
     this.Application  = app;
     this.Component    = comp;
     this.ManifestPath = Manifest;
 }
Beispiel #14
0
 internal DefinitionIdentity(IDefinitionIdentity i)
 {
     if (i == null)
     {
         throw new ArgumentNullException();
     }
     this._id = i;
 }
 public StoreOperationStageComponent(IDefinitionAppId app, IDefinitionIdentity comp, string Manifest)
 {
     this.Size = (uint) Marshal.SizeOf(typeof(StoreOperationStageComponent));
     this.Flags = OpFlags.Nothing;
     this.Application = app;
     this.Component = comp;
     this.ManifestPath = Manifest;
 }
 public StoreOperationStageComponentFile(IDefinitionAppId App, IDefinitionIdentity Component, string CompRelPath, string SrcFile)
 {
     this.Size = (uint) Marshal.SizeOf(typeof(StoreOperationStageComponentFile));
     this.Flags = OpFlags.Nothing;
     this.Application = App;
     this.Component = Component;
     this.ComponentRelativePath = CompRelPath;
     this.SourceFilePath = SrcFile;
 }
Beispiel #17
0
 public StoreOperationStageComponentFile(IDefinitionAppId App, IDefinitionIdentity Component, string CompRelPath, string SrcFile)
 {
     this.Size                  = (uint)Marshal.SizeOf(typeof(StoreOperationStageComponentFile));
     this.Flags                 = StoreOperationStageComponentFile.OpFlags.Nothing;
     this.Application           = App;
     this.Component             = Component;
     this.ComponentRelativePath = CompRelPath;
     this.SourceFilePath        = SrcFile;
 }
Beispiel #18
0
 public bool MoveNext()
 {
     if ((int)this._enum.Next(1U, this._fetchList) == 1)
     {
         this._current = this._fetchList[0];
         return(true);
     }
     this._current = (IDefinitionIdentity)null;
     return(false);
 }
Beispiel #19
0
        public DefinitionAppId(string codebase, params DefinitionIdentity[] idPath)
        {
            uint length = (uint)idPath.Length;

            IDefinitionIdentity[] DefinitionIdentity = new IDefinitionIdentity[(int)length];
            for (uint index = 0; index < length; ++index)
            {
                DefinitionIdentity[(int)index] = idPath[(int)index].ComPointer;
            }
            this._idComPtr = IsolationInterop.AppIdAuthority.CreateDefinition();
            this._idComPtr.put_Codebase(codebase);
            this._idComPtr.SetAppPath(length, DefinitionIdentity);
        }
Beispiel #20
0
 public DefinitionIdentity(AssemblyName asmName)
 {
     this._idComPtr  = IsolationInterop.IdentityAuthority.CreateDefinition();
     this["name"]    = asmName.Name;
     this["version"] = asmName.Version.ToString();
     if (asmName.CultureInfo != null)
     {
         this["culture"] = asmName.CultureInfo.Name;
     }
     byte[] publicKeyToken = asmName.GetPublicKeyToken();
     if (publicKeyToken == null || publicKeyToken.Length == 0)
     {
         return;
     }
     this["publicKeyToken"] = HexString.FromBytes(publicKeyToken);
 }
        private void CreateFromNameAndManifests(ApplicationIdentity applicationIdentity, string[] manifestPaths)
        {
            if (applicationIdentity == null)
            {
                throw new ArgumentNullException("applicationIdentity");
            }
            if (manifestPaths == null)
            {
                throw new ArgumentNullException("manifestPaths");
            }
            this._applicationIdentity = applicationIdentity;
            IEnumDefinitionIdentity identity = this._applicationIdentity.Identity.EnumAppPath();

            this._manifests     = new ArrayList(2);
            this._manifestPaths = new string[manifestPaths.Length];
            IDefinitionIdentity[] definitionIdentity = new IDefinitionIdentity[1];
            int index = 0;

            while (identity.Next(1, definitionIdentity) == 1)
            {
                ICMS icms = (ICMS)IsolationInterop.ParseManifest(manifestPaths[index], null, ref IsolationInterop.IID_ICMS);
                if (!IsolationInterop.IdentityAuthority.AreDefinitionsEqual(0, icms.Identity, definitionIdentity[0]))
                {
                    throw new ArgumentException(Environment.GetResourceString("Argument_IllegalAppIdMismatch"));
                }
                this._manifests.Add(icms);
                this._manifestPaths[index] = manifestPaths[index];
                index++;
            }
            if (index != manifestPaths.Length)
            {
                throw new ArgumentException(Environment.GetResourceString("Argument_IllegalAppId"));
            }
            this._manifests.TrimToSize();
            if (this._manifests.Count <= 1)
            {
                throw new ArgumentException(Environment.GetResourceString("Argument_InvalidAppId"));
            }
            this._definitionIdentities = null;
            this._actContext           = null;
            this._form        = ContextForm.Loose;
            this._appRunState = ApplicationStateDisposition.Undefined;
        }
Beispiel #22
0
        private void CreateFromName(ApplicationIdentity applicationIdentity)
        {
            if (applicationIdentity == null)
            {
                throw new ArgumentNullException("applicationIdentity");
            }
            Contract.EndContractBlock();

            _applicationIdentity = applicationIdentity;

            IEnumDefinitionIdentity idenum = _applicationIdentity.Identity.EnumAppPath();

            _definitionIdentities = new ArrayList(DefaultComponentCount);

            IDefinitionIdentity[] asbId = new IDefinitionIdentity[1];
            while (idenum.Next(1, asbId) == 1)
            {
                _definitionIdentities.Add(asbId[0]);
            }
            _definitionIdentities.TrimToSize();
            if (_definitionIdentities.Count <= 1)
            {
#if ISOLATION_IN_MSCORLIB
                throw new ArgumentException(Environment.GetResourceString("Argument_InvalidAppId"));
#else
                throw new ArgumentException("Invalid identity: no deployment/app identity specified");
#endif
            }

            _manifestPaths = null;
            _manifests     = null;

            // Construct real IActContext from store.
            _actContext  = IsolationInterop.CreateActContext(_applicationIdentity.Identity);
            _form        = ContextForm.StoreBounded;
            _appRunState = ApplicationStateDisposition.Undefined;

#if ISOLATION_IN_MSCORLIB
            Contract.Assert(_definitionIdentities.Count == 2, "An application must have exactly 1 deployment component and 1 application component in Whidbey");
#endif
        }
Beispiel #23
0
        private DefinitionIdentity PathComponent(uint index)
        {
            IEnumDefinitionIdentity definitionIdentity = (IEnumDefinitionIdentity)null;

            try
            {
                definitionIdentity = this._idComPtr.EnumAppPath();
                if (index > 0U)
                {
                    definitionIdentity.Skip(index);
                }
                IDefinitionIdentity[] DefinitionIdentity = new IDefinitionIdentity[1];
                return((int)definitionIdentity.Next(1U, DefinitionIdentity) == 1 ? new DefinitionIdentity(DefinitionIdentity[0]) : (DefinitionIdentity)null);
            }
            finally
            {
                if (definitionIdentity != null)
                {
                    Marshal.ReleaseComObject((object)definitionIdentity);
                }
            }
        }
Beispiel #24
0
        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;
        }
Beispiel #25
0
        public StoreSubcategoryEnumeration EnumSubcategories(Store.EnumSubcategoriesFlags Flags, IDefinitionIdentity Category, string SearchPattern)
        {
            Guid   guidOfType = IsolationInterop.GetGuidOfType(typeof(IEnumSTORE_CATEGORY_SUBCATEGORY));
            object obj        = this._pStore.EnumSubcategories((uint)Flags, Category, SearchPattern, ref guidOfType);

            return(new StoreSubcategoryEnumeration((IEnumSTORE_CATEGORY_SUBCATEGORY)obj));
        }
Beispiel #26
0
        public IEnumSTORE_ASSEMBLY_INSTALLATION_REFERENCE EnumInstallationReferences(Store.EnumAssemblyInstallReferenceFlags Flags, IDefinitionIdentity Assembly)
        {
            Guid   guidOfType = IsolationInterop.GetGuidOfType(typeof(IEnumSTORE_ASSEMBLY_INSTALLATION_REFERENCE));
            object obj        = this._pStore.EnumInstallationReferences((uint)Flags, Assembly, ref guidOfType);

            return((IEnumSTORE_ASSEMBLY_INSTALLATION_REFERENCE)obj);
        }
Beispiel #27
0
 public ulong QueryChangeID(IDefinitionIdentity asm)
 {
     return(this._pStore.QueryChangeID(asm));
 }
 private void CreateFromNameAndManifests(ApplicationIdentity applicationIdentity, string[] manifestPaths)
 {
     if (applicationIdentity == null)
     {
         throw new ArgumentNullException("applicationIdentity");
     }
     if (manifestPaths == null)
     {
         throw new ArgumentNullException("manifestPaths");
     }
     this._applicationIdentity = applicationIdentity;
     IEnumDefinitionIdentity identity = this._applicationIdentity.Identity.EnumAppPath();
     this._manifests = new ArrayList(2);
     this._manifestPaths = new string[manifestPaths.Length];
     IDefinitionIdentity[] definitionIdentity = new IDefinitionIdentity[1];
     int index = 0;
     while (identity.Next(1, definitionIdentity) == 1)
     {
         ICMS icms = (ICMS) IsolationInterop.ParseManifest(manifestPaths[index], null, ref IsolationInterop.IID_ICMS);
         if (!IsolationInterop.IdentityAuthority.AreDefinitionsEqual(0, icms.Identity, definitionIdentity[0]))
         {
             throw new ArgumentException(Environment.GetResourceString("Argument_IllegalAppIdMismatch"));
         }
         this._manifests.Add(icms);
         this._manifestPaths[index] = manifestPaths[index];
         index++;
     }
     if (index != manifestPaths.Length)
     {
         throw new ArgumentException(Environment.GetResourceString("Argument_IllegalAppId"));
     }
     this._manifests.TrimToSize();
     if (this._manifests.Count <= 1)
     {
         throw new ArgumentException(Environment.GetResourceString("Argument_InvalidAppId"));
     }
     this._definitionIdentities = null;
     this._actContext = null;
     this._form = ContextForm.Loose;
     this._appRunState = ApplicationStateDisposition.Undefined;
 }
        internal DefinitionIdentity(IDefinitionIdentity i)
        {
            if (i == null)
                throw new ArgumentNullException();

            _id = i;
        }
Beispiel #30
0
        private void CreateFromName (ApplicationIdentity applicationIdentity) 
        {
            if (applicationIdentity == null) 
                throw new ArgumentNullException("applicationIdentity"); 
            Contract.EndContractBlock();
 
            _applicationIdentity = applicationIdentity;

            IEnumDefinitionIdentity idenum = _applicationIdentity.Identity.EnumAppPath();
 
            _definitionIdentities = new ArrayList(DefaultComponentCount);
 
            IDefinitionIdentity[] asbId = new IDefinitionIdentity[1]; 
            while (idenum.Next(1, asbId) == 1)
            { 
                _definitionIdentities.Add(asbId[0]);
            }
            _definitionIdentities.TrimToSize();
            if (_definitionIdentities.Count <= 1) 
            {
#if ISOLATION_IN_MSCORLIB 
                throw new ArgumentException(Environment.GetResourceString("Argument_InvalidAppId")); 
#else
                throw new ArgumentException("Invalid identity: no deployment/app identity specified"); 
#endif
            }

            _manifestPaths = null; 
            _manifests = null;
 
            // Construct real IActContext from store. 
            _actContext = IsolationInterop.CreateActContext(_applicationIdentity.Identity);
            _form = ContextForm.StoreBounded; 
            _appRunState = ApplicationStateDisposition.Undefined;

#if ISOLATION_IN_MSCORLIB
            Contract.Assert(_definitionIdentities.Count == 2, "An application must have exactly 1 deployment component and 1 application component in Whidbey"); 
#endif
        } 
 internal ICMS GetComponentManifest(IDefinitionIdentity component)
 {
     object obj2;
     this._actContext.GetComponentManifest(0, component, ref IsolationInterop.IID_ICMS, out obj2);
     return (obj2 as ICMS);
 }
 public UInt64 QueryChangeID(IDefinitionIdentity asm)
 {
     UInt64 ChangeId;
     ChangeId=_pStore.QueryChangeID(asm);
     return ChangeId;
 }
Beispiel #33
0
 public StoreCategoryInstanceEnumeration EnumCategoryInstances(EnumCategoryInstancesFlags Flags, IDefinitionIdentity Category, string SubCat)
 {
     Guid guidOfType = IsolationInterop.GetGuidOfType(typeof(IEnumSTORE_CATEGORY_INSTANCE));
     return new StoreCategoryInstanceEnumeration((IEnumSTORE_CATEGORY_INSTANCE) this._pStore.EnumCategoryInstances((uint) Flags, Category, SubCat, ref guidOfType));
 }
Beispiel #34
0
 public IPathLock LockAssemblyPath(IDefinitionIdentity asm)
 {
     IntPtr ptr;
     return new AssemblyPathLock(this._pStore, ptr, this._pStore.LockAssemblyPath(0, asm, out ptr));
 }
 public StoreSubcategoryEnumeration  EnumSubcategories(EnumSubcategoriesFlags Flags, IDefinitionIdentity Category, string SearchPattern)
 {
     System.Guid g = IsolationInterop.GetGuidOfType(typeof(IEnumSTORE_CATEGORY_SUBCATEGORY));
     object o;
     o=_pStore.EnumSubcategories((UInt32)Flags, Category, SearchPattern, ref g);
     return new StoreSubcategoryEnumeration((IEnumSTORE_CATEGORY_SUBCATEGORY)o);
 }
Beispiel #36
0
 public ICMS GetAssemblyManifest(uint Flags, IDefinitionIdentity DefinitionIdentity)
 {
     Guid riid = IsolationInterop.IID_ICMS;
     return (ICMS) this._pStore.GetAssemblyInformation(Flags, DefinitionIdentity, ref riid);
 }
Beispiel #37
0
 public IDefinitionIdentity GetAssemblyIdentity(uint Flags, IDefinitionIdentity DefinitionIdentity)
 {
     Guid riid = IsolationInterop.IID_IDefinitionIdentity;
     return (IDefinitionIdentity) this._pStore.GetAssemblyInformation(Flags, DefinitionIdentity, ref riid);
 }
 public StoreCategoryInstanceEnumeration EnumCategoryInstances(EnumCategoryInstancesFlags Flags, IDefinitionIdentity Category, string SubCat)
 {
     System.Guid g = IsolationInterop.GetGuidOfType(typeof(IEnumSTORE_CATEGORY_INSTANCE));
     object o;
     o=_pStore.EnumCategoryInstances((UInt32)Flags, Category, SubCat, ref g);
     return new StoreCategoryInstanceEnumeration((IEnumSTORE_CATEGORY_INSTANCE)o);
 }
 public void Reset()
 {
     _current = null;
     _enum.Reset();
 }
Beispiel #40
0
 public IEnumSTORE_ASSEMBLY_INSTALLATION_REFERENCE EnumInstallationReferences(EnumAssemblyInstallReferenceFlags Flags, IDefinitionIdentity Assembly)
 {
     Guid guidOfType = IsolationInterop.GetGuidOfType(typeof(IEnumSTORE_ASSEMBLY_INSTALLATION_REFERENCE));
     return (IEnumSTORE_ASSEMBLY_INSTALLATION_REFERENCE) this._pStore.EnumInstallationReferences((uint) Flags, Assembly, ref guidOfType);
 }
Beispiel #41
0
 internal ICMS GetComponentManifest(IDefinitionIdentity component)
 { 
     object o;
     _actContext.GetComponentManifest(0, component, ref IsolationInterop.IID_ICMS, out o);
     return o as ICMS;
 } 
Beispiel #42
0
 public StoreAssemblyFileEnumeration EnumPrivateFiles(EnumApplicationPrivateFiles Flags, IDefinitionAppId Application, IDefinitionIdentity Assembly)
 {
     Guid guidOfType = IsolationInterop.GetGuidOfType(typeof(IEnumSTORE_ASSEMBLY_FILE));
     return new StoreAssemblyFileEnumeration((IEnumSTORE_ASSEMBLY_FILE) this._pStore.EnumPrivateFiles((uint) Flags, Application, Assembly, ref guidOfType));
 }
Beispiel #43
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 ICMS GetAssemblyManifest(uint Flags, IDefinitionIdentity DefinitionIdentity)
        {
            Guid riid = IsolationInterop.IID_ICMS;

            return((ICMS)this._pStore.GetAssemblyInformation(Flags, DefinitionIdentity, ref riid));
        }
 public IDefinitionIdentity GetAssemblyIdentity(
     UInt32 Flags,
     IDefinitionIdentity DefinitionIdentity
     )
 {
     object o;
     System.Guid g = IsolationInterop.IID_IDefinitionIdentity;
     o=_pStore.GetAssemblyInformation(
         Flags,
         DefinitionIdentity,
         ref g);
     return (IDefinitionIdentity)o;
 }
        public StoreAssemblyFileEnumeration EnumFiles(EnumAssemblyFilesFlags Flags, IDefinitionIdentity Assembly)
        {
            Guid guidOfType = IsolationInterop.GetGuidOfType(typeof(IEnumSTORE_ASSEMBLY_FILE));

            return(new StoreAssemblyFileEnumeration((IEnumSTORE_ASSEMBLY_FILE)this._pStore.EnumFiles((uint)Flags, Assembly, ref guidOfType)));
        }
Beispiel #47
0
 public StoreSubcategoryEnumeration EnumSubcategories(EnumSubcategoriesFlags Flags, IDefinitionIdentity CategoryMatch)
 {
     return this.EnumSubcategories(Flags, CategoryMatch, null);
 }
 public bool MoveNext()
 {
     if ((_enum.Next(1, _fetchList)) == 1)
     {
         _current = _fetchList[0];
         return true;
     }
     else
     {
         _current = null;
         return false;
     }
 }
        public IPathLock LockAssemblyPath(IDefinitionIdentity asm)
        {
            IntPtr ptr;

            return(new AssemblyPathLock(this._pStore, ptr, this._pStore.LockAssemblyPath(0, asm, out ptr)));
        }
Beispiel #50
0
 public StoreSubcategoryEnumeration EnumSubcategories(EnumSubcategoriesFlags Flags, IDefinitionIdentity Category, string SearchPattern)
 {
     Guid guidOfType = IsolationInterop.GetGuidOfType(typeof(IEnumSTORE_CATEGORY_SUBCATEGORY));
     return new StoreSubcategoryEnumeration((IEnumSTORE_CATEGORY_SUBCATEGORY) this._pStore.EnumSubcategories((uint) Flags, Category, SearchPattern, ref guidOfType));
 }
Beispiel #51
0
        public StoreAssemblyFileEnumeration EnumPrivateFiles(Store.EnumApplicationPrivateFiles Flags, IDefinitionAppId Application, IDefinitionIdentity Assembly)
        {
            Guid   guidOfType = IsolationInterop.GetGuidOfType(typeof(IEnumSTORE_ASSEMBLY_FILE));
            object obj        = this._pStore.EnumPrivateFiles((uint)Flags, Application, Assembly, ref guidOfType);

            return(new StoreAssemblyFileEnumeration((IEnumSTORE_ASSEMBLY_FILE)obj));
        }
 public IPathLock LockAssemblyPath(IDefinitionIdentity asm)
 {
     string thePath;
     IntPtr theCookie;
     thePath=_pStore.LockAssemblyPath(0, asm, out theCookie);
     return new AssemblyPathLock(_pStore, theCookie, thePath);
 }
 public IEnumSTORE_ASSEMBLY_INSTALLATION_REFERENCE EnumInstallationReferences(
         EnumAssemblyInstallReferenceFlags Flags,
         IDefinitionIdentity Assembly
         )
 {
     System.Guid g = IsolationInterop.GetGuidOfType(typeof(IEnumSTORE_ASSEMBLY_INSTALLATION_REFERENCE));
     object o;
     o=_pStore.EnumInstallationReferences((UInt32)Flags, Assembly, ref g);
     return (IEnumSTORE_ASSEMBLY_INSTALLATION_REFERENCE)o;
 }
 public StoreAssemblyFileEnumeration EnumPrivateFiles(
         EnumApplicationPrivateFiles Flags,
         IDefinitionAppId Application,
         IDefinitionIdentity Assembly)
 {
     System.Guid g = IsolationInterop.GetGuidOfType(typeof(IEnumSTORE_ASSEMBLY_FILE));
     object o;
     o=_pStore.EnumPrivateFiles((UInt32)Flags, Application, Assembly, ref g);
     return new StoreAssemblyFileEnumeration((IEnumSTORE_ASSEMBLY_FILE)o);
 }
Beispiel #55
0
 // Token: 0x06004ED3 RID: 20179 RVA: 0x001185D4 File Offset: 0x001167D4
 public StoreSubcategoryEnumeration EnumSubcategories(Store.EnumSubcategoriesFlags Flags, IDefinitionIdentity CategoryMatch)
 {
     return(this.EnumSubcategories(Flags, CategoryMatch, null));
 }
Beispiel #56
0
        private void CreateFromNameAndManifests (ApplicationIdentity applicationIdentity, string[] manifestPaths)
        {
            if (applicationIdentity == null) 
                throw new ArgumentNullException("applicationIdentity");
            if (manifestPaths == null) 
                throw new ArgumentNullException("manifestPaths"); 
            Contract.EndContractBlock();
 
            _applicationIdentity = applicationIdentity;

            // ISSUE - need validation on manifestPaths
 
            IEnumDefinitionIdentity idenum = _applicationIdentity.Identity.EnumAppPath();
 
            _manifests = new ArrayList(DefaultComponentCount); 
            _manifestPaths = new String[manifestPaths.Length];
 
            IDefinitionIdentity[] asbId = new IDefinitionIdentity[1];
            int i=0;
            while (idenum.Next(1, asbId) == 1)
            { 
                ICMS cms = (ICMS) IsolationInterop.ParseManifest(manifestPaths[i], null, ref IsolationInterop.IID_ICMS);
 
                if (IsolationInterop.IdentityAuthority.AreDefinitionsEqual(0, cms.Identity, asbId[0])) 
                {
                    _manifests.Add(cms); 
                    _manifestPaths[i]=manifestPaths[i];
                }
                else
                { 
#if ISOLATION_IN_MSCORLIB
                    throw new ArgumentException(Environment.GetResourceString("Argument_IllegalAppIdMismatch")); 
#else 
                    throw new ArgumentException("Application Identity does not match identity in manifests");
#endif 
                }
                i++;
            }
            if (i!=manifestPaths.Length) 
            {
#if ISOLATION_IN_MSCORLIB 
                throw new ArgumentException(Environment.GetResourceString("Argument_IllegalAppId")); 
#else
                throw new ArgumentException("Application Identity does not have same number of components as manifest paths"); 
#endif
            }
            _manifests.TrimToSize();
            if (_manifests.Count <= 1) 
            {
#if ISOLATION_IN_MSCORLIB 
                throw new ArgumentException(Environment.GetResourceString("Argument_InvalidAppId")); 
#else
                throw new ArgumentException("Invalid identity: no deployment/app identity specified"); 
#endif
            }

            _definitionIdentities = null; 
            _actContext = null;
            _form = ContextForm.Loose; 
            _appRunState = ApplicationStateDisposition.Undefined; 

#if ISOLATION_IN_MSCORLIB 
            Contract.Assert(_manifests.Count == 2, "An application must have exactly 1 deployment component and 1 application component in Whidbey");
#endif
        }
Beispiel #57
0
        public StoreCategoryInstanceEnumeration EnumCategoryInstances(Store.EnumCategoryInstancesFlags Flags, IDefinitionIdentity Category, string SubCat)
        {
            Guid   guidOfType = IsolationInterop.GetGuidOfType(typeof(IEnumSTORE_CATEGORY_INSTANCE));
            object obj        = this._pStore.EnumCategoryInstances((uint)Flags, Category, SubCat, ref guidOfType);

            return(new StoreCategoryInstanceEnumeration((IEnumSTORE_CATEGORY_INSTANCE)obj));
        }
 void SetAppPath(IDefinitionIdentity[] Ids)
 {
     _id.SetAppPath((uint)Ids.Length, Ids);
 }
Beispiel #59
0
 public ulong QueryChangeID(IDefinitionIdentity asm)
 {
     return this._pStore.QueryChangeID(asm);
 }
Beispiel #60
0
 public ICMS BindReferenceToAssemblyManifest(uint Flags, IReferenceIdentity ReferenceIdentity, uint cDeploymentsToIgnore, IDefinitionIdentity[] DefinitionIdentity_DeploymentsToIgnore)
 {
     Guid riid = IsolationInterop.IID_ICMS;
     return (ICMS) this._pStore.BindReferenceToAssembly(Flags, ReferenceIdentity, cDeploymentsToIgnore, DefinitionIdentity_DeploymentsToIgnore, ref riid);
 }