public override bool RegisterController() { unsafe { fixed(UIntPtr *ctr = &ControllerHandle, ctx = &ContextHandle) { if (LocalController.GetControllerHandle(ctr, ctx)) { return(DiagnosisService.RegisterEventingController(ControllerHandle, ContextHandle)); } } } return(false); }
unsafe public bool InitializeFromExistingHandle() { mutex = new Mutex(); if (mutex == null) { return(false); } // Mirror the existing memory buffer. We do not need actually to also fetch // the pointers since someone else has the ownership of that memory Buffers = new UnmanagedMemoryBuffer(); hostController = Controller.GetLocalController(); return(Buffers != null); }
// Public methods static public void InitializeSystem() { // Create the system controller if needed. The SIPs will // get a proxy controller object that will handle operations // as syscalls. // TODO: Further optimizations may allow writing a more // efficient proxy that may use shared memory. #if SINGULARITY_KERNEL KernelController controller = new KernelController(); if (controller != null) { LocalControllerObject = controller; SystemControllerObject = LocalControllerObject; controller.Initialize(); } #else LocalController controller = new LocalController(); if (controller != null) { LocalControllerObject = controller; // For SIPs we need a proxy object that will handle the calls // to the system controller SystemControllerObject = new SystemControllerProxy(); controller.Initialize(); } #endif if (SystemControllerObject != null) { SystemControllerObject.Initialize(); SystemControllerObject.RegisterController(); QuerySession.InitializeQuerySystem(); } }
unsafe public bool Initialize(ulong Size) { mutex = new Mutex(); if (mutex == null) { return(false); } UnmanagedMemoryBuffer NewBuffer = new UnmanagedMemoryBuffer(); if (NewBuffer != null) { uint overheadSize = MemoryStorage.GetMemoryStorageOveheadImpl(); if (!NewBuffer.AllocateBuffer(overheadSize + Size)) { return(false); } Buffers = NewBuffer; StorageHandle = MemoryStorage.MemoryStorageCreateImpl( QoS.StorageSettings, NewBuffer.GetBuffer(), (uint)NewBuffer.GetSize(), 0); if (Controller.GetLocalController().RegisterStorage(this)) { hostController = Controller.GetLocalController(); return(true); } } return(false); }