mirror of
https://github.com/ZuneDev/Xune.git
synced 2026-07-27 13:13:10 -07:00
Format RenderApi code
This commit is contained in:
+4
-4
@@ -8,8 +8,8 @@ using Microsoft.Iris.Render.Protocol;
|
||||
|
||||
namespace Microsoft.Iris.Render.Protocols.Splash.Messaging
|
||||
{
|
||||
internal interface IDataBufferCallback
|
||||
{
|
||||
void OnComplete(RENDERHANDLE target);
|
||||
}
|
||||
internal interface IDataBufferCallback
|
||||
{
|
||||
void OnComplete(RENDERHANDLE target);
|
||||
}
|
||||
}
|
||||
|
||||
+5
-5
@@ -8,10 +8,10 @@ using Microsoft.Iris.Render.Protocol;
|
||||
|
||||
namespace Microsoft.Iris.Render.Protocols.Splash.Messaging
|
||||
{
|
||||
internal interface IRenderPortCallback
|
||||
{
|
||||
void OnBatchProcessed(RENDERHANDLE target, uint uBatchCompleted);
|
||||
internal interface IRenderPortCallback
|
||||
{
|
||||
void OnBatchProcessed(RENDERHANDLE target, uint uBatchCompleted);
|
||||
|
||||
void OnPingReply(RENDERHANDLE target);
|
||||
}
|
||||
void OnPingReply(RENDERHANDLE target);
|
||||
}
|
||||
}
|
||||
|
||||
+59
-59
@@ -10,65 +10,65 @@ using System.Runtime.InteropServices;
|
||||
|
||||
namespace Microsoft.Iris.Render.Protocols.Splash.Messaging
|
||||
{
|
||||
internal class LocalDataBufferCallback : RemoteObject
|
||||
{
|
||||
private static ushort[] s_priv_ByteOrder_Msg0_OnComplete;
|
||||
|
||||
protected LocalDataBufferCallback()
|
||||
internal class LocalDataBufferCallback : RemoteObject
|
||||
{
|
||||
private static ushort[] s_priv_ByteOrder_Msg0_OnComplete;
|
||||
|
||||
protected LocalDataBufferCallback()
|
||||
{
|
||||
}
|
||||
|
||||
internal static LocalDataBufferCallback CreateCallbackImpl(
|
||||
RenderPort port,
|
||||
RENDERHANDLE callbackInstance)
|
||||
{
|
||||
return new LocalDataBufferCallback(port, callbackInstance);
|
||||
}
|
||||
|
||||
protected LocalDataBufferCallback(RenderPort port, RENDERHANDLE handle)
|
||||
: base(port, handle, false)
|
||||
{
|
||||
}
|
||||
|
||||
public override bool Equals(object other) => other is LocalDataBufferCallback && this.m_renderHandle == ((RemoteObject)other).m_renderHandle;
|
||||
|
||||
public override int GetHashCode() => base.GetHashCode();
|
||||
|
||||
internal static RENDERHANDLE BindCallback(RenderPort port) => port.RegisterCallback(new PortCallback(LocalDataBufferCallback.DispatchCallback), out uint _);
|
||||
|
||||
private static unsafe void DispatchCallback(
|
||||
RenderPort port,
|
||||
IRenderHandleOwner owner,
|
||||
CallbackMessage* message)
|
||||
{
|
||||
if (!(owner is IDataBufferCallback _priv_target) || message->nMsg != 0U)
|
||||
return;
|
||||
LocalDataBufferCallback.Dispatch_OnComplete(port, _priv_target, (LocalDataBufferCallback.Msg0_OnComplete*)message);
|
||||
}
|
||||
|
||||
private static unsafe void Dispatch_OnComplete(
|
||||
RenderPort _priv_port,
|
||||
IDataBufferCallback _priv_target,
|
||||
LocalDataBufferCallback.Msg0_OnComplete* _priv_pmsg)
|
||||
{
|
||||
if (_priv_port.ForeignByteOrder)
|
||||
MarshalHelper.SwapByteOrder((byte*)_priv_pmsg, ref LocalDataBufferCallback.s_priv_ByteOrder_Msg0_OnComplete, typeof(LocalDataBufferCallback.Msg0_OnComplete), sizeof(CallbackMessage), 0);
|
||||
RENDERHANDLE target = _priv_pmsg->target;
|
||||
_priv_target.OnComplete(target);
|
||||
}
|
||||
|
||||
[Conditional("DEBUG")]
|
||||
private static unsafe void OnInvalidCallback(CallbackMessage* message, string category)
|
||||
{
|
||||
}
|
||||
|
||||
[ComVisible(false)]
|
||||
private struct Msg0_OnComplete
|
||||
{
|
||||
public uint _priv_size;
|
||||
public uint _priv_msgid;
|
||||
public RENDERHANDLE _priv_idObjectSubject;
|
||||
public RENDERHANDLE target;
|
||||
}
|
||||
}
|
||||
|
||||
internal static LocalDataBufferCallback CreateCallbackImpl(
|
||||
RenderPort port,
|
||||
RENDERHANDLE callbackInstance)
|
||||
{
|
||||
return new LocalDataBufferCallback(port, callbackInstance);
|
||||
}
|
||||
|
||||
protected LocalDataBufferCallback(RenderPort port, RENDERHANDLE handle)
|
||||
: base(port, handle, false)
|
||||
{
|
||||
}
|
||||
|
||||
public override bool Equals(object other) => other is LocalDataBufferCallback && this.m_renderHandle == ((RemoteObject) other).m_renderHandle;
|
||||
|
||||
public override int GetHashCode() => base.GetHashCode();
|
||||
|
||||
internal static RENDERHANDLE BindCallback(RenderPort port) => port.RegisterCallback(new PortCallback(LocalDataBufferCallback.DispatchCallback), out uint _);
|
||||
|
||||
private static unsafe void DispatchCallback(
|
||||
RenderPort port,
|
||||
IRenderHandleOwner owner,
|
||||
CallbackMessage* message)
|
||||
{
|
||||
if (!(owner is IDataBufferCallback _priv_target) || message->nMsg != 0U)
|
||||
return;
|
||||
LocalDataBufferCallback.Dispatch_OnComplete(port, _priv_target, (LocalDataBufferCallback.Msg0_OnComplete*) message);
|
||||
}
|
||||
|
||||
private static unsafe void Dispatch_OnComplete(
|
||||
RenderPort _priv_port,
|
||||
IDataBufferCallback _priv_target,
|
||||
LocalDataBufferCallback.Msg0_OnComplete* _priv_pmsg)
|
||||
{
|
||||
if (_priv_port.ForeignByteOrder)
|
||||
MarshalHelper.SwapByteOrder((byte*) _priv_pmsg, ref LocalDataBufferCallback.s_priv_ByteOrder_Msg0_OnComplete, typeof (LocalDataBufferCallback.Msg0_OnComplete), sizeof (CallbackMessage), 0);
|
||||
RENDERHANDLE target = _priv_pmsg->target;
|
||||
_priv_target.OnComplete(target);
|
||||
}
|
||||
|
||||
[Conditional("DEBUG")]
|
||||
private static unsafe void OnInvalidCallback(CallbackMessage* message, string category)
|
||||
{
|
||||
}
|
||||
|
||||
[ComVisible(false)]
|
||||
private struct Msg0_OnComplete
|
||||
{
|
||||
public uint _priv_size;
|
||||
public uint _priv_msgid;
|
||||
public RENDERHANDLE _priv_idObjectSubject;
|
||||
public RENDERHANDLE target;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+130
-130
@@ -10,136 +10,136 @@ using System.Runtime.InteropServices;
|
||||
|
||||
namespace Microsoft.Iris.Render.Protocols.Splash.Messaging
|
||||
{
|
||||
internal class LocalRenderPortCallback : RemoteObject
|
||||
{
|
||||
private static ushort[] s_priv_ByteOrder_Msg0_OnBatchProcessed;
|
||||
private static ushort[] s_priv_ByteOrder_Msg1_OnPingReply;
|
||||
|
||||
protected LocalRenderPortCallback()
|
||||
internal class LocalRenderPortCallback : RemoteObject
|
||||
{
|
||||
private static ushort[] s_priv_ByteOrder_Msg0_OnBatchProcessed;
|
||||
private static ushort[] s_priv_ByteOrder_Msg1_OnPingReply;
|
||||
|
||||
protected LocalRenderPortCallback()
|
||||
{
|
||||
}
|
||||
|
||||
public static unsafe void AutoSendOnBatchProcessed(
|
||||
ProtocolSplashMessaging _priv_protocolInstance,
|
||||
RENDERHANDLE target,
|
||||
uint uBatchCompleted)
|
||||
{
|
||||
RenderPort port = _priv_protocolInstance.Port;
|
||||
RENDERHANDLE callbackInstance = _priv_protocolInstance.RenderPortCallback_CallbackInstance;
|
||||
uint num = (uint)sizeof(LocalRenderPortCallback.Msg0_OnBatchProcessed);
|
||||
// ISSUE: untyped stack allocation
|
||||
byte* pMem = (byte*)__untypedstackalloc(1 * (int)num);
|
||||
LocalRenderPortCallback.Msg0_OnBatchProcessed* onBatchProcessedPtr = (LocalRenderPortCallback.Msg0_OnBatchProcessed*)pMem;
|
||||
onBatchProcessedPtr->_priv_size = num;
|
||||
onBatchProcessedPtr->_priv_msgid = 0U;
|
||||
onBatchProcessedPtr->target = target;
|
||||
onBatchProcessedPtr->uBatchCompleted = uBatchCompleted;
|
||||
onBatchProcessedPtr->_priv_idObjectSubject = callbackInstance;
|
||||
if (port.ForeignByteOrder)
|
||||
MarshalHelper.SwapByteOrder(pMem, ref LocalRenderPortCallback.s_priv_ByteOrder_Msg0_OnBatchProcessed, typeof(LocalRenderPortCallback.Msg0_OnBatchProcessed), 0, 0);
|
||||
port.SendLocalCallbackMessage((Message*)onBatchProcessedPtr);
|
||||
}
|
||||
|
||||
public static unsafe void AutoSendOnPingReply(
|
||||
ProtocolSplashMessaging _priv_protocolInstance,
|
||||
RENDERHANDLE target)
|
||||
{
|
||||
RenderPort port = _priv_protocolInstance.Port;
|
||||
RENDERHANDLE callbackInstance = _priv_protocolInstance.RenderPortCallback_CallbackInstance;
|
||||
uint num = (uint)sizeof(LocalRenderPortCallback.Msg1_OnPingReply);
|
||||
// ISSUE: untyped stack allocation
|
||||
byte* pMem = (byte*)__untypedstackalloc(1 * (int)num);
|
||||
LocalRenderPortCallback.Msg1_OnPingReply* msg1OnPingReplyPtr = (LocalRenderPortCallback.Msg1_OnPingReply*)pMem;
|
||||
msg1OnPingReplyPtr->_priv_size = num;
|
||||
msg1OnPingReplyPtr->_priv_msgid = 1U;
|
||||
msg1OnPingReplyPtr->target = target;
|
||||
msg1OnPingReplyPtr->_priv_idObjectSubject = callbackInstance;
|
||||
if (port.ForeignByteOrder)
|
||||
MarshalHelper.SwapByteOrder(pMem, ref LocalRenderPortCallback.s_priv_ByteOrder_Msg1_OnPingReply, typeof(LocalRenderPortCallback.Msg1_OnPingReply), 0, 0);
|
||||
port.SendLocalCallbackMessage((Message*)msg1OnPingReplyPtr);
|
||||
}
|
||||
|
||||
internal static LocalRenderPortCallback CreateCallbackImpl(
|
||||
RenderPort port,
|
||||
RENDERHANDLE callbackInstance)
|
||||
{
|
||||
return new LocalRenderPortCallback(port, callbackInstance);
|
||||
}
|
||||
|
||||
protected LocalRenderPortCallback(RenderPort port, RENDERHANDLE handle)
|
||||
: base(port, handle, false)
|
||||
{
|
||||
}
|
||||
|
||||
public override bool Equals(object other) => other is LocalRenderPortCallback && this.m_renderHandle == ((RemoteObject)other).m_renderHandle;
|
||||
|
||||
public override int GetHashCode() => base.GetHashCode();
|
||||
|
||||
internal static RENDERHANDLE BindCallback(RenderPort port) => port.RegisterCallback(new PortCallback(LocalRenderPortCallback.DispatchCallback), out uint _);
|
||||
|
||||
private static unsafe void DispatchCallback(
|
||||
RenderPort port,
|
||||
IRenderHandleOwner owner,
|
||||
CallbackMessage* message)
|
||||
{
|
||||
if (!(owner is IRenderPortCallback _priv_target))
|
||||
return;
|
||||
switch (message->nMsg)
|
||||
{
|
||||
case 0:
|
||||
LocalRenderPortCallback.Dispatch_OnBatchProcessed(port, _priv_target, (LocalRenderPortCallback.Msg0_OnBatchProcessed*)message);
|
||||
break;
|
||||
case 1:
|
||||
LocalRenderPortCallback.Dispatch_OnPingReply(port, _priv_target, (LocalRenderPortCallback.Msg1_OnPingReply*)message);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
private static unsafe void Dispatch_OnBatchProcessed(
|
||||
RenderPort _priv_port,
|
||||
IRenderPortCallback _priv_target,
|
||||
LocalRenderPortCallback.Msg0_OnBatchProcessed* _priv_pmsg)
|
||||
{
|
||||
if (_priv_port.ForeignByteOrder)
|
||||
MarshalHelper.SwapByteOrder((byte*)_priv_pmsg, ref LocalRenderPortCallback.s_priv_ByteOrder_Msg0_OnBatchProcessed, typeof(LocalRenderPortCallback.Msg0_OnBatchProcessed), sizeof(CallbackMessage), 0);
|
||||
RENDERHANDLE target = _priv_pmsg->target;
|
||||
uint uBatchCompleted = _priv_pmsg->uBatchCompleted;
|
||||
_priv_target.OnBatchProcessed(target, uBatchCompleted);
|
||||
}
|
||||
|
||||
private static unsafe void Dispatch_OnPingReply(
|
||||
RenderPort _priv_port,
|
||||
IRenderPortCallback _priv_target,
|
||||
LocalRenderPortCallback.Msg1_OnPingReply* _priv_pmsg)
|
||||
{
|
||||
if (_priv_port.ForeignByteOrder)
|
||||
MarshalHelper.SwapByteOrder((byte*)_priv_pmsg, ref LocalRenderPortCallback.s_priv_ByteOrder_Msg1_OnPingReply, typeof(LocalRenderPortCallback.Msg1_OnPingReply), sizeof(CallbackMessage), 0);
|
||||
RENDERHANDLE target = _priv_pmsg->target;
|
||||
_priv_target.OnPingReply(target);
|
||||
}
|
||||
|
||||
[Conditional("DEBUG")]
|
||||
private static unsafe void OnInvalidCallback(CallbackMessage* message, string category)
|
||||
{
|
||||
}
|
||||
|
||||
[ComVisible(false)]
|
||||
private struct Msg0_OnBatchProcessed
|
||||
{
|
||||
public uint _priv_size;
|
||||
public uint _priv_msgid;
|
||||
public RENDERHANDLE _priv_idObjectSubject;
|
||||
public RENDERHANDLE target;
|
||||
public uint uBatchCompleted;
|
||||
}
|
||||
|
||||
[ComVisible(false)]
|
||||
private struct Msg1_OnPingReply
|
||||
{
|
||||
public uint _priv_size;
|
||||
public uint _priv_msgid;
|
||||
public RENDERHANDLE _priv_idObjectSubject;
|
||||
public RENDERHANDLE target;
|
||||
}
|
||||
}
|
||||
|
||||
public static unsafe void AutoSendOnBatchProcessed(
|
||||
ProtocolSplashMessaging _priv_protocolInstance,
|
||||
RENDERHANDLE target,
|
||||
uint uBatchCompleted)
|
||||
{
|
||||
RenderPort port = _priv_protocolInstance.Port;
|
||||
RENDERHANDLE callbackInstance = _priv_protocolInstance.RenderPortCallback_CallbackInstance;
|
||||
uint num = (uint) sizeof (LocalRenderPortCallback.Msg0_OnBatchProcessed);
|
||||
// ISSUE: untyped stack allocation
|
||||
byte* pMem = (byte*) __untypedstackalloc(1 * (int) num);
|
||||
LocalRenderPortCallback.Msg0_OnBatchProcessed* onBatchProcessedPtr = (LocalRenderPortCallback.Msg0_OnBatchProcessed*) pMem;
|
||||
onBatchProcessedPtr->_priv_size = num;
|
||||
onBatchProcessedPtr->_priv_msgid = 0U;
|
||||
onBatchProcessedPtr->target = target;
|
||||
onBatchProcessedPtr->uBatchCompleted = uBatchCompleted;
|
||||
onBatchProcessedPtr->_priv_idObjectSubject = callbackInstance;
|
||||
if (port.ForeignByteOrder)
|
||||
MarshalHelper.SwapByteOrder(pMem, ref LocalRenderPortCallback.s_priv_ByteOrder_Msg0_OnBatchProcessed, typeof (LocalRenderPortCallback.Msg0_OnBatchProcessed), 0, 0);
|
||||
port.SendLocalCallbackMessage((Message*) onBatchProcessedPtr);
|
||||
}
|
||||
|
||||
public static unsafe void AutoSendOnPingReply(
|
||||
ProtocolSplashMessaging _priv_protocolInstance,
|
||||
RENDERHANDLE target)
|
||||
{
|
||||
RenderPort port = _priv_protocolInstance.Port;
|
||||
RENDERHANDLE callbackInstance = _priv_protocolInstance.RenderPortCallback_CallbackInstance;
|
||||
uint num = (uint) sizeof (LocalRenderPortCallback.Msg1_OnPingReply);
|
||||
// ISSUE: untyped stack allocation
|
||||
byte* pMem = (byte*) __untypedstackalloc(1 * (int) num);
|
||||
LocalRenderPortCallback.Msg1_OnPingReply* msg1OnPingReplyPtr = (LocalRenderPortCallback.Msg1_OnPingReply*) pMem;
|
||||
msg1OnPingReplyPtr->_priv_size = num;
|
||||
msg1OnPingReplyPtr->_priv_msgid = 1U;
|
||||
msg1OnPingReplyPtr->target = target;
|
||||
msg1OnPingReplyPtr->_priv_idObjectSubject = callbackInstance;
|
||||
if (port.ForeignByteOrder)
|
||||
MarshalHelper.SwapByteOrder(pMem, ref LocalRenderPortCallback.s_priv_ByteOrder_Msg1_OnPingReply, typeof (LocalRenderPortCallback.Msg1_OnPingReply), 0, 0);
|
||||
port.SendLocalCallbackMessage((Message*) msg1OnPingReplyPtr);
|
||||
}
|
||||
|
||||
internal static LocalRenderPortCallback CreateCallbackImpl(
|
||||
RenderPort port,
|
||||
RENDERHANDLE callbackInstance)
|
||||
{
|
||||
return new LocalRenderPortCallback(port, callbackInstance);
|
||||
}
|
||||
|
||||
protected LocalRenderPortCallback(RenderPort port, RENDERHANDLE handle)
|
||||
: base(port, handle, false)
|
||||
{
|
||||
}
|
||||
|
||||
public override bool Equals(object other) => other is LocalRenderPortCallback && this.m_renderHandle == ((RemoteObject) other).m_renderHandle;
|
||||
|
||||
public override int GetHashCode() => base.GetHashCode();
|
||||
|
||||
internal static RENDERHANDLE BindCallback(RenderPort port) => port.RegisterCallback(new PortCallback(LocalRenderPortCallback.DispatchCallback), out uint _);
|
||||
|
||||
private static unsafe void DispatchCallback(
|
||||
RenderPort port,
|
||||
IRenderHandleOwner owner,
|
||||
CallbackMessage* message)
|
||||
{
|
||||
if (!(owner is IRenderPortCallback _priv_target))
|
||||
return;
|
||||
switch (message->nMsg)
|
||||
{
|
||||
case 0:
|
||||
LocalRenderPortCallback.Dispatch_OnBatchProcessed(port, _priv_target, (LocalRenderPortCallback.Msg0_OnBatchProcessed*) message);
|
||||
break;
|
||||
case 1:
|
||||
LocalRenderPortCallback.Dispatch_OnPingReply(port, _priv_target, (LocalRenderPortCallback.Msg1_OnPingReply*) message);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
private static unsafe void Dispatch_OnBatchProcessed(
|
||||
RenderPort _priv_port,
|
||||
IRenderPortCallback _priv_target,
|
||||
LocalRenderPortCallback.Msg0_OnBatchProcessed* _priv_pmsg)
|
||||
{
|
||||
if (_priv_port.ForeignByteOrder)
|
||||
MarshalHelper.SwapByteOrder((byte*) _priv_pmsg, ref LocalRenderPortCallback.s_priv_ByteOrder_Msg0_OnBatchProcessed, typeof (LocalRenderPortCallback.Msg0_OnBatchProcessed), sizeof (CallbackMessage), 0);
|
||||
RENDERHANDLE target = _priv_pmsg->target;
|
||||
uint uBatchCompleted = _priv_pmsg->uBatchCompleted;
|
||||
_priv_target.OnBatchProcessed(target, uBatchCompleted);
|
||||
}
|
||||
|
||||
private static unsafe void Dispatch_OnPingReply(
|
||||
RenderPort _priv_port,
|
||||
IRenderPortCallback _priv_target,
|
||||
LocalRenderPortCallback.Msg1_OnPingReply* _priv_pmsg)
|
||||
{
|
||||
if (_priv_port.ForeignByteOrder)
|
||||
MarshalHelper.SwapByteOrder((byte*) _priv_pmsg, ref LocalRenderPortCallback.s_priv_ByteOrder_Msg1_OnPingReply, typeof (LocalRenderPortCallback.Msg1_OnPingReply), sizeof (CallbackMessage), 0);
|
||||
RENDERHANDLE target = _priv_pmsg->target;
|
||||
_priv_target.OnPingReply(target);
|
||||
}
|
||||
|
||||
[Conditional("DEBUG")]
|
||||
private static unsafe void OnInvalidCallback(CallbackMessage* message, string category)
|
||||
{
|
||||
}
|
||||
|
||||
[ComVisible(false)]
|
||||
private struct Msg0_OnBatchProcessed
|
||||
{
|
||||
public uint _priv_size;
|
||||
public uint _priv_msgid;
|
||||
public RENDERHANDLE _priv_idObjectSubject;
|
||||
public RENDERHANDLE target;
|
||||
public uint uBatchCompleted;
|
||||
}
|
||||
|
||||
[ComVisible(false)]
|
||||
private struct Msg1_OnPingReply
|
||||
{
|
||||
public uint _priv_size;
|
||||
public uint _priv_msgid;
|
||||
public RENDERHANDLE _priv_idObjectSubject;
|
||||
public RENDERHANDLE target;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+63
-63
@@ -10,69 +10,69 @@ using System;
|
||||
|
||||
namespace Microsoft.Iris.Render.Protocols.Splash.Messaging
|
||||
{
|
||||
internal sealed class ProtocolSplashMessaging : ProtocolInstance
|
||||
{
|
||||
private RENDERHANDLE _priv_remoteClass_Broker;
|
||||
private RENDERHANDLE _priv_remoteClass_Context;
|
||||
private RENDERHANDLE _priv_remoteClass_DataBuffer;
|
||||
private RENDERHANDLE _priv_remoteClass_ContextRelay;
|
||||
private RENDERHANDLE _priv_callbackInstance_RenderPortCallback;
|
||||
private RENDERHANDLE _priv_callbackInstance_DataBufferCallback;
|
||||
|
||||
public static ProtocolSplashMessaging Bind(RenderPort port)
|
||||
internal sealed class ProtocolSplashMessaging : ProtocolInstance
|
||||
{
|
||||
Debug2.Validate(port != null, typeof (ArgumentNullException), nameof (port));
|
||||
ProtocolInstance protocolInstance = port.LookUpProtocol("Splash::Messaging");
|
||||
if (protocolInstance != null)
|
||||
{
|
||||
ProtocolSplashMessaging protocolSplashMessaging = protocolInstance as ProtocolSplashMessaging;
|
||||
Debug2.Validate(protocolSplashMessaging != null, typeof (InvalidOperationException), "protocol name collision");
|
||||
return protocolSplashMessaging;
|
||||
}
|
||||
ProtocolSplashMessaging protocolSplashMessaging1 = new ProtocolSplashMessaging(port);
|
||||
port.BindProtocol((ProtocolInstance) protocolSplashMessaging1);
|
||||
return protocolSplashMessaging1;
|
||||
private RENDERHANDLE _priv_remoteClass_Broker;
|
||||
private RENDERHANDLE _priv_remoteClass_Context;
|
||||
private RENDERHANDLE _priv_remoteClass_DataBuffer;
|
||||
private RENDERHANDLE _priv_remoteClass_ContextRelay;
|
||||
private RENDERHANDLE _priv_callbackInstance_RenderPortCallback;
|
||||
private RENDERHANDLE _priv_callbackInstance_DataBufferCallback;
|
||||
|
||||
public static ProtocolSplashMessaging Bind(RenderPort port)
|
||||
{
|
||||
Debug2.Validate(port != null, typeof(ArgumentNullException), nameof(port));
|
||||
ProtocolInstance protocolInstance = port.LookUpProtocol("Splash::Messaging");
|
||||
if (protocolInstance != null)
|
||||
{
|
||||
ProtocolSplashMessaging protocolSplashMessaging = protocolInstance as ProtocolSplashMessaging;
|
||||
Debug2.Validate(protocolSplashMessaging != null, typeof(InvalidOperationException), "protocol name collision");
|
||||
return protocolSplashMessaging;
|
||||
}
|
||||
ProtocolSplashMessaging protocolSplashMessaging1 = new ProtocolSplashMessaging(port);
|
||||
port.BindProtocol((ProtocolInstance)protocolSplashMessaging1);
|
||||
return protocolSplashMessaging1;
|
||||
}
|
||||
|
||||
public LocalRenderPortCallback LocalRenderPortCallbackHandle => LocalRenderPortCallback.CreateCallbackImpl(this.Port, this._priv_callbackInstance_RenderPortCallback);
|
||||
|
||||
public LocalDataBufferCallback LocalDataBufferCallbackHandle => LocalDataBufferCallback.CreateCallbackImpl(this.Port, this._priv_callbackInstance_DataBufferCallback);
|
||||
|
||||
private ProtocolSplashMessaging(RenderPort port)
|
||||
: base(port, "Splash::Messaging")
|
||||
{
|
||||
}
|
||||
|
||||
protected override void Init()
|
||||
{
|
||||
RenderPort port = this.Port;
|
||||
this._priv_remoteClass_Broker = port.InitRemoteClass("Splash::Messaging::Broker");
|
||||
this._priv_remoteClass_Context = port.InitRemoteClass("Splash::Messaging::Context");
|
||||
this._priv_remoteClass_DataBuffer = port.InitRemoteClass("Splash::Messaging::DataBuffer");
|
||||
this._priv_remoteClass_ContextRelay = port.InitRemoteClass("Splash::Messaging::ContextRelay");
|
||||
this._priv_callbackInstance_RenderPortCallback = LocalRenderPortCallback.BindCallback(port);
|
||||
this._priv_callbackInstance_DataBufferCallback = LocalDataBufferCallback.BindCallback(port);
|
||||
}
|
||||
|
||||
internal RENDERHANDLE Broker_ClassHandle => this._priv_remoteClass_Broker;
|
||||
|
||||
internal RENDERHANDLE Context_ClassHandle => this._priv_remoteClass_Context;
|
||||
|
||||
internal RENDERHANDLE DataBuffer_ClassHandle => this._priv_remoteClass_DataBuffer;
|
||||
|
||||
internal RENDERHANDLE ContextRelay_ClassHandle => this._priv_remoteClass_ContextRelay;
|
||||
|
||||
internal RENDERHANDLE RenderPortCallback_CallbackInstance => this._priv_callbackInstance_RenderPortCallback;
|
||||
|
||||
internal RENDERHANDLE DataBufferCallback_CallbackInstance => this._priv_callbackInstance_DataBufferCallback;
|
||||
|
||||
internal RemoteContextRelay BuildRemoteContextRelay(
|
||||
IRenderHandleOwner _priv_owner,
|
||||
TransportProtocol protocol,
|
||||
string stServer,
|
||||
string stSession)
|
||||
{
|
||||
return RemoteContextRelay.Create(this, _priv_owner, protocol, stServer, stSession);
|
||||
}
|
||||
}
|
||||
|
||||
public LocalRenderPortCallback LocalRenderPortCallbackHandle => LocalRenderPortCallback.CreateCallbackImpl(this.Port, this._priv_callbackInstance_RenderPortCallback);
|
||||
|
||||
public LocalDataBufferCallback LocalDataBufferCallbackHandle => LocalDataBufferCallback.CreateCallbackImpl(this.Port, this._priv_callbackInstance_DataBufferCallback);
|
||||
|
||||
private ProtocolSplashMessaging(RenderPort port)
|
||||
: base(port, "Splash::Messaging")
|
||||
{
|
||||
}
|
||||
|
||||
protected override void Init()
|
||||
{
|
||||
RenderPort port = this.Port;
|
||||
this._priv_remoteClass_Broker = port.InitRemoteClass("Splash::Messaging::Broker");
|
||||
this._priv_remoteClass_Context = port.InitRemoteClass("Splash::Messaging::Context");
|
||||
this._priv_remoteClass_DataBuffer = port.InitRemoteClass("Splash::Messaging::DataBuffer");
|
||||
this._priv_remoteClass_ContextRelay = port.InitRemoteClass("Splash::Messaging::ContextRelay");
|
||||
this._priv_callbackInstance_RenderPortCallback = LocalRenderPortCallback.BindCallback(port);
|
||||
this._priv_callbackInstance_DataBufferCallback = LocalDataBufferCallback.BindCallback(port);
|
||||
}
|
||||
|
||||
internal RENDERHANDLE Broker_ClassHandle => this._priv_remoteClass_Broker;
|
||||
|
||||
internal RENDERHANDLE Context_ClassHandle => this._priv_remoteClass_Context;
|
||||
|
||||
internal RENDERHANDLE DataBuffer_ClassHandle => this._priv_remoteClass_DataBuffer;
|
||||
|
||||
internal RENDERHANDLE ContextRelay_ClassHandle => this._priv_remoteClass_ContextRelay;
|
||||
|
||||
internal RENDERHANDLE RenderPortCallback_CallbackInstance => this._priv_callbackInstance_RenderPortCallback;
|
||||
|
||||
internal RENDERHANDLE DataBufferCallback_CallbackInstance => this._priv_callbackInstance_DataBufferCallback;
|
||||
|
||||
internal RemoteContextRelay BuildRemoteContextRelay(
|
||||
IRenderHandleOwner _priv_owner,
|
||||
TransportProtocol protocol,
|
||||
string stServer,
|
||||
string stSession)
|
||||
{
|
||||
return RemoteContextRelay.Create(this, _priv_owner, protocol, stServer, stSession);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+171
-171
@@ -9,177 +9,177 @@ using System.Runtime.InteropServices;
|
||||
|
||||
namespace Microsoft.Iris.Render.Protocols.Splash.Messaging
|
||||
{
|
||||
internal class RemoteBroker : RemoteObject
|
||||
{
|
||||
private static ushort[] s_priv_ByteOrder_Msg0_DestroyObject;
|
||||
private static ushort[] s_priv_ByteOrder_Msg1_CreateObject;
|
||||
private static ushort[] s_priv_ByteOrder_Msg2_CreateClass;
|
||||
|
||||
protected RemoteBroker()
|
||||
internal class RemoteBroker : RemoteObject
|
||||
{
|
||||
private static ushort[] s_priv_ByteOrder_Msg0_DestroyObject;
|
||||
private static ushort[] s_priv_ByteOrder_Msg1_CreateObject;
|
||||
private static ushort[] s_priv_ByteOrder_Msg2_CreateClass;
|
||||
|
||||
protected RemoteBroker()
|
||||
{
|
||||
}
|
||||
|
||||
public static unsafe void BuildDestroyObject(
|
||||
out RenderPort _priv_portUse,
|
||||
out Message* _priv_pmsgUse,
|
||||
ProtocolSplashMessaging _priv_protocolInstance,
|
||||
RENDERHANDLE idObject)
|
||||
{
|
||||
RenderPort port = _priv_protocolInstance.Port;
|
||||
_priv_portUse = port;
|
||||
RENDERHANDLE brokerClassHandle = _priv_protocolInstance.Broker_ClassHandle;
|
||||
_priv_portUse.ValidateHandle(brokerClassHandle);
|
||||
uint size = (uint)sizeof(RemoteBroker.Msg0_DestroyObject);
|
||||
RemoteBroker.Msg0_DestroyObject* msg0DestroyObjectPtr = (RemoteBroker.Msg0_DestroyObject*)_priv_portUse.AllocMessageBuffer(size);
|
||||
msg0DestroyObjectPtr->_priv_size = size;
|
||||
msg0DestroyObjectPtr->_priv_msgid = 0U;
|
||||
msg0DestroyObjectPtr->idObject = idObject;
|
||||
msg0DestroyObjectPtr->_priv_idObjectSubject = brokerClassHandle;
|
||||
if (_priv_portUse.ForeignByteOrder)
|
||||
MarshalHelper.SwapByteOrder((byte*)msg0DestroyObjectPtr, ref RemoteBroker.s_priv_ByteOrder_Msg0_DestroyObject, typeof(RemoteBroker.Msg0_DestroyObject), 0, 0);
|
||||
_priv_pmsgUse = (Message*)msg0DestroyObjectPtr;
|
||||
}
|
||||
|
||||
public static unsafe void SendDestroyObject(
|
||||
ProtocolSplashMessaging _priv_protocolInstance,
|
||||
RENDERHANDLE idObject)
|
||||
{
|
||||
RenderPort _priv_portUse;
|
||||
Message* _priv_pmsgUse;
|
||||
RemoteBroker.BuildDestroyObject(out _priv_portUse, out _priv_pmsgUse, _priv_protocolInstance, idObject);
|
||||
_priv_portUse.SendRemoteMessage(_priv_pmsgUse);
|
||||
}
|
||||
|
||||
public static unsafe void BuildCreateObject(
|
||||
out RenderPort _priv_portUse,
|
||||
out Message* _priv_pmsgUse,
|
||||
ProtocolSplashMessaging _priv_protocolInstance,
|
||||
RENDERHANDLE idObjectClass,
|
||||
RENDERHANDLE idObjectNew,
|
||||
Message* msgConstruction)
|
||||
{
|
||||
RenderPort port = _priv_protocolInstance.Port;
|
||||
_priv_portUse = port;
|
||||
RENDERHANDLE brokerClassHandle = _priv_protocolInstance.Broker_ClassHandle;
|
||||
_priv_portUse.ValidateHandle(brokerClassHandle);
|
||||
BlobInfo blobInfo = new BlobInfo(_priv_portUse, (uint)sizeof(RemoteBroker.Msg1_CreateObject));
|
||||
BLOBREF blobref = blobInfo.Add(msgConstruction);
|
||||
uint adjustedTotalSize = blobInfo.AdjustedTotalSize;
|
||||
RemoteBroker.Msg1_CreateObject* msg1CreateObjectPtr = (RemoteBroker.Msg1_CreateObject*)_priv_portUse.AllocMessageBuffer(adjustedTotalSize);
|
||||
msg1CreateObjectPtr->_priv_size = adjustedTotalSize;
|
||||
msg1CreateObjectPtr->_priv_msgid = 1U;
|
||||
msg1CreateObjectPtr->idObjectClass = idObjectClass;
|
||||
msg1CreateObjectPtr->idObjectNew = idObjectNew;
|
||||
msg1CreateObjectPtr->msgConstruction = blobref;
|
||||
blobInfo.Attach((Message*)msg1CreateObjectPtr);
|
||||
msg1CreateObjectPtr->_priv_idObjectSubject = brokerClassHandle;
|
||||
if (_priv_portUse.ForeignByteOrder)
|
||||
MarshalHelper.SwapByteOrder((byte*)msg1CreateObjectPtr, ref RemoteBroker.s_priv_ByteOrder_Msg1_CreateObject, typeof(RemoteBroker.Msg1_CreateObject), 0, 0);
|
||||
_priv_pmsgUse = (Message*)msg1CreateObjectPtr;
|
||||
}
|
||||
|
||||
public static unsafe void SendCreateObject(
|
||||
ProtocolSplashMessaging _priv_protocolInstance,
|
||||
RENDERHANDLE idObjectClass,
|
||||
RENDERHANDLE idObjectNew,
|
||||
Message* msgConstruction)
|
||||
{
|
||||
RenderPort _priv_portUse;
|
||||
Message* _priv_pmsgUse;
|
||||
RemoteBroker.BuildCreateObject(out _priv_portUse, out _priv_pmsgUse, _priv_protocolInstance, idObjectClass, idObjectNew, msgConstruction);
|
||||
_priv_portUse.SendRemoteMessage(_priv_pmsgUse);
|
||||
}
|
||||
|
||||
public static unsafe void BuildCreateClass(
|
||||
out RenderPort _priv_portUse,
|
||||
out Message* _priv_pmsgUse,
|
||||
ProtocolSplashMessaging _priv_protocolInstance,
|
||||
string stClassName,
|
||||
RENDERHANDLE idObjectClass)
|
||||
{
|
||||
RenderPort port = _priv_protocolInstance.Port;
|
||||
_priv_portUse = port;
|
||||
RENDERHANDLE brokerClassHandle = _priv_protocolInstance.Broker_ClassHandle;
|
||||
_priv_portUse.ValidateHandle(brokerClassHandle);
|
||||
BlobInfo blobInfo = new BlobInfo(_priv_portUse, (uint)sizeof(RemoteBroker.Msg2_CreateClass));
|
||||
BLOBREF blobref = blobInfo.Add(stClassName);
|
||||
uint adjustedTotalSize = blobInfo.AdjustedTotalSize;
|
||||
RemoteBroker.Msg2_CreateClass* msg2CreateClassPtr = (RemoteBroker.Msg2_CreateClass*)_priv_portUse.AllocMessageBuffer(adjustedTotalSize);
|
||||
msg2CreateClassPtr->_priv_size = adjustedTotalSize;
|
||||
msg2CreateClassPtr->_priv_msgid = 2U;
|
||||
msg2CreateClassPtr->stClassName = blobref;
|
||||
msg2CreateClassPtr->idObjectClass = idObjectClass;
|
||||
blobInfo.Attach((Message*)msg2CreateClassPtr);
|
||||
msg2CreateClassPtr->_priv_idObjectSubject = brokerClassHandle;
|
||||
if (_priv_portUse.ForeignByteOrder)
|
||||
MarshalHelper.SwapByteOrder((byte*)msg2CreateClassPtr, ref RemoteBroker.s_priv_ByteOrder_Msg2_CreateClass, typeof(RemoteBroker.Msg2_CreateClass), 0, 0);
|
||||
_priv_pmsgUse = (Message*)msg2CreateClassPtr;
|
||||
}
|
||||
|
||||
public static unsafe void SendCreateClass(
|
||||
ProtocolSplashMessaging _priv_protocolInstance,
|
||||
string stClassName,
|
||||
RENDERHANDLE idObjectClass)
|
||||
{
|
||||
RenderPort _priv_portUse;
|
||||
Message* _priv_pmsgUse;
|
||||
RemoteBroker.BuildCreateClass(out _priv_portUse, out _priv_pmsgUse, _priv_protocolInstance, stClassName, idObjectClass);
|
||||
_priv_portUse.SendRemoteMessage(_priv_pmsgUse);
|
||||
}
|
||||
|
||||
public static RemoteBroker CreateFromHandle(RenderPort port, RENDERHANDLE handle) => new RemoteBroker(port, handle, true);
|
||||
|
||||
public static RemoteBroker CreateFromExternalHandle(
|
||||
RenderPort port,
|
||||
RENDERHANDLE handle,
|
||||
IRenderHandleOwner owner)
|
||||
{
|
||||
port.RegisterKnownHandle(owner, handle);
|
||||
return new RemoteBroker(port, handle, false);
|
||||
}
|
||||
|
||||
protected RemoteBroker(RenderPort port, RENDERHANDLE handle, bool fFreeOnDispose)
|
||||
: base(port, handle, fFreeOnDispose)
|
||||
{
|
||||
}
|
||||
|
||||
protected RemoteBroker(RenderPort port, IRenderHandleOwner owner)
|
||||
: base(port, owner)
|
||||
{
|
||||
}
|
||||
|
||||
public override bool Equals(object other) => other is RemoteBroker && this.m_renderHandle == ((RemoteObject)other).m_renderHandle;
|
||||
|
||||
public override int GetHashCode() => base.GetHashCode();
|
||||
|
||||
[ComVisible(false)]
|
||||
private struct Msg0_DestroyObject
|
||||
{
|
||||
public uint _priv_size;
|
||||
public uint _priv_msgid;
|
||||
public RENDERHANDLE _priv_idObjectSubject;
|
||||
public RENDERHANDLE idObject;
|
||||
}
|
||||
|
||||
[ComVisible(false)]
|
||||
private struct Msg1_CreateObject
|
||||
{
|
||||
public uint _priv_size;
|
||||
public uint _priv_msgid;
|
||||
public RENDERHANDLE _priv_idObjectSubject;
|
||||
public RENDERHANDLE idObjectClass;
|
||||
public RENDERHANDLE idObjectNew;
|
||||
public BLOBREF msgConstruction;
|
||||
}
|
||||
|
||||
[ComVisible(false)]
|
||||
private struct Msg2_CreateClass
|
||||
{
|
||||
public uint _priv_size;
|
||||
public uint _priv_msgid;
|
||||
public RENDERHANDLE _priv_idObjectSubject;
|
||||
public BLOBREF stClassName;
|
||||
public RENDERHANDLE idObjectClass;
|
||||
}
|
||||
}
|
||||
|
||||
public static unsafe void BuildDestroyObject(
|
||||
out RenderPort _priv_portUse,
|
||||
out Message* _priv_pmsgUse,
|
||||
ProtocolSplashMessaging _priv_protocolInstance,
|
||||
RENDERHANDLE idObject)
|
||||
{
|
||||
RenderPort port = _priv_protocolInstance.Port;
|
||||
_priv_portUse = port;
|
||||
RENDERHANDLE brokerClassHandle = _priv_protocolInstance.Broker_ClassHandle;
|
||||
_priv_portUse.ValidateHandle(brokerClassHandle);
|
||||
uint size = (uint) sizeof (RemoteBroker.Msg0_DestroyObject);
|
||||
RemoteBroker.Msg0_DestroyObject* msg0DestroyObjectPtr = (RemoteBroker.Msg0_DestroyObject*) _priv_portUse.AllocMessageBuffer(size);
|
||||
msg0DestroyObjectPtr->_priv_size = size;
|
||||
msg0DestroyObjectPtr->_priv_msgid = 0U;
|
||||
msg0DestroyObjectPtr->idObject = idObject;
|
||||
msg0DestroyObjectPtr->_priv_idObjectSubject = brokerClassHandle;
|
||||
if (_priv_portUse.ForeignByteOrder)
|
||||
MarshalHelper.SwapByteOrder((byte*) msg0DestroyObjectPtr, ref RemoteBroker.s_priv_ByteOrder_Msg0_DestroyObject, typeof (RemoteBroker.Msg0_DestroyObject), 0, 0);
|
||||
_priv_pmsgUse = (Message*) msg0DestroyObjectPtr;
|
||||
}
|
||||
|
||||
public static unsafe void SendDestroyObject(
|
||||
ProtocolSplashMessaging _priv_protocolInstance,
|
||||
RENDERHANDLE idObject)
|
||||
{
|
||||
RenderPort _priv_portUse;
|
||||
Message* _priv_pmsgUse;
|
||||
RemoteBroker.BuildDestroyObject(out _priv_portUse, out _priv_pmsgUse, _priv_protocolInstance, idObject);
|
||||
_priv_portUse.SendRemoteMessage(_priv_pmsgUse);
|
||||
}
|
||||
|
||||
public static unsafe void BuildCreateObject(
|
||||
out RenderPort _priv_portUse,
|
||||
out Message* _priv_pmsgUse,
|
||||
ProtocolSplashMessaging _priv_protocolInstance,
|
||||
RENDERHANDLE idObjectClass,
|
||||
RENDERHANDLE idObjectNew,
|
||||
Message* msgConstruction)
|
||||
{
|
||||
RenderPort port = _priv_protocolInstance.Port;
|
||||
_priv_portUse = port;
|
||||
RENDERHANDLE brokerClassHandle = _priv_protocolInstance.Broker_ClassHandle;
|
||||
_priv_portUse.ValidateHandle(brokerClassHandle);
|
||||
BlobInfo blobInfo = new BlobInfo(_priv_portUse, (uint) sizeof (RemoteBroker.Msg1_CreateObject));
|
||||
BLOBREF blobref = blobInfo.Add(msgConstruction);
|
||||
uint adjustedTotalSize = blobInfo.AdjustedTotalSize;
|
||||
RemoteBroker.Msg1_CreateObject* msg1CreateObjectPtr = (RemoteBroker.Msg1_CreateObject*) _priv_portUse.AllocMessageBuffer(adjustedTotalSize);
|
||||
msg1CreateObjectPtr->_priv_size = adjustedTotalSize;
|
||||
msg1CreateObjectPtr->_priv_msgid = 1U;
|
||||
msg1CreateObjectPtr->idObjectClass = idObjectClass;
|
||||
msg1CreateObjectPtr->idObjectNew = idObjectNew;
|
||||
msg1CreateObjectPtr->msgConstruction = blobref;
|
||||
blobInfo.Attach((Message*) msg1CreateObjectPtr);
|
||||
msg1CreateObjectPtr->_priv_idObjectSubject = brokerClassHandle;
|
||||
if (_priv_portUse.ForeignByteOrder)
|
||||
MarshalHelper.SwapByteOrder((byte*) msg1CreateObjectPtr, ref RemoteBroker.s_priv_ByteOrder_Msg1_CreateObject, typeof (RemoteBroker.Msg1_CreateObject), 0, 0);
|
||||
_priv_pmsgUse = (Message*) msg1CreateObjectPtr;
|
||||
}
|
||||
|
||||
public static unsafe void SendCreateObject(
|
||||
ProtocolSplashMessaging _priv_protocolInstance,
|
||||
RENDERHANDLE idObjectClass,
|
||||
RENDERHANDLE idObjectNew,
|
||||
Message* msgConstruction)
|
||||
{
|
||||
RenderPort _priv_portUse;
|
||||
Message* _priv_pmsgUse;
|
||||
RemoteBroker.BuildCreateObject(out _priv_portUse, out _priv_pmsgUse, _priv_protocolInstance, idObjectClass, idObjectNew, msgConstruction);
|
||||
_priv_portUse.SendRemoteMessage(_priv_pmsgUse);
|
||||
}
|
||||
|
||||
public static unsafe void BuildCreateClass(
|
||||
out RenderPort _priv_portUse,
|
||||
out Message* _priv_pmsgUse,
|
||||
ProtocolSplashMessaging _priv_protocolInstance,
|
||||
string stClassName,
|
||||
RENDERHANDLE idObjectClass)
|
||||
{
|
||||
RenderPort port = _priv_protocolInstance.Port;
|
||||
_priv_portUse = port;
|
||||
RENDERHANDLE brokerClassHandle = _priv_protocolInstance.Broker_ClassHandle;
|
||||
_priv_portUse.ValidateHandle(brokerClassHandle);
|
||||
BlobInfo blobInfo = new BlobInfo(_priv_portUse, (uint) sizeof (RemoteBroker.Msg2_CreateClass));
|
||||
BLOBREF blobref = blobInfo.Add(stClassName);
|
||||
uint adjustedTotalSize = blobInfo.AdjustedTotalSize;
|
||||
RemoteBroker.Msg2_CreateClass* msg2CreateClassPtr = (RemoteBroker.Msg2_CreateClass*) _priv_portUse.AllocMessageBuffer(adjustedTotalSize);
|
||||
msg2CreateClassPtr->_priv_size = adjustedTotalSize;
|
||||
msg2CreateClassPtr->_priv_msgid = 2U;
|
||||
msg2CreateClassPtr->stClassName = blobref;
|
||||
msg2CreateClassPtr->idObjectClass = idObjectClass;
|
||||
blobInfo.Attach((Message*) msg2CreateClassPtr);
|
||||
msg2CreateClassPtr->_priv_idObjectSubject = brokerClassHandle;
|
||||
if (_priv_portUse.ForeignByteOrder)
|
||||
MarshalHelper.SwapByteOrder((byte*) msg2CreateClassPtr, ref RemoteBroker.s_priv_ByteOrder_Msg2_CreateClass, typeof (RemoteBroker.Msg2_CreateClass), 0, 0);
|
||||
_priv_pmsgUse = (Message*) msg2CreateClassPtr;
|
||||
}
|
||||
|
||||
public static unsafe void SendCreateClass(
|
||||
ProtocolSplashMessaging _priv_protocolInstance,
|
||||
string stClassName,
|
||||
RENDERHANDLE idObjectClass)
|
||||
{
|
||||
RenderPort _priv_portUse;
|
||||
Message* _priv_pmsgUse;
|
||||
RemoteBroker.BuildCreateClass(out _priv_portUse, out _priv_pmsgUse, _priv_protocolInstance, stClassName, idObjectClass);
|
||||
_priv_portUse.SendRemoteMessage(_priv_pmsgUse);
|
||||
}
|
||||
|
||||
public static RemoteBroker CreateFromHandle(RenderPort port, RENDERHANDLE handle) => new RemoteBroker(port, handle, true);
|
||||
|
||||
public static RemoteBroker CreateFromExternalHandle(
|
||||
RenderPort port,
|
||||
RENDERHANDLE handle,
|
||||
IRenderHandleOwner owner)
|
||||
{
|
||||
port.RegisterKnownHandle(owner, handle);
|
||||
return new RemoteBroker(port, handle, false);
|
||||
}
|
||||
|
||||
protected RemoteBroker(RenderPort port, RENDERHANDLE handle, bool fFreeOnDispose)
|
||||
: base(port, handle, fFreeOnDispose)
|
||||
{
|
||||
}
|
||||
|
||||
protected RemoteBroker(RenderPort port, IRenderHandleOwner owner)
|
||||
: base(port, owner)
|
||||
{
|
||||
}
|
||||
|
||||
public override bool Equals(object other) => other is RemoteBroker && this.m_renderHandle == ((RemoteObject) other).m_renderHandle;
|
||||
|
||||
public override int GetHashCode() => base.GetHashCode();
|
||||
|
||||
[ComVisible(false)]
|
||||
private struct Msg0_DestroyObject
|
||||
{
|
||||
public uint _priv_size;
|
||||
public uint _priv_msgid;
|
||||
public RENDERHANDLE _priv_idObjectSubject;
|
||||
public RENDERHANDLE idObject;
|
||||
}
|
||||
|
||||
[ComVisible(false)]
|
||||
private struct Msg1_CreateObject
|
||||
{
|
||||
public uint _priv_size;
|
||||
public uint _priv_msgid;
|
||||
public RENDERHANDLE _priv_idObjectSubject;
|
||||
public RENDERHANDLE idObjectClass;
|
||||
public RENDERHANDLE idObjectNew;
|
||||
public BLOBREF msgConstruction;
|
||||
}
|
||||
|
||||
[ComVisible(false)]
|
||||
private struct Msg2_CreateClass
|
||||
{
|
||||
public uint _priv_size;
|
||||
public uint _priv_msgid;
|
||||
public RENDERHANDLE _priv_idObjectSubject;
|
||||
public BLOBREF stClassName;
|
||||
public RENDERHANDLE idObjectClass;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+205
-205
@@ -10,211 +10,211 @@ using System.Runtime.InteropServices;
|
||||
|
||||
namespace Microsoft.Iris.Render.Protocols.Splash.Messaging
|
||||
{
|
||||
internal class RemoteContext : RemoteObject
|
||||
{
|
||||
private static ushort[] s_priv_ByteOrder_Msg0_ReleaseObject;
|
||||
private static ushort[] s_priv_ByteOrder_Msg2_ForwardMessage;
|
||||
private static ushort[] s_priv_ByteOrder_Msg3_DestroyGroup;
|
||||
private static ushort[] s_priv_ByteOrder_Msg4_CreateGroup;
|
||||
|
||||
protected RemoteContext()
|
||||
internal class RemoteContext : RemoteObject
|
||||
{
|
||||
private static ushort[] s_priv_ByteOrder_Msg0_ReleaseObject;
|
||||
private static ushort[] s_priv_ByteOrder_Msg2_ForwardMessage;
|
||||
private static ushort[] s_priv_ByteOrder_Msg3_DestroyGroup;
|
||||
private static ushort[] s_priv_ByteOrder_Msg4_CreateGroup;
|
||||
|
||||
protected RemoteContext()
|
||||
{
|
||||
}
|
||||
|
||||
public static unsafe void BuildReleaseObject(
|
||||
out RenderPort _priv_portUse,
|
||||
out Message* _priv_pmsgUse,
|
||||
ProtocolSplashMessaging _priv_protocolInstance,
|
||||
IntPtr punkObj)
|
||||
{
|
||||
RenderPort port = _priv_protocolInstance.Port;
|
||||
_priv_portUse = port;
|
||||
RENDERHANDLE contextClassHandle = _priv_protocolInstance.Context_ClassHandle;
|
||||
_priv_portUse.ValidateHandle(contextClassHandle);
|
||||
uint size = (uint)sizeof(RemoteContext.Msg0_ReleaseObject);
|
||||
RemoteContext.Msg0_ReleaseObject* msg0ReleaseObjectPtr = (RemoteContext.Msg0_ReleaseObject*)_priv_portUse.AllocMessageBuffer(size);
|
||||
msg0ReleaseObjectPtr->_priv_size = size;
|
||||
msg0ReleaseObjectPtr->_priv_msgid = 0U;
|
||||
msg0ReleaseObjectPtr->punkObj = punkObj;
|
||||
msg0ReleaseObjectPtr->_priv_idObjectSubject = contextClassHandle;
|
||||
if (_priv_portUse.ForeignByteOrder)
|
||||
MarshalHelper.SwapByteOrder((byte*)msg0ReleaseObjectPtr, ref RemoteContext.s_priv_ByteOrder_Msg0_ReleaseObject, typeof(RemoteContext.Msg0_ReleaseObject), 0, 0);
|
||||
_priv_pmsgUse = (Message*)msg0ReleaseObjectPtr;
|
||||
}
|
||||
|
||||
public static unsafe void SendReleaseObject(
|
||||
ProtocolSplashMessaging _priv_protocolInstance,
|
||||
IntPtr punkObj)
|
||||
{
|
||||
RenderPort _priv_portUse;
|
||||
Message* _priv_pmsgUse;
|
||||
RemoteContext.BuildReleaseObject(out _priv_portUse, out _priv_pmsgUse, _priv_protocolInstance, punkObj);
|
||||
_priv_portUse.SendRemoteMessage(_priv_pmsgUse);
|
||||
}
|
||||
|
||||
public static unsafe void BuildForwardMessage(
|
||||
out RenderPort _priv_portUse,
|
||||
out Message* _priv_pmsgUse,
|
||||
ProtocolSplashMessaging _priv_protocolInstance,
|
||||
ContextID idContextDest,
|
||||
Message* msgReturn)
|
||||
{
|
||||
RenderPort port = _priv_protocolInstance.Port;
|
||||
_priv_portUse = port;
|
||||
RENDERHANDLE contextClassHandle = _priv_protocolInstance.Context_ClassHandle;
|
||||
_priv_portUse.ValidateHandle(contextClassHandle);
|
||||
BlobInfo blobInfo = new BlobInfo(_priv_portUse, (uint)sizeof(RemoteContext.Msg2_ForwardMessage));
|
||||
BLOBREF blobref = blobInfo.Add(msgReturn);
|
||||
uint adjustedTotalSize = blobInfo.AdjustedTotalSize;
|
||||
RemoteContext.Msg2_ForwardMessage* msg2ForwardMessagePtr = (RemoteContext.Msg2_ForwardMessage*)_priv_portUse.AllocMessageBuffer(adjustedTotalSize);
|
||||
msg2ForwardMessagePtr->_priv_size = adjustedTotalSize;
|
||||
msg2ForwardMessagePtr->_priv_msgid = 2U;
|
||||
msg2ForwardMessagePtr->idContextDest = idContextDest;
|
||||
msg2ForwardMessagePtr->msgReturn = blobref;
|
||||
blobInfo.Attach((Message*)msg2ForwardMessagePtr);
|
||||
msg2ForwardMessagePtr->_priv_idObjectSubject = contextClassHandle;
|
||||
if (_priv_portUse.ForeignByteOrder)
|
||||
MarshalHelper.SwapByteOrder((byte*)msg2ForwardMessagePtr, ref RemoteContext.s_priv_ByteOrder_Msg2_ForwardMessage, typeof(RemoteContext.Msg2_ForwardMessage), 0, 0);
|
||||
_priv_pmsgUse = (Message*)msg2ForwardMessagePtr;
|
||||
}
|
||||
|
||||
public static unsafe void SendForwardMessage(
|
||||
ProtocolSplashMessaging _priv_protocolInstance,
|
||||
ContextID idContextDest,
|
||||
Message* msgReturn)
|
||||
{
|
||||
RenderPort _priv_portUse;
|
||||
Message* _priv_pmsgUse;
|
||||
RemoteContext.BuildForwardMessage(out _priv_portUse, out _priv_pmsgUse, _priv_protocolInstance, idContextDest, msgReturn);
|
||||
_priv_portUse.SendRemoteMessage(_priv_pmsgUse);
|
||||
}
|
||||
|
||||
public static unsafe void BuildDestroyGroup(
|
||||
out RenderPort _priv_portUse,
|
||||
out Message* _priv_pmsgUse,
|
||||
ProtocolSplashMessaging _priv_protocolInstance,
|
||||
int idxGroup)
|
||||
{
|
||||
RenderPort port = _priv_protocolInstance.Port;
|
||||
_priv_portUse = port;
|
||||
RENDERHANDLE contextClassHandle = _priv_protocolInstance.Context_ClassHandle;
|
||||
_priv_portUse.ValidateHandle(contextClassHandle);
|
||||
uint size = (uint)sizeof(RemoteContext.Msg3_DestroyGroup);
|
||||
RemoteContext.Msg3_DestroyGroup* msg3DestroyGroupPtr = (RemoteContext.Msg3_DestroyGroup*)_priv_portUse.AllocMessageBuffer(size);
|
||||
msg3DestroyGroupPtr->_priv_size = size;
|
||||
msg3DestroyGroupPtr->_priv_msgid = 3U;
|
||||
msg3DestroyGroupPtr->idxGroup = idxGroup;
|
||||
msg3DestroyGroupPtr->_priv_idObjectSubject = contextClassHandle;
|
||||
if (_priv_portUse.ForeignByteOrder)
|
||||
MarshalHelper.SwapByteOrder((byte*)msg3DestroyGroupPtr, ref RemoteContext.s_priv_ByteOrder_Msg3_DestroyGroup, typeof(RemoteContext.Msg3_DestroyGroup), 0, 0);
|
||||
_priv_pmsgUse = (Message*)msg3DestroyGroupPtr;
|
||||
}
|
||||
|
||||
public static unsafe void SendDestroyGroup(
|
||||
ProtocolSplashMessaging _priv_protocolInstance,
|
||||
int idxGroup)
|
||||
{
|
||||
RenderPort _priv_portUse;
|
||||
Message* _priv_pmsgUse;
|
||||
RemoteContext.BuildDestroyGroup(out _priv_portUse, out _priv_pmsgUse, _priv_protocolInstance, idxGroup);
|
||||
_priv_portUse.SendRemoteMessage(_priv_pmsgUse);
|
||||
}
|
||||
|
||||
public static unsafe void BuildCreateGroup(
|
||||
out RenderPort _priv_portUse,
|
||||
out Message* _priv_pmsgUse,
|
||||
ProtocolSplashMessaging _priv_protocolInstance,
|
||||
int idxGroup,
|
||||
ContextID idContextOwner)
|
||||
{
|
||||
RenderPort port = _priv_protocolInstance.Port;
|
||||
_priv_portUse = port;
|
||||
RENDERHANDLE contextClassHandle = _priv_protocolInstance.Context_ClassHandle;
|
||||
_priv_portUse.ValidateHandle(contextClassHandle);
|
||||
uint size = (uint)sizeof(RemoteContext.Msg4_CreateGroup);
|
||||
RemoteContext.Msg4_CreateGroup* msg4CreateGroupPtr = (RemoteContext.Msg4_CreateGroup*)_priv_portUse.AllocMessageBuffer(size);
|
||||
msg4CreateGroupPtr->_priv_size = size;
|
||||
msg4CreateGroupPtr->_priv_msgid = 4U;
|
||||
msg4CreateGroupPtr->idxGroup = idxGroup;
|
||||
msg4CreateGroupPtr->idContextOwner = idContextOwner;
|
||||
msg4CreateGroupPtr->_priv_idObjectSubject = contextClassHandle;
|
||||
if (_priv_portUse.ForeignByteOrder)
|
||||
MarshalHelper.SwapByteOrder((byte*)msg4CreateGroupPtr, ref RemoteContext.s_priv_ByteOrder_Msg4_CreateGroup, typeof(RemoteContext.Msg4_CreateGroup), 0, 0);
|
||||
_priv_pmsgUse = (Message*)msg4CreateGroupPtr;
|
||||
}
|
||||
|
||||
public static unsafe void SendCreateGroup(
|
||||
ProtocolSplashMessaging _priv_protocolInstance,
|
||||
int idxGroup,
|
||||
ContextID idContextOwner)
|
||||
{
|
||||
RenderPort _priv_portUse;
|
||||
Message* _priv_pmsgUse;
|
||||
RemoteContext.BuildCreateGroup(out _priv_portUse, out _priv_pmsgUse, _priv_protocolInstance, idxGroup, idContextOwner);
|
||||
_priv_portUse.SendRemoteMessage(_priv_pmsgUse);
|
||||
}
|
||||
|
||||
public static RemoteContext CreateFromHandle(RenderPort port, RENDERHANDLE handle) => new RemoteContext(port, handle, true);
|
||||
|
||||
public static RemoteContext CreateFromExternalHandle(
|
||||
RenderPort port,
|
||||
RENDERHANDLE handle,
|
||||
IRenderHandleOwner owner)
|
||||
{
|
||||
port.RegisterKnownHandle(owner, handle);
|
||||
return new RemoteContext(port, handle, false);
|
||||
}
|
||||
|
||||
protected RemoteContext(RenderPort port, RENDERHANDLE handle, bool fFreeOnDispose)
|
||||
: base(port, handle, fFreeOnDispose)
|
||||
{
|
||||
}
|
||||
|
||||
protected RemoteContext(RenderPort port, IRenderHandleOwner owner)
|
||||
: base(port, owner)
|
||||
{
|
||||
}
|
||||
|
||||
public override bool Equals(object other) => other is RemoteContext && this.m_renderHandle == ((RemoteObject)other).m_renderHandle;
|
||||
|
||||
public override int GetHashCode() => base.GetHashCode();
|
||||
|
||||
[ComVisible(false)]
|
||||
private struct Msg0_ReleaseObject
|
||||
{
|
||||
public uint _priv_size;
|
||||
public uint _priv_msgid;
|
||||
public RENDERHANDLE _priv_idObjectSubject;
|
||||
public IntPtr punkObj;
|
||||
}
|
||||
|
||||
[ComVisible(false)]
|
||||
private struct Msg2_ForwardMessage
|
||||
{
|
||||
public uint _priv_size;
|
||||
public uint _priv_msgid;
|
||||
public RENDERHANDLE _priv_idObjectSubject;
|
||||
public ContextID idContextDest;
|
||||
public BLOBREF msgReturn;
|
||||
}
|
||||
|
||||
[ComVisible(false)]
|
||||
private struct Msg3_DestroyGroup
|
||||
{
|
||||
public uint _priv_size;
|
||||
public uint _priv_msgid;
|
||||
public RENDERHANDLE _priv_idObjectSubject;
|
||||
public int idxGroup;
|
||||
}
|
||||
|
||||
[ComVisible(false)]
|
||||
private struct Msg4_CreateGroup
|
||||
{
|
||||
public uint _priv_size;
|
||||
public uint _priv_msgid;
|
||||
public RENDERHANDLE _priv_idObjectSubject;
|
||||
public int idxGroup;
|
||||
public ContextID idContextOwner;
|
||||
}
|
||||
}
|
||||
|
||||
public static unsafe void BuildReleaseObject(
|
||||
out RenderPort _priv_portUse,
|
||||
out Message* _priv_pmsgUse,
|
||||
ProtocolSplashMessaging _priv_protocolInstance,
|
||||
IntPtr punkObj)
|
||||
{
|
||||
RenderPort port = _priv_protocolInstance.Port;
|
||||
_priv_portUse = port;
|
||||
RENDERHANDLE contextClassHandle = _priv_protocolInstance.Context_ClassHandle;
|
||||
_priv_portUse.ValidateHandle(contextClassHandle);
|
||||
uint size = (uint) sizeof (RemoteContext.Msg0_ReleaseObject);
|
||||
RemoteContext.Msg0_ReleaseObject* msg0ReleaseObjectPtr = (RemoteContext.Msg0_ReleaseObject*) _priv_portUse.AllocMessageBuffer(size);
|
||||
msg0ReleaseObjectPtr->_priv_size = size;
|
||||
msg0ReleaseObjectPtr->_priv_msgid = 0U;
|
||||
msg0ReleaseObjectPtr->punkObj = punkObj;
|
||||
msg0ReleaseObjectPtr->_priv_idObjectSubject = contextClassHandle;
|
||||
if (_priv_portUse.ForeignByteOrder)
|
||||
MarshalHelper.SwapByteOrder((byte*) msg0ReleaseObjectPtr, ref RemoteContext.s_priv_ByteOrder_Msg0_ReleaseObject, typeof (RemoteContext.Msg0_ReleaseObject), 0, 0);
|
||||
_priv_pmsgUse = (Message*) msg0ReleaseObjectPtr;
|
||||
}
|
||||
|
||||
public static unsafe void SendReleaseObject(
|
||||
ProtocolSplashMessaging _priv_protocolInstance,
|
||||
IntPtr punkObj)
|
||||
{
|
||||
RenderPort _priv_portUse;
|
||||
Message* _priv_pmsgUse;
|
||||
RemoteContext.BuildReleaseObject(out _priv_portUse, out _priv_pmsgUse, _priv_protocolInstance, punkObj);
|
||||
_priv_portUse.SendRemoteMessage(_priv_pmsgUse);
|
||||
}
|
||||
|
||||
public static unsafe void BuildForwardMessage(
|
||||
out RenderPort _priv_portUse,
|
||||
out Message* _priv_pmsgUse,
|
||||
ProtocolSplashMessaging _priv_protocolInstance,
|
||||
ContextID idContextDest,
|
||||
Message* msgReturn)
|
||||
{
|
||||
RenderPort port = _priv_protocolInstance.Port;
|
||||
_priv_portUse = port;
|
||||
RENDERHANDLE contextClassHandle = _priv_protocolInstance.Context_ClassHandle;
|
||||
_priv_portUse.ValidateHandle(contextClassHandle);
|
||||
BlobInfo blobInfo = new BlobInfo(_priv_portUse, (uint) sizeof (RemoteContext.Msg2_ForwardMessage));
|
||||
BLOBREF blobref = blobInfo.Add(msgReturn);
|
||||
uint adjustedTotalSize = blobInfo.AdjustedTotalSize;
|
||||
RemoteContext.Msg2_ForwardMessage* msg2ForwardMessagePtr = (RemoteContext.Msg2_ForwardMessage*) _priv_portUse.AllocMessageBuffer(adjustedTotalSize);
|
||||
msg2ForwardMessagePtr->_priv_size = adjustedTotalSize;
|
||||
msg2ForwardMessagePtr->_priv_msgid = 2U;
|
||||
msg2ForwardMessagePtr->idContextDest = idContextDest;
|
||||
msg2ForwardMessagePtr->msgReturn = blobref;
|
||||
blobInfo.Attach((Message*) msg2ForwardMessagePtr);
|
||||
msg2ForwardMessagePtr->_priv_idObjectSubject = contextClassHandle;
|
||||
if (_priv_portUse.ForeignByteOrder)
|
||||
MarshalHelper.SwapByteOrder((byte*) msg2ForwardMessagePtr, ref RemoteContext.s_priv_ByteOrder_Msg2_ForwardMessage, typeof (RemoteContext.Msg2_ForwardMessage), 0, 0);
|
||||
_priv_pmsgUse = (Message*) msg2ForwardMessagePtr;
|
||||
}
|
||||
|
||||
public static unsafe void SendForwardMessage(
|
||||
ProtocolSplashMessaging _priv_protocolInstance,
|
||||
ContextID idContextDest,
|
||||
Message* msgReturn)
|
||||
{
|
||||
RenderPort _priv_portUse;
|
||||
Message* _priv_pmsgUse;
|
||||
RemoteContext.BuildForwardMessage(out _priv_portUse, out _priv_pmsgUse, _priv_protocolInstance, idContextDest, msgReturn);
|
||||
_priv_portUse.SendRemoteMessage(_priv_pmsgUse);
|
||||
}
|
||||
|
||||
public static unsafe void BuildDestroyGroup(
|
||||
out RenderPort _priv_portUse,
|
||||
out Message* _priv_pmsgUse,
|
||||
ProtocolSplashMessaging _priv_protocolInstance,
|
||||
int idxGroup)
|
||||
{
|
||||
RenderPort port = _priv_protocolInstance.Port;
|
||||
_priv_portUse = port;
|
||||
RENDERHANDLE contextClassHandle = _priv_protocolInstance.Context_ClassHandle;
|
||||
_priv_portUse.ValidateHandle(contextClassHandle);
|
||||
uint size = (uint) sizeof (RemoteContext.Msg3_DestroyGroup);
|
||||
RemoteContext.Msg3_DestroyGroup* msg3DestroyGroupPtr = (RemoteContext.Msg3_DestroyGroup*) _priv_portUse.AllocMessageBuffer(size);
|
||||
msg3DestroyGroupPtr->_priv_size = size;
|
||||
msg3DestroyGroupPtr->_priv_msgid = 3U;
|
||||
msg3DestroyGroupPtr->idxGroup = idxGroup;
|
||||
msg3DestroyGroupPtr->_priv_idObjectSubject = contextClassHandle;
|
||||
if (_priv_portUse.ForeignByteOrder)
|
||||
MarshalHelper.SwapByteOrder((byte*) msg3DestroyGroupPtr, ref RemoteContext.s_priv_ByteOrder_Msg3_DestroyGroup, typeof (RemoteContext.Msg3_DestroyGroup), 0, 0);
|
||||
_priv_pmsgUse = (Message*) msg3DestroyGroupPtr;
|
||||
}
|
||||
|
||||
public static unsafe void SendDestroyGroup(
|
||||
ProtocolSplashMessaging _priv_protocolInstance,
|
||||
int idxGroup)
|
||||
{
|
||||
RenderPort _priv_portUse;
|
||||
Message* _priv_pmsgUse;
|
||||
RemoteContext.BuildDestroyGroup(out _priv_portUse, out _priv_pmsgUse, _priv_protocolInstance, idxGroup);
|
||||
_priv_portUse.SendRemoteMessage(_priv_pmsgUse);
|
||||
}
|
||||
|
||||
public static unsafe void BuildCreateGroup(
|
||||
out RenderPort _priv_portUse,
|
||||
out Message* _priv_pmsgUse,
|
||||
ProtocolSplashMessaging _priv_protocolInstance,
|
||||
int idxGroup,
|
||||
ContextID idContextOwner)
|
||||
{
|
||||
RenderPort port = _priv_protocolInstance.Port;
|
||||
_priv_portUse = port;
|
||||
RENDERHANDLE contextClassHandle = _priv_protocolInstance.Context_ClassHandle;
|
||||
_priv_portUse.ValidateHandle(contextClassHandle);
|
||||
uint size = (uint) sizeof (RemoteContext.Msg4_CreateGroup);
|
||||
RemoteContext.Msg4_CreateGroup* msg4CreateGroupPtr = (RemoteContext.Msg4_CreateGroup*) _priv_portUse.AllocMessageBuffer(size);
|
||||
msg4CreateGroupPtr->_priv_size = size;
|
||||
msg4CreateGroupPtr->_priv_msgid = 4U;
|
||||
msg4CreateGroupPtr->idxGroup = idxGroup;
|
||||
msg4CreateGroupPtr->idContextOwner = idContextOwner;
|
||||
msg4CreateGroupPtr->_priv_idObjectSubject = contextClassHandle;
|
||||
if (_priv_portUse.ForeignByteOrder)
|
||||
MarshalHelper.SwapByteOrder((byte*) msg4CreateGroupPtr, ref RemoteContext.s_priv_ByteOrder_Msg4_CreateGroup, typeof (RemoteContext.Msg4_CreateGroup), 0, 0);
|
||||
_priv_pmsgUse = (Message*) msg4CreateGroupPtr;
|
||||
}
|
||||
|
||||
public static unsafe void SendCreateGroup(
|
||||
ProtocolSplashMessaging _priv_protocolInstance,
|
||||
int idxGroup,
|
||||
ContextID idContextOwner)
|
||||
{
|
||||
RenderPort _priv_portUse;
|
||||
Message* _priv_pmsgUse;
|
||||
RemoteContext.BuildCreateGroup(out _priv_portUse, out _priv_pmsgUse, _priv_protocolInstance, idxGroup, idContextOwner);
|
||||
_priv_portUse.SendRemoteMessage(_priv_pmsgUse);
|
||||
}
|
||||
|
||||
public static RemoteContext CreateFromHandle(RenderPort port, RENDERHANDLE handle) => new RemoteContext(port, handle, true);
|
||||
|
||||
public static RemoteContext CreateFromExternalHandle(
|
||||
RenderPort port,
|
||||
RENDERHANDLE handle,
|
||||
IRenderHandleOwner owner)
|
||||
{
|
||||
port.RegisterKnownHandle(owner, handle);
|
||||
return new RemoteContext(port, handle, false);
|
||||
}
|
||||
|
||||
protected RemoteContext(RenderPort port, RENDERHANDLE handle, bool fFreeOnDispose)
|
||||
: base(port, handle, fFreeOnDispose)
|
||||
{
|
||||
}
|
||||
|
||||
protected RemoteContext(RenderPort port, IRenderHandleOwner owner)
|
||||
: base(port, owner)
|
||||
{
|
||||
}
|
||||
|
||||
public override bool Equals(object other) => other is RemoteContext && this.m_renderHandle == ((RemoteObject) other).m_renderHandle;
|
||||
|
||||
public override int GetHashCode() => base.GetHashCode();
|
||||
|
||||
[ComVisible(false)]
|
||||
private struct Msg0_ReleaseObject
|
||||
{
|
||||
public uint _priv_size;
|
||||
public uint _priv_msgid;
|
||||
public RENDERHANDLE _priv_idObjectSubject;
|
||||
public IntPtr punkObj;
|
||||
}
|
||||
|
||||
[ComVisible(false)]
|
||||
private struct Msg2_ForwardMessage
|
||||
{
|
||||
public uint _priv_size;
|
||||
public uint _priv_msgid;
|
||||
public RENDERHANDLE _priv_idObjectSubject;
|
||||
public ContextID idContextDest;
|
||||
public BLOBREF msgReturn;
|
||||
}
|
||||
|
||||
[ComVisible(false)]
|
||||
private struct Msg3_DestroyGroup
|
||||
{
|
||||
public uint _priv_size;
|
||||
public uint _priv_msgid;
|
||||
public RENDERHANDLE _priv_idObjectSubject;
|
||||
public int idxGroup;
|
||||
}
|
||||
|
||||
[ComVisible(false)]
|
||||
private struct Msg4_CreateGroup
|
||||
{
|
||||
public uint _priv_size;
|
||||
public uint _priv_msgid;
|
||||
public RENDERHANDLE _priv_idObjectSubject;
|
||||
public int idxGroup;
|
||||
public ContextID idContextOwner;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+167
-167
@@ -9,173 +9,173 @@ using System.Runtime.InteropServices;
|
||||
|
||||
namespace Microsoft.Iris.Render.Protocols.Splash.Messaging
|
||||
{
|
||||
internal class RemoteContextRelay : RemoteObject
|
||||
{
|
||||
private static ushort[] s_priv_ByteOrder_Msg2_Create;
|
||||
private static ushort[] s_priv_ByteOrder_Msg0_UnlinkContext;
|
||||
private static ushort[] s_priv_ByteOrder_Msg1_LinkContext;
|
||||
|
||||
protected RemoteContextRelay()
|
||||
internal class RemoteContextRelay : RemoteObject
|
||||
{
|
||||
private static ushort[] s_priv_ByteOrder_Msg2_Create;
|
||||
private static ushort[] s_priv_ByteOrder_Msg0_UnlinkContext;
|
||||
private static ushort[] s_priv_ByteOrder_Msg1_LinkContext;
|
||||
|
||||
protected RemoteContextRelay()
|
||||
{
|
||||
}
|
||||
|
||||
public static unsafe RemoteContextRelay Create(
|
||||
ProtocolSplashMessaging _priv_protocolInstance,
|
||||
IRenderHandleOwner _priv_owner,
|
||||
TransportProtocol protocol,
|
||||
string stServer,
|
||||
string stSession)
|
||||
{
|
||||
RenderPort port = _priv_protocolInstance.Port;
|
||||
RENDERHANDLE relayClassHandle = _priv_protocolInstance.ContextRelay_ClassHandle;
|
||||
RemoteContextRelay remoteContextRelay = new RemoteContextRelay(port, _priv_owner);
|
||||
BlobInfo blobInfo = new BlobInfo(port, (uint)sizeof(RemoteContextRelay.Msg2_Create));
|
||||
BLOBREF blobref1 = blobInfo.Add(stServer);
|
||||
BLOBREF blobref2 = blobInfo.Add(stSession);
|
||||
uint adjustedTotalSize = blobInfo.AdjustedTotalSize;
|
||||
// ISSUE: untyped stack allocation
|
||||
byte* pMem = (byte*)__untypedstackalloc(1 * (int)adjustedTotalSize);
|
||||
RemoteContextRelay.Msg2_Create* msg2CreatePtr = (RemoteContextRelay.Msg2_Create*)pMem;
|
||||
msg2CreatePtr->_priv_size = adjustedTotalSize;
|
||||
msg2CreatePtr->_priv_msgid = 2U;
|
||||
msg2CreatePtr->protocol = protocol;
|
||||
msg2CreatePtr->stServer = blobref1;
|
||||
msg2CreatePtr->stSession = blobref2;
|
||||
blobInfo.Attach((Message*)msg2CreatePtr);
|
||||
msg2CreatePtr->_priv_idObjectSubject = remoteContextRelay.m_renderHandle;
|
||||
if (port.ForeignByteOrder)
|
||||
MarshalHelper.SwapByteOrder(pMem, ref RemoteContextRelay.s_priv_ByteOrder_Msg2_Create, typeof(RemoteContextRelay.Msg2_Create), 0, 0);
|
||||
port.CreateRemoteObject(relayClassHandle, remoteContextRelay.m_renderHandle, (Message*)msg2CreatePtr);
|
||||
return remoteContextRelay;
|
||||
}
|
||||
|
||||
public static unsafe void BuildUnlinkContext(
|
||||
out RenderPort _priv_portUse,
|
||||
out Message* _priv_pmsgUse,
|
||||
ProtocolSplashMessaging _priv_protocolInstance,
|
||||
ContextID idContextExisting,
|
||||
ContextID idContextAlias)
|
||||
{
|
||||
RenderPort port = _priv_protocolInstance.Port;
|
||||
_priv_portUse = port;
|
||||
RENDERHANDLE relayClassHandle = _priv_protocolInstance.ContextRelay_ClassHandle;
|
||||
_priv_portUse.ValidateHandle(relayClassHandle);
|
||||
uint size = (uint)sizeof(RemoteContextRelay.Msg0_UnlinkContext);
|
||||
RemoteContextRelay.Msg0_UnlinkContext* msg0UnlinkContextPtr = (RemoteContextRelay.Msg0_UnlinkContext*)_priv_portUse.AllocMessageBuffer(size);
|
||||
msg0UnlinkContextPtr->_priv_size = size;
|
||||
msg0UnlinkContextPtr->_priv_msgid = 0U;
|
||||
msg0UnlinkContextPtr->idContextExisting = idContextExisting;
|
||||
msg0UnlinkContextPtr->idContextAlias = idContextAlias;
|
||||
msg0UnlinkContextPtr->_priv_idObjectSubject = relayClassHandle;
|
||||
if (_priv_portUse.ForeignByteOrder)
|
||||
MarshalHelper.SwapByteOrder((byte*)msg0UnlinkContextPtr, ref RemoteContextRelay.s_priv_ByteOrder_Msg0_UnlinkContext, typeof(RemoteContextRelay.Msg0_UnlinkContext), 0, 0);
|
||||
_priv_pmsgUse = (Message*)msg0UnlinkContextPtr;
|
||||
}
|
||||
|
||||
public static unsafe void SendUnlinkContext(
|
||||
ProtocolSplashMessaging _priv_protocolInstance,
|
||||
ContextID idContextExisting,
|
||||
ContextID idContextAlias)
|
||||
{
|
||||
RenderPort _priv_portUse;
|
||||
Message* _priv_pmsgUse;
|
||||
RemoteContextRelay.BuildUnlinkContext(out _priv_portUse, out _priv_pmsgUse, _priv_protocolInstance, idContextExisting, idContextAlias);
|
||||
_priv_portUse.SendRemoteMessage(_priv_pmsgUse);
|
||||
}
|
||||
|
||||
public static unsafe void BuildLinkContext(
|
||||
out RenderPort _priv_portUse,
|
||||
out Message* _priv_pmsgUse,
|
||||
ProtocolSplashMessaging _priv_protocolInstance,
|
||||
ContextID idContextExisting,
|
||||
ContextID idContextAlias)
|
||||
{
|
||||
RenderPort port = _priv_protocolInstance.Port;
|
||||
_priv_portUse = port;
|
||||
RENDERHANDLE relayClassHandle = _priv_protocolInstance.ContextRelay_ClassHandle;
|
||||
_priv_portUse.ValidateHandle(relayClassHandle);
|
||||
uint size = (uint)sizeof(RemoteContextRelay.Msg1_LinkContext);
|
||||
RemoteContextRelay.Msg1_LinkContext* msg1LinkContextPtr = (RemoteContextRelay.Msg1_LinkContext*)_priv_portUse.AllocMessageBuffer(size);
|
||||
msg1LinkContextPtr->_priv_size = size;
|
||||
msg1LinkContextPtr->_priv_msgid = 1U;
|
||||
msg1LinkContextPtr->idContextExisting = idContextExisting;
|
||||
msg1LinkContextPtr->idContextAlias = idContextAlias;
|
||||
msg1LinkContextPtr->_priv_idObjectSubject = relayClassHandle;
|
||||
if (_priv_portUse.ForeignByteOrder)
|
||||
MarshalHelper.SwapByteOrder((byte*)msg1LinkContextPtr, ref RemoteContextRelay.s_priv_ByteOrder_Msg1_LinkContext, typeof(RemoteContextRelay.Msg1_LinkContext), 0, 0);
|
||||
_priv_pmsgUse = (Message*)msg1LinkContextPtr;
|
||||
}
|
||||
|
||||
public static unsafe void SendLinkContext(
|
||||
ProtocolSplashMessaging _priv_protocolInstance,
|
||||
ContextID idContextExisting,
|
||||
ContextID idContextAlias)
|
||||
{
|
||||
RenderPort _priv_portUse;
|
||||
Message* _priv_pmsgUse;
|
||||
RemoteContextRelay.BuildLinkContext(out _priv_portUse, out _priv_pmsgUse, _priv_protocolInstance, idContextExisting, idContextAlias);
|
||||
_priv_portUse.SendRemoteMessage(_priv_pmsgUse);
|
||||
}
|
||||
|
||||
public static RemoteContextRelay CreateFromHandle(
|
||||
RenderPort port,
|
||||
RENDERHANDLE handle)
|
||||
{
|
||||
return new RemoteContextRelay(port, handle, true);
|
||||
}
|
||||
|
||||
public static RemoteContextRelay CreateFromExternalHandle(
|
||||
RenderPort port,
|
||||
RENDERHANDLE handle,
|
||||
IRenderHandleOwner owner)
|
||||
{
|
||||
port.RegisterKnownHandle(owner, handle);
|
||||
return new RemoteContextRelay(port, handle, false);
|
||||
}
|
||||
|
||||
protected RemoteContextRelay(RenderPort port, RENDERHANDLE handle, bool fFreeOnDispose)
|
||||
: base(port, handle, fFreeOnDispose)
|
||||
{
|
||||
}
|
||||
|
||||
protected RemoteContextRelay(RenderPort port, IRenderHandleOwner owner)
|
||||
: base(port, owner)
|
||||
{
|
||||
}
|
||||
|
||||
public override bool Equals(object other) => other is RemoteContextRelay && this.m_renderHandle == ((RemoteObject)other).m_renderHandle;
|
||||
|
||||
public override int GetHashCode() => base.GetHashCode();
|
||||
|
||||
[ComVisible(false)]
|
||||
private struct Msg2_Create
|
||||
{
|
||||
public uint _priv_size;
|
||||
public uint _priv_msgid;
|
||||
public RENDERHANDLE _priv_idObjectSubject;
|
||||
public TransportProtocol protocol;
|
||||
public BLOBREF stServer;
|
||||
public BLOBREF stSession;
|
||||
}
|
||||
|
||||
[ComVisible(false)]
|
||||
private struct Msg0_UnlinkContext
|
||||
{
|
||||
public uint _priv_size;
|
||||
public uint _priv_msgid;
|
||||
public RENDERHANDLE _priv_idObjectSubject;
|
||||
public ContextID idContextExisting;
|
||||
public ContextID idContextAlias;
|
||||
}
|
||||
|
||||
[ComVisible(false)]
|
||||
private struct Msg1_LinkContext
|
||||
{
|
||||
public uint _priv_size;
|
||||
public uint _priv_msgid;
|
||||
public RENDERHANDLE _priv_idObjectSubject;
|
||||
public ContextID idContextExisting;
|
||||
public ContextID idContextAlias;
|
||||
}
|
||||
}
|
||||
|
||||
public static unsafe RemoteContextRelay Create(
|
||||
ProtocolSplashMessaging _priv_protocolInstance,
|
||||
IRenderHandleOwner _priv_owner,
|
||||
TransportProtocol protocol,
|
||||
string stServer,
|
||||
string stSession)
|
||||
{
|
||||
RenderPort port = _priv_protocolInstance.Port;
|
||||
RENDERHANDLE relayClassHandle = _priv_protocolInstance.ContextRelay_ClassHandle;
|
||||
RemoteContextRelay remoteContextRelay = new RemoteContextRelay(port, _priv_owner);
|
||||
BlobInfo blobInfo = new BlobInfo(port, (uint) sizeof (RemoteContextRelay.Msg2_Create));
|
||||
BLOBREF blobref1 = blobInfo.Add(stServer);
|
||||
BLOBREF blobref2 = blobInfo.Add(stSession);
|
||||
uint adjustedTotalSize = blobInfo.AdjustedTotalSize;
|
||||
// ISSUE: untyped stack allocation
|
||||
byte* pMem = (byte*) __untypedstackalloc(1 * (int) adjustedTotalSize);
|
||||
RemoteContextRelay.Msg2_Create* msg2CreatePtr = (RemoteContextRelay.Msg2_Create*) pMem;
|
||||
msg2CreatePtr->_priv_size = adjustedTotalSize;
|
||||
msg2CreatePtr->_priv_msgid = 2U;
|
||||
msg2CreatePtr->protocol = protocol;
|
||||
msg2CreatePtr->stServer = blobref1;
|
||||
msg2CreatePtr->stSession = blobref2;
|
||||
blobInfo.Attach((Message*) msg2CreatePtr);
|
||||
msg2CreatePtr->_priv_idObjectSubject = remoteContextRelay.m_renderHandle;
|
||||
if (port.ForeignByteOrder)
|
||||
MarshalHelper.SwapByteOrder(pMem, ref RemoteContextRelay.s_priv_ByteOrder_Msg2_Create, typeof (RemoteContextRelay.Msg2_Create), 0, 0);
|
||||
port.CreateRemoteObject(relayClassHandle, remoteContextRelay.m_renderHandle, (Message*) msg2CreatePtr);
|
||||
return remoteContextRelay;
|
||||
}
|
||||
|
||||
public static unsafe void BuildUnlinkContext(
|
||||
out RenderPort _priv_portUse,
|
||||
out Message* _priv_pmsgUse,
|
||||
ProtocolSplashMessaging _priv_protocolInstance,
|
||||
ContextID idContextExisting,
|
||||
ContextID idContextAlias)
|
||||
{
|
||||
RenderPort port = _priv_protocolInstance.Port;
|
||||
_priv_portUse = port;
|
||||
RENDERHANDLE relayClassHandle = _priv_protocolInstance.ContextRelay_ClassHandle;
|
||||
_priv_portUse.ValidateHandle(relayClassHandle);
|
||||
uint size = (uint) sizeof (RemoteContextRelay.Msg0_UnlinkContext);
|
||||
RemoteContextRelay.Msg0_UnlinkContext* msg0UnlinkContextPtr = (RemoteContextRelay.Msg0_UnlinkContext*) _priv_portUse.AllocMessageBuffer(size);
|
||||
msg0UnlinkContextPtr->_priv_size = size;
|
||||
msg0UnlinkContextPtr->_priv_msgid = 0U;
|
||||
msg0UnlinkContextPtr->idContextExisting = idContextExisting;
|
||||
msg0UnlinkContextPtr->idContextAlias = idContextAlias;
|
||||
msg0UnlinkContextPtr->_priv_idObjectSubject = relayClassHandle;
|
||||
if (_priv_portUse.ForeignByteOrder)
|
||||
MarshalHelper.SwapByteOrder((byte*) msg0UnlinkContextPtr, ref RemoteContextRelay.s_priv_ByteOrder_Msg0_UnlinkContext, typeof (RemoteContextRelay.Msg0_UnlinkContext), 0, 0);
|
||||
_priv_pmsgUse = (Message*) msg0UnlinkContextPtr;
|
||||
}
|
||||
|
||||
public static unsafe void SendUnlinkContext(
|
||||
ProtocolSplashMessaging _priv_protocolInstance,
|
||||
ContextID idContextExisting,
|
||||
ContextID idContextAlias)
|
||||
{
|
||||
RenderPort _priv_portUse;
|
||||
Message* _priv_pmsgUse;
|
||||
RemoteContextRelay.BuildUnlinkContext(out _priv_portUse, out _priv_pmsgUse, _priv_protocolInstance, idContextExisting, idContextAlias);
|
||||
_priv_portUse.SendRemoteMessage(_priv_pmsgUse);
|
||||
}
|
||||
|
||||
public static unsafe void BuildLinkContext(
|
||||
out RenderPort _priv_portUse,
|
||||
out Message* _priv_pmsgUse,
|
||||
ProtocolSplashMessaging _priv_protocolInstance,
|
||||
ContextID idContextExisting,
|
||||
ContextID idContextAlias)
|
||||
{
|
||||
RenderPort port = _priv_protocolInstance.Port;
|
||||
_priv_portUse = port;
|
||||
RENDERHANDLE relayClassHandle = _priv_protocolInstance.ContextRelay_ClassHandle;
|
||||
_priv_portUse.ValidateHandle(relayClassHandle);
|
||||
uint size = (uint) sizeof (RemoteContextRelay.Msg1_LinkContext);
|
||||
RemoteContextRelay.Msg1_LinkContext* msg1LinkContextPtr = (RemoteContextRelay.Msg1_LinkContext*) _priv_portUse.AllocMessageBuffer(size);
|
||||
msg1LinkContextPtr->_priv_size = size;
|
||||
msg1LinkContextPtr->_priv_msgid = 1U;
|
||||
msg1LinkContextPtr->idContextExisting = idContextExisting;
|
||||
msg1LinkContextPtr->idContextAlias = idContextAlias;
|
||||
msg1LinkContextPtr->_priv_idObjectSubject = relayClassHandle;
|
||||
if (_priv_portUse.ForeignByteOrder)
|
||||
MarshalHelper.SwapByteOrder((byte*) msg1LinkContextPtr, ref RemoteContextRelay.s_priv_ByteOrder_Msg1_LinkContext, typeof (RemoteContextRelay.Msg1_LinkContext), 0, 0);
|
||||
_priv_pmsgUse = (Message*) msg1LinkContextPtr;
|
||||
}
|
||||
|
||||
public static unsafe void SendLinkContext(
|
||||
ProtocolSplashMessaging _priv_protocolInstance,
|
||||
ContextID idContextExisting,
|
||||
ContextID idContextAlias)
|
||||
{
|
||||
RenderPort _priv_portUse;
|
||||
Message* _priv_pmsgUse;
|
||||
RemoteContextRelay.BuildLinkContext(out _priv_portUse, out _priv_pmsgUse, _priv_protocolInstance, idContextExisting, idContextAlias);
|
||||
_priv_portUse.SendRemoteMessage(_priv_pmsgUse);
|
||||
}
|
||||
|
||||
public static RemoteContextRelay CreateFromHandle(
|
||||
RenderPort port,
|
||||
RENDERHANDLE handle)
|
||||
{
|
||||
return new RemoteContextRelay(port, handle, true);
|
||||
}
|
||||
|
||||
public static RemoteContextRelay CreateFromExternalHandle(
|
||||
RenderPort port,
|
||||
RENDERHANDLE handle,
|
||||
IRenderHandleOwner owner)
|
||||
{
|
||||
port.RegisterKnownHandle(owner, handle);
|
||||
return new RemoteContextRelay(port, handle, false);
|
||||
}
|
||||
|
||||
protected RemoteContextRelay(RenderPort port, RENDERHANDLE handle, bool fFreeOnDispose)
|
||||
: base(port, handle, fFreeOnDispose)
|
||||
{
|
||||
}
|
||||
|
||||
protected RemoteContextRelay(RenderPort port, IRenderHandleOwner owner)
|
||||
: base(port, owner)
|
||||
{
|
||||
}
|
||||
|
||||
public override bool Equals(object other) => other is RemoteContextRelay && this.m_renderHandle == ((RemoteObject) other).m_renderHandle;
|
||||
|
||||
public override int GetHashCode() => base.GetHashCode();
|
||||
|
||||
[ComVisible(false)]
|
||||
private struct Msg2_Create
|
||||
{
|
||||
public uint _priv_size;
|
||||
public uint _priv_msgid;
|
||||
public RENDERHANDLE _priv_idObjectSubject;
|
||||
public TransportProtocol protocol;
|
||||
public BLOBREF stServer;
|
||||
public BLOBREF stSession;
|
||||
}
|
||||
|
||||
[ComVisible(false)]
|
||||
private struct Msg0_UnlinkContext
|
||||
{
|
||||
public uint _priv_size;
|
||||
public uint _priv_msgid;
|
||||
public RENDERHANDLE _priv_idObjectSubject;
|
||||
public ContextID idContextExisting;
|
||||
public ContextID idContextAlias;
|
||||
}
|
||||
|
||||
[ComVisible(false)]
|
||||
private struct Msg1_LinkContext
|
||||
{
|
||||
public uint _priv_size;
|
||||
public uint _priv_msgid;
|
||||
public RENDERHANDLE _priv_idObjectSubject;
|
||||
public ContextID idContextExisting;
|
||||
public ContextID idContextAlias;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+74
-74
@@ -10,80 +10,80 @@ using System.Runtime.InteropServices;
|
||||
|
||||
namespace Microsoft.Iris.Render.Protocols.Splash.Messaging
|
||||
{
|
||||
internal class RemoteDataBuffer : RemoteObject
|
||||
{
|
||||
private static ushort[] s_priv_ByteOrder_Msg0_RegisterOwner;
|
||||
|
||||
protected RemoteDataBuffer()
|
||||
internal class RemoteDataBuffer : RemoteObject
|
||||
{
|
||||
private static ushort[] s_priv_ByteOrder_Msg0_RegisterOwner;
|
||||
|
||||
protected RemoteDataBuffer()
|
||||
{
|
||||
}
|
||||
|
||||
public unsafe void BuildRegisterOwner(
|
||||
out RenderPort _priv_portUse,
|
||||
out Message* _priv_pmsgUse,
|
||||
LocalDataBufferCallback cb)
|
||||
{
|
||||
Debug2.Throw(this.IsValid, "Non-static method call requires an instance");
|
||||
_priv_portUse = this.m_renderPort;
|
||||
_priv_portUse.ValidateHandle(this.m_renderHandle);
|
||||
uint size = (uint)sizeof(RemoteDataBuffer.Msg0_RegisterOwner);
|
||||
RemoteDataBuffer.Msg0_RegisterOwner* msg0RegisterOwnerPtr = (RemoteDataBuffer.Msg0_RegisterOwner*)_priv_portUse.AllocMessageBuffer(size);
|
||||
msg0RegisterOwnerPtr->_priv_size = size;
|
||||
msg0RegisterOwnerPtr->_priv_msgid = 0U;
|
||||
msg0RegisterOwnerPtr->_priv_objcb = cb.RenderHandle;
|
||||
msg0RegisterOwnerPtr->_priv_ctxcb = _priv_portUse.Session.LocalContext;
|
||||
msg0RegisterOwnerPtr->_priv_idObjectSubject = this.m_renderHandle;
|
||||
if (_priv_portUse.ForeignByteOrder)
|
||||
MarshalHelper.SwapByteOrder((byte*)msg0RegisterOwnerPtr, ref RemoteDataBuffer.s_priv_ByteOrder_Msg0_RegisterOwner, typeof(RemoteDataBuffer.Msg0_RegisterOwner), 0, 0);
|
||||
_priv_pmsgUse = (Message*)msg0RegisterOwnerPtr;
|
||||
}
|
||||
|
||||
public unsafe void SendRegisterOwner(LocalDataBufferCallback cb)
|
||||
{
|
||||
RenderPort _priv_portUse;
|
||||
Message* _priv_pmsgUse;
|
||||
this.BuildRegisterOwner(out _priv_portUse, out _priv_pmsgUse, cb);
|
||||
_priv_portUse.SendRemoteMessage(_priv_pmsgUse);
|
||||
}
|
||||
|
||||
public static RemoteDataBuffer CreateFromHandle(
|
||||
RenderPort port,
|
||||
RENDERHANDLE handle)
|
||||
{
|
||||
return new RemoteDataBuffer(port, handle, true);
|
||||
}
|
||||
|
||||
public static RemoteDataBuffer CreateFromExternalHandle(
|
||||
RenderPort port,
|
||||
RENDERHANDLE handle,
|
||||
IRenderHandleOwner owner)
|
||||
{
|
||||
port.RegisterKnownHandle(owner, handle);
|
||||
return new RemoteDataBuffer(port, handle, false);
|
||||
}
|
||||
|
||||
protected RemoteDataBuffer(RenderPort port, RENDERHANDLE handle, bool fFreeOnDispose)
|
||||
: base(port, handle, fFreeOnDispose)
|
||||
{
|
||||
}
|
||||
|
||||
protected RemoteDataBuffer(RenderPort port, IRenderHandleOwner owner)
|
||||
: base(port, owner)
|
||||
{
|
||||
}
|
||||
|
||||
public override bool Equals(object other) => other is RemoteDataBuffer && this.m_renderHandle == ((RemoteObject)other).m_renderHandle;
|
||||
|
||||
public override int GetHashCode() => base.GetHashCode();
|
||||
|
||||
[ComVisible(false)]
|
||||
private struct Msg0_RegisterOwner
|
||||
{
|
||||
public uint _priv_size;
|
||||
public uint _priv_msgid;
|
||||
public RENDERHANDLE _priv_idObjectSubject;
|
||||
public RENDERHANDLE _priv_objcb;
|
||||
public ContextID _priv_ctxcb;
|
||||
}
|
||||
}
|
||||
|
||||
public unsafe void BuildRegisterOwner(
|
||||
out RenderPort _priv_portUse,
|
||||
out Message* _priv_pmsgUse,
|
||||
LocalDataBufferCallback cb)
|
||||
{
|
||||
Debug2.Throw(this.IsValid, "Non-static method call requires an instance");
|
||||
_priv_portUse = this.m_renderPort;
|
||||
_priv_portUse.ValidateHandle(this.m_renderHandle);
|
||||
uint size = (uint) sizeof (RemoteDataBuffer.Msg0_RegisterOwner);
|
||||
RemoteDataBuffer.Msg0_RegisterOwner* msg0RegisterOwnerPtr = (RemoteDataBuffer.Msg0_RegisterOwner*) _priv_portUse.AllocMessageBuffer(size);
|
||||
msg0RegisterOwnerPtr->_priv_size = size;
|
||||
msg0RegisterOwnerPtr->_priv_msgid = 0U;
|
||||
msg0RegisterOwnerPtr->_priv_objcb = cb.RenderHandle;
|
||||
msg0RegisterOwnerPtr->_priv_ctxcb = _priv_portUse.Session.LocalContext;
|
||||
msg0RegisterOwnerPtr->_priv_idObjectSubject = this.m_renderHandle;
|
||||
if (_priv_portUse.ForeignByteOrder)
|
||||
MarshalHelper.SwapByteOrder((byte*) msg0RegisterOwnerPtr, ref RemoteDataBuffer.s_priv_ByteOrder_Msg0_RegisterOwner, typeof (RemoteDataBuffer.Msg0_RegisterOwner), 0, 0);
|
||||
_priv_pmsgUse = (Message*) msg0RegisterOwnerPtr;
|
||||
}
|
||||
|
||||
public unsafe void SendRegisterOwner(LocalDataBufferCallback cb)
|
||||
{
|
||||
RenderPort _priv_portUse;
|
||||
Message* _priv_pmsgUse;
|
||||
this.BuildRegisterOwner(out _priv_portUse, out _priv_pmsgUse, cb);
|
||||
_priv_portUse.SendRemoteMessage(_priv_pmsgUse);
|
||||
}
|
||||
|
||||
public static RemoteDataBuffer CreateFromHandle(
|
||||
RenderPort port,
|
||||
RENDERHANDLE handle)
|
||||
{
|
||||
return new RemoteDataBuffer(port, handle, true);
|
||||
}
|
||||
|
||||
public static RemoteDataBuffer CreateFromExternalHandle(
|
||||
RenderPort port,
|
||||
RENDERHANDLE handle,
|
||||
IRenderHandleOwner owner)
|
||||
{
|
||||
port.RegisterKnownHandle(owner, handle);
|
||||
return new RemoteDataBuffer(port, handle, false);
|
||||
}
|
||||
|
||||
protected RemoteDataBuffer(RenderPort port, RENDERHANDLE handle, bool fFreeOnDispose)
|
||||
: base(port, handle, fFreeOnDispose)
|
||||
{
|
||||
}
|
||||
|
||||
protected RemoteDataBuffer(RenderPort port, IRenderHandleOwner owner)
|
||||
: base(port, owner)
|
||||
{
|
||||
}
|
||||
|
||||
public override bool Equals(object other) => other is RemoteDataBuffer && this.m_renderHandle == ((RemoteObject) other).m_renderHandle;
|
||||
|
||||
public override int GetHashCode() => base.GetHashCode();
|
||||
|
||||
[ComVisible(false)]
|
||||
private struct Msg0_RegisterOwner
|
||||
{
|
||||
public uint _priv_size;
|
||||
public uint _priv_msgid;
|
||||
public RENDERHANDLE _priv_idObjectSubject;
|
||||
public RENDERHANDLE _priv_objcb;
|
||||
public ContextID _priv_ctxcb;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user