Beispiel #1
0
        public Async BeginCreateLun(LunType type, ulong sizeInBytes, Guid[] driveIdArray, UnmaskingList unmaskingList, LunHints hints, AsyncCallback callback, object state)
        {
            IVdsAsync async;

            if (unmaskingList == null)
            {
                throw new ArgumentNullException("unmaskingList");
            }
            if (hints == null)
            {
                throw new ArgumentNullException("hints");
            }
            Hints hints2 = hints.Hints;

            this.InitializeComInterfaces();
            try
            {
                this.subSystem.CreateLun(type, sizeInBytes, (driveIdArray.Length != 0) ? driveIdArray : null, driveIdArray.Length, unmaskingList.ToString(), ref hints2, out async);
            }
            catch (COMException exception)
            {
                throw new VdsException("The call to IVdsSubSystem::CreateLun failed.", exception);
            }
            Async async2 = new Async(async, callback, state);

            new Thread(new ThreadStart(async2.Wait)).Start();
            return(async2);
        }
Beispiel #2
0
        public ulong QueryMaxLunCreateSize(LunType type, Guid[] driveIdArray, LunHints hints)
        {
            ulong num;

            if (hints == null)
            {
                throw new ArgumentNullException("hints");
            }
            Hints hints2 = hints.Hints;

            this.InitializeComInterfaces();
            try
            {
                this.subSystem.QueryMaxLunCreateSize(type, (driveIdArray.Length != 0) ? driveIdArray : null, driveIdArray.Length, ref hints2, out num);
            }
            catch (COMException exception)
            {
                throw new VdsException("The call to IVdsSubSystem::QueryMaxLunCreateSize failed.", exception);
            }
            return(num);
        }