示例#1
0
        public Capacity Index()
        {
            var memStatus = new MEMORYSTATUSEX();

            if (!GlobalMemoryStatusEx(memStatus))
            {
                throw new Win32Exception(Marshal.GetLastWin32Error());
            }

            var drive = new DriveInfo(ContainerServiceFactory.GetContainerRoot());

            return(new Capacity
            {
                MemoryInBytes = memStatus.ullTotalPhys,
                DiskInBytes = (ulong)drive.TotalSize,
                MaxContainers = MaxContainers,
            });
        }
示例#2
0
 public static string GetContainerPath(string handle)
 {
     return(Path.Combine(ContainerServiceFactory.GetContainerRoot(), GenerateContainerId(handle), "user"));
 }