Files
mxaccess/analysis/decompiled-interop/Interop.Lmx/Interop/Lmx/RedundancyObjectClass.cs
T
Joseph Doherty fe2a6db786
rust / build / test / clippy / fmt (push) Has been cancelled
Initial project state: .NET reference, design, Rust port (M0+M1), evidence
Layout:
- src/                    .NET 10 x64 reference: MxNativeCodec, MxNativeClient,
                          MxAsbClient, probes, tests, harnesses. Executable spec.
- design/                 Architectural plan for the Rust port (M0–M6), error
                          model, protocol invariants, risks (R1–R16), adversarial
                          review log (review.md).
- rust/                   Rust workspace. M0 skeleton + M1 codec parity.
                          mxaccess-codec: 215 unit tests + 2 cross-implementation
                          parity tests (byte-identical against .NET reference).
                          Other crates are M0 stubs awaiting M2+.
- captures/               Frida + netsh + pcap evidence per CLAUDE.md
                          ("captures are evidence, not throwaway logs").
- analysis/               Decompiled C# (frida/proxy/decompiled-*),
                          Ghidra exports for native DLLs (`exports/` only —
                          working state at `projects/` and AVEVA's input
                          binaries at `input/` are gitignored).
- docs/                   Reverse-engineering reference docs.
- tools/                  Setup-LiveProbeEnv.ps1 (Infisical credential fetcher),
                          Compute-Crc.ps1 (.NET parity helper).
- .github/workflows/      Rust CI: fmt + build + test + clippy on Windows.
- LICENSE                 MIT (Joseph Doherty, 2026).

Verified:
- cargo test --workspace → 217 passed (215 unit + 2 .NET parity), 0 failed
- cargo clippy --workspace -- -D warnings → clean
- cargo fmt --all -- --check → clean
- cargo publish --dry-run -p mxaccess-codec → packages cleanly

Excluded from history (see .gitignore):
- **/bin, **/obj, **/target — build artifacts
- analysis/ghidra/projects/ — Ghidra working state (regenerable)
- analysis/ghidra/input/ — AVEVA proprietary DLLs (vendor IP)

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-05 06:21:00 -04:00

97 lines
7.9 KiB
C#

using System;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
namespace Interop.Lmx;
[ComImport]
[TypeLibType(TypeLibTypeFlags.FCanCreate)]
[Guid("A5865417-2DDC-47D0-A5E9-B9138015AC73")]
[ClassInterface(ClassInterfaceType.None)]
public class RedundancyObjectClass : IRedundancyService2, RedundancyObject
{
[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
public virtual extern void Initialize([In] Guid guidGalaxyId, [In] int lPlatformId, [In][MarshalAs(UnmanagedType.BStr)] string bstrPrimaryAddress, [In] int lPrimaryPort, [In][MarshalAs(UnmanagedType.BStr)] string bstrSecondaryAddress, [In] int lSecondaryPort, [In][MarshalAs(UnmanagedType.BStr)] string bstrMulticastGroup, [In] int lMultiCastPort = 5001);
[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
public virtual extern void TransferData([In] int lEngineId, [In] int lType, [In] int lReference, [In] ref byte pBuffer, [In] int lLength, [In] int lTimeOut = 0);
[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
public virtual extern void UpdateSubscriberInfo([In] int lEngineId, [In] int lToAddCount, [In] ref tagEngineSubscriberInformation pToAdd, [In] int lToDeleteCount, [In] ref tagEngineSubscriberInformation pToDelete);
[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
public virtual extern void RegisterRedundancyNotification([In] int lEngineId, [In][MarshalAs(UnmanagedType.Interface)] IRedundancyNotify pNotify, out int pCookie);
[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
public virtual extern void UnregisterRedundancyNotification([In] int lCookie);
[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
public virtual extern void RegisterRedundancyStatusNotification([In] int lTargetPlatformId, [In] int lTargetEngineId, [In][MarshalAs(UnmanagedType.Interface)] IRedundancyNotify pNotify, out int pCookie);
[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
public virtual extern void UnregisterRedundancyStatusNotification([In] int lTargetPlatformId, [In] int lTargetEngineId, [In] int lCookie);
[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
public virtual extern void UnregisterRedundantEngine([In] int lEngineId);
[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
public virtual extern void SetHeartbeatRateForRedundantPartner([In] int lEngineId, [In] int lTicks, [In] int lMaxMissedTicks);
[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
public virtual extern void SetHeartbeatRate([In] int lEngineId, [In] int lTicks, [In] int lMaxMissedTicks);
[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
public virtual extern void SetIndirectDetectTimeoutForRedundantPartner([In] int lEngineId, [In] int lTimeOut, [In] int bEnableStandbyDetect);
[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
public virtual extern void SetIndirectDetectTimeout([In] int lEngineId, [In] int lTimeOut, [In] int bEnableStandbyDetect);
[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
public virtual extern void UpdateRedundancyStatus([In] int lEngineId, [In] tagRedundancyStatus eFailoverStatus, [In] tagRedundancySubStatus subStatus);
[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
public virtual extern void GetRedundancyStatus([In] int lPlatformId, [In] int lEngineId, out tagRedundancyStatus eFailoverStatus, out tagRedundancySubStatus subStatus);
[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
public virtual extern void GetRedundancyStatusBlock([In] int lPlatformId, [In] int lEngineId, [In] int lTimeOut, out tagRedundancyStatus eFailoverStatus, out tagRedundancySubStatus subStatus);
[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
public virtual extern void GetEngineRedundancyInfo([In] int lPlatformId, [In] int lEngineId, out tagEngineRedundancyInformation pFailoverEngineInfo);
[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
public virtual extern void GetHeartbeatConsecMissCount([In] int lEngineId, [In] tagRedundancyChannel eChannel, out int plTotalHeartbeatMissed, out int plConsecHeartbeatMissed);
[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
public virtual extern void UpdateRemotePlatform([In] int lPlatformId, [In][MarshalAs(UnmanagedType.BStr)] string bstrPrimaryAddress, [In] int lPrimaryPort, [In][MarshalAs(UnmanagedType.BStr)] string bstrFailoverAddress, [In] int lFailoverPort);
[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
public virtual extern void RemoveRemotePlatform([In] int lPlatformId);
[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
public virtual extern void RegisterRedundantEngine([In] int lEngineId, [In] int lPartnerPlatformId, [In][MarshalAs(UnmanagedType.BStr)] string partnerPMCAddress, [In] int partnerPMCPort, [In][MarshalAs(UnmanagedType.BStr)] string partnerRMCAddress, [In] int partnerRMCPort, [In] int timeToDiscoverPartner, [In][MarshalAs(UnmanagedType.BStr)] string engineName, [In] tagRedundancyIdentity eFailoverConfig);
[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
public virtual extern void UpdatePartnerRMCAddress([In] int lEngineId, [In][MarshalAs(UnmanagedType.BStr)] string partnerRMCAddress, [In] int partnerRMCPort);
[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
public virtual extern void UpdateTimeToDiscoverRedundantPartner([In] int engineId, [In] int timeToDiscoverPartner);
[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
public virtual extern void SetMaxTimeForStandbyToBecomeActive([In] int engineId, [In] int timeToBecomeActive);
[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
public virtual extern void GetPartnerRedundancyStatus([In] int engineId, out tagRedundancyStatus status, out tagRedundancySubStatus subStatus, out tagRedundancyStatus partnerStatus);
[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
public virtual extern void GetPartnerRMCAddress([In] int engineId, [MarshalAs(UnmanagedType.BStr)] out string partnerRMCAddress, out int partnerRMCPort);
[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
public virtual extern void Dump([In] int dumpmsg, [In][MarshalAs(UnmanagedType.Struct)] ref object parm1, [In][MarshalAs(UnmanagedType.Struct)] ref object parm2);
[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
public virtual extern void GetRedundancyStatusBlockEx([In] tagRedundancyChannel lMessageChannelId, [In] int lPlatformId, [In] int lEngineId, [In] int lTimeOut, out tagRedundancyStatus eStatus, out int partnerPlatform, out int partnerEngine, [ComAliasName("Interop.Lmx.eRedundancyStatusBlockExResult")] out eRedundancyStatusBlockExResult result);
[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
public virtual extern void GetRedundancyStatusBlockEx2([In] tagRedundancyChannel eMessageChannel, [In] int lPlatformId, [In] int lEngineId, [In] int lTimeOut, [In] tagRedundancyChannel ePartnerStatusMessageChannel, out tagRedundancyStatus peStatus, out tagRedundancySubStatus peSubStatus, out tagRedundancyStatus pePartnerStatus, out tagRedundancySubStatus pePartnerSubStatus, out int plPartnerPlatform, out int plPartnerEngine, [ComAliasName("Interop.Lmx.eRedundancyStatusBlockExResult")] out eRedundancyStatusBlockExResult peResult);
}