Initial commit: Complete open-source Decal rebuild
All 5 phases of the open-source Decal rebuild: Phase 1: 14 decompiled .NET projects (Interop.*, Adapter, FileService, DecalUtil) Phase 2: 10 native DLLs rewritten as C# COM servers with matching GUIDs - DecalDat, DHS, SpellFilter, DecalInput, DecalNet, DecalFilters - Decal.Core, DecalControls, DecalRender, D3DService Phase 3: C++ shims for Inject.DLL (D3D9 hooking) and LauncherHook.DLL Phase 4: DenAgent WinForms tray application Phase 5: WiX installer and build script 25 C# projects building with 0 errors. Native C++ projects require VS 2022 + Windows SDK (x86). Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
commit
d1442e3747
1382 changed files with 170725 additions and 0 deletions
8
Managed/Decal.Interop.Input/Decal.Interop.Input.csproj
Normal file
8
Managed/Decal.Interop.Input/Decal.Interop.Input.csproj
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
<PropertyGroup>
|
||||
<AssemblyName>Decal.Interop.Input</AssemblyName>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\Decal.Interop.Core\Decal.Interop.Core.csproj" />
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
|
|
@ -0,0 +1,10 @@
|
|||
using System.Runtime.InteropServices;
|
||||
|
||||
namespace Decal.Interop.Input;
|
||||
|
||||
[ComImport]
|
||||
[CoClass(typeof(DelayActionClass))]
|
||||
[Guid("C73A3F3D-8286-4250-BF97-155EE341E42F")]
|
||||
public interface DelayAction : IInputAction
|
||||
{
|
||||
}
|
||||
|
|
@ -0,0 +1,38 @@
|
|||
using System.Runtime.CompilerServices;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Security;
|
||||
|
||||
namespace Decal.Interop.Input;
|
||||
|
||||
[ComImport]
|
||||
[SuppressUnmanagedCodeSecurity]
|
||||
[ClassInterface(ClassInterfaceType.None)]
|
||||
[Guid("324D76B8-D8C7-4A81-B867-E4E1F874E488")]
|
||||
[TypeLibType(2)]
|
||||
public class DelayActionClass : IInputAction, DelayAction
|
||||
{
|
||||
[DispId(1610678274)]
|
||||
public virtual extern bool Stackable
|
||||
{
|
||||
[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
|
||||
get;
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
|
||||
public virtual extern void Initialize([MarshalAs(UnmanagedType.Interface)] IInputActionSite pSite, [MarshalAs(UnmanagedType.BStr)] string strData);
|
||||
|
||||
[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
|
||||
public virtual extern void Terminate();
|
||||
|
||||
[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
|
||||
public virtual extern void Reset();
|
||||
|
||||
[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
|
||||
public virtual extern void Push();
|
||||
|
||||
[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
|
||||
public virtual extern void Pop();
|
||||
|
||||
[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
|
||||
public virtual extern void Execute();
|
||||
}
|
||||
|
|
@ -0,0 +1,10 @@
|
|||
using System.Runtime.InteropServices;
|
||||
|
||||
namespace Decal.Interop.Input;
|
||||
|
||||
[ComImport]
|
||||
[CoClass(typeof(EventActionClass))]
|
||||
[Guid("C73A3F3D-8286-4250-BF97-155EE341E42F")]
|
||||
public interface EventAction : IInputAction
|
||||
{
|
||||
}
|
||||
|
|
@ -0,0 +1,38 @@
|
|||
using System.Runtime.CompilerServices;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Security;
|
||||
|
||||
namespace Decal.Interop.Input;
|
||||
|
||||
[ComImport]
|
||||
[Guid("D6E4BD19-4900-4515-BCE2-A9EA4AAE2699")]
|
||||
[ClassInterface(ClassInterfaceType.None)]
|
||||
[TypeLibType(2)]
|
||||
[SuppressUnmanagedCodeSecurity]
|
||||
public class EventActionClass : IInputAction, EventAction
|
||||
{
|
||||
[DispId(1610678274)]
|
||||
public virtual extern bool Stackable
|
||||
{
|
||||
[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
|
||||
get;
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
|
||||
public virtual extern void Initialize([MarshalAs(UnmanagedType.Interface)] IInputActionSite pSite, [MarshalAs(UnmanagedType.BStr)] string strData);
|
||||
|
||||
[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
|
||||
public virtual extern void Terminate();
|
||||
|
||||
[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
|
||||
public virtual extern void Reset();
|
||||
|
||||
[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
|
||||
public virtual extern void Push();
|
||||
|
||||
[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
|
||||
public virtual extern void Pop();
|
||||
|
||||
[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
|
||||
public virtual extern void Execute();
|
||||
}
|
||||
10
Managed/Decal.Interop.Input/Decal.Interop.Input/Hotkey.cs
Normal file
10
Managed/Decal.Interop.Input/Decal.Interop.Input/Hotkey.cs
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
using System.Runtime.InteropServices;
|
||||
|
||||
namespace Decal.Interop.Input;
|
||||
|
||||
[ComImport]
|
||||
[Guid("95AF8DF7-F2A0-476E-9D8C-B23493B1698D")]
|
||||
[CoClass(typeof(HotkeyClass))]
|
||||
public interface Hotkey : IHotkey, IHotkeyEvents_Event
|
||||
{
|
||||
}
|
||||
|
|
@ -0,0 +1,56 @@
|
|||
using System.Runtime.CompilerServices;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Security;
|
||||
|
||||
namespace Decal.Interop.Input;
|
||||
|
||||
[ComImport]
|
||||
[SuppressUnmanagedCodeSecurity]
|
||||
[Guid("F183506A-3664-49D6-8CA4-CFD295F2811D")]
|
||||
[TypeLibType(2)]
|
||||
[ClassInterface(ClassInterfaceType.None)]
|
||||
[ComSourceInterfaces("Decal.Interop.Input.IHotkeyEvents\0\0")]
|
||||
public class HotkeyClass : IHotkey, Hotkey, IHotkeyEvents_Event
|
||||
{
|
||||
[DispId(1)]
|
||||
public virtual extern object Tag
|
||||
{
|
||||
[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
|
||||
[DispId(1)]
|
||||
[return: MarshalAs(UnmanagedType.Struct)]
|
||||
get;
|
||||
[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
|
||||
[DispId(1)]
|
||||
[param: In]
|
||||
[param: MarshalAs(UnmanagedType.Struct)]
|
||||
set;
|
||||
}
|
||||
|
||||
[DispId(2)]
|
||||
public virtual extern string Key
|
||||
{
|
||||
[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
|
||||
[DispId(2)]
|
||||
[return: MarshalAs(UnmanagedType.BStr)]
|
||||
get;
|
||||
[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
|
||||
[DispId(2)]
|
||||
[param: In]
|
||||
[param: MarshalAs(UnmanagedType.BStr)]
|
||||
set;
|
||||
}
|
||||
|
||||
[DispId(3)]
|
||||
public virtual extern bool Enabled
|
||||
{
|
||||
[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
|
||||
[DispId(3)]
|
||||
get;
|
||||
[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
|
||||
[DispId(3)]
|
||||
[param: In]
|
||||
set;
|
||||
}
|
||||
|
||||
public virtual extern event IHotkeyEvents_HotkeyEventHandler Hotkey;
|
||||
}
|
||||
|
|
@ -0,0 +1,42 @@
|
|||
using System.Runtime.CompilerServices;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Security;
|
||||
|
||||
namespace Decal.Interop.Input;
|
||||
|
||||
[ComImport]
|
||||
[TypeLibType(4160)]
|
||||
[SuppressUnmanagedCodeSecurity]
|
||||
[Guid("6CE124D7-534E-4BB6-AAF2-2BE22F69326D")]
|
||||
public interface IDecalTimer
|
||||
{
|
||||
[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
|
||||
[DispId(1)]
|
||||
void Start(int Interval);
|
||||
|
||||
[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
|
||||
[DispId(2)]
|
||||
void Stop();
|
||||
|
||||
[DispId(3)]
|
||||
object Tag
|
||||
{
|
||||
[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
|
||||
[DispId(3)]
|
||||
[return: MarshalAs(UnmanagedType.Struct)]
|
||||
get;
|
||||
[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
|
||||
[DispId(3)]
|
||||
[param: In]
|
||||
[param: MarshalAs(UnmanagedType.Struct)]
|
||||
set;
|
||||
}
|
||||
|
||||
[DispId(4)]
|
||||
bool Running
|
||||
{
|
||||
[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
|
||||
[DispId(4)]
|
||||
get;
|
||||
}
|
||||
}
|
||||
52
Managed/Decal.Interop.Input/Decal.Interop.Input/IHotkey.cs
Normal file
52
Managed/Decal.Interop.Input/Decal.Interop.Input/IHotkey.cs
Normal file
|
|
@ -0,0 +1,52 @@
|
|||
using System.Runtime.CompilerServices;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Security;
|
||||
|
||||
namespace Decal.Interop.Input;
|
||||
|
||||
[ComImport]
|
||||
[TypeLibType(4160)]
|
||||
[Guid("95AF8DF7-F2A0-476E-9D8C-B23493B1698D")]
|
||||
[SuppressUnmanagedCodeSecurity]
|
||||
public interface IHotkey
|
||||
{
|
||||
[DispId(1)]
|
||||
object Tag
|
||||
{
|
||||
[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
|
||||
[DispId(1)]
|
||||
[return: MarshalAs(UnmanagedType.Struct)]
|
||||
get;
|
||||
[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
|
||||
[DispId(1)]
|
||||
[param: In]
|
||||
[param: MarshalAs(UnmanagedType.Struct)]
|
||||
set;
|
||||
}
|
||||
|
||||
[DispId(2)]
|
||||
string Key
|
||||
{
|
||||
[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
|
||||
[DispId(2)]
|
||||
[return: MarshalAs(UnmanagedType.BStr)]
|
||||
get;
|
||||
[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
|
||||
[DispId(2)]
|
||||
[param: In]
|
||||
[param: MarshalAs(UnmanagedType.BStr)]
|
||||
set;
|
||||
}
|
||||
|
||||
[DispId(3)]
|
||||
bool Enabled
|
||||
{
|
||||
[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
|
||||
[DispId(3)]
|
||||
get;
|
||||
[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
|
||||
[DispId(3)]
|
||||
[param: In]
|
||||
set;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,17 @@
|
|||
using System.Runtime.CompilerServices;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Security;
|
||||
|
||||
namespace Decal.Interop.Input;
|
||||
|
||||
[ComImport]
|
||||
[TypeLibType(4096)]
|
||||
[InterfaceType(2)]
|
||||
[Guid("15EAEB82-6EC8-4A09-8FA3-2D691BBB732F")]
|
||||
[SuppressUnmanagedCodeSecurity]
|
||||
public interface IHotkeyEvents
|
||||
{
|
||||
[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
|
||||
[DispId(1)]
|
||||
void Hotkey([MarshalAs(UnmanagedType.Interface)] Hotkey Source);
|
||||
}
|
||||
|
|
@ -0,0 +1,10 @@
|
|||
using System.Runtime.InteropServices;
|
||||
|
||||
namespace Decal.Interop.Input;
|
||||
|
||||
[ComVisible(false)]
|
||||
[TypeLibType(16)]
|
||||
public interface IHotkeyEvents_Event
|
||||
{
|
||||
event IHotkeyEvents_HotkeyEventHandler Hotkey;
|
||||
}
|
||||
|
|
@ -0,0 +1,154 @@
|
|||
using System;
|
||||
using System.Collections;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Runtime.InteropServices.ComTypes;
|
||||
using System.Threading;
|
||||
|
||||
namespace Decal.Interop.Input;
|
||||
|
||||
internal sealed class IHotkeyEvents_EventProvider : IHotkeyEvents_Event, IDisposable
|
||||
{
|
||||
private IConnectionPointContainer m_ConnectionPointContainer;
|
||||
|
||||
private ArrayList m_aEventSinkHelpers;
|
||||
|
||||
private IConnectionPoint m_ConnectionPoint;
|
||||
|
||||
private void Init()
|
||||
{
|
||||
IConnectionPoint ppCP = null;
|
||||
Guid riid = new Guid(new byte[16]
|
||||
{
|
||||
130, 235, 234, 21, 200, 110, 9, 74, 143, 163,
|
||||
45, 105, 27, 187, 115, 47
|
||||
});
|
||||
m_ConnectionPointContainer.FindConnectionPoint(ref riid, out ppCP);
|
||||
m_ConnectionPoint = ppCP;
|
||||
m_aEventSinkHelpers = new ArrayList();
|
||||
}
|
||||
|
||||
event IHotkeyEvents_HotkeyEventHandler IHotkeyEvents_Event.Hotkey
|
||||
{
|
||||
add
|
||||
{
|
||||
|
||||
bool lockTaken = default(bool);
|
||||
try
|
||||
{
|
||||
Monitor.Enter(this, ref lockTaken);
|
||||
if (m_ConnectionPoint == null)
|
||||
{
|
||||
Init();
|
||||
}
|
||||
IHotkeyEvents_SinkHelper hotkeyEvents_SinkHelper = new IHotkeyEvents_SinkHelper();
|
||||
int pdwCookie = 0;
|
||||
m_ConnectionPoint.Advise(hotkeyEvents_SinkHelper, out pdwCookie);
|
||||
hotkeyEvents_SinkHelper.m_dwCookie = pdwCookie;
|
||||
hotkeyEvents_SinkHelper.m_HotkeyDelegate = value;
|
||||
m_aEventSinkHelpers.Add(hotkeyEvents_SinkHelper);
|
||||
}
|
||||
finally
|
||||
{
|
||||
if (lockTaken)
|
||||
{
|
||||
Monitor.Exit(this);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
remove
|
||||
{
|
||||
|
||||
bool lockTaken = default(bool);
|
||||
try
|
||||
{
|
||||
Monitor.Enter(this, ref lockTaken);
|
||||
if (m_aEventSinkHelpers == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
int count = m_aEventSinkHelpers.Count;
|
||||
int num = 0;
|
||||
if (0 >= count)
|
||||
{
|
||||
return;
|
||||
}
|
||||
do
|
||||
{
|
||||
IHotkeyEvents_SinkHelper hotkeyEvents_SinkHelper = (IHotkeyEvents_SinkHelper)m_aEventSinkHelpers[num];
|
||||
if (hotkeyEvents_SinkHelper.m_HotkeyDelegate != null && ((hotkeyEvents_SinkHelper.m_HotkeyDelegate.Equals(value) ? 1u : 0u) & 0xFFu) != 0)
|
||||
{
|
||||
m_aEventSinkHelpers.RemoveAt(num);
|
||||
m_ConnectionPoint.Unadvise(hotkeyEvents_SinkHelper.m_dwCookie);
|
||||
if (count <= 1)
|
||||
{
|
||||
Marshal.ReleaseComObject(m_ConnectionPoint);
|
||||
m_ConnectionPoint = null;
|
||||
m_aEventSinkHelpers = null;
|
||||
}
|
||||
break;
|
||||
}
|
||||
num++;
|
||||
}
|
||||
while (num < count);
|
||||
}
|
||||
finally
|
||||
{
|
||||
if (lockTaken)
|
||||
{
|
||||
Monitor.Exit(this);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
public IHotkeyEvents_EventProvider(object P_0)
|
||||
{
|
||||
//Error decoding local variables: Signature type sequence must have at least one element.
|
||||
m_ConnectionPointContainer = (IConnectionPointContainer)P_0;
|
||||
}
|
||||
|
||||
public void Finalize()
|
||||
{
|
||||
bool lockTaken = default(bool);
|
||||
try
|
||||
{
|
||||
Monitor.Enter(this, ref lockTaken);
|
||||
if (m_ConnectionPoint == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
int count = m_aEventSinkHelpers.Count;
|
||||
int num = 0;
|
||||
if (0 < count)
|
||||
{
|
||||
do
|
||||
{
|
||||
IHotkeyEvents_SinkHelper hotkeyEvents_SinkHelper = (IHotkeyEvents_SinkHelper)m_aEventSinkHelpers[num];
|
||||
m_ConnectionPoint.Unadvise(hotkeyEvents_SinkHelper.m_dwCookie);
|
||||
num++;
|
||||
}
|
||||
while (num < count);
|
||||
}
|
||||
Marshal.ReleaseComObject(m_ConnectionPoint);
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
}
|
||||
finally
|
||||
{
|
||||
if (lockTaken)
|
||||
{
|
||||
Monitor.Exit(this);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void Dispose()
|
||||
{
|
||||
//Error decoding local variables: Signature type sequence must have at least one element.
|
||||
Finalize();
|
||||
GC.SuppressFinalize(this);
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,6 @@
|
|||
using System.Runtime.InteropServices;
|
||||
|
||||
namespace Decal.Interop.Input;
|
||||
|
||||
[ComVisible(false)]
|
||||
public delegate void IHotkeyEvents_HotkeyEventHandler([MarshalAs(UnmanagedType.Interface)] Hotkey Source);
|
||||
|
|
@ -0,0 +1,28 @@
|
|||
using System.Runtime.InteropServices;
|
||||
|
||||
namespace Decal.Interop.Input;
|
||||
|
||||
[TypeLibType(TypeLibTypeFlags.FHidden)]
|
||||
[ClassInterface(ClassInterfaceType.None)]
|
||||
public sealed class IHotkeyEvents_SinkHelper : IHotkeyEvents
|
||||
{
|
||||
public IHotkeyEvents_HotkeyEventHandler m_HotkeyDelegate;
|
||||
|
||||
public int m_dwCookie;
|
||||
|
||||
public void Hotkey(Hotkey P_0)
|
||||
{
|
||||
//Error decoding local variables: Signature type sequence must have at least one element.
|
||||
if (m_HotkeyDelegate != null)
|
||||
{
|
||||
m_HotkeyDelegate(P_0);
|
||||
}
|
||||
}
|
||||
|
||||
internal IHotkeyEvents_SinkHelper()
|
||||
{
|
||||
//Error decoding local variables: Signature type sequence must have at least one element.
|
||||
m_dwCookie = 0;
|
||||
m_HotkeyDelegate = null;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,37 @@
|
|||
using System.Runtime.CompilerServices;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Security;
|
||||
|
||||
namespace Decal.Interop.Input;
|
||||
|
||||
[ComImport]
|
||||
[Guid("C73A3F3D-8286-4250-BF97-155EE341E42F")]
|
||||
[SuppressUnmanagedCodeSecurity]
|
||||
[InterfaceType(1)]
|
||||
public interface IInputAction
|
||||
{
|
||||
[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
|
||||
void Initialize([MarshalAs(UnmanagedType.Interface)] IInputActionSite pSite, [MarshalAs(UnmanagedType.BStr)] string strData);
|
||||
|
||||
[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
|
||||
void Terminate();
|
||||
|
||||
[DispId(1610678274)]
|
||||
bool Stackable
|
||||
{
|
||||
[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
|
||||
get;
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
|
||||
void Reset();
|
||||
|
||||
[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
|
||||
void Push();
|
||||
|
||||
[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
|
||||
void Pop();
|
||||
|
||||
[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
|
||||
void Execute();
|
||||
}
|
||||
|
|
@ -0,0 +1,29 @@
|
|||
using System.Runtime.CompilerServices;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Security;
|
||||
|
||||
namespace Decal.Interop.Input;
|
||||
|
||||
[ComImport]
|
||||
[SuppressUnmanagedCodeSecurity]
|
||||
[InterfaceType(1)]
|
||||
[Guid("1751F4E5-4E11-42F1-A00F-ED5B1D899C66")]
|
||||
public interface IInputActionSite
|
||||
{
|
||||
[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
|
||||
void Delay(int Time, bool Advance);
|
||||
|
||||
[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
|
||||
void FireEvent(int nEventID, [MarshalAs(UnmanagedType.Struct)] object vParam);
|
||||
|
||||
[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
|
||||
void MoveMouse(int X, int Y);
|
||||
|
||||
[DispId(1610678275)]
|
||||
InputService Service
|
||||
{
|
||||
[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
|
||||
[return: MarshalAs(UnmanagedType.Interface)]
|
||||
get;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,54 @@
|
|||
using System.Runtime.CompilerServices;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Security;
|
||||
|
||||
namespace Decal.Interop.Input;
|
||||
|
||||
[ComImport]
|
||||
[SuppressUnmanagedCodeSecurity]
|
||||
[TypeLibType(4160)]
|
||||
[Guid("B772FDC3-36AD-4957-9143-5A10FBDA6D1D")]
|
||||
public interface IInputBuffer
|
||||
{
|
||||
[DispId(1)]
|
||||
object Tag
|
||||
{
|
||||
[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
|
||||
[DispId(1)]
|
||||
[return: MarshalAs(UnmanagedType.Struct)]
|
||||
get;
|
||||
[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
|
||||
[DispId(1)]
|
||||
[param: In]
|
||||
[param: MarshalAs(UnmanagedType.Struct)]
|
||||
set;
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
|
||||
[DispId(2)]
|
||||
void Add([MarshalAs(UnmanagedType.BStr)] string Command);
|
||||
|
||||
[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
|
||||
[DispId(3)]
|
||||
void Push([MarshalAs(UnmanagedType.BStr)] string Command);
|
||||
|
||||
[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
|
||||
[DispId(4)]
|
||||
void Pop();
|
||||
|
||||
[DispId(5)]
|
||||
bool CanRun
|
||||
{
|
||||
[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
|
||||
[DispId(5)]
|
||||
get;
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
|
||||
[DispId(6)]
|
||||
void Run();
|
||||
|
||||
[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
|
||||
[DispId(7)]
|
||||
void Stop();
|
||||
}
|
||||
|
|
@ -0,0 +1,25 @@
|
|||
using System.Runtime.CompilerServices;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Security;
|
||||
|
||||
namespace Decal.Interop.Input;
|
||||
|
||||
[ComImport]
|
||||
[TypeLibType(4096)]
|
||||
[InterfaceType(2)]
|
||||
[Guid("04CD59E6-672E-45A6-AE0A-454B1F59377A")]
|
||||
[SuppressUnmanagedCodeSecurity]
|
||||
public interface IInputBufferEvents
|
||||
{
|
||||
[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
|
||||
[DispId(1)]
|
||||
void Begin([MarshalAs(UnmanagedType.Interface)] InputBuffer Buffer);
|
||||
|
||||
[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
|
||||
[DispId(2)]
|
||||
void End([MarshalAs(UnmanagedType.Interface)] InputBuffer Buffer);
|
||||
|
||||
[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
|
||||
[DispId(3)]
|
||||
void Event([MarshalAs(UnmanagedType.Interface)] InputBuffer Buffer, int EventID, [MarshalAs(UnmanagedType.Struct)] object Param);
|
||||
}
|
||||
|
|
@ -0,0 +1,6 @@
|
|||
using System.Runtime.InteropServices;
|
||||
|
||||
namespace Decal.Interop.Input;
|
||||
|
||||
[ComVisible(false)]
|
||||
public delegate void IInputBufferEvents_BeginEventHandler([MarshalAs(UnmanagedType.Interface)] InputBuffer Buffer);
|
||||
|
|
@ -0,0 +1,6 @@
|
|||
using System.Runtime.InteropServices;
|
||||
|
||||
namespace Decal.Interop.Input;
|
||||
|
||||
[ComVisible(false)]
|
||||
public delegate void IInputBufferEvents_EndEventHandler([MarshalAs(UnmanagedType.Interface)] InputBuffer Buffer);
|
||||
|
|
@ -0,0 +1,14 @@
|
|||
using System.Runtime.InteropServices;
|
||||
|
||||
namespace Decal.Interop.Input;
|
||||
|
||||
[TypeLibType(16)]
|
||||
[ComVisible(false)]
|
||||
public interface IInputBufferEvents_Event
|
||||
{
|
||||
event IInputBufferEvents_BeginEventHandler Begin;
|
||||
|
||||
event IInputBufferEvents_EndEventHandler End;
|
||||
|
||||
event IInputBufferEvents_EventEventHandler Event;
|
||||
}
|
||||
|
|
@ -0,0 +1,6 @@
|
|||
using System.Runtime.InteropServices;
|
||||
|
||||
namespace Decal.Interop.Input;
|
||||
|
||||
[ComVisible(false)]
|
||||
public delegate void IInputBufferEvents_EventEventHandler([MarshalAs(UnmanagedType.Interface)] InputBuffer Buffer, int EventID, [MarshalAs(UnmanagedType.Struct)] object Param);
|
||||
|
|
@ -0,0 +1,306 @@
|
|||
using System;
|
||||
using System.Collections;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Runtime.InteropServices.ComTypes;
|
||||
using System.Threading;
|
||||
|
||||
namespace Decal.Interop.Input;
|
||||
|
||||
internal sealed class IInputBufferEvents_EventProvider : IInputBufferEvents_Event, IDisposable
|
||||
{
|
||||
private IConnectionPointContainer m_ConnectionPointContainer;
|
||||
|
||||
private ArrayList m_aEventSinkHelpers;
|
||||
|
||||
private IConnectionPoint m_ConnectionPoint;
|
||||
|
||||
private void Init()
|
||||
{
|
||||
IConnectionPoint ppCP = null;
|
||||
Guid riid = new Guid(new byte[16]
|
||||
{
|
||||
230, 89, 205, 4, 46, 103, 166, 69, 174, 10,
|
||||
69, 75, 31, 89, 55, 122
|
||||
});
|
||||
m_ConnectionPointContainer.FindConnectionPoint(ref riid, out ppCP);
|
||||
m_ConnectionPoint = ppCP;
|
||||
m_aEventSinkHelpers = new ArrayList();
|
||||
}
|
||||
|
||||
event IInputBufferEvents_BeginEventHandler IInputBufferEvents_Event.Begin
|
||||
{
|
||||
add
|
||||
{
|
||||
|
||||
bool lockTaken = default(bool);
|
||||
try
|
||||
{
|
||||
Monitor.Enter(this, ref lockTaken);
|
||||
if (m_ConnectionPoint == null)
|
||||
{
|
||||
Init();
|
||||
}
|
||||
IInputBufferEvents_SinkHelper inputBufferEvents_SinkHelper = new IInputBufferEvents_SinkHelper();
|
||||
int pdwCookie = 0;
|
||||
m_ConnectionPoint.Advise(inputBufferEvents_SinkHelper, out pdwCookie);
|
||||
inputBufferEvents_SinkHelper.m_dwCookie = pdwCookie;
|
||||
inputBufferEvents_SinkHelper.m_BeginDelegate = value;
|
||||
m_aEventSinkHelpers.Add(inputBufferEvents_SinkHelper);
|
||||
}
|
||||
finally
|
||||
{
|
||||
if (lockTaken)
|
||||
{
|
||||
Monitor.Exit(this);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
remove
|
||||
{
|
||||
|
||||
bool lockTaken = default(bool);
|
||||
try
|
||||
{
|
||||
Monitor.Enter(this, ref lockTaken);
|
||||
if (m_aEventSinkHelpers == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
int count = m_aEventSinkHelpers.Count;
|
||||
int num = 0;
|
||||
if (0 >= count)
|
||||
{
|
||||
return;
|
||||
}
|
||||
do
|
||||
{
|
||||
IInputBufferEvents_SinkHelper inputBufferEvents_SinkHelper = (IInputBufferEvents_SinkHelper)m_aEventSinkHelpers[num];
|
||||
if (inputBufferEvents_SinkHelper.m_BeginDelegate != null && ((inputBufferEvents_SinkHelper.m_BeginDelegate.Equals(value) ? 1u : 0u) & 0xFFu) != 0)
|
||||
{
|
||||
m_aEventSinkHelpers.RemoveAt(num);
|
||||
m_ConnectionPoint.Unadvise(inputBufferEvents_SinkHelper.m_dwCookie);
|
||||
if (count <= 1)
|
||||
{
|
||||
Marshal.ReleaseComObject(m_ConnectionPoint);
|
||||
m_ConnectionPoint = null;
|
||||
m_aEventSinkHelpers = null;
|
||||
}
|
||||
break;
|
||||
}
|
||||
num++;
|
||||
}
|
||||
while (num < count);
|
||||
}
|
||||
finally
|
||||
{
|
||||
if (lockTaken)
|
||||
{
|
||||
Monitor.Exit(this);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
event IInputBufferEvents_EndEventHandler IInputBufferEvents_Event.End
|
||||
{
|
||||
add
|
||||
{
|
||||
|
||||
bool lockTaken = default(bool);
|
||||
try
|
||||
{
|
||||
Monitor.Enter(this, ref lockTaken);
|
||||
if (m_ConnectionPoint == null)
|
||||
{
|
||||
Init();
|
||||
}
|
||||
IInputBufferEvents_SinkHelper inputBufferEvents_SinkHelper = new IInputBufferEvents_SinkHelper();
|
||||
int pdwCookie = 0;
|
||||
m_ConnectionPoint.Advise(inputBufferEvents_SinkHelper, out pdwCookie);
|
||||
inputBufferEvents_SinkHelper.m_dwCookie = pdwCookie;
|
||||
inputBufferEvents_SinkHelper.m_EndDelegate = value;
|
||||
m_aEventSinkHelpers.Add(inputBufferEvents_SinkHelper);
|
||||
}
|
||||
finally
|
||||
{
|
||||
if (lockTaken)
|
||||
{
|
||||
Monitor.Exit(this);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
remove
|
||||
{
|
||||
|
||||
bool lockTaken = default(bool);
|
||||
try
|
||||
{
|
||||
Monitor.Enter(this, ref lockTaken);
|
||||
if (m_aEventSinkHelpers == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
int count = m_aEventSinkHelpers.Count;
|
||||
int num = 0;
|
||||
if (0 >= count)
|
||||
{
|
||||
return;
|
||||
}
|
||||
do
|
||||
{
|
||||
IInputBufferEvents_SinkHelper inputBufferEvents_SinkHelper = (IInputBufferEvents_SinkHelper)m_aEventSinkHelpers[num];
|
||||
if (inputBufferEvents_SinkHelper.m_EndDelegate != null && ((inputBufferEvents_SinkHelper.m_EndDelegate.Equals(value) ? 1u : 0u) & 0xFFu) != 0)
|
||||
{
|
||||
m_aEventSinkHelpers.RemoveAt(num);
|
||||
m_ConnectionPoint.Unadvise(inputBufferEvents_SinkHelper.m_dwCookie);
|
||||
if (count <= 1)
|
||||
{
|
||||
Marshal.ReleaseComObject(m_ConnectionPoint);
|
||||
m_ConnectionPoint = null;
|
||||
m_aEventSinkHelpers = null;
|
||||
}
|
||||
break;
|
||||
}
|
||||
num++;
|
||||
}
|
||||
while (num < count);
|
||||
}
|
||||
finally
|
||||
{
|
||||
if (lockTaken)
|
||||
{
|
||||
Monitor.Exit(this);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
event IInputBufferEvents_EventEventHandler IInputBufferEvents_Event.Event
|
||||
{
|
||||
add
|
||||
{
|
||||
|
||||
bool lockTaken = default(bool);
|
||||
try
|
||||
{
|
||||
Monitor.Enter(this, ref lockTaken);
|
||||
if (m_ConnectionPoint == null)
|
||||
{
|
||||
Init();
|
||||
}
|
||||
IInputBufferEvents_SinkHelper inputBufferEvents_SinkHelper = new IInputBufferEvents_SinkHelper();
|
||||
int pdwCookie = 0;
|
||||
m_ConnectionPoint.Advise(inputBufferEvents_SinkHelper, out pdwCookie);
|
||||
inputBufferEvents_SinkHelper.m_dwCookie = pdwCookie;
|
||||
inputBufferEvents_SinkHelper.m_EventDelegate = value;
|
||||
m_aEventSinkHelpers.Add(inputBufferEvents_SinkHelper);
|
||||
}
|
||||
finally
|
||||
{
|
||||
if (lockTaken)
|
||||
{
|
||||
Monitor.Exit(this);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
remove
|
||||
{
|
||||
|
||||
bool lockTaken = default(bool);
|
||||
try
|
||||
{
|
||||
Monitor.Enter(this, ref lockTaken);
|
||||
if (m_aEventSinkHelpers == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
int count = m_aEventSinkHelpers.Count;
|
||||
int num = 0;
|
||||
if (0 >= count)
|
||||
{
|
||||
return;
|
||||
}
|
||||
do
|
||||
{
|
||||
IInputBufferEvents_SinkHelper inputBufferEvents_SinkHelper = (IInputBufferEvents_SinkHelper)m_aEventSinkHelpers[num];
|
||||
if (inputBufferEvents_SinkHelper.m_EventDelegate != null && ((inputBufferEvents_SinkHelper.m_EventDelegate.Equals(value) ? 1u : 0u) & 0xFFu) != 0)
|
||||
{
|
||||
m_aEventSinkHelpers.RemoveAt(num);
|
||||
m_ConnectionPoint.Unadvise(inputBufferEvents_SinkHelper.m_dwCookie);
|
||||
if (count <= 1)
|
||||
{
|
||||
Marshal.ReleaseComObject(m_ConnectionPoint);
|
||||
m_ConnectionPoint = null;
|
||||
m_aEventSinkHelpers = null;
|
||||
}
|
||||
break;
|
||||
}
|
||||
num++;
|
||||
}
|
||||
while (num < count);
|
||||
}
|
||||
finally
|
||||
{
|
||||
if (lockTaken)
|
||||
{
|
||||
Monitor.Exit(this);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
public IInputBufferEvents_EventProvider(object P_0)
|
||||
{
|
||||
//Error decoding local variables: Signature type sequence must have at least one element.
|
||||
m_ConnectionPointContainer = (IConnectionPointContainer)P_0;
|
||||
}
|
||||
|
||||
public void Finalize()
|
||||
{
|
||||
bool lockTaken = default(bool);
|
||||
try
|
||||
{
|
||||
Monitor.Enter(this, ref lockTaken);
|
||||
if (m_ConnectionPoint == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
int count = m_aEventSinkHelpers.Count;
|
||||
int num = 0;
|
||||
if (0 < count)
|
||||
{
|
||||
do
|
||||
{
|
||||
IInputBufferEvents_SinkHelper inputBufferEvents_SinkHelper = (IInputBufferEvents_SinkHelper)m_aEventSinkHelpers[num];
|
||||
m_ConnectionPoint.Unadvise(inputBufferEvents_SinkHelper.m_dwCookie);
|
||||
num++;
|
||||
}
|
||||
while (num < count);
|
||||
}
|
||||
Marshal.ReleaseComObject(m_ConnectionPoint);
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
}
|
||||
finally
|
||||
{
|
||||
if (lockTaken)
|
||||
{
|
||||
Monitor.Exit(this);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void Dispose()
|
||||
{
|
||||
//Error decoding local variables: Signature type sequence must have at least one element.
|
||||
Finalize();
|
||||
GC.SuppressFinalize(this);
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,52 @@
|
|||
using System.Runtime.InteropServices;
|
||||
|
||||
namespace Decal.Interop.Input;
|
||||
|
||||
[TypeLibType(TypeLibTypeFlags.FHidden)]
|
||||
[ClassInterface(ClassInterfaceType.None)]
|
||||
public sealed class IInputBufferEvents_SinkHelper : IInputBufferEvents
|
||||
{
|
||||
public IInputBufferEvents_BeginEventHandler m_BeginDelegate;
|
||||
|
||||
public IInputBufferEvents_EndEventHandler m_EndDelegate;
|
||||
|
||||
public IInputBufferEvents_EventEventHandler m_EventDelegate;
|
||||
|
||||
public int m_dwCookie;
|
||||
|
||||
public void Begin(InputBuffer P_0)
|
||||
{
|
||||
//Error decoding local variables: Signature type sequence must have at least one element.
|
||||
if (m_BeginDelegate != null)
|
||||
{
|
||||
m_BeginDelegate(P_0);
|
||||
}
|
||||
}
|
||||
|
||||
public void End(InputBuffer P_0)
|
||||
{
|
||||
//Error decoding local variables: Signature type sequence must have at least one element.
|
||||
if (m_EndDelegate != null)
|
||||
{
|
||||
m_EndDelegate(P_0);
|
||||
}
|
||||
}
|
||||
|
||||
public void Event(InputBuffer P_0, int P_1, object P_2)
|
||||
{
|
||||
//Error decoding local variables: Signature type sequence must have at least one element.
|
||||
if (m_EventDelegate != null)
|
||||
{
|
||||
m_EventDelegate(P_0, P_1, P_2);
|
||||
}
|
||||
}
|
||||
|
||||
internal IInputBufferEvents_SinkHelper()
|
||||
{
|
||||
//Error decoding local variables: Signature type sequence must have at least one element.
|
||||
m_dwCookie = 0;
|
||||
m_BeginDelegate = null;
|
||||
m_EndDelegate = null;
|
||||
m_EventDelegate = null;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,30 @@
|
|||
using System.Runtime.CompilerServices;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Security;
|
||||
using Decal.Interop.Core;
|
||||
|
||||
namespace Decal.Interop.Input;
|
||||
|
||||
[ComImport]
|
||||
[TypeLibType(4160)]
|
||||
[SuppressUnmanagedCodeSecurity]
|
||||
[Guid("27A63073-10D6-4282-85CF-77E4DEB8C6B8")]
|
||||
public interface IInputService
|
||||
{
|
||||
[DispId(1610743808)]
|
||||
DecalCore Decal
|
||||
{
|
||||
[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
|
||||
[DispId(1610743808)]
|
||||
[return: MarshalAs(UnmanagedType.Interface)]
|
||||
get;
|
||||
}
|
||||
|
||||
[DispId(1610743809)]
|
||||
int KeyByName
|
||||
{
|
||||
[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
|
||||
[DispId(1610743809)]
|
||||
get;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,17 @@
|
|||
using System.Runtime.CompilerServices;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Security;
|
||||
|
||||
namespace Decal.Interop.Input;
|
||||
|
||||
[ComImport]
|
||||
[InterfaceType(2)]
|
||||
[Guid("BBF25010-50FE-4398-BB78-BF8B9D392915")]
|
||||
[TypeLibType(4096)]
|
||||
[SuppressUnmanagedCodeSecurity]
|
||||
public interface ITimerEvents
|
||||
{
|
||||
[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
|
||||
[DispId(1)]
|
||||
void Timeout([MarshalAs(UnmanagedType.Interface)] Timer Source);
|
||||
}
|
||||
|
|
@ -0,0 +1,10 @@
|
|||
using System.Runtime.InteropServices;
|
||||
|
||||
namespace Decal.Interop.Input;
|
||||
|
||||
[TypeLibType(16)]
|
||||
[ComVisible(false)]
|
||||
public interface ITimerEvents_Event
|
||||
{
|
||||
event ITimerEvents_TimeoutEventHandler Timeout;
|
||||
}
|
||||
|
|
@ -0,0 +1,154 @@
|
|||
using System;
|
||||
using System.Collections;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Runtime.InteropServices.ComTypes;
|
||||
using System.Threading;
|
||||
|
||||
namespace Decal.Interop.Input;
|
||||
|
||||
internal sealed class ITimerEvents_EventProvider : ITimerEvents_Event, IDisposable
|
||||
{
|
||||
private IConnectionPointContainer m_ConnectionPointContainer;
|
||||
|
||||
private ArrayList m_aEventSinkHelpers;
|
||||
|
||||
private IConnectionPoint m_ConnectionPoint;
|
||||
|
||||
private void Init()
|
||||
{
|
||||
IConnectionPoint ppCP = null;
|
||||
Guid riid = new Guid(new byte[16]
|
||||
{
|
||||
16, 80, 242, 187, 254, 80, 152, 67, 187, 120,
|
||||
191, 139, 157, 57, 41, 21
|
||||
});
|
||||
m_ConnectionPointContainer.FindConnectionPoint(ref riid, out ppCP);
|
||||
m_ConnectionPoint = ppCP;
|
||||
m_aEventSinkHelpers = new ArrayList();
|
||||
}
|
||||
|
||||
event ITimerEvents_TimeoutEventHandler ITimerEvents_Event.Timeout
|
||||
{
|
||||
add
|
||||
{
|
||||
|
||||
bool lockTaken = default(bool);
|
||||
try
|
||||
{
|
||||
Monitor.Enter(this, ref lockTaken);
|
||||
if (m_ConnectionPoint == null)
|
||||
{
|
||||
Init();
|
||||
}
|
||||
ITimerEvents_SinkHelper timerEvents_SinkHelper = new ITimerEvents_SinkHelper();
|
||||
int pdwCookie = 0;
|
||||
m_ConnectionPoint.Advise(timerEvents_SinkHelper, out pdwCookie);
|
||||
timerEvents_SinkHelper.m_dwCookie = pdwCookie;
|
||||
timerEvents_SinkHelper.m_TimeoutDelegate = value;
|
||||
m_aEventSinkHelpers.Add(timerEvents_SinkHelper);
|
||||
}
|
||||
finally
|
||||
{
|
||||
if (lockTaken)
|
||||
{
|
||||
Monitor.Exit(this);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
remove
|
||||
{
|
||||
|
||||
bool lockTaken = default(bool);
|
||||
try
|
||||
{
|
||||
Monitor.Enter(this, ref lockTaken);
|
||||
if (m_aEventSinkHelpers == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
int count = m_aEventSinkHelpers.Count;
|
||||
int num = 0;
|
||||
if (0 >= count)
|
||||
{
|
||||
return;
|
||||
}
|
||||
do
|
||||
{
|
||||
ITimerEvents_SinkHelper timerEvents_SinkHelper = (ITimerEvents_SinkHelper)m_aEventSinkHelpers[num];
|
||||
if (timerEvents_SinkHelper.m_TimeoutDelegate != null && ((timerEvents_SinkHelper.m_TimeoutDelegate.Equals(value) ? 1u : 0u) & 0xFFu) != 0)
|
||||
{
|
||||
m_aEventSinkHelpers.RemoveAt(num);
|
||||
m_ConnectionPoint.Unadvise(timerEvents_SinkHelper.m_dwCookie);
|
||||
if (count <= 1)
|
||||
{
|
||||
Marshal.ReleaseComObject(m_ConnectionPoint);
|
||||
m_ConnectionPoint = null;
|
||||
m_aEventSinkHelpers = null;
|
||||
}
|
||||
break;
|
||||
}
|
||||
num++;
|
||||
}
|
||||
while (num < count);
|
||||
}
|
||||
finally
|
||||
{
|
||||
if (lockTaken)
|
||||
{
|
||||
Monitor.Exit(this);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
public ITimerEvents_EventProvider(object P_0)
|
||||
{
|
||||
//Error decoding local variables: Signature type sequence must have at least one element.
|
||||
m_ConnectionPointContainer = (IConnectionPointContainer)P_0;
|
||||
}
|
||||
|
||||
public void Finalize()
|
||||
{
|
||||
bool lockTaken = default(bool);
|
||||
try
|
||||
{
|
||||
Monitor.Enter(this, ref lockTaken);
|
||||
if (m_ConnectionPoint == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
int count = m_aEventSinkHelpers.Count;
|
||||
int num = 0;
|
||||
if (0 < count)
|
||||
{
|
||||
do
|
||||
{
|
||||
ITimerEvents_SinkHelper timerEvents_SinkHelper = (ITimerEvents_SinkHelper)m_aEventSinkHelpers[num];
|
||||
m_ConnectionPoint.Unadvise(timerEvents_SinkHelper.m_dwCookie);
|
||||
num++;
|
||||
}
|
||||
while (num < count);
|
||||
}
|
||||
Marshal.ReleaseComObject(m_ConnectionPoint);
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
}
|
||||
finally
|
||||
{
|
||||
if (lockTaken)
|
||||
{
|
||||
Monitor.Exit(this);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void Dispose()
|
||||
{
|
||||
//Error decoding local variables: Signature type sequence must have at least one element.
|
||||
Finalize();
|
||||
GC.SuppressFinalize(this);
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,28 @@
|
|||
using System.Runtime.InteropServices;
|
||||
|
||||
namespace Decal.Interop.Input;
|
||||
|
||||
[ClassInterface(ClassInterfaceType.None)]
|
||||
[TypeLibType(TypeLibTypeFlags.FHidden)]
|
||||
public sealed class ITimerEvents_SinkHelper : ITimerEvents
|
||||
{
|
||||
public ITimerEvents_TimeoutEventHandler m_TimeoutDelegate;
|
||||
|
||||
public int m_dwCookie;
|
||||
|
||||
public void Timeout(Timer P_0)
|
||||
{
|
||||
//Error decoding local variables: Signature type sequence must have at least one element.
|
||||
if (m_TimeoutDelegate != null)
|
||||
{
|
||||
m_TimeoutDelegate(P_0);
|
||||
}
|
||||
}
|
||||
|
||||
internal ITimerEvents_SinkHelper()
|
||||
{
|
||||
//Error decoding local variables: Signature type sequence must have at least one element.
|
||||
m_dwCookie = 0;
|
||||
m_TimeoutDelegate = null;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,6 @@
|
|||
using System.Runtime.InteropServices;
|
||||
|
||||
namespace Decal.Interop.Input;
|
||||
|
||||
[ComVisible(false)]
|
||||
public delegate void ITimerEvents_TimeoutEventHandler([MarshalAs(UnmanagedType.Interface)] Timer Source);
|
||||
|
|
@ -0,0 +1,38 @@
|
|||
using System.Runtime.CompilerServices;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Security;
|
||||
|
||||
namespace Decal.Interop.Input;
|
||||
|
||||
[ComImport]
|
||||
[SuppressUnmanagedCodeSecurity]
|
||||
[Guid("F4E4EA59-0E47-4BAD-819A-722F5FFD506F")]
|
||||
[TypeLibType(4160)]
|
||||
public interface IWinMsgHook
|
||||
{
|
||||
[DispId(1)]
|
||||
object Tag
|
||||
{
|
||||
[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
|
||||
[DispId(1)]
|
||||
[return: MarshalAs(UnmanagedType.Struct)]
|
||||
get;
|
||||
[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
|
||||
[DispId(1)]
|
||||
[param: In]
|
||||
[param: MarshalAs(UnmanagedType.Struct)]
|
||||
set;
|
||||
}
|
||||
|
||||
[DispId(2)]
|
||||
bool Enabled
|
||||
{
|
||||
[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
|
||||
[DispId(2)]
|
||||
get;
|
||||
[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
|
||||
[DispId(2)]
|
||||
[param: In]
|
||||
set;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,17 @@
|
|||
using System.Runtime.CompilerServices;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Security;
|
||||
|
||||
namespace Decal.Interop.Input;
|
||||
|
||||
[ComImport]
|
||||
[InterfaceType(2)]
|
||||
[SuppressUnmanagedCodeSecurity]
|
||||
[Guid("7E3E2EE8-1E06-4CFD-87D9-E4AEAB4CFE31")]
|
||||
[TypeLibType(4096)]
|
||||
public interface IWinMsgHookEvents
|
||||
{
|
||||
[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
|
||||
[DispId(1)]
|
||||
void Message([MarshalAs(UnmanagedType.Interface)] WinMsgHook Hook, [MarshalAs(UnmanagedType.Interface)] WndMsg Message);
|
||||
}
|
||||
|
|
@ -0,0 +1,10 @@
|
|||
using System.Runtime.InteropServices;
|
||||
|
||||
namespace Decal.Interop.Input;
|
||||
|
||||
[ComVisible(false)]
|
||||
[TypeLibType(16)]
|
||||
public interface IWinMsgHookEvents_Event
|
||||
{
|
||||
event IWinMsgHookEvents_MessageEventHandler Message;
|
||||
}
|
||||
|
|
@ -0,0 +1,154 @@
|
|||
using System;
|
||||
using System.Collections;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Runtime.InteropServices.ComTypes;
|
||||
using System.Threading;
|
||||
|
||||
namespace Decal.Interop.Input;
|
||||
|
||||
internal sealed class IWinMsgHookEvents_EventProvider : IWinMsgHookEvents_Event, IDisposable
|
||||
{
|
||||
private IConnectionPointContainer m_ConnectionPointContainer;
|
||||
|
||||
private ArrayList m_aEventSinkHelpers;
|
||||
|
||||
private IConnectionPoint m_ConnectionPoint;
|
||||
|
||||
private void Init()
|
||||
{
|
||||
IConnectionPoint ppCP = null;
|
||||
Guid riid = new Guid(new byte[16]
|
||||
{
|
||||
232, 46, 62, 126, 6, 30, 253, 76, 135, 217,
|
||||
228, 174, 171, 76, 254, 49
|
||||
});
|
||||
m_ConnectionPointContainer.FindConnectionPoint(ref riid, out ppCP);
|
||||
m_ConnectionPoint = ppCP;
|
||||
m_aEventSinkHelpers = new ArrayList();
|
||||
}
|
||||
|
||||
event IWinMsgHookEvents_MessageEventHandler IWinMsgHookEvents_Event.Message
|
||||
{
|
||||
add
|
||||
{
|
||||
|
||||
bool lockTaken = default(bool);
|
||||
try
|
||||
{
|
||||
Monitor.Enter(this, ref lockTaken);
|
||||
if (m_ConnectionPoint == null)
|
||||
{
|
||||
Init();
|
||||
}
|
||||
IWinMsgHookEvents_SinkHelper winMsgHookEvents_SinkHelper = new IWinMsgHookEvents_SinkHelper();
|
||||
int pdwCookie = 0;
|
||||
m_ConnectionPoint.Advise(winMsgHookEvents_SinkHelper, out pdwCookie);
|
||||
winMsgHookEvents_SinkHelper.m_dwCookie = pdwCookie;
|
||||
winMsgHookEvents_SinkHelper.m_MessageDelegate = value;
|
||||
m_aEventSinkHelpers.Add(winMsgHookEvents_SinkHelper);
|
||||
}
|
||||
finally
|
||||
{
|
||||
if (lockTaken)
|
||||
{
|
||||
Monitor.Exit(this);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
remove
|
||||
{
|
||||
|
||||
bool lockTaken = default(bool);
|
||||
try
|
||||
{
|
||||
Monitor.Enter(this, ref lockTaken);
|
||||
if (m_aEventSinkHelpers == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
int count = m_aEventSinkHelpers.Count;
|
||||
int num = 0;
|
||||
if (0 >= count)
|
||||
{
|
||||
return;
|
||||
}
|
||||
do
|
||||
{
|
||||
IWinMsgHookEvents_SinkHelper winMsgHookEvents_SinkHelper = (IWinMsgHookEvents_SinkHelper)m_aEventSinkHelpers[num];
|
||||
if (winMsgHookEvents_SinkHelper.m_MessageDelegate != null && ((winMsgHookEvents_SinkHelper.m_MessageDelegate.Equals(value) ? 1u : 0u) & 0xFFu) != 0)
|
||||
{
|
||||
m_aEventSinkHelpers.RemoveAt(num);
|
||||
m_ConnectionPoint.Unadvise(winMsgHookEvents_SinkHelper.m_dwCookie);
|
||||
if (count <= 1)
|
||||
{
|
||||
Marshal.ReleaseComObject(m_ConnectionPoint);
|
||||
m_ConnectionPoint = null;
|
||||
m_aEventSinkHelpers = null;
|
||||
}
|
||||
break;
|
||||
}
|
||||
num++;
|
||||
}
|
||||
while (num < count);
|
||||
}
|
||||
finally
|
||||
{
|
||||
if (lockTaken)
|
||||
{
|
||||
Monitor.Exit(this);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
public IWinMsgHookEvents_EventProvider(object P_0)
|
||||
{
|
||||
//Error decoding local variables: Signature type sequence must have at least one element.
|
||||
m_ConnectionPointContainer = (IConnectionPointContainer)P_0;
|
||||
}
|
||||
|
||||
public void Finalize()
|
||||
{
|
||||
bool lockTaken = default(bool);
|
||||
try
|
||||
{
|
||||
Monitor.Enter(this, ref lockTaken);
|
||||
if (m_ConnectionPoint == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
int count = m_aEventSinkHelpers.Count;
|
||||
int num = 0;
|
||||
if (0 < count)
|
||||
{
|
||||
do
|
||||
{
|
||||
IWinMsgHookEvents_SinkHelper winMsgHookEvents_SinkHelper = (IWinMsgHookEvents_SinkHelper)m_aEventSinkHelpers[num];
|
||||
m_ConnectionPoint.Unadvise(winMsgHookEvents_SinkHelper.m_dwCookie);
|
||||
num++;
|
||||
}
|
||||
while (num < count);
|
||||
}
|
||||
Marshal.ReleaseComObject(m_ConnectionPoint);
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
}
|
||||
finally
|
||||
{
|
||||
if (lockTaken)
|
||||
{
|
||||
Monitor.Exit(this);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void Dispose()
|
||||
{
|
||||
//Error decoding local variables: Signature type sequence must have at least one element.
|
||||
Finalize();
|
||||
GC.SuppressFinalize(this);
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,6 @@
|
|||
using System.Runtime.InteropServices;
|
||||
|
||||
namespace Decal.Interop.Input;
|
||||
|
||||
[ComVisible(false)]
|
||||
public delegate void IWinMsgHookEvents_MessageEventHandler([MarshalAs(UnmanagedType.Interface)] WinMsgHook Hook, [MarshalAs(UnmanagedType.Interface)] WndMsg Message);
|
||||
|
|
@ -0,0 +1,28 @@
|
|||
using System.Runtime.InteropServices;
|
||||
|
||||
namespace Decal.Interop.Input;
|
||||
|
||||
[TypeLibType(TypeLibTypeFlags.FHidden)]
|
||||
[ClassInterface(ClassInterfaceType.None)]
|
||||
public sealed class IWinMsgHookEvents_SinkHelper : IWinMsgHookEvents
|
||||
{
|
||||
public IWinMsgHookEvents_MessageEventHandler m_MessageDelegate;
|
||||
|
||||
public int m_dwCookie;
|
||||
|
||||
public void Message(WinMsgHook P_0, WndMsg P_1)
|
||||
{
|
||||
//Error decoding local variables: Signature type sequence must have at least one element.
|
||||
if (m_MessageDelegate != null)
|
||||
{
|
||||
m_MessageDelegate(P_0, P_1);
|
||||
}
|
||||
}
|
||||
|
||||
internal IWinMsgHookEvents_SinkHelper()
|
||||
{
|
||||
//Error decoding local variables: Signature type sequence must have at least one element.
|
||||
m_dwCookie = 0;
|
||||
m_MessageDelegate = null;
|
||||
}
|
||||
}
|
||||
56
Managed/Decal.Interop.Input/Decal.Interop.Input/IWndMsg.cs
Normal file
56
Managed/Decal.Interop.Input/Decal.Interop.Input/IWndMsg.cs
Normal file
|
|
@ -0,0 +1,56 @@
|
|||
using System.Runtime.CompilerServices;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Security;
|
||||
|
||||
namespace Decal.Interop.Input;
|
||||
|
||||
[ComImport]
|
||||
[TypeLibType(4160)]
|
||||
[Guid("BDAD721B-7A00-440D-8964-70427167DD36")]
|
||||
[SuppressUnmanagedCodeSecurity]
|
||||
public interface IWndMsg
|
||||
{
|
||||
[DispId(1)]
|
||||
int HWND
|
||||
{
|
||||
[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
|
||||
[DispId(1)]
|
||||
get;
|
||||
}
|
||||
|
||||
[DispId(2)]
|
||||
int Message
|
||||
{
|
||||
[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
|
||||
[DispId(2)]
|
||||
get;
|
||||
}
|
||||
|
||||
[DispId(3)]
|
||||
int WParam
|
||||
{
|
||||
[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
|
||||
[DispId(3)]
|
||||
get;
|
||||
}
|
||||
|
||||
[DispId(4)]
|
||||
int LParam
|
||||
{
|
||||
[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
|
||||
[DispId(4)]
|
||||
get;
|
||||
}
|
||||
|
||||
[DispId(5)]
|
||||
bool Eat
|
||||
{
|
||||
[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
|
||||
[DispId(5)]
|
||||
get;
|
||||
[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
|
||||
[DispId(5)]
|
||||
[param: In]
|
||||
set;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,10 @@
|
|||
using System.Runtime.InteropServices;
|
||||
|
||||
namespace Decal.Interop.Input;
|
||||
|
||||
[ComImport]
|
||||
[CoClass(typeof(InputBufferClass))]
|
||||
[Guid("B772FDC3-36AD-4957-9143-5A10FBDA6D1D")]
|
||||
public interface InputBuffer : IInputBuffer, IInputBufferEvents_Event
|
||||
{
|
||||
}
|
||||
|
|
@ -0,0 +1,62 @@
|
|||
using System.Runtime.CompilerServices;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Security;
|
||||
|
||||
namespace Decal.Interop.Input;
|
||||
|
||||
[ComImport]
|
||||
[TypeLibType(2)]
|
||||
[ComSourceInterfaces("Decal.Interop.Input.IInputBufferEvents\0\0")]
|
||||
[SuppressUnmanagedCodeSecurity]
|
||||
[ClassInterface(ClassInterfaceType.None)]
|
||||
[Guid("F0A17A04-7F8F-4A17-A41D-8C297A1E929B")]
|
||||
public class InputBufferClass : IInputBuffer, InputBuffer, IInputBufferEvents_Event
|
||||
{
|
||||
[DispId(1)]
|
||||
public virtual extern object Tag
|
||||
{
|
||||
[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
|
||||
[DispId(1)]
|
||||
[return: MarshalAs(UnmanagedType.Struct)]
|
||||
get;
|
||||
[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
|
||||
[DispId(1)]
|
||||
[param: In]
|
||||
[param: MarshalAs(UnmanagedType.Struct)]
|
||||
set;
|
||||
}
|
||||
|
||||
[DispId(5)]
|
||||
public virtual extern bool CanRun
|
||||
{
|
||||
[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
|
||||
[DispId(5)]
|
||||
get;
|
||||
}
|
||||
|
||||
public virtual extern event IInputBufferEvents_BeginEventHandler Begin;
|
||||
|
||||
public virtual extern event IInputBufferEvents_EndEventHandler End;
|
||||
|
||||
public virtual extern event IInputBufferEvents_EventEventHandler Event;
|
||||
|
||||
[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
|
||||
[DispId(2)]
|
||||
public virtual extern void Add([MarshalAs(UnmanagedType.BStr)] string Command);
|
||||
|
||||
[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
|
||||
[DispId(3)]
|
||||
public virtual extern void Push([MarshalAs(UnmanagedType.BStr)] string Command);
|
||||
|
||||
[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
|
||||
[DispId(4)]
|
||||
public virtual extern void Pop();
|
||||
|
||||
[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
|
||||
[DispId(6)]
|
||||
public virtual extern void Run();
|
||||
|
||||
[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
|
||||
[DispId(7)]
|
||||
public virtual extern void Stop();
|
||||
}
|
||||
|
|
@ -0,0 +1,10 @@
|
|||
using System.Runtime.InteropServices;
|
||||
|
||||
namespace Decal.Interop.Input;
|
||||
|
||||
[ComImport]
|
||||
[CoClass(typeof(InputServiceClass))]
|
||||
[Guid("27A63073-10D6-4282-85CF-77E4DEB8C6B8")]
|
||||
public interface InputService : IInputService
|
||||
{
|
||||
}
|
||||
|
|
@ -0,0 +1,31 @@
|
|||
using System.Runtime.CompilerServices;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Security;
|
||||
using Decal.Interop.Core;
|
||||
|
||||
namespace Decal.Interop.Input;
|
||||
|
||||
[ComImport]
|
||||
[TypeLibType(2)]
|
||||
[SuppressUnmanagedCodeSecurity]
|
||||
[Guid("B33307BA-706D-474A-80B9-70BB8D13EF3E")]
|
||||
[ClassInterface(ClassInterfaceType.None)]
|
||||
public class InputServiceClass : IInputService, InputService
|
||||
{
|
||||
[DispId(1610743808)]
|
||||
public virtual extern DecalCore Decal
|
||||
{
|
||||
[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
|
||||
[DispId(1610743808)]
|
||||
[return: MarshalAs(UnmanagedType.Interface)]
|
||||
get;
|
||||
}
|
||||
|
||||
[DispId(1610743809)]
|
||||
public virtual extern int KeyByName
|
||||
{
|
||||
[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
|
||||
[DispId(1610743809)]
|
||||
get;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,10 @@
|
|||
using System.Runtime.InteropServices;
|
||||
|
||||
namespace Decal.Interop.Input;
|
||||
|
||||
[ComImport]
|
||||
[Guid("C73A3F3D-8286-4250-BF97-155EE341E42F")]
|
||||
[CoClass(typeof(MouseMoveActionClass))]
|
||||
public interface MouseMoveAction : IInputAction
|
||||
{
|
||||
}
|
||||
|
|
@ -0,0 +1,38 @@
|
|||
using System.Runtime.CompilerServices;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Security;
|
||||
|
||||
namespace Decal.Interop.Input;
|
||||
|
||||
[ComImport]
|
||||
[TypeLibType(2)]
|
||||
[Guid("57D18578-0BF0-4DE5-A0A9-E7CB531C0429")]
|
||||
[SuppressUnmanagedCodeSecurity]
|
||||
[ClassInterface(ClassInterfaceType.None)]
|
||||
public class MouseMoveActionClass : IInputAction, MouseMoveAction
|
||||
{
|
||||
[DispId(1610678274)]
|
||||
public virtual extern bool Stackable
|
||||
{
|
||||
[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
|
||||
get;
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
|
||||
public virtual extern void Initialize([MarshalAs(UnmanagedType.Interface)] IInputActionSite pSite, [MarshalAs(UnmanagedType.BStr)] string strData);
|
||||
|
||||
[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
|
||||
public virtual extern void Terminate();
|
||||
|
||||
[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
|
||||
public virtual extern void Reset();
|
||||
|
||||
[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
|
||||
public virtual extern void Push();
|
||||
|
||||
[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
|
||||
public virtual extern void Pop();
|
||||
|
||||
[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
|
||||
public virtual extern void Execute();
|
||||
}
|
||||
|
|
@ -0,0 +1,10 @@
|
|||
using System.Runtime.InteropServices;
|
||||
|
||||
namespace Decal.Interop.Input;
|
||||
|
||||
[ComImport]
|
||||
[Guid("C73A3F3D-8286-4250-BF97-155EE341E42F")]
|
||||
[CoClass(typeof(PolledDelayActionClass))]
|
||||
public interface PolledDelayAction : IInputAction
|
||||
{
|
||||
}
|
||||
|
|
@ -0,0 +1,38 @@
|
|||
using System.Runtime.CompilerServices;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Security;
|
||||
|
||||
namespace Decal.Interop.Input;
|
||||
|
||||
[ComImport]
|
||||
[TypeLibType(2)]
|
||||
[SuppressUnmanagedCodeSecurity]
|
||||
[Guid("762335B2-2274-4BB4-8B1F-F7286C949FF7")]
|
||||
[ClassInterface(ClassInterfaceType.None)]
|
||||
public class PolledDelayActionClass : IInputAction, PolledDelayAction
|
||||
{
|
||||
[DispId(1610678274)]
|
||||
public virtual extern bool Stackable
|
||||
{
|
||||
[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
|
||||
get;
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
|
||||
public virtual extern void Initialize([MarshalAs(UnmanagedType.Interface)] IInputActionSite pSite, [MarshalAs(UnmanagedType.BStr)] string strData);
|
||||
|
||||
[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
|
||||
public virtual extern void Terminate();
|
||||
|
||||
[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
|
||||
public virtual extern void Reset();
|
||||
|
||||
[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
|
||||
public virtual extern void Push();
|
||||
|
||||
[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
|
||||
public virtual extern void Pop();
|
||||
|
||||
[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
|
||||
public virtual extern void Execute();
|
||||
}
|
||||
|
|
@ -0,0 +1,10 @@
|
|||
using System.Runtime.InteropServices;
|
||||
|
||||
namespace Decal.Interop.Input;
|
||||
|
||||
[ComImport]
|
||||
[CoClass(typeof(RestoreActionClass))]
|
||||
[Guid("C73A3F3D-8286-4250-BF97-155EE341E42F")]
|
||||
public interface RestoreAction : IInputAction
|
||||
{
|
||||
}
|
||||
|
|
@ -0,0 +1,38 @@
|
|||
using System.Runtime.CompilerServices;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Security;
|
||||
|
||||
namespace Decal.Interop.Input;
|
||||
|
||||
[ComImport]
|
||||
[TypeLibType(2)]
|
||||
[ClassInterface(ClassInterfaceType.None)]
|
||||
[Guid("6EE2F682-7129-44BE-84B9-787BAE35EC1C")]
|
||||
[SuppressUnmanagedCodeSecurity]
|
||||
public class RestoreActionClass : IInputAction, RestoreAction
|
||||
{
|
||||
[DispId(1610678274)]
|
||||
public virtual extern bool Stackable
|
||||
{
|
||||
[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
|
||||
get;
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
|
||||
public virtual extern void Initialize([MarshalAs(UnmanagedType.Interface)] IInputActionSite pSite, [MarshalAs(UnmanagedType.BStr)] string strData);
|
||||
|
||||
[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
|
||||
public virtual extern void Terminate();
|
||||
|
||||
[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
|
||||
public virtual extern void Reset();
|
||||
|
||||
[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
|
||||
public virtual extern void Push();
|
||||
|
||||
[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
|
||||
public virtual extern void Pop();
|
||||
|
||||
[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
|
||||
public virtual extern void Execute();
|
||||
}
|
||||
10
Managed/Decal.Interop.Input/Decal.Interop.Input/Timer.cs
Normal file
10
Managed/Decal.Interop.Input/Decal.Interop.Input/Timer.cs
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
using System.Runtime.InteropServices;
|
||||
|
||||
namespace Decal.Interop.Input;
|
||||
|
||||
[ComImport]
|
||||
[Guid("6CE124D7-534E-4BB6-AAF2-2BE22F69326D")]
|
||||
[CoClass(typeof(TimerClass))]
|
||||
public interface Timer : IDecalTimer, ITimerEvents_Event
|
||||
{
|
||||
}
|
||||
|
|
@ -0,0 +1,46 @@
|
|||
using System.Runtime.CompilerServices;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Security;
|
||||
|
||||
namespace Decal.Interop.Input;
|
||||
|
||||
[ComImport]
|
||||
[Guid("79497C87-92E1-416B-AE5C-9D6C4C59133C")]
|
||||
[ComSourceInterfaces("Decal.Interop.Input.ITimerEvents\0\0")]
|
||||
[SuppressUnmanagedCodeSecurity]
|
||||
[ClassInterface(ClassInterfaceType.None)]
|
||||
[TypeLibType(2)]
|
||||
public class TimerClass : IDecalTimer, Timer, ITimerEvents_Event
|
||||
{
|
||||
[DispId(3)]
|
||||
public virtual extern object Tag
|
||||
{
|
||||
[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
|
||||
[DispId(3)]
|
||||
[return: MarshalAs(UnmanagedType.Struct)]
|
||||
get;
|
||||
[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
|
||||
[DispId(3)]
|
||||
[param: In]
|
||||
[param: MarshalAs(UnmanagedType.Struct)]
|
||||
set;
|
||||
}
|
||||
|
||||
[DispId(4)]
|
||||
public virtual extern bool Running
|
||||
{
|
||||
[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
|
||||
[DispId(4)]
|
||||
get;
|
||||
}
|
||||
|
||||
public virtual extern event ITimerEvents_TimeoutEventHandler Timeout;
|
||||
|
||||
[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
|
||||
[DispId(1)]
|
||||
public virtual extern void Start(int Interval);
|
||||
|
||||
[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
|
||||
[DispId(2)]
|
||||
public virtual extern void Stop();
|
||||
}
|
||||
|
|
@ -0,0 +1,10 @@
|
|||
using System.Runtime.InteropServices;
|
||||
|
||||
namespace Decal.Interop.Input;
|
||||
|
||||
[ComImport]
|
||||
[Guid("C73A3F3D-8286-4250-BF97-155EE341E42F")]
|
||||
[CoClass(typeof(TypeActionClass))]
|
||||
public interface TypeAction : IInputAction
|
||||
{
|
||||
}
|
||||
|
|
@ -0,0 +1,38 @@
|
|||
using System.Runtime.CompilerServices;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Security;
|
||||
|
||||
namespace Decal.Interop.Input;
|
||||
|
||||
[ComImport]
|
||||
[Guid("9CDCEEDC-F8AC-42D5-9A05-52B9346D00A4")]
|
||||
[SuppressUnmanagedCodeSecurity]
|
||||
[ClassInterface(ClassInterfaceType.None)]
|
||||
[TypeLibType(2)]
|
||||
public class TypeActionClass : IInputAction, TypeAction
|
||||
{
|
||||
[DispId(1610678274)]
|
||||
public virtual extern bool Stackable
|
||||
{
|
||||
[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
|
||||
get;
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
|
||||
public virtual extern void Initialize([MarshalAs(UnmanagedType.Interface)] IInputActionSite pSite, [MarshalAs(UnmanagedType.BStr)] string strData);
|
||||
|
||||
[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
|
||||
public virtual extern void Terminate();
|
||||
|
||||
[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
|
||||
public virtual extern void Reset();
|
||||
|
||||
[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
|
||||
public virtual extern void Push();
|
||||
|
||||
[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
|
||||
public virtual extern void Pop();
|
||||
|
||||
[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
|
||||
public virtual extern void Execute();
|
||||
}
|
||||
|
|
@ -0,0 +1,10 @@
|
|||
using System.Runtime.InteropServices;
|
||||
|
||||
namespace Decal.Interop.Input;
|
||||
|
||||
[ComImport]
|
||||
[CoClass(typeof(WinMsgHookClass))]
|
||||
[Guid("F4E4EA59-0E47-4BAD-819A-722F5FFD506F")]
|
||||
public interface WinMsgHook : IWinMsgHook, IWinMsgHookEvents_Event
|
||||
{
|
||||
}
|
||||
|
|
@ -0,0 +1,42 @@
|
|||
using System.Runtime.CompilerServices;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Security;
|
||||
|
||||
namespace Decal.Interop.Input;
|
||||
|
||||
[ComImport]
|
||||
[ClassInterface(ClassInterfaceType.None)]
|
||||
[Guid("F3170E85-517E-43A4-B7B4-6F006A7B1B85")]
|
||||
[SuppressUnmanagedCodeSecurity]
|
||||
[ComSourceInterfaces("Decal.Interop.Input.IWinMsgHookEvents\0\0")]
|
||||
[TypeLibType(2)]
|
||||
public class WinMsgHookClass : IWinMsgHook, WinMsgHook, IWinMsgHookEvents_Event
|
||||
{
|
||||
[DispId(1)]
|
||||
public virtual extern object Tag
|
||||
{
|
||||
[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
|
||||
[DispId(1)]
|
||||
[return: MarshalAs(UnmanagedType.Struct)]
|
||||
get;
|
||||
[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
|
||||
[DispId(1)]
|
||||
[param: In]
|
||||
[param: MarshalAs(UnmanagedType.Struct)]
|
||||
set;
|
||||
}
|
||||
|
||||
[DispId(2)]
|
||||
public virtual extern bool Enabled
|
||||
{
|
||||
[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
|
||||
[DispId(2)]
|
||||
get;
|
||||
[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
|
||||
[DispId(2)]
|
||||
[param: In]
|
||||
set;
|
||||
}
|
||||
|
||||
public virtual extern event IWinMsgHookEvents_MessageEventHandler Message;
|
||||
}
|
||||
10
Managed/Decal.Interop.Input/Decal.Interop.Input/WndMsg.cs
Normal file
10
Managed/Decal.Interop.Input/Decal.Interop.Input/WndMsg.cs
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
using System.Runtime.InteropServices;
|
||||
|
||||
namespace Decal.Interop.Input;
|
||||
|
||||
[ComImport]
|
||||
[Guid("BDAD721B-7A00-440D-8964-70427167DD36")]
|
||||
[CoClass(typeof(WndMsgClass))]
|
||||
public interface WndMsg : IWndMsg
|
||||
{
|
||||
}
|
||||
|
|
@ -0,0 +1,56 @@
|
|||
using System.Runtime.CompilerServices;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Security;
|
||||
|
||||
namespace Decal.Interop.Input;
|
||||
|
||||
[ComImport]
|
||||
[Guid("85AB0296-124E-4E68-A6A8-FCF5721AC09B")]
|
||||
[SuppressUnmanagedCodeSecurity]
|
||||
[ClassInterface(ClassInterfaceType.None)]
|
||||
public class WndMsgClass : IWndMsg, WndMsg
|
||||
{
|
||||
[DispId(1)]
|
||||
public virtual extern int HWND
|
||||
{
|
||||
[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
|
||||
[DispId(1)]
|
||||
get;
|
||||
}
|
||||
|
||||
[DispId(2)]
|
||||
public virtual extern int Message
|
||||
{
|
||||
[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
|
||||
[DispId(2)]
|
||||
get;
|
||||
}
|
||||
|
||||
[DispId(3)]
|
||||
public virtual extern int WParam
|
||||
{
|
||||
[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
|
||||
[DispId(3)]
|
||||
get;
|
||||
}
|
||||
|
||||
[DispId(4)]
|
||||
public virtual extern int LParam
|
||||
{
|
||||
[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
|
||||
[DispId(4)]
|
||||
get;
|
||||
}
|
||||
|
||||
[DispId(5)]
|
||||
public virtual extern bool Eat
|
||||
{
|
||||
[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
|
||||
[DispId(5)]
|
||||
get;
|
||||
[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
|
||||
[DispId(5)]
|
||||
[param: In]
|
||||
set;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,7 @@
|
|||
namespace Decal.Interop.Input;
|
||||
|
||||
public enum eActionUse
|
||||
{
|
||||
eActionExecute,
|
||||
eActionStack
|
||||
}
|
||||
10
Managed/Decal.Interop.Input/Properties/AssemblyInfo.cs
Normal file
10
Managed/Decal.Interop.Input/Properties/AssemblyInfo.cs
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
using System.Reflection;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Security;
|
||||
|
||||
[assembly: Guid("3a985f2b-bad5-43bf-9008-ed4ebbb45b6e")]
|
||||
[assembly: PrimaryInteropAssembly(2, 0)]
|
||||
[assembly: SecurityRules(SecurityRuleSet.Level2)]
|
||||
[assembly: ImportedFromTypeLib("DecalInput")]
|
||||
[assembly: TypeLibVersion(2, 0)]
|
||||
[assembly: AssemblyVersion("2.9.8.3")]
|
||||
Loading…
Add table
Add a link
Reference in a new issue