b0954b2672
Lands the M2 wave 3 main course — the INmxSvcCallback callback exporter.
Pure-tokio TCP server that mirrors src/MxNativeClient/ManagedCallbackExporter.cs
and lets a Rust client receive callbacks from NmxSvc.exe.
New
- exporter.rs (~700 LoC, 10 tests) — port of ManagedCallbackExporter.cs.
CallbackExporter::bind starts a TcpListener + accept loop; per-connection
serve task walks Bind / AlterContext / Request / Auth3 PDUs and dispatches
IRemUnknown (opnums 3/4/5) and INmxSvcCallback (opnums 3/4) requests.
Hand-rolled BindAck encoder mirroring cs:226-254 (single acceptance entry,
NDR20 transfer syntax).
- ExporterIdentities { oxid, oid, callback_ipid, rem_unknown_ipid } — exposes
both `random()` (production) and `fixed()` (tests). Mirrors the .NET
RandomUInt64 + Guid.NewGuid pattern at cs:14-20.
- CallbackEvent enum — typed diagnostic stream replacing .NET's
List<string> log (cs:12,33-42,315-321). Variants: ClientConnected,
AcceptError, Bind, Auth3Ignored, Request, RemQueryInterface,
CallbackInvoked, UnhandledRequest, ClientDisconnected, ProtocolError.
- IUNKNOWN_IID const re-exported alongside the other IIDs.
Tests cover real-socket round-trips: Bind+RemQueryInterface (with IUNKNOWN
returning S_OK), Bind+unknown opnum -> Fault, Bind+DataReceived ->
CallbackInvoked event + 12-byte success response, and graceful shutdown.
Test count delta: 344 -> 354 (+10).
Open followups touched: none new. F2 (verify_signature path) still
gated on a live status-frame fixture under tests/fixtures/m2-status-frame/.
F6 / F9 still need the windows-rs and DceRpcTcpClient ports respectively.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
20 lines
901 B
Rust
20 lines
901 B
Rust
//! `mxaccess-callback` — `INmxSvcCallback` RPC server (the callback exporter).
|
|
//!
|
|
//! M2 wave 3 landed: the [`exporter`] module ports
|
|
//! `src/MxNativeClient/ManagedCallbackExporter.cs` to a tokio-based TCP
|
|
//! server that serves `IRemUnknown` and `INmxSvcCallback` opnums and emits
|
|
//! typed [`exporter::CallbackEvent`]s for diagnostic observation.
|
|
//!
|
|
//! Opnums (verified against `src/MxNativeClient/NmxSvcCallbackMessages.cs:11-12`):
|
|
//! - `3` `DataReceived(bufferSize: i32, dataBuffer: sbyte[bufferSize]) -> hresult`
|
|
//! - `4` `StatusReceived(bufferSize: i32, statusBuffer: sbyte[bufferSize]) -> hresult`
|
|
//!
|
|
//! Plus the `IRemUnknown::RemQueryInterface` handler that completes the
|
|
//! server-side handshake against our exported OBJREF (DoD condition for M2).
|
|
|
|
#![forbid(unsafe_code)]
|
|
|
|
pub mod exporter;
|
|
|
|
pub use exporter::{CallbackEvent, CallbackExporter, ExporterIdentities, IUNKNOWN_IID};
|