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, }); }
public static string GetContainerPath(string handle) { return(Path.Combine(ContainerServiceFactory.GetContainerRoot(), GenerateContainerId(handle), "user")); }