ms-ndr
Pure-Rust NDR (Network Data Representation) marshaling — the DCE/RPC transfer syntax
(MS-RPCE), little-endian. No FFI, no unsafe.
This is the foundation layer every MS-RPCE interface rides on. It turns Rust values into NDR bytes and back; it knows nothing about transports, PDUs, or specific interfaces.
What it covers
- Aligned primitives (
u8/u16/u32/u64,uuid) — alignment relative to the start of the stub buffer, matching the NDR rule that an aggregate aligns to its largest member. - Unique (referent) pointers — fresh referent ids from
0x00020000, stepping by 4. - Conformant + varying UTF-16 strings — the
[size_is][length_is]wchar payload used byRPC_UNICODE_STRING. - Raw byte reads for fixed context handles / tower blobs.
Usage
use ;
let mut e = new;
e.u32;
e.conformant_varying_wstr;
let stub = e.into_bytes;
let mut d = new;
let n = d.u32?;
let name = d.conformant_varying_wstr?;
# Ok::
Extracted from and used by dcerpc.
License
MIT