Skip to content

Commit 4b584be

Browse files
committed
Fixed issue with handling NDR structures.
1 parent 04d1eae commit 4b584be

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

NtApiDotNet/Ndr/Marshal/NdrMarshalBuffer.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -873,7 +873,7 @@ public void WriteVaryingArray<T>(T[] array, long variance) where T : struct
873873
{
874874
WriteVaryingCharArray(array.Cast<T, char>(), variance);
875875
}
876-
else if (typeof(T) == typeof(INdrStructure))
876+
else if (typeof(INdrStructure).IsAssignableFrom(typeof(T)))
877877
{
878878
using (var queue = _deferred_writes.Push())
879879
{
@@ -1045,7 +1045,7 @@ public void WriteConformantArray<T>(T[] array, long conformance) where T : struc
10451045
{
10461046
WriteConformantCharArray(array.Cast<T, char>(), conformance);
10471047
}
1048-
else if (typeof(T) == typeof(INdrStructure))
1048+
else if (typeof(INdrStructure).IsAssignableFrom(typeof(T)))
10491049
{
10501050
using (var queue = _deferred_writes.Push())
10511051
{
@@ -1155,7 +1155,7 @@ public void WriteConformantVaryingArray<T>(T[] array, long conformance, long var
11551155
{
11561156
WriteConformantVaryingCharArray(array.Cast<T, char>(), conformance, variance);
11571157
}
1158-
else if (typeof(T) == typeof(INdrStructure))
1158+
else if (typeof(INdrStructure).IsAssignableFrom(typeof(T)))
11591159
{
11601160
using (var queue = _deferred_writes.Push())
11611161
{

NtApiDotNet/Ndr/Marshal/NdrUnmarshalBuffer.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -561,7 +561,7 @@ public T[] ReadVaryingArray<T>() where T : struct
561561
{
562562
return ReadVaryingCharArray().Cast<char, T>();
563563
}
564-
else if (typeof(T) == typeof(INdrStructure))
564+
else if (typeof(INdrStructure).IsAssignableFrom(typeof(T)))
565565
{
566566
using (var queue = _deferred_reads.Push())
567567
{
@@ -675,7 +675,7 @@ public T[] ReadConformantVaryingArray<T>() where T : struct
675675
{
676676
return ReadConformantVaryingCharArray().Cast<char, T>();
677677
}
678-
else if (typeof(T) == typeof(INdrStructure))
678+
else if (typeof(INdrStructure).IsAssignableFrom(typeof(T)))
679679
{
680680
using (var queue = _deferred_reads.Push())
681681
{

0 commit comments

Comments
 (0)