CallableCOMWrapper

We found 10 examples in language CSharp for this search. You will see 14 fragments of code.

		public SOSDac? GetSOSDacInterface() {
			var result = QueryInterface(SOSDac.IID_ISOSDac);
			if (result == IntPtr.Zero)
				return null;

			try {
				return new SOSDac(_library, result);
			}
			catch (InvalidOperationException) {
				return null;
			}
		}

		public void Flush() {
			VTable.Flush(Self);
		}

		public HResult Request(uint reqCode, byte[] input, byte[] output) {
			fixed (byte* pInput = input)
			fixed (byte* pOutput = output)
				return VTable.Request(Self, reqCode, input.Length, pInput, output.Length, pOutput);
		}



        public HResult GetMethodTableCollectibleData(ulong mt, out MethodTableCollectibleData data)
        {
            InitDelegate(ref _getMethodTableCollectibleData, VTable.GetMethodTableCollectibleData);
            return _getMethodTableCollectibleData(Self, mt, out data);
        }


        public bool AllocateMemory(ulong address, uint size, uint typeFlags, uint protectFlags, out ulong remoteAddress)
        {
            return VTable.AllocVirtual(Self, address, size, typeFlags, protectFlags, out remoteAddress) == HResult.S_OK;
        }

        public bool FreeMemory(ulong address, uint size, uint typeFlags)
        {
            return VTable.FreeVirtual(Self, address, size, typeFlags) == HResult.S_OK;
        }


        public bool AllocateMemory(ulong address, uint size, uint typeFlags, uint protectFlags, out ulong remoteAddress)
        {
            return VTable.AllocVirtual(Self, address, size, typeFlags, protectFlags, out remoteAddress) == HResult.S_OK;
        }

        public bool FreeMemory(ulong address, uint size, uint typeFlags)
        {
            return VTable.FreeVirtual(Self, address, size, typeFlags) == HResult.S_OK;
        }


        public HResult GetMethodTableCollectibleData(ulong mt, out MethodTableCollectibleData data)
        {
            return VTable.GetMethodTableCollectibleData(Self, mt, out data);
        }


        public int ReadHandles(Span<HandleData> handles)
        {
            if (handles.IsEmpty)
                throw new ArgumentException(null, nameof(handles));

            fixed (HandleData* ptr = handles)
            {
                HResult hr = _next(Self, handles.Length, ptr, out int read);
                return hr ? read : 0;
            }
        }


        public HResult GetThreadContext(Span<byte> context)
        {
            InitDelegate(ref _getThreadContext, VTable.GetThreadContext);

            using IDisposable holder = _sys.Enter();
            fixed (byte* ptr = context)
                return _getThreadContext(Self, ptr, context.Length);
        }


        public int ReadStackReferences(Span<StackRefData> stackRefs)
        {
            if (stackRefs.IsEmpty)
                throw new ArgumentException(null, nameof(stackRefs));

            fixed (StackRefData* ptr = stackRefs)
            {
                HResult hr = _next(Self, stackRefs.Length, ptr, out int read);
                return hr ? read : 0;
            }
        }


        public HResult GetThreadContext(Span<byte> context)
        {
            using IDisposable holder = _sys.Enter();
            fixed (byte* ptr = context)
                return VTable.GetThreadContext(Self, ptr, context.Length);
        }


        public ClrStackWalk? CreateStackWalk(DacLibrary library, uint flags)
        {
            CreateStackWalkDelegate create = Marshal.GetDelegateForFunctionPointer<CreateStackWalkDelegate>(VTable.CreateStackWalk);
            if (!create(Self, flags, out IntPtr pUnk))
                return null;

            GC.KeepAlive(create);
            return new ClrStackWalk(library, pUnk);
        }

Microsoft.Diagnostics.Runtime.Utilities.CallableCOMWrapper : IDisposable

Methods :

public Int32 AddRef()
public Int32 Release()
public IntPtr QueryInterface(Guid& riid = )
public Void Dispose()
public Type GetType()
public String ToString()
public Boolean Equals(Object obj = )
public Int32 GetHashCode()