using System;
using System.Runtime.ConstrainedExecution;
using System.Runtime.InteropServices;
namespace ZB.MOM.WW.OtOpcUa.Driver.Galaxy.Host.Sta;
///
/// SafeHandle-style lifetime wrapper for an LMXProxyServer COM connection. Per Task B.3
/// + decision #65: must call Marshal.ReleaseComObject until
/// refcount = 0, then UnregisterProxy. The finalizer runs as a
/// to honor AppDomain-unload ordering.
///
///
/// This scaffold accepts any RCW (tagged as ) so we can unit-test the
/// release logic with a mock. The concrete wiring to ArchestrA.MxAccess.LMXProxyServer
/// lands when the actual Galaxy code moves over (the part deferred to the parity gate).
///
public sealed class MxAccessHandle : SafeHandle
{
private object? _comObject;
private readonly Action