コード例 #1
0
        unsafe public static bool IsSubtype(SharedHeap.Allocation *childData,
                                            SystemType parent)
        {
            UIntPtr childHandle = SharedHeap.Allocation.GetType(childData);

            return(IsSubtype(childHandle, parent.id));
        }
コード例 #2
0
        // requires alloc's owner unlocked
        private unsafe void AllocationVisit(SharedHeap.Allocation *alloc)
        {
// TODO: support PAGING
#if !PAGING
            SharedHeap.CurrentProcessSharedHeap.Free(alloc, allocationOwnerId);
#endif //PAGING
        }
コード例 #3
0
        // requires alloc's owner locked
        private unsafe bool Matches(SharedHeap.Allocation *alloc)
        {
            // TODO: using an integer id is only an approximate way to
            // get the right process.  Is this the right design?
            Process process = Process.GetProcessByID(
                SharedHeap.Allocation.GetOwnerProcessId(alloc));

            return(process == null);
        }
コード例 #4
0
        // requires alloc's owner unlocked
        private unsafe void EndpointVisit(SharedHeap.Allocation *alloc)
        {
// TODO: support PAGING
#if !PAGING
            EndpointCore *epData = (EndpointCore *)
                                   // Currently use unchecked access here, since the shared heap
                                   // walker does not run in the same process as the data.
                                   SharedHeap.Allocation.GetDataUnchecked(alloc);
            if (!epData->Closed())
            {
                epData->Dispose();
            }
            EndpointCore.Free(alloc);
#endif //PAGING
        }
コード例 #5
0
        public static unsafe bool SetStartupEndpoint(ProcessHandle handle,
                                                     int index,
                                                     SharedHeapService.Allocation *endpoint)
        {
            Tracing.Log(Tracing.Debug,
                        "ProcessHandle.SetStartupEndpoint(id={0:x8}, ndx={1}, ep={2:x8})",
                        handle.id, (UIntPtr)index, (UIntPtr)endpoint);

            //
            // Convert the handle to a process; set the endpoint.
            //
            SharedHeap.Allocation *ep = (SharedHeap.Allocation *)endpoint;
            Process process           = HandleTable.GetHandle(handle.id) as Process;

            return(process.SetEndpoint(index, ref ep));
        }
コード例 #6
0
 // Parameter is really: ExtensionContract.Exp opt(ExHeap) *
 public static unsafe void SetStartupEndpoint(int arg,
                                              SharedHeapService.Allocation *ep)
 {
     SharedHeap.Allocation *mep = (SharedHeap.Allocation *)ep;
     Thread.CurrentProcess.SetEndpoint(arg, ref mep);
 }