Exemple #1
0
 public StoreOperationUninstallDeployment(IDefinitionAppId appid, StoreApplicationReference AppRef)
 {
     this.Size        = (uint)Marshal.SizeOf(typeof(StoreOperationUninstallDeployment));
     this.Flags       = StoreOperationUninstallDeployment.OpFlags.Nothing;
     this.Application = appid;
     this.Reference   = AppRef.ToIntPtr();
 }
 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 StoreOperationUnpinDeployment(IDefinitionAppId app, StoreApplicationReference reference)
 {
     this.Size = (uint) Marshal.SizeOf(typeof(StoreOperationUnpinDeployment));
     this.Flags = OpFlags.Nothing;
     this.Application = app;
     this.Reference = reference.ToIntPtr();
 }
Exemple #4
0
 public StoreOperationSetDeploymentMetadata(IDefinitionAppId Deployment, StoreApplicationReference Reference, StoreOperationMetadataProperty[] SetProperties, StoreOperationMetadataProperty[] TestProperties)
 {
     this.Size       = (uint)Marshal.SizeOf(typeof(StoreOperationSetDeploymentMetadata));
     this.Flags      = StoreOperationSetDeploymentMetadata.OpFlags.Nothing;
     this.Deployment = Deployment;
     if (SetProperties != null)
     {
         this.PropertiesToSet  = StoreOperationSetDeploymentMetadata.MarshalProperties(SetProperties);
         this.cPropertiesToSet = new IntPtr(SetProperties.Length);
     }
     else
     {
         this.PropertiesToSet  = IntPtr.Zero;
         this.cPropertiesToSet = IntPtr.Zero;
     }
     if (TestProperties != null)
     {
         this.PropertiesToTest  = StoreOperationSetDeploymentMetadata.MarshalProperties(TestProperties);
         this.cPropertiesToTest = new IntPtr(TestProperties.Length);
     }
     else
     {
         this.PropertiesToTest  = IntPtr.Zero;
         this.cPropertiesToTest = IntPtr.Zero;
     }
     this.InstallerReference = Reference.ToIntPtr();
 }
        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;
        }
        public Store.IPathLock LockApplicationPath(IDefinitionAppId app)
        {
            IntPtr Cookie;
            string path = this._pStore.LockApplicationPath(0U, app, out Cookie);

            return((Store.IPathLock) new Store.ApplicationPathLock(this._pStore, Cookie, path));
        }
Exemple #7
0
 public StoreOperationUnpinDeployment(IDefinitionAppId app, StoreApplicationReference reference)
 {
     this.Size        = (uint)Marshal.SizeOf(typeof(StoreOperationUnpinDeployment));
     this.Flags       = StoreOperationUnpinDeployment.OpFlags.Nothing;
     this.Application = app;
     this.Reference   = reference.ToIntPtr();
 }
		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;
		}
Exemple #9
0
        public Store.IPathLock LockApplicationPath(IDefinitionAppId app)
        {
            IntPtr c;
            string path = this._pStore.LockApplicationPath(0U, app, out c);

            return(new Store.ApplicationPathLock(this._pStore, c, path));
        }
Exemple #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 StoreOperationUninstallDeployment(IDefinitionAppId appid, StoreApplicationReference AppRef)
 {
     this.Size = (uint) Marshal.SizeOf(typeof(StoreOperationUninstallDeployment));
     this.Flags = OpFlags.Nothing;
     this.Application = appid;
     this.Reference = AppRef.ToIntPtr();
 }
Exemple #12
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;
 }
Exemple #13
0
 public StoreOperationPinDeployment(IDefinitionAppId AppId, StoreApplicationReference Ref)
 {
     this.Size           = (uint)Marshal.SizeOf(typeof(StoreOperationPinDeployment));
     this.Flags          = StoreOperationPinDeployment.OpFlags.NeverExpires;
     this.Application    = AppId;
     this.Reference      = Ref.ToIntPtr();
     this.ExpirationTime = 0L;
 }
 public ApplicationIdentity(string applicationIdentityFullName)
 {
     if (applicationIdentityFullName == null)
     {
         throw new ArgumentNullException("applicationIdentityFullName");
     }
     this._appId = IsolationInterop.AppIdAuthority.TextToDefinition(0, applicationIdentityFullName);
 }
 public StoreOperationPinDeployment(IDefinitionAppId AppId, StoreApplicationReference Ref)
 {
     this.Size = (uint) Marshal.SizeOf(typeof(StoreOperationPinDeployment));
     this.Flags = OpFlags.NeverExpires;
     this.Application = AppId;
     this.Reference = Ref.ToIntPtr();
     this.ExpirationTime = 0L;
 }
Exemple #16
0
 public ApplicationIdentity(string applicationIdentityFullName)
 {
     if (applicationIdentityFullName == null)
     {
         throw new ArgumentNullException("applicationIdentityFullName");
     }
     this._appId = IsolationInterop.AppIdAuthority.TextToDefinition(0, applicationIdentityFullName);
 }
 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;
 }
Exemple #18
0
 internal DefinitionAppId(IDefinitionAppId id)
 {
     if (id == null)
     {
         throw new ArgumentNullException();
     }
     this._id = id;
 }
 public ApplicationIdentity(String applicationIdentityFullName)
 {
     if (applicationIdentityFullName == null)
     {
         throw new ArgumentNullException("applicationIdentityFullName");
     }
     Contract.EndContractBlock();
     _appId = IsolationInterop.AppIdAuthority.TextToDefinition(0, applicationIdentityFullName);
 }
 private ApplicationIdentity(SerializationInfo info, StreamingContext context)
 {
     string identity = (string) info.GetValue("FullName", typeof(string));
     if (identity == null)
     {
         throw new ArgumentNullException("fullName");
     }
     this._appId = IsolationInterop.AppIdAuthority.TextToDefinition(0, identity);
 }
 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;
 }
Exemple #22
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;
 }
 public bool MoveNext()
 {
     IDefinitionAppId[] appIds = new IDefinitionAppId[1];
     uint num = this._enum.Next(1, appIds);
     if (num == 1)
     {
         this._current = appIds[0];
     }
     return (this._fValid = num == 1);
 }
Exemple #24
0
        private ApplicationIdentity(SerializationInfo info, StreamingContext context)
        {
            string identity = (string)info.GetValue("FullName", typeof(string));

            if (identity == null)
            {
                throw new ArgumentNullException("fullName");
            }
            this._appId = IsolationInterop.AppIdAuthority.TextToDefinition(0, identity);
        }
 public StoreOperationInstallDeployment(IDefinitionAppId App, bool UninstallOthers, StoreApplicationReference reference)
 {
     this.Size        = (uint)Marshal.SizeOf(typeof(StoreOperationInstallDeployment));
     this.Flags       = StoreOperationInstallDeployment.OpFlags.Nothing;
     this.Application = App;
     if (UninstallOthers)
     {
         this.Flags |= StoreOperationInstallDeployment.OpFlags.UninstallOthers;
     }
     this.Reference = reference.ToIntPtr();
 }
        public bool MoveNext()
        {
            IDefinitionAppId[] appIds = new IDefinitionAppId[1];
            uint num = this._enum.Next(1, appIds);

            if (num == 1)
            {
                this._current = appIds[0];
            }
            return(this._fValid = num == 1);
        }
        public bool MoveNext()
        {
            IDefinitionAppId[] array = new IDefinitionAppId[1];
            uint num = this._enum.Next(1U, array);

            if (num == 1U)
            {
                this._current = array[0];
            }
            return(this._fValid = (num == 1U));
        }
 public StoreOperationInstallDeployment(IDefinitionAppId App, bool UninstallOthers, StoreApplicationReference reference)
 {
     this.Size = (uint) Marshal.SizeOf(typeof(StoreOperationInstallDeployment));
     this.Flags = OpFlags.Nothing;
     this.Application = App;
     if (UninstallOthers)
     {
         this.Flags |= OpFlags.UninstallOthers;
     }
     this.Reference = reference.ToIntPtr();
 }
Exemple #29
0
        public bool MoveNext()
        {
            IDefinitionAppId[] AppIds = new IDefinitionAppId[1];
            uint num = this._enum.Next(1U, AppIds);

            if ((int)num == 1)
            {
                this._current = AppIds[0];
            }
            return(this._fValid = (int)num == 1);
        }
Exemple #30
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);
        }
        public byte[] GetDeploymentProperty(Store.GetPackagePropertyFlags Flags, IDefinitionAppId Deployment, StoreApplicationReference Reference, Guid PropertySet, string PropertyName)
        {
            BLOB blob = new BLOB();

            byte[] destination = (byte[])null;
            try
            {
                this._pStore.GetDeploymentProperty((uint)Flags, Deployment, ref Reference, ref PropertySet, PropertyName, out blob);
                destination = new byte[(int)blob.Size];
                Marshal.Copy(blob.BlobData, destination, 0, (int)blob.Size);
            }
            finally
            {
                blob.Dispose();
            }
            return(destination);
        }
Exemple #32
0
        public byte[] GetDeploymentProperty(Store.GetPackagePropertyFlags Flags, IDefinitionAppId Deployment, StoreApplicationReference Reference, Guid PropertySet, string PropertyName)
        {
            BLOB blob = default(BLOB);

            byte[] array = null;
            try
            {
                this._pStore.GetDeploymentProperty((uint)Flags, Deployment, ref Reference, ref PropertySet, PropertyName, out blob);
                array = new byte[blob.Size];
                Marshal.Copy(blob.BlobData, array, 0, (int)blob.Size);
            }
            finally
            {
                blob.Dispose();
            }
            return(array);
        }
Exemple #33
0
        internal static IActContext CreateActContext(IDefinitionAppId AppId)
        {
            IsolationInterop.CreateActContextParameters createActContextParameters;
            createActContextParameters.Size                      = (uint)Marshal.SizeOf(typeof(IsolationInterop.CreateActContextParameters));
            createActContextParameters.Flags                     = 16U;
            createActContextParameters.CustomStoreList           = IntPtr.Zero;
            createActContextParameters.CultureFallbackList       = IntPtr.Zero;
            createActContextParameters.ProcessorArchitectureList = IntPtr.Zero;
            createActContextParameters.Source                    = IntPtr.Zero;
            createActContextParameters.ProcArch                  = 0;
            IsolationInterop.CreateActContextParametersSource createActContextParametersSource;
            createActContextParametersSource.Size       = (uint)Marshal.SizeOf(typeof(IsolationInterop.CreateActContextParametersSource));
            createActContextParametersSource.Flags      = 0U;
            createActContextParametersSource.SourceType = 1U;
            createActContextParametersSource.Data       = IntPtr.Zero;
            IsolationInterop.CreateActContextParametersSourceDefinitionAppid createActContextParametersSourceDefinitionAppid;
            createActContextParametersSourceDefinitionAppid.Size  = (uint)Marshal.SizeOf(typeof(IsolationInterop.CreateActContextParametersSourceDefinitionAppid));
            createActContextParametersSourceDefinitionAppid.Flags = 0U;
            createActContextParametersSourceDefinitionAppid.AppId = AppId;
            IActContext result;

            try
            {
                createActContextParametersSource.Data = createActContextParametersSourceDefinitionAppid.ToIntPtr();
                createActContextParameters.Source     = createActContextParametersSource.ToIntPtr();
                result = (IsolationInterop.CreateActContext(ref createActContextParameters) as IActContext);
            }
            finally
            {
                if (createActContextParametersSource.Data != IntPtr.Zero)
                {
                    IsolationInterop.CreateActContextParametersSourceDefinitionAppid.Destroy(createActContextParametersSource.Data);
                    createActContextParametersSource.Data = IntPtr.Zero;
                }
                if (createActContextParameters.Source != IntPtr.Zero)
                {
                    IsolationInterop.CreateActContextParametersSource.Destroy(createActContextParameters.Source);
                    createActContextParameters.Source = IntPtr.Zero;
                }
            }
            return(result);
        }
        internal static IActContext CreateActContext(IDefinitionAppId AppId)
        {
            CreateActContextParameters       parameters;
            CreateActContextParametersSource source;
            CreateActContextParametersSourceDefinitionAppid appid;
            IActContext context;

            parameters.Size                      = (uint)Marshal.SizeOf(typeof(CreateActContextParameters));
            parameters.Flags                     = 0x10;
            parameters.CustomStoreList           = IntPtr.Zero;
            parameters.CultureFallbackList       = IntPtr.Zero;
            parameters.ProcessorArchitectureList = IntPtr.Zero;
            parameters.Source                    = IntPtr.Zero;
            parameters.ProcArch                  = 0;
            source.Size       = (uint)Marshal.SizeOf(typeof(CreateActContextParametersSource));
            source.Flags      = 0;
            source.SourceType = 1;
            source.Data       = IntPtr.Zero;
            appid.Size        = (uint)Marshal.SizeOf(typeof(CreateActContextParametersSourceDefinitionAppid));
            appid.Flags       = 0;
            appid.AppId       = AppId;
            try
            {
                source.Data       = appid.ToIntPtr();
                parameters.Source = source.ToIntPtr();
                context           = CreateActContext(ref parameters) as IActContext;
            }
            finally
            {
                if (source.Data != IntPtr.Zero)
                {
                    CreateActContextParametersSourceDefinitionAppid.Destroy(source.Data);
                    source.Data = IntPtr.Zero;
                }
                if (parameters.Source != IntPtr.Zero)
                {
                    CreateActContextParametersSource.Destroy(parameters.Source);
                    parameters.Source = IntPtr.Zero;
                }
            }
            return(context);
        }
 internal static IActContext CreateActContext(IDefinitionAppId AppId)
 {
     CreateActContextParameters parameters;
     CreateActContextParametersSource source;
     CreateActContextParametersSourceDefinitionAppid appid;
     IActContext context;
     parameters.Size = (uint) Marshal.SizeOf(typeof(CreateActContextParameters));
     parameters.Flags = 0x10;
     parameters.CustomStoreList = IntPtr.Zero;
     parameters.CultureFallbackList = IntPtr.Zero;
     parameters.ProcessorArchitectureList = IntPtr.Zero;
     parameters.Source = IntPtr.Zero;
     parameters.ProcArch = 0;
     source.Size = (uint) Marshal.SizeOf(typeof(CreateActContextParametersSource));
     source.Flags = 0;
     source.SourceType = 1;
     source.Data = IntPtr.Zero;
     appid.Size = (uint) Marshal.SizeOf(typeof(CreateActContextParametersSourceDefinitionAppid));
     appid.Flags = 0;
     appid.AppId = AppId;
     try
     {
         source.Data = appid.ToIntPtr();
         parameters.Source = source.ToIntPtr();
         context = CreateActContext(ref parameters) as IActContext;
     }
     finally
     {
         if (source.Data != IntPtr.Zero)
         {
             CreateActContextParametersSourceDefinitionAppid.Destroy(source.Data);
             source.Data = IntPtr.Zero;
         }
         if (parameters.Source != IntPtr.Zero)
         {
             CreateActContextParametersSource.Destroy(parameters.Source);
             parameters.Source = IntPtr.Zero;
         }
     }
     return context;
 }
Exemple #36
0
 internal static IActContext CreateActContext(IDefinitionAppId AppId)
 {
     IsolationInterop.CreateActContextParameters Params;
     Params.Size                      = (uint)Marshal.SizeOf(typeof(IsolationInterop.CreateActContextParameters));
     Params.Flags                     = 16U;
     Params.CustomStoreList           = IntPtr.Zero;
     Params.CultureFallbackList       = IntPtr.Zero;
     Params.ProcessorArchitectureList = IntPtr.Zero;
     Params.Source                    = IntPtr.Zero;
     Params.ProcArch                  = (ushort)0;
     IsolationInterop.CreateActContextParametersSource parametersSource;
     parametersSource.Size       = (uint)Marshal.SizeOf(typeof(IsolationInterop.CreateActContextParametersSource));
     parametersSource.Flags      = 0U;
     parametersSource.SourceType = 1U;
     parametersSource.Data       = IntPtr.Zero;
     IsolationInterop.CreateActContextParametersSourceDefinitionAppid sourceDefinitionAppid;
     sourceDefinitionAppid.Size  = (uint)Marshal.SizeOf(typeof(IsolationInterop.CreateActContextParametersSourceDefinitionAppid));
     sourceDefinitionAppid.Flags = 0U;
     sourceDefinitionAppid.AppId = AppId;
     try
     {
         parametersSource.Data = sourceDefinitionAppid.ToIntPtr();
         Params.Source         = parametersSource.ToIntPtr();
         return(IsolationInterop.CreateActContext(ref Params) as IActContext);
     }
     finally
     {
         if (parametersSource.Data != IntPtr.Zero)
         {
             IsolationInterop.CreateActContextParametersSourceDefinitionAppid.Destroy(parametersSource.Data);
             parametersSource.Data = IntPtr.Zero;
         }
         if (Params.Source != IntPtr.Zero)
         {
             IsolationInterop.CreateActContextParametersSource.Destroy(Params.Source);
             Params.Source = IntPtr.Zero;
         }
     }
 }
Exemple #37
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;
        }
Exemple #38
0
        public StoreDeploymentMetadataPropertyEnumeration EnumInstallerDeploymentProperties(Guid InstallerId, string InstallerName, string InstallerMetadata, IDefinitionAppId Deployment)
        {
            StoreApplicationReference storeApplicationReference = new StoreApplicationReference(InstallerId, InstallerName, InstallerMetadata);
            object obj = this._pStore.EnumInstallerDeploymentMetadataProperties(0U, ref storeApplicationReference, Deployment, ref IsolationInterop.IID_IEnumSTORE_DEPLOYMENT_METADATA_PROPERTY);

            return(new StoreDeploymentMetadataPropertyEnumeration((IEnumSTORE_DEPLOYMENT_METADATA_PROPERTY)obj));
        }
        [System.Security.SecuritySafeCritical]  // auto-generated
        internal static IActContext CreateActContext(IDefinitionAppId AppId)
        {
            CreateActContextParameters Parameters;
            CreateActContextParametersSource SourceInfo;
            CreateActContextParametersSourceDefinitionAppid DefAppIdSource;

            Parameters.Size = (UInt32)Marshal.SizeOf(typeof(CreateActContextParameters));
            Parameters.Flags = (UInt32)CreateActContextParameters.CreateFlags.SourceValid;
            Parameters.CustomStoreList = IntPtr.Zero;
            Parameters.CultureFallbackList = IntPtr.Zero;
            Parameters.ProcessorArchitectureList = IntPtr.Zero;
            Parameters.Source = IntPtr.Zero;
            Parameters.ProcArch = 0;

            SourceInfo.Size = (UInt32)Marshal.SizeOf(typeof(CreateActContextParametersSource));
            SourceInfo.Flags = 0;
            SourceInfo.SourceType = (UInt32)CreateActContextParametersSource.SourceFlags.Definition;
            SourceInfo.Data = IntPtr.Zero;

            DefAppIdSource.Size = (UInt32)Marshal.SizeOf(typeof(CreateActContextParametersSourceDefinitionAppid));
            DefAppIdSource.Flags = 0;
            DefAppIdSource.AppId = AppId;

            try
            {
                SourceInfo.Data = DefAppIdSource.ToIntPtr();
                Parameters.Source = SourceInfo.ToIntPtr();

                return CreateActContext(ref Parameters) as IActContext;
            }
            //
            // Don't care about exceptions, but we don't want to leak nonmanaged heap
            //
            finally
            {
                if (SourceInfo.Data != IntPtr.Zero)
                {
                    CreateActContextParametersSourceDefinitionAppid.Destroy(SourceInfo.Data);
                    SourceInfo.Data = IntPtr.Zero;
                }

                if (Parameters.Source != IntPtr.Zero)
                {
                    CreateActContextParametersSource.Destroy(Parameters.Source);
                    Parameters.Source = IntPtr.Zero;
                }
            }
        }
        [System.Security.SecurityCritical]  // auto-generated
        public byte[] GetDeploymentProperty(
                GetPackagePropertyFlags Flags,
                IDefinitionAppId Deployment,
                StoreApplicationReference Reference,
                Guid PropertySet,
                string PropertyName
                )
        {
            BLOB b = new BLOB();
            byte[] retval = null;

            try
            {
                _pStore.GetDeploymentProperty(
                    (UInt32)Flags,
                    Deployment,
                    ref Reference,
                    ref PropertySet,
                    PropertyName,
                    out b);

                retval = new byte[b.Size];
                Marshal.Copy(b.BlobData, retval, 0, (int)b.Size);
            }
            finally
            {
                b.Dispose();
            }

            return retval;
        }
Exemple #41
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));
        }
Exemple #42
0
 public byte[] GetDeploymentProperty(GetPackagePropertyFlags Flags, IDefinitionAppId Deployment, StoreApplicationReference Reference, Guid PropertySet, string PropertyName)
 {
     BLOB blob = new BLOB();
     byte[] destination = null;
     try
     {
         this._pStore.GetDeploymentProperty((uint) Flags, Deployment, ref Reference, ref PropertySet, PropertyName, out blob);
         destination = new byte[blob.Size];
         Marshal.Copy(blob.BlobData, destination, 0, (int) blob.Size);
     }
     finally
     {
         blob.Dispose();
     }
     return destination;
 }
Exemple #43
0
 public IPathLock LockApplicationPath(IDefinitionAppId app)
 {
     IntPtr ptr;
     return new ApplicationPathLock(this._pStore, ptr, this._pStore.LockApplicationPath(0, app, out ptr));
 }
 public IPathLock LockApplicationPath(IDefinitionAppId app)
 {
     string thePath;
     IntPtr theCookie;
     thePath = _pStore.LockApplicationPath(0, app, out theCookie);
     return new ApplicationPathLock(_pStore, theCookie, thePath);
 }
 internal ApplicationIdentity(IDefinitionAppId applicationIdentity)
 {
     this._appId = applicationIdentity;
 }
 public StoreOperationSetDeploymentMetadata(IDefinitionAppId Deployment, StoreApplicationReference Reference, StoreOperationMetadataProperty[] SetProperties)
     : this(Deployment, Reference, SetProperties, null)
 {
 }
Exemple #47
0
 public StoreDeploymentMetadataPropertyEnumeration EnumInstallerDeploymentProperties(Guid InstallerId, string InstallerName, string InstallerMetadata, IDefinitionAppId Deployment)
 {
     StoreApplicationReference reference = new StoreApplicationReference(InstallerId, InstallerName, InstallerMetadata);
     return new StoreDeploymentMetadataPropertyEnumeration((IEnumSTORE_DEPLOYMENT_METADATA_PROPERTY) this._pStore.EnumInstallerDeploymentMetadataProperties(0, ref reference, Deployment, ref IsolationInterop.IID_IEnumSTORE_DEPLOYMENT_METADATA_PROPERTY));
 }
Exemple #48
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));
 }
 // Token: 0x06004EB1 RID: 20145 RVA: 0x00117F0B File Offset: 0x0011610B
 public StoreOperationInstallDeployment(IDefinitionAppId App, StoreApplicationReference reference)
 {
     this = new StoreOperationInstallDeployment(App, true, reference);
 }
        public void CalculateDelimiterOfDeploymentsBasedOnQuota(
            UInt32 dwFlags,
            UInt32 cDeployments,
            IDefinitionAppId[] rgpIDefinitionAppId_Deployments,
            ref StoreApplicationReference InstallerReference,
            UInt64 ulonglongQuota,
            ref UInt32 Delimiter,
            ref UInt64 SizeSharedWithExternalDeployment,
            ref UInt64 SizeConsumedByInputDeploymentArray
            )
        {
            IntPtr DelimIntPtr = IntPtr.Zero;
            
            _pStore.CalculateDelimiterOfDeploymentsBasedOnQuota(
                dwFlags,
                new IntPtr((Int64)cDeployments),
                rgpIDefinitionAppId_Deployments,
                ref InstallerReference,
                ulonglongQuota,
                ref DelimIntPtr,
                ref SizeSharedWithExternalDeployment,
                ref SizeConsumedByInputDeploymentArray);
                
            Delimiter = (UInt32)DelimIntPtr.ToInt64();

            return;
        }
 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);
 }
 internal DefinitionAppId(IDefinitionAppId id)
 {
     if (id == null)
         throw new ArgumentNullException();
     _id = id;
 }
Exemple #53
0
 public void CalculateDelimiterOfDeploymentsBasedOnQuota(uint dwFlags, uint cDeployments, IDefinitionAppId[] rgpIDefinitionAppId_Deployments, ref StoreApplicationReference InstallerReference, ulong ulonglongQuota, ref uint Delimiter, ref ulong SizeSharedWithExternalDeployment, ref ulong SizeConsumedByInputDeploymentArray)
 {
     IntPtr zero = IntPtr.Zero;
     this._pStore.CalculateDelimiterOfDeploymentsBasedOnQuota(dwFlags, new IntPtr((long) cDeployments), rgpIDefinitionAppId_Deployments, ref InstallerReference, ulonglongQuota, ref zero, ref SizeSharedWithExternalDeployment, ref SizeConsumedByInputDeploymentArray);
     Delimiter = (uint) zero.ToInt64();
 }
 public StoreOperationStageComponentFile(IDefinitionAppId App, string CompRelPath, string SrcFile) : this(App, null, CompRelPath, SrcFile)
 {
 }
 public bool MoveNext()
 {
     IDefinitionAppId[] next = new IDefinitionAppId[1];
     UInt32 fetched;
     fetched=_enum.Next(1, next);
     if (fetched == 1)
         _current = next[0];
     return (_fValid = (fetched == 1));
 }
 public StoreOperationInstallDeployment(IDefinitionAppId App, StoreApplicationReference reference) : this(App, true, reference)
 {
 }
Exemple #57
0
 internal ApplicationIdentity(IDefinitionAppId applicationIdentity)
 {
     this._appId = applicationIdentity;
 }
 public ApplicationIdentity(String applicationIdentityFullName) 
 {
     if (applicationIdentityFullName == null) 
         throw new ArgumentNullException("applicationIdentityFullName");
     Contract.EndContractBlock();
     _appId = IsolationInterop.AppIdAuthority.TextToDefinition(0, applicationIdentityFullName);
 } 
 internal ApplicationIdentity(IDefinitionAppId applicationIdentity) 
 {
     // ISSUE- this should clone the IDefintionAppId. 
     _appId = applicationIdentity;
 }
 public StoreOperationPinDeployment(IDefinitionAppId AppId, DateTime Expiry, StoreApplicationReference Ref) : this(AppId, Ref)
 {
     this.Flags |= OpFlags.NeverExpires;
 }