Skip to content

Commit

Permalink
fix: use INVOKE_PROPERTYPUT for SAFEARRAY (#323)
Browse files Browse the repository at this point in the history
  • Loading branch information
marklechtermann authored Jan 3, 2025
1 parent 478458d commit 37c5e86
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/dscom.test/tests/PropertyTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ public void PropertyInInterfaceWithComInterface_ShouldHavePutRef()
[InlineData(typeof(bool), INVOKEKIND.INVOKE_PROPERTYPUT)]
[InlineData(typeof(char), INVOKEKIND.INVOKE_PROPERTYPUT)]
[InlineData(typeof(object), INVOKEKIND.INVOKE_PROPERTYPUTREF)]
[InlineData(typeof(object[]), INVOKEKIND.INVOKE_PROPERTYPUTREF)]
[InlineData(typeof(object[]), INVOKEKIND.INVOKE_PROPERTYPUT)]
[InlineData(typeof(System.Collections.IEnumerator), INVOKEKIND.INVOKE_PROPERTYPUTREF)]
[InlineData(typeof(DateTime), INVOKEKIND.INVOKE_PROPERTYPUT)]
[InlineData(typeof(Guid), INVOKEKIND.INVOKE_PROPERTYPUT)]
Expand Down
4 changes: 2 additions & 2 deletions src/dscom/writer/PropertySetMethodWriter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,9 @@ public override void Create()
return true;
}

// every class except special ones (e.g. String)
// every class except special ones (e.g. String) or SAFEARRAY
// are handles as references
if (type.IsClass && !type.IsSpecialHandledClass())
if (type.IsClass && !type.IsSpecialHandledClass() && !type.IsArray)
{
return true;
}
Expand Down

0 comments on commit 37c5e86

Please sign in to comment.