Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
PR feedback
  • Loading branch information
jkoritzinsky committed Nov 19, 2022
commit 3f3fe4ea2b38bc9f2c8a273c0b59322c17659cf2
Original file line number Diff line number Diff line change
Expand Up @@ -47,14 +47,14 @@ internal static class ComInterfaceGeneratorHelpers
new AttributedMarshallingModelOptions(
runtimeMarshallingDisabled,
direction == MarshalDirection.ManagedToUnmanaged
? MarshalMode.ManagedToUnmanagedIn
: MarshalMode.UnmanagedToManagedOut,
? MarshalMode.ManagedToUnmanagedIn
: MarshalMode.UnmanagedToManagedOut,
direction == MarshalDirection.ManagedToUnmanaged
? MarshalMode.ManagedToUnmanagedRef
: MarshalMode.UnmanagedToManagedRef,
? MarshalMode.ManagedToUnmanagedRef
: MarshalMode.UnmanagedToManagedRef,
direction == MarshalDirection.ManagedToUnmanaged
? MarshalMode.ManagedToUnmanagedOut
: MarshalMode.UnmanagedToManagedIn));
? MarshalMode.ManagedToUnmanagedOut
: MarshalMode.UnmanagedToManagedIn));

generatorFactory = new ByValueContentsMarshalKindValidator(generatorFactory);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ private bool ValidateRuntimeMarshallingOptions(CustomTypeMarshallerData marshall

private CustomTypeMarshallerData GetMarshallerDataForTypePositionInfo(CustomTypeMarshallers marshallers, TypePositionInfo info, StubCodeContext context)
{
MarshalDirection elementDirection = MarshallerHelpers.GetElementMarshalDirection(info, context);
MarshalDirection elementDirection = MarshallerHelpers.GetMarshalDirection(info, context);

return elementDirection switch
{
Expand Down Expand Up @@ -372,7 +372,7 @@ private static TypeSyntax ReplacePlaceholderSyntaxWithUnmanagedTypeSyntax(

private void ValidateCustomNativeTypeMarshallingSupported(TypePositionInfo info, StubCodeContext context, NativeMarshallingAttributeInfo marshalInfo)
{
MarshalDirection elementDirection = MarshallerHelpers.GetElementMarshalDirection(info, context);
MarshalDirection elementDirection = MarshallerHelpers.GetMarshalDirection(info, context);
// Marshalling out or return parameter, but no out marshaller is specified
if (elementDirection == MarshalDirection.UnmanagedToManaged
&& !marshalInfo.Marshallers.IsDefinedOrDefault(Options.UnmanagedToManagedMode))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ public IEnumerable<StatementSyntax> Generate(TypePositionInfo info, StubCodeCont
yield break;
}

MarshalDirection elementMarshalling = MarshallerHelpers.GetElementMarshalDirection(info, context);
MarshalDirection elementMarshalling = MarshallerHelpers.GetMarshalDirection(info, context);

switch (context.CurrentStage)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ public ValueBoundaryBehavior GetValueBoundaryBehavior(TypePositionInfo info, Stu

public IEnumerable<StatementSyntax> Generate(TypePositionInfo info, StubCodeContext context)
{
MarshalDirection elementMarshalDirection = MarshallerHelpers.GetElementMarshalDirection(info, context);
MarshalDirection elementMarshalDirection = MarshallerHelpers.GetMarshalDirection(info, context);
(string managedIdentifier, string nativeIdentifier) = context.GetIdentifiers(info);
switch (context.CurrentStage)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ public IEnumerable<StatementSyntax> Generate(TypePositionInfo info, StubCodeCont
yield break;
}

MarshalDirection elementMarshalDirection = MarshallerHelpers.GetElementMarshalDirection(info, context);
MarshalDirection elementMarshalDirection = MarshallerHelpers.GetMarshalDirection(info, context);

switch (context.CurrentStage)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ public SignatureBehavior GetNativeSignatureBehavior(TypePositionInfo info)

public IEnumerable<StatementSyntax> Generate(TypePositionInfo info, StubCodeContext context)
{
MarshalDirection elementMarshalDirection = MarshallerHelpers.GetElementMarshalDirection(info, context);
MarshalDirection elementMarshalDirection = MarshallerHelpers.GetMarshalDirection(info, context);
// Although custom native type marshalling doesn't support [In] or [Out] by value marshalling,
// other marshallers that wrap this one might, so we handle the correct cases here.
switch (context.CurrentStage)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public ValueBoundaryBehavior GetValueBoundaryBehavior(TypePositionInfo info, Stu

public IEnumerable<StatementSyntax> Generate(TypePositionInfo info, StubCodeContext context)
{
MarshalDirection elementMarshalDirection = MarshallerHelpers.GetElementMarshalDirection(info, context);
MarshalDirection elementMarshalDirection = MarshallerHelpers.GetMarshalDirection(info, context);
(string managedIdentifier, string nativeIdentifier) = context.GetIdentifiers(info);
switch (context.CurrentStage)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -341,7 +341,7 @@ public static StatementSyntax SkipInitOrDefaultInit(TypePositionInfo info, StubC
/// <param name="info">The info for an element.</param>
/// <param name="context">The context for the stub.</param>
/// <returns>The direction the element is marshalled.</returns>
public static MarshalDirection GetElementMarshalDirection(TypePositionInfo info, StubCodeContext context)
public static MarshalDirection GetMarshalDirection(TypePositionInfo info, StubCodeContext context)
{
if (context.Direction is not (MarshalDirection.ManagedToUnmanaged or MarshalDirection.UnmanagedToManaged))
{
Expand Down