in ComObject.cs [192:197]
protected void QueryInterfaceFrom<T>(T fromObject) where T : ComObject
{
IntPtr parentPtr;
fromObject.QueryInterface(this.GetType().GetTypeInfo().GUID, out parentPtr);
NativePointer = parentPtr;
}