mirror of
https://github.com/ZuneDev/MicrosoftIris.git
synced 2026-07-27 13:13:29 -07:00
Clean up EngineApi.cs
This commit is contained in:
@@ -4,12 +4,12 @@
|
|||||||
// MVID: D47658B8-A8EA-43D6-8837-ECE823BFFFC1
|
// MVID: D47658B8-A8EA-43D6-8837-ECE823BFFFC1
|
||||||
// Assembly location: C:\Program Files\Zune\UIX.RenderApi.dll
|
// Assembly location: C:\Program Files\Zune\UIX.RenderApi.dll
|
||||||
|
|
||||||
using Microsoft.Iris.Render.Common;
|
|
||||||
using Microsoft.Iris.Render.Internal;
|
|
||||||
using System;
|
using System;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
using System.Runtime.InteropServices;
|
using System.Runtime.InteropServices;
|
||||||
using System.Security;
|
using System.Security;
|
||||||
|
using Microsoft.Iris.Render.Common;
|
||||||
|
using Microsoft.Iris.Render.Internal;
|
||||||
|
|
||||||
namespace Microsoft.Iris.Render.Protocol
|
namespace Microsoft.Iris.Render.Protocol
|
||||||
{
|
{
|
||||||
@@ -22,7 +22,7 @@ namespace Microsoft.Iris.Render.Protocol
|
|||||||
{
|
{
|
||||||
if (hr.Int >= 0)
|
if (hr.Int >= 0)
|
||||||
return;
|
return;
|
||||||
RenderException.ErrorCode code = (RenderException.ErrorCode)hr.Int;
|
var code = (RenderException.ErrorCode)hr.Int;
|
||||||
switch (hr.Int)
|
switch (hr.Int)
|
||||||
{
|
{
|
||||||
case -2147221503:
|
case -2147221503:
|
||||||
@@ -102,76 +102,76 @@ namespace Microsoft.Iris.Render.Protocol
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
[DllImport("UIXRender.dll")]
|
[DllImport(s_stEhRenderDll)]
|
||||||
public static extern HRESULT SpInit(ref EngineApi.InitArgs args);
|
public static extern HRESULT SpInit(ref InitArgs args);
|
||||||
|
|
||||||
[DllImport("UIXRender.dll")]
|
[DllImport(s_stEhRenderDll)]
|
||||||
public static extern HRESULT SpUninit();
|
public static extern HRESULT SpUninit();
|
||||||
|
|
||||||
[DllImport("UIXRender.dll")]
|
[DllImport(s_stEhRenderDll)]
|
||||||
public static extern unsafe HRESULT SpBufferOpen(
|
public static extern unsafe HRESULT SpBufferOpen(
|
||||||
EngineApi.BufferInfo* phdrData,
|
BufferInfo* phdrData,
|
||||||
void* pvData);
|
void* pvData);
|
||||||
|
|
||||||
[DllImport("UIXRender.dll")]
|
[DllImport(s_stEhRenderDll)]
|
||||||
public static extern unsafe HRESULT SpWrapBufferProc(
|
public static extern unsafe HRESULT SpWrapBufferProc(
|
||||||
EngineApi.MessageBufferEventHandler pfnProcessBufferProc,
|
MessageBufferEventHandler pfnProcessBufferProc,
|
||||||
IntPtr* ppNativeProc);
|
IntPtr* ppNativeProc);
|
||||||
|
|
||||||
[DllImport("UIXRender.dll", CharSet = CharSet.Auto)]
|
[DllImport(s_stEhRenderDll, CharSet = CharSet.Auto)]
|
||||||
public static extern HRESULT SpPeekMessage(
|
public static extern HRESULT SpPeekMessage(
|
||||||
out Win32Api.MSG msg,
|
out Win32Api.MSG msg,
|
||||||
HWND hwnd,
|
HWND hwnd,
|
||||||
uint nMsgFilterMin,
|
uint nMsgFilterMin,
|
||||||
uint nMsgFilterMax,
|
uint nMsgFilterMax,
|
||||||
uint wRemoveMsg,
|
uint wRemoveMsg,
|
||||||
out EngineApi.WorkResult nResult);
|
out WorkResult nResult);
|
||||||
|
|
||||||
[DllImport("UIXRender.dll")]
|
[DllImport(s_stEhRenderDll)]
|
||||||
public static extern HRESULT SpWaitMessage(uint nTimeOutMs, IntPtr _unused);
|
public static extern HRESULT SpWaitMessage(uint nTimeOutMs, IntPtr _unused);
|
||||||
|
|
||||||
[DllImport("UIXRender.dll")]
|
[DllImport(s_stEhRenderDll)]
|
||||||
public static extern HRESULT SpInvoke(
|
public static extern HRESULT SpInvoke(
|
||||||
ContextID idContext,
|
ContextID idContext,
|
||||||
IntPtr pfnInvoke,
|
IntPtr pfnInvoke,
|
||||||
IntPtr pvArgs,
|
IntPtr pvArgs,
|
||||||
bool synchronous);
|
bool synchronous);
|
||||||
|
|
||||||
[DllImport("UIXRender.dll")]
|
[DllImport(s_stEhRenderDll)]
|
||||||
public static extern HRESULT SpRenderThreadInit(
|
public static extern HRESULT SpRenderThreadInit(
|
||||||
ref EngineApi.InitArgs argsRender,
|
ref InitArgs argsRender,
|
||||||
out IntPtr pThread);
|
out IntPtr pThread);
|
||||||
|
|
||||||
[DllImport("UIXRender.dll")]
|
[DllImport(s_stEhRenderDll)]
|
||||||
public static extern HRESULT SpRenderThreadUninit(IntPtr pThread);
|
public static extern HRESULT SpRenderThreadUninit(IntPtr pThread);
|
||||||
|
|
||||||
[DllImport("UIXRender.dll", CharSet = CharSet.Unicode)]
|
[DllImport(s_stEhRenderDll, CharSet = CharSet.Unicode)]
|
||||||
public static extern HRESULT SpRemoteCreateServerStreams(
|
public static extern HRESULT SpRemoteCreateServerStreams(
|
||||||
string stSession,
|
string stSession,
|
||||||
TransportProtocol nProtocol,
|
TransportProtocol nProtocol,
|
||||||
out IntPtr pSendStream,
|
out IntPtr pSendStream,
|
||||||
out IntPtr pReceiveStream);
|
out IntPtr pReceiveStream);
|
||||||
|
|
||||||
[DllImport("UIXRender.dll")]
|
[DllImport(s_stEhRenderDll)]
|
||||||
public static extern HRESULT SpRemoteWaitServerStreamsConnected(
|
public static extern HRESULT SpRemoteWaitServerStreamsConnected(
|
||||||
TransportProtocol nProtocol,
|
TransportProtocol nProtocol,
|
||||||
IntPtr pSendStream,
|
IntPtr pSendStream,
|
||||||
IntPtr pReceiveStream);
|
IntPtr pReceiveStream);
|
||||||
|
|
||||||
[DllImport("UIXRender.dll")]
|
[DllImport(s_stEhRenderDll)]
|
||||||
public static extern HRESULT SpRemoteServerInit(
|
public static extern HRESULT SpRemoteServerInit(
|
||||||
IntPtr pSendStream,
|
IntPtr pSendStream,
|
||||||
IntPtr pReceiveStream,
|
IntPtr pReceiveStream,
|
||||||
EngineApi.InitArgs argsSend,
|
InitArgs argsSend,
|
||||||
out IntPtr pSession);
|
out IntPtr pSession);
|
||||||
|
|
||||||
[DllImport("UIXRender.dll")]
|
[DllImport(s_stEhRenderDll)]
|
||||||
public static extern HRESULT SpRemoteServerUninit(
|
public static extern HRESULT SpRemoteServerUninit(
|
||||||
IntPtr pSession,
|
IntPtr pSession,
|
||||||
bool fForceShutdown,
|
bool fForceShutdown,
|
||||||
out ShutdownReason nShutdownReason);
|
out ShutdownReason nShutdownReason);
|
||||||
|
|
||||||
[DllImport("UIXRender.dll", CharSet = CharSet.Ansi)]
|
[DllImport(s_stEhRenderDll, CharSet = CharSet.Ansi)]
|
||||||
public static extern HRESULT SpDx9CompileEffect(
|
public static extern HRESULT SpDx9CompileEffect(
|
||||||
string stEffect,
|
string stEffect,
|
||||||
string stDefines,
|
string stDefines,
|
||||||
@@ -181,10 +181,10 @@ namespace Microsoft.Iris.Render.Protocol
|
|||||||
out uint EffectBlobSize,
|
out uint EffectBlobSize,
|
||||||
out IntPtr pEffectBlobBuffer);
|
out IntPtr pEffectBlobBuffer);
|
||||||
|
|
||||||
[DllImport("UIXRender.dll")]
|
[DllImport(s_stEhRenderDll)]
|
||||||
public static extern void SpObjectRelease(IntPtr pUnknown);
|
public static extern void SpObjectRelease(IntPtr pUnknown);
|
||||||
|
|
||||||
[System.Flags]
|
[Flags]
|
||||||
public enum BufferFlags
|
public enum BufferFlags
|
||||||
{
|
{
|
||||||
IsBatch = 1,
|
IsBatch = 1,
|
||||||
@@ -198,7 +198,7 @@ namespace Microsoft.Iris.Render.Protocol
|
|||||||
public ContextID idContextSrc;
|
public ContextID idContextSrc;
|
||||||
public ContextID idContextDest;
|
public ContextID idContextDest;
|
||||||
public RENDERHANDLE idBuffer;
|
public RENDERHANDLE idBuffer;
|
||||||
public EngineApi.BufferFlags nFlags;
|
public BufferFlags nFlags;
|
||||||
public uint cbSizeBuffer;
|
public uint cbSizeBuffer;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -214,46 +214,46 @@ namespace Microsoft.Iris.Render.Protocol
|
|||||||
public IntPtr pfnProcessBuffer;
|
public IntPtr pfnProcessBuffer;
|
||||||
public IntPtr pvProcessData;
|
public IntPtr pvProcessData;
|
||||||
public RENDERHANDLE idObjectBrokerClass;
|
public RENDERHANDLE idObjectBrokerClass;
|
||||||
public EngineApi.TimeoutEventHandler pfnTimeout;
|
public TimeoutEventHandler pfnTimeout;
|
||||||
public IntPtr pvTimeoutData;
|
public IntPtr pvTimeoutData;
|
||||||
public uint nTimeOutSec;
|
public uint nTimeOutSec;
|
||||||
|
|
||||||
public InitArgs(MessageCookieLayout layout, ContextID idContextNew)
|
public InitArgs(MessageCookieLayout layout, ContextID idContextNew)
|
||||||
{
|
{
|
||||||
Debug2.Validate(idContextNew != ContextID.NULL, typeof(ArgumentNullException), nameof(idContextNew));
|
Debug2.Validate(idContextNew != ContextID.NULL, typeof(ArgumentNullException), nameof(idContextNew));
|
||||||
this.cbSize = (uint)Marshal.SizeOf(typeof(EngineApi.InitArgs));
|
cbSize = (uint)Marshal.SizeOf(typeof(InitArgs));
|
||||||
this.idContext = idContextNew;
|
idContext = idContextNew;
|
||||||
this.cItemsPerGroupBits = layout.numberOfObjectBits;
|
cItemsPerGroupBits = layout.numberOfObjectBits;
|
||||||
this.cGroupBits = layout.numberOfGroupBits;
|
cGroupBits = layout.numberOfGroupBits;
|
||||||
this.pfnProcessBuffer = IntPtr.Zero;
|
pfnProcessBuffer = IntPtr.Zero;
|
||||||
this.pvProcessData = IntPtr.Zero;
|
pvProcessData = IntPtr.Zero;
|
||||||
this.idObjectBrokerClass = RENDERHANDLE.FromUInt32(0U);
|
idObjectBrokerClass = RENDERHANDLE.FromUInt32(0U);
|
||||||
this.pfnTimeout = null;
|
pfnTimeout = null;
|
||||||
this.pvTimeoutData = IntPtr.Zero;
|
pvTimeoutData = IntPtr.Zero;
|
||||||
this.nTimeOutSec = 0U;
|
nTimeOutSec = 0U;
|
||||||
}
|
}
|
||||||
|
|
||||||
public unsafe InitArgs(
|
public unsafe InitArgs(
|
||||||
MessageCookieLayout layout,
|
MessageCookieLayout layout,
|
||||||
ContextID idContextNew,
|
ContextID idContextNew,
|
||||||
EngineApi.MessageBufferEventHandler pfnProcessBufferProc)
|
MessageBufferEventHandler pfnProcessBufferProc)
|
||||||
: this(layout, idContextNew)
|
: this(layout, idContextNew)
|
||||||
{
|
{
|
||||||
if (pfnProcessBufferProc == null)
|
if (pfnProcessBufferProc == null)
|
||||||
return;
|
return;
|
||||||
IntPtr num;
|
IntPtr num;
|
||||||
IFC(SpWrapBufferProc(pfnProcessBufferProc, &num));
|
IFC(SpWrapBufferProc(pfnProcessBufferProc, &num));
|
||||||
this.pfnProcessBuffer = num;
|
pfnProcessBuffer = num;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
internal unsafe delegate int MessageBufferEventHandler(
|
internal unsafe delegate int MessageBufferEventHandler(
|
||||||
IntPtr pData,
|
IntPtr pData,
|
||||||
uint hContext,
|
uint hContext,
|
||||||
EngineApi.BufferInfo* pBufferInfo,
|
BufferInfo* pBufferInfo,
|
||||||
void* pvBufferData);
|
void* pvBufferData);
|
||||||
|
|
||||||
[System.Flags]
|
[Flags]
|
||||||
public enum WorkResult : uint
|
public enum WorkResult : uint
|
||||||
{
|
{
|
||||||
ProcessedMessage = 1,
|
ProcessedMessage = 1,
|
||||||
|
|||||||
Reference in New Issue
Block a user