Skip to content

Commit 272f6c1

Browse files
authored
Fix issue with INdrStructure type check during unmarshalling and expose authentication context on the RcpConnectedClientTransport class (#35)
* Fix issue where INdrStructure derived type was not unmarshalled correctly * Expose RpcConnectedClientTransport authentication context as a public property * Added XML comment to get rid of compiler warnings.
1 parent df6fb0e commit 272f6c1

2 files changed

Lines changed: 6 additions & 1 deletion

File tree

NtApiDotNet/Ndr/Marshal/NdrUnmarshalBuffer.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -390,7 +390,7 @@ public T[] ReadConformantArray<T>() where T : struct
390390
{
391391
return ReadConformantCharArray().Cast<char, T>();
392392
}
393-
else if (typeof(T) == typeof(INdrStructure))
393+
else if (typeof(INdrStructure).IsAssignableFrom(typeof(T)))
394394
{
395395
using (var queue = _deferred_reads.Push())
396396
{

NtApiDotNet/Win32/Rpc/Transport/RpcConnectedClientTransport.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -482,6 +482,11 @@ private void BindAuth(Guid interface_id, Version interface_version, Guid transfe
482482
/// </summary>
483483
public RpcAuthenticationLevel AuthenticationLevel => Authenticated ? _transport_security.AuthenticationLevel : RpcAuthenticationLevel.None;
484484

485+
/// <summary>
486+
/// Get the transport authentication context.
487+
/// </summary>
488+
public IClientAuthenticationContext AuthenticationContext => _auth_context;
489+
485490
/// <summary>
486491
/// Get the current Call ID.
487492
/// </summary>

0 commit comments

Comments
 (0)